spec

package
v1.4.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 14, 2024 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChartRefKey                = "chart_ref"
	GitRepositoryKey           = "git_repository"
	HelmRepositorykey          = "helm_repository"
	RepositoryNameKey          = "repository_name"
	RepositoryNamespaceNameKey = "repository_namespace"
	ChartPathKey               = "chart_path"
	ChartNameKey               = "chart_name"
	VersionKey                 = "version"
	IntervalKey                = "interval"
	InlineConfigKey            = "inline_config"
	TargetNamespaceKey         = "target_namespace"
	SpecKey                    = "spec"
)

Variables

View Source
var SpecSchema = &schema.Schema{
	Type:        schema.TypeList,
	Description: "Spec for the Repository.",
	Required:    true,
	MaxItems:    1,
	Elem: &schema.Resource{
		Schema: map[string]*schema.Schema{
			InlineConfigKey: {
				Type:        schema.TypeString,
				Description: "File to read inline values from (in yaml format).User need to specify the file path for inline config",
				Optional:    true,
				DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {
					newInlineConfig, err := readYamlFile(new)
					if err != nil {
						return false
					}

					return old == newInlineConfig
				},
			},
			TargetNamespaceKey: {
				Type:        schema.TypeString,
				Description: "TargetNamespace sets or overrides the namespaces of resources yaml while applying on cluster.",
				Optional:    true,
			},
			IntervalKey: {
				Type:        schema.TypeString,
				Description: "Interval at which to reconcile the Helm release. This is the interval at which Tanzu Mission Control will attempt to reconcile changes in the helm release to the cluster. A sync interval of 0 would result in no future syncs. If no value is entered, a default interval of 5 minutes will be applied as `5m`.",
				Optional:    true,
				Default:     "5m",
				DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {
					durationInScript, err := time.ParseDuration(old)
					if err != nil {
						return false
					}

					durationInState, err := time.ParseDuration(new)
					if err != nil {
						return false
					}

					return durationInScript.Seconds() == durationInState.Seconds()
				},
			},
			ChartRefKey: refSchema,
		},
	},
}

Functions

func HasSpecChanged

func HasSpecChanged(d *schema.ResourceData) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL