common

package
v1.23.2 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: Apache-2.0 Imports: 11 Imported by: 6

Documentation

Index

Constants

View Source
const (
	// Delete the resource after it is successfully deployed.
	DeletePolicySucceeded DeletePolicy = "succeeded"
	// Delete the resource after it fails to be deployed.
	DeletePolicyFailed DeletePolicy = "failed"
	// Delete the resource before deploying it. Basically means "recreate the resource" instead of
	// updating it.
	DeletePolicyBeforeCreation DeletePolicy = "before-creation"
	// If during resource update we got an immutable error, then recreate the resource instead of
	// updating it.
	DeletePolicyBeforeCreationIfImmutable DeletePolicy = "before-creation-if-immutable"

	// Installing revision number 1 of the release always considered "Initial".
	DeployTypeInitial DeployType = "Initial"
	// Revision number > 1 with no successful revisions between revision 1 and the last revision
	// results in install.
	DeployTypeInstall DeployType = "Install"
	// If any successful revision found in history, then the current operation is upgrade.
	DeployTypeUpgrade DeployType = "Upgrade"
	// If current operation is release rollback.
	DeployTypeRollback DeployType = "Rollback"
	// If current operation is release uninstall.
	DeployTypeUninstall DeployType = "Uninstall"

	// Render resource on release installation.
	InstallOnInstall On = "install"
	// Render resource on release upgrade.
	InstallOnUpgrade On = "upgrade"
	// Render resource on release rollback.
	InstallOnRollback On = "rollback"
	// Render resource on release uninstall.
	InstallOnDelete On = "delete"
	// Render resource on release test.
	InstallOnTest On = "test"

	// The resource is owned by anyone (e.g. not tied to the release).
	OwnershipAnyone Ownership = "anyone"
	// The resource is owned by a single release.
	OwnershipRelease Ownership = "release"

	ResourceStateAbsent  ResourceState = "absent"
	ResourceStatePresent ResourceState = "present"
	ResourceStateReady   ResourceState = "ready"

	StageInit              Stage = "init"                // create pending release
	StagePrePreUninstall   Stage = "pre-pre-uninstall"   // uninstall previous release resources
	StagePrePreInstall     Stage = "pre-pre-install"     // install crd
	StagePreInstall        Stage = "pre-install"         // install pre-hooks
	StagePreUninstall      Stage = "pre-uninstall"       // cleanup pre-hooks
	StageInstall           Stage = "install"             // install resources
	StageUninstall         Stage = "uninstall"           // cleanup resources
	StagePostInstall       Stage = "post-install"        // install post-hooks
	StagePostUninstall     Stage = "post-uninstall"      // cleanup post-hooks
	StagePostPostInstall   Stage = "post-post-install"   // install webhook
	StagePostPostUninstall Stage = "post-post-uninstall" // uninstall crd, webhook
	StageFinal             Stage = "final"               // succeed pending release, supersede previous release

	StoreAsNone    StoreAs = "none"
	StoreAsHook    StoreAs = "hook"
	StoreAsRegular StoreAs = "regular"

	// ChartTSEntryPointJS is the JavaScript entry point path.
	ChartTSEntryPointJS = "src/index.js"
	// ChartTSEntryPointTS is the TypeScript entry point path.
	ChartTSEntryPointTS = "src/index.ts"
	// ChartTSSourceDir is the directory containing TypeScript sources in a Helm chart.
	ChartTSSourceDir = "ts/"
	// ChartTSVendorBundleFile is the path to the vendor bundle file in a Helm chart.
	ChartTSVendorBundleFile = ChartTSSourceDir + "vendor/libs.js"
	DefaultBurstLimit       = 100
	// TODO(major): switch to if-possible
	DefaultChartProvenanceStrategy = "never"
	// TODO(major): reconsider?
	DefaultDeletePropagation = metav1.DeletePropagationForeground
	DefaultDiffContextLines  = 3
	DefaultFieldManager      = "helm"
	// TODO(major): update to a more recent version? Not sure about backwards compatibility.
	DefaultLocalKubeVersion      = "1.20.0"
	DefaultLogColorMode          = log.LogColorModeAuto
	DefaultNetworkParallelism    = 30
	DefaultProgressPrintInterval = 5 * time.Second
	DefaultQPSLimit              = 30
	DefaultReleaseHistoryLimit   = 10
	// DefaultResourceValidationKubeVersion Kubernetes version to use during resource validation by kubeconform
	DefaultResourceValidationKubeVersion = "1.35.0"
	KubectlEditFieldManager              = "kubectl-edit"
	OldFieldManagerPrefix                = "werf"
	OutputFormatJSON                     = "json"
	OutputFormatTable                    = "table"
	OutputFormatYAML                     = "yaml"
	ReleaseStorageDriverConfigMap        = "configmap"
	ReleaseStorageDriverConfigMaps       = "configmaps"
	ReleaseStorageDriverDefault          = ""
	ReleaseStorageDriverMemory           = "memory"
	ReleaseStorageDriverSQL              = "sql"
	ReleaseStorageDriverSecret           = "secret"
	ReleaseStorageDriverSecrets          = "secrets"
	StageEndSuffix                       = "end"
	StagePrefix                          = "stage"
	StageStartSuffix                     = "start"
	StubReleaseName                      = "stub-release"
	StubReleaseNamespace                 = "stub-namespace"
)

Variables

View Source
var (
	// Use it whenever possible (e.g. in --help output) to refer to the product name, so it can be
	// easily white-labeled in forks.
	Brand   = "Nelm"
	Version = "0.0.0"
	// ChartTSEntryPoints defines supported TypeScript/JavaScript entry points (in priority order).
	ChartTSEntryPoints = [...]string{ChartTSEntryPointTS, ChartTSEntryPointJS}
	StagesOrdered      = []Stage{
		StageInit,
		StagePrePreUninstall,
		StagePrePreInstall,
		StagePreInstall,
		StagePreUninstall,
		StageInstall,
		StageUninstall,
		StagePostInstall,
		StagePostUninstall,
		StagePostPostInstall,
		StagePostPostUninstall,
		StageFinal,
	}
	OrderedStoreAs                                      = []StoreAs{StoreAsNone, StoreAsHook, StoreAsRegular}
	DefaultRegistryCredentialsPath                      = filepath.Join(homedir.Get(), ".docker", config.ConfigFileName)
	LabelKeyHumanManagedBy                              = "app.kubernetes.io/managed-by"
	LabelKeyPatternManagedBy                            = regexp.MustCompile(`^app.kubernetes.io/managed-by$`)
	AnnotationKeyHumanReleaseName                       = "meta.helm.sh/release-name"
	AnnotationKeyPatternReleaseName                     = regexp.MustCompile(`^meta.helm.sh/release-name$`)
	AnnotationKeyHumanReleaseNamespace                  = "meta.helm.sh/release-namespace"
	AnnotationKeyPatternReleaseNamespace                = regexp.MustCompile(`^meta.helm.sh/release-namespace$`)
	AnnotationKeyHumanHook                              = "helm.sh/hook"
	AnnotationKeyPatternHook                            = regexp.MustCompile(`^helm.sh/hook$`)
	AnnotationKeyHumanResourcePolicy                    = "helm.sh/resource-policy"
	AnnotationKeyPatternResourcePolicy                  = regexp.MustCompile(`^helm.sh/resource-policy$`)
	AnnotationKeyHumanDeletePolicy                      = "werf.io/delete-policy"
	AnnotationKeyPatternDeletePolicy                    = regexp.MustCompile(`^werf.io/delete-policy$`)
	AnnotationKeyHumanHookDeletePolicy                  = "helm.sh/hook-delete-policy"
	AnnotationKeyPatternHookDeletePolicy                = regexp.MustCompile(`^helm.sh/hook-delete-policy$`)
	AnnotationKeyHumanReplicasOnCreation                = "werf.io/replicas-on-creation"
	AnnotationKeyPatternReplicasOnCreation              = regexp.MustCompile(`^werf.io/replicas-on-creation$`)
	AnnotationKeyHumanFailMode                          = "werf.io/fail-mode"
	AnnotationKeyPatternFailMode                        = regexp.MustCompile(`^werf.io/fail-mode$`)
	AnnotationKeyHumanFailuresAllowedPerReplica         = "werf.io/failures-allowed-per-replica"
	AnnotationKeyPatternFailuresAllowedPerReplica       = regexp.MustCompile(`^werf.io/failures-allowed-per-replica$`)
	AnnotationKeyHumanIgnoreReadinessProbeFailsFor      = "werf.io/ignore-readiness-probe-fails-for-<container>"
	AnnotationKeyPatternIgnoreReadinessProbeFailsFor    = regexp.MustCompile(`^werf.io/ignore-readiness-probe-fails-for-(?P<container>.+)$`)
	AnnotationKeyHumanLogRegex                          = "werf.io/log-regex"
	AnnotationKeyPatternLogRegex                        = regexp.MustCompile(`^werf.io/log-regex$`)
	AnnotationKeyHumanLogRegexSkip                      = "werf.io/log-regex-skip"
	AnnotationKeyPatternLogRegexSkip                    = regexp.MustCompile(`^werf.io/log-regex-skip$`)
	AnnotationKeyHumanLogRegexFor                       = "werf.io/log-regex-for-<container>"
	AnnotationKeyPatternLogRegexFor                     = regexp.MustCompile(`^werf.io/log-regex-for-(?P<container>.+)$`)
	AnnotationKeyHumanSkipLogRegexFor                   = "werf.io/log-regex-skip-for-<container>"
	AnnotationKeyPatternSkipLogRegexFor                 = regexp.MustCompile(`^werf.io/log-regex-skip-for-(?P<container>.+)$`)
	AnnotationKeyHumanNoActivityTimeout                 = "werf.io/no-activity-timeout"
	AnnotationKeyPatternNoActivityTimeout               = regexp.MustCompile(`^werf.io/no-activity-timeout$`)
	AnnotationKeyHumanShowLogsOnlyForContainers         = "werf.io/show-logs-only-for-containers"
	AnnotationKeyPatternShowLogsOnlyForContainers       = regexp.MustCompile(`^werf.io/show-logs-only-for-containers$`)
	AnnotationKeyHumanShowServiceMessages               = "werf.io/show-service-messages"
	AnnotationKeyPatternShowServiceMessages             = regexp.MustCompile(`^werf.io/show-service-messages$`)
	AnnotationKeyHumanShowLogsOnlyForNumberOfReplicas   = "werf.io/show-logs-only-for-number-of-replicas"
	AnnotationKeyPatternShowLogsOnlyForNumberOfReplicas = regexp.MustCompile(`^werf.io/show-logs-only-for-number-of-replicas$`)
	AnnotationKeyHumanSkipLogs                          = "werf.io/skip-logs"
	AnnotationKeyPatternSkipLogs                        = regexp.MustCompile(`^werf.io/skip-logs$`)
	AnnotationKeyHumanSkipLogsForContainers             = "werf.io/skip-logs-for-containers"
	AnnotationKeyPatternSkipLogsForContainers           = regexp.MustCompile(`^werf.io/skip-logs-for-containers$`)
	AnnotationKeyHumanTrackTerminationMode              = "werf.io/track-termination-mode"
	AnnotationKeyPatternTrackTerminationMode            = regexp.MustCompile(`^werf.io/track-termination-mode$`)
	AnnotationKeyHumanWeight                            = "werf.io/weight"
	AnnotationKeyPatternWeight                          = regexp.MustCompile(`^werf.io/weight$`)
	AnnotationKeyHumanHookWeight                        = "helm.sh/hook-weight"
	AnnotationKeyPatternHookWeight                      = regexp.MustCompile(`^helm.sh/hook-weight$`)
	AnnotationKeyHumanDeployDependency                  = "werf.io/deploy-dependency-<name>"
	AnnotationKeyPatternDeployDependency                = regexp.MustCompile(`^werf.io/deploy-dependency-(?P<id>.+)$`)
	AnnotationKeyHumanDeleteDependency                  = "werf.io/delete-dependency-<name>"
	AnnotationKeyPatternDeleteDependency                = regexp.MustCompile(`^werf.io/delete-dependency-(?P<id>.+)$`)
	// TODO(major): get rid
	AnnotationKeyHumanDependency                          = "<name>.dependency.werf.io"
	AnnotationKeyPatternDependency                        = regexp.MustCompile(`^(?P<id>.+).dependency.werf.io$`)
	AnnotationKeyHumanExternalDependency                  = "<name>.external-dependency.werf.io"
	AnnotationKeyPatternExternalDependency                = regexp.MustCompile(`^(?P<id>.+).external-dependency.werf.io$`)
	AnnotationKeyHumanLegacyExternalDependencyResource    = "<name>.external-dependency.werf.io/resource"
	AnnotationKeyPatternLegacyExternalDependencyResource  = regexp.MustCompile(`^(?P<id>.+).external-dependency.werf.io/resource$`)
	AnnotationKeyHumanLegacyExternalDependencyNamespace   = "<name>.external-dependency.werf.io/namespace"
	AnnotationKeyPatternLegacyExternalDependencyNamespace = regexp.MustCompile(`^(?P<id>.+).external-dependency.werf.io/namespace$`)
	AnnotationKeyHumanSensitive                           = "werf.io/sensitive"
	AnnotationKeyPatternSensitive                         = regexp.MustCompile(`^werf.io/sensitive$`)
	AnnotationKeyHumanSensitivePaths                      = "werf.io/sensitive-paths"
	AnnotationKeyPatternSensitivePaths                    = regexp.MustCompile(`^werf.io/sensitive-paths$`)
	AnnotationKeyHumanDeployOn                            = "werf.io/deploy-on"
	AnnotationKeyPatternDeployOn                          = regexp.MustCompile(`^werf.io/deploy-on$`)
	AnnotationKeyHumanOwnership                           = "werf.io/ownership"
	AnnotationKeyPatternOwnership                         = regexp.MustCompile(`^werf.io/ownership$`)
	AnnotationKeyHumanDeletePropagation                   = "werf.io/delete-propagation"
	AnnotationKeyPatternDeletePropagation                 = regexp.MustCompile(`^werf.io/delete-propagation$`)
	SprigFuncs                                            = sprig.TxtFuncMap()
	DefaultPlanArtifactLifetime                           = 2 * time.Hour
	DefaultResourceValidationSchema                       = []string{
		"https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/{{ .NormalizedKubernetesVersion }}-standalone{{ .StrictSuffix }}/{{ .ResourceKind }}{{ .KindSuffix }}.json",
		"https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/{{.Group}}/{{.ResourceKind}}_{{.ResourceAPIVersion}}.json",
	}
	DefaultResourceValidationCacheLifetime   = 48 * time.Hour
	APIResourceValidationJSONSchemasCacheDir = helmpath.CachePath("nelm", "api-resource-json-schemas")
)

Functions

func StagesSortHandler added in v1.15.1

func StagesSortHandler(stage1, stage2 Stage) bool

Types

type ChartRepoConnectionOptions added in v1.15.1

type ChartRepoConnectionOptions struct {
	// ChartRepoBasicAuthPassword is the password for HTTP basic authentication to the chart repository.
	ChartRepoBasicAuthPassword string
	// ChartRepoBasicAuthUsername is the username for HTTP basic authentication to the chart repository.
	ChartRepoBasicAuthUsername string
	// ChartRepoCAPath is the path to the TLS CA certificate file for verifying the chart repository server.
	ChartRepoCAPath string
	// ChartRepoCertPath is the path to the TLS client certificate file for connecting to the chart repository.
	ChartRepoCertPath string
	// ChartRepoInsecure, when true, allows insecure HTTP connections to the chart repository.
	// WARNING: This disables HTTPS and should only be used for testing.
	ChartRepoInsecure bool
	// ChartRepoKeyPath is the path to the TLS client key file for connecting to the chart repository.
	ChartRepoKeyPath string
	// ChartRepoPassCreds, when true, passes repository credentials to all domains during chart operations.
	// By default, credentials are only passed to the original repository domain.
	ChartRepoPassCreds bool
	// ChartRepoRequestTimeout is the timeout duration for requests to the chart repository.
	// If 0, no timeout is applied.
	ChartRepoRequestTimeout time.Duration
	// ChartRepoSkipTLSVerify, when true, disables TLS certificate verification for the chart repository.
	// WARNING: This makes connections insecure and should only be used for testing.
	ChartRepoSkipTLSVerify bool
	// ChartRepoURL is the URL of the chart repository to use for chart lookups (e.g., "https://charts.example.com").
	ChartRepoURL string
}

func (*ChartRepoConnectionOptions) ApplyDefaults added in v1.15.1

func (opts *ChartRepoConnectionOptions) ApplyDefaults()

type DeletePolicy

type DeletePolicy string

Configures resource deletions during deployment of this resource.

type DeployType

type DeployType string

Type of the current operation.

type KubeConnectionOptions added in v1.15.1

type KubeConnectionOptions struct {
	// KubeAPIServerAddress is the Kubernetes API server address (e.g., "https://kubernetes.example.com:6443").
	KubeAPIServerAddress string
	// KubeAuthProviderConfig is the configuration map for the authentication provider in Kubernetes API.
	KubeAuthProviderConfig map[string]string
	// KubeAuthProviderName is the name of the authentication provider for Kubernetes (e.g., "gcp", "azure", "oidc").
	KubeAuthProviderName string
	// KubeBasicAuthPassword is the password for HTTP basic authentication to the Kubernetes API.
	KubeBasicAuthPassword string
	// KubeBasicAuthUsername is the username for HTTP basic authentication to the Kubernetes API.
	KubeBasicAuthUsername string
	// KubeBearerTokenData is the bearer token data for authentication in Kubernetes.
	KubeBearerTokenData string
	// KubeBearerTokenPath is the path to a file containing the bearer token for Kubernetes authentication.
	KubeBearerTokenPath string
	// KubeBurstLimit is the maximum burst limit for throttling requests to Kubernetes API.
	// Defaults to DefaultBurstLimit (100) if not set or <= 0.
	KubeBurstLimit int
	// KubeConfigBase64 is the base64-encoded kubeconfig file content.
	// Takes precedence over reading from file paths.
	KubeConfigBase64 string
	// KubeConfigPaths is a list of paths to kubeconfig files. If multiple are specified, their contents are merged.
	// Defaults to ~/.kube/config if both this and KubeConfigBase64 are empty.
	KubeConfigPaths []string
	// KubeContextCluster overrides the cluster to use from the kubeconfig for the current context.
	KubeContextCluster string
	// KubeContextCurrent specifies which kubeconfig context to use (e.g., "production", "staging").
	KubeContextCurrent string
	// KubeContextUser overrides the user to use from the kubeconfig for the current context.
	KubeContextUser string
	// KubeImpersonateGroups sets the Impersonate-Group headers when authenticating in Kubernetes.
	// Used to impersonate specific groups for authorization purposes.
	KubeImpersonateGroups []string
	// KubeImpersonateUID sets the Impersonate-Uid header when authenticating in Kubernetes.
	KubeImpersonateUID string
	// KubeImpersonateUser sets the Impersonate-User header when authenticating in Kubernetes.
	// Used to perform actions as a different user.
	KubeImpersonateUser string
	// KubeProxyURL is the proxy URL to use for all requests to the Kubernetes API (e.g., "http://proxy.example.com:8080").
	KubeProxyURL string
	// KubeQPSLimit is the Queries Per Second limit for requests to Kubernetes API.
	// Controls the rate of API requests. Defaults to DefaultQPSLimit (30) if not set or <= 0.
	KubeQPSLimit int
	// KubeRequestTimeout is the timeout duration for all requests to the Kubernetes API.
	// If 0, no timeout is applied.
	KubeRequestTimeout time.Duration
	// KubeSkipTLSVerify, when true, disables TLS certificate verification for the Kubernetes API.
	// WARNING: This makes connections insecure and should only be used for testing.
	KubeSkipTLSVerify bool
	// KubeTLSCAData is the PEM-encoded TLS CA certificate data for the Kubernetes API server.
	KubeTLSCAData string
	// KubeTLSCAPath is the path to the PEM-encoded TLS CA certificate file for the Kubernetes API server.
	KubeTLSCAPath string
	// KubeTLSClientCertData is the PEM-encoded TLS client certificate data for connecting to Kubernetes API.
	KubeTLSClientCertData string
	// KubeTLSClientCertPath is the path to the PEM-encoded TLS client certificate file for connecting to Kubernetes API.
	KubeTLSClientCertPath string
	// KubeTLSClientKeyData is the PEM-encoded TLS client key data for connecting to Kubernetes API.
	KubeTLSClientKeyData string
	// KubeTLSClientKeyPath is the path to the PEM-encoded TLS client key file for connecting to Kubernetes API.
	KubeTLSClientKeyPath string
	// KubeTLSServerName is the server name to use for Kubernetes API TLS validation.
	// Useful when the API server hostname differs from the TLS certificate's subject.
	KubeTLSServerName string
}

func (*KubeConnectionOptions) ApplyDefaults added in v1.15.1

func (opts *KubeConnectionOptions) ApplyDefaults(homeDir string)

type On added in v1.15.1

type On string

On which action type the resource should be rendered for the deployment.

type Ownership added in v1.15.1

type Ownership string

Resource ownership.

type ReleaseInstallRuntimeOptions added in v1.22.0

type ReleaseInstallRuntimeOptions struct {
	ResourceValidationOptions

	// DefaultDeletePropagation sets the deletion propagation policy for resource deletions.
	DefaultDeletePropagation string `json:"defaultDeletePropagation"`
	// ExtraAnnotations are additional Kubernetes annotations to add to all chart resources.
	// These are added during chart rendering, before resources are stored in the release.
	ExtraAnnotations map[string]string `json:"extraAnnotations"`
	// ExtraLabels are additional Kubernetes labels to add to all chart resources.
	// These are added during chart rendering, before resources are stored in the release.
	ExtraLabels map[string]string `json:"extraLabels"`
	// ExtraRuntimeAnnotations are additional annotations to add to resources at runtime.
	// These are added during resource creation/update but not stored in the release.
	ExtraRuntimeAnnotations map[string]string `json:"extraRuntimeAnnotations"`
	// ExtraRuntimeLabels are additional labels to add to resources at runtime.
	// These are added during resource creation/update but not stored in the release.
	ExtraRuntimeLabels map[string]string `json:"extraRuntimeLabels"`
	// ForceAdoption, when true, allows adopting resources that belong to a different Helm release.
	// WARNING: This can lead to conflicts if resources are managed by multiple releases.
	ForceAdoption bool `json:"forceAdoption"`
	// NoInstallStandaloneCRDs, when true, skips installation of CustomResourceDefinitions from the "crds/" directory.
	// By default, CRDs are installed first before other chart resources.
	NoInstallStandaloneCRDs bool `json:"noInstallStandaloneCRDs"`
	// NoRemoveManualChanges, when true, preserves fields manually added to resources in the cluster
	// that are not present in the chart manifests. By default, such fields are removed during updates.
	NoRemoveManualChanges bool `json:"noRemoveManualChanges"`
	// ReleaseHistoryLimit sets the maximum number of release revisions to keep in storage.
	// When exceeded, the oldest revisions are deleted. Defaults to DefaultReleaseHistoryLimit if not set or <= 0.
	// Note: Only release metadata is deleted; actual Kubernetes resources are not affected.
	ReleaseHistoryLimit int `json:"releaseHistoryLimit"`
	// ReleaseInfoAnnotations are custom annotations to add to the release metadata (stored in Secret/ConfigMap).
	// These do not affect resources but can be used for tagging releases.
	ReleaseInfoAnnotations map[string]string `json:"releaseInfoAnnotations"`
	// ReleaseLabels are labels to add to the release storage object (Secret/ConfigMap).
	// Used for filtering and organizing releases in storage.
	ReleaseLabels map[string]string `json:"releaseLabels"`
	// ReleaseStorageDriver specifies how release metadata is stored in Kubernetes.
	// Valid values: "secret" (default), "configmap", "sql".
	// Defaults to "secret" if not specified or set to "default".
	ReleaseStorageDriver string `json:"releaseStorageDriver"`
	// ReleaseStorageSQLConnection is the SQL connection string when using SQL storage driver.
	// Only used when ReleaseStorageDriver is "sql".
	ReleaseStorageSQLConnection string `json:"releaseStorageSQLConnection"`
}

type ResourceDiffOptions added in v1.22.0

type ResourceDiffOptions struct {
	DiffContextLines       int
	ShowInsignificantDiffs bool
	ShowSensitiveDiffs     bool
	ShowVerboseCRDDiffs    bool
	ShowVerboseDiffs       bool
}

func (*ResourceDiffOptions) ApplyDefaults added in v1.22.0

func (opts *ResourceDiffOptions) ApplyDefaults()

type ResourceState added in v1.15.1

type ResourceState string

The state of the resource in the cluster.

type ResourceValidationOptions added in v1.21.0

type ResourceValidationOptions struct {
	// NoResourceValidation Disable resource validation.
	NoResourceValidation bool `json:"noResourceValidation"`
	// LocalResourceValidation Disable KubeConform resource validation.
	LocalResourceValidation bool `json:"localResourceValidation"`
	// ValidationKubeVersion sets specific Kubernetes version and respective schemas to use on resource validation.
	ValidationKubeVersion string `json:"validationKubeVersion"`
	// ValidationSkip Do not validate resources with specific attributes.
	ValidationSkip []string `json:"validationSkip"`
	// ValidationSchemaCacheLifetime how long the schema cache should be valid.
	ValidationSchemaCacheLifetime time.Duration `json:"validationSchemaCacheLifetime"`
	// ValidationSchemas default schema sources to validate Kubernetes resources.
	ValidationSchemas []string `json:"validationSchemas"`
	// ValidationExtraSchemas extra schema sources to validate Kubernetes resources (preferred).
	ValidationExtraSchemas []string `json:"validationExtraSchemas"`
}

func (*ResourceValidationOptions) ApplyDefaults added in v1.21.0

func (opts *ResourceValidationOptions) ApplyDefaults()

type SecretValuesOptions added in v1.15.1

type SecretValuesOptions struct {
	// DefaultSecretValuesDisable, when true, ignores the default secret-values.yaml file from the chart.
	// Useful when you don't want to use the chart's default encrypted values.
	DefaultSecretValuesDisable bool
	// SecretKey is the encryption/decryption key for secret values files.
	// Must be set (or available via $NELM_SECRET_KEY) to work with encrypted values.
	SecretKey string
	// SecretKeyIgnore, when true, ignores the secret key and skips decryption of secret values files.
	// Useful for operations that don't require access to secrets.
	SecretKeyIgnore bool
	// SecretValuesFiles is a list of paths to encrypted values files to decrypt and merge.
	// Files are decrypted in-memory during chart operations using the secret key.
	SecretValuesFiles []string
	// SecretWorkDir is the working directory for resolving relative paths in secret operations.
	// Defaults to the current directory if not specified.
	SecretWorkDir string
}

func (*SecretValuesOptions) ApplyDefaults added in v1.15.1

func (opts *SecretValuesOptions) ApplyDefaults(currentDir string)

type Stage added in v1.15.1

type Stage string

A sequential stage of the plan.

func SubStageWeighted added in v1.15.1

func SubStageWeighted(stage Stage, weight int) Stage

type StoreAs added in v1.15.1

type StoreAs string

How the resource should be stored in the Helm release.

type TrackingOptions added in v1.15.1

type TrackingOptions struct {
	// LegacyHelmCompatibleTracking enables Helm-compatible tracking behavior: only Jobs-hooks are tracked.
	LegacyHelmCompatibleTracking bool
	// NoFinalTracking, when true, disables final tracking of resources after the release operation.
	// Final tracking waits for all resources to reach their ready state.
	NoFinalTracking bool
	// NoPodLogs, when true, disables collection and printing of Pod logs during tracking.
	// By default, logs from failing or starting Pods are shown.
	NoPodLogs bool
	// NoProgressTablePrint, when true, disables real-time progress table display.
	// The progress table shows logs, events, and status information for release resources.
	NoProgressTablePrint bool
	// ProgressTablePrintInterval is the interval for updating the progress table display.
	// Defaults to DefaultProgressPrintInterval (5 seconds) if not set or <= 0.
	ProgressTablePrintInterval time.Duration
	// TrackCreationTimeout is the timeout duration for tracking resource creation.
	// If resource creation doesn't complete within this time, the operation fails.
	// If 0, no timeout is applied and resources are tracked indefinitely.
	TrackCreationTimeout time.Duration
	// TrackDeletionTimeout is the timeout duration for tracking resource deletion.
	// If resource deletion doesn't complete within this time, the operation fails.
	// If 0, no timeout is applied and resources are tracked indefinitely.
	TrackDeletionTimeout time.Duration
	// TrackReadinessTimeout is the timeout duration for tracking resource readiness.
	// If resources don't become ready within this time, the operation fails.
	// If 0, no timeout is applied and resources are tracked indefinitely.
	TrackReadinessTimeout time.Duration
}

func (*TrackingOptions) ApplyDefaults added in v1.15.1

func (opts *TrackingOptions) ApplyDefaults()

type ValuesOptions added in v1.15.1

type ValuesOptions struct {
	// DefaultValuesDisable, when true, ignores the values.yaml file from the top-level chart.
	// Useful when you want complete control over values without chart defaults.
	DefaultValuesDisable bool
	// RootSetJSON is a list of key-value pairs in "key=json" format to set
	// arbitrary things in the global root context ("$"). This is meant to be
	// generated programmatically. Do not use it unless you know what you are doing.
	RootSetJSON []string
	// RuntimeSetJSON is a list of key-value pairs in "key=json" format to set in $.Runtime.
	// This is meant to be generated programmatically. Users should prefer ValuesSetJSON.
	// Example: ["runtime.env=dev", "runtime.timestamp=1234567890"]
	// TODO(major): get rid of it
	RuntimeSetJSON []string
	// ValuesFiles is a list of paths to additional values files to merge with chart values.
	// Files are merged in order, with later files overriding earlier ones.
	ValuesFiles []string
	// ValuesSet is a list of key-value pairs in "key=value" format to set chart values.
	// Values are parsed and may become various types (string, int, bool, etc.).
	// Example: ["image.tag=v1.2.3", "replicas=3"]
	ValuesSet []string
	// ValuesSetFile is a list of key-file pairs in "key=filepath" format.
	// The value is set to the contents of the specified file.
	// Example: ["config.yaml=/path/to/config.yaml"]
	ValuesSetFile []string
	// ValuesSetJSON is a list of key-value pairs in "key=json" format.
	// Values must be valid JSON and are parsed as such.
	// Example: ["config={\"key\":\"value\"}", "list=[1,2,3]"]
	ValuesSetJSON []string
	// ValuesSetLiteral is a list of key-value pairs in "key=value" format.
	// Values always become literal strings, even if they look like numbers or booleans.
	// Example: ["version=1.0.0", "enabled=true"] results in strings "1.0.0" and "true"
	ValuesSetLiteral []string
	// ValuesSetString is a list of key-value pairs in "key=value" format.
	// Values always become strings (no type inference).
	// Example: ["image.tag=v1.2.3", "count=5"] results in strings "v1.2.3" and "5"
	ValuesSetString []string
}

func (*ValuesOptions) ApplyDefaults added in v1.15.1

func (opts *ValuesOptions) ApplyDefaults()

Jump to

Keyboard shortcuts

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