spec

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	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{
			sourceKey: sourceSchema,
			pathKey: {
				Type:        schema.TypeString,
				Description: "Path within the source from which configurations will be applied. The path must exactly match what is in the repository.",
				Required:    true,
			},
			pruneKey: {
				Type:        schema.TypeBool,
				Description: "If true, the workloads will be deleted when the kustomization CR is deleted. When prune is enabled, removing the kustomization will trigger a removal of all kubernetes objects previously applied on all clusters of this cluster group by this kustomization.",
				Optional:    true,
				Default:     false,
			},
			intervalKey: {
				Type:        schema.TypeString,
				Description: "Interval defines the interval at which to reconcile kustomization.",
				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()
				},
			},
			targetNamespaceKey: {
				Type:        schema.TypeString,
				Description: "TargetNamespace sets or overrides the namespaces of resources/kustomization yaml while applying on cluster. Namespace specified here must exist on cluster. It won't be created as a result of specifying here. Enter the name of the namespace you want the kustomization to be synced to. Entering a target namespace removes the need to specify a namespace in your kustomization. If the namespace does not exist in the cluster, syncing the kustomization will fail.",
				Optional:    true,
				Default:     "",
			},
		},
	},
}

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