common

package
v2.0.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: Apache-2.0 Imports: 12 Imported by: 17

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"

	DependencyExternalAuto  DependencyExternal = "auto"
	DependencyExternalFalse DependencyExternal = "false"
	DependencyExternalTrue  DependencyExternal = "true"

	// 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"

	// Skip creating the resource if it does not exist in the cluster.
	ResourcePolicySkipCreate ResourcePolicy = "skip-create"
	// Skip updating the resource if it already exists in the cluster.
	ResourcePolicySkipUpdate ResourcePolicy = "skip-update"
	// Skip recreating the resource when a recreation would otherwise be required.
	ResourcePolicySkipRecreate ResourcePolicy = "skip-recreate"
	// Skip deleting the resource (protect it from deletion). Alias: keep.
	ResourcePolicySkipDelete ResourcePolicy = "skip-delete"
	// Alias for skipDelete, matching the legacy helm.sh/resource-policy value.
	ResourcePolicyKeep ResourcePolicy = "keep"

	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"

	// CacheDirAPIResourceJSONSchemas is where the JSON schemas downloaded from the schema sources
	// configured by the user are cached. Unchanged on purpose: moving it would orphan the schemas
	// every existing installation has already downloaded, with nothing to clean them up afterwards.
	CacheDirAPIResourceJSONSchemas = CacheSubdirNelm + "/api-resource-json-schemas"
	// CacheDirEmbeddedAPIResourceJSONSchemas is where the JSON schemas embedded into the binary are
	// unpacked to, so that they are validated against from disk instead of from memory. It nests under
	// the directory above, which holds nothing but hash named per source directories, so a new name
	// cannot collide with one of those.
	CacheDirEmbeddedAPIResourceJSONSchemas = CacheDirAPIResourceJSONSchemas + "/embedded"
	CacheSubdirNelm                        = "nelm"
	// ChartTSBundleFile is the path to the bundle in a Helm chart.
	ChartTSBundleFile = ChartTSSourceDir + "dist/bundle.js"
	// ChartTSEntryPointJS is the JavaScript entry point path.
	ChartTSEntryPointJS = "src/index.js"
	// ChartTSEntryPointTS is the TypeScript entry point path.
	ChartTSEntryPointTS = "src/index.ts"
	// ChartTSInputFile is the name of the input file with context for the Deno app.
	ChartTSInputFile = "input.yaml"
	// ChartTSOutputFile is the name of the output file with rendered manifests from the Deno app.
	ChartTSOutputFile = "output.yaml"
	// ChartTSSourceDir is the directory containing TypeScript sources in a Helm chart.
	ChartTSSourceDir                    = "ts/"
	DefaultBurstLimit                   = 100
	DefaultChartProvenanceStrategy      = "never"
	DefaultDeletePropagation            = metav1.DeletePropagationBackground
	DefaultDependencyExternal           = DependencyExternalAuto
	DefaultDiffContextLines             = 3
	DefaultExternalDependencyMaxMatches = 30
	DefaultExternalDependencyMinMatches = 1
	DefaultFieldManager                 = "helm"
	DefaultLocalKubeVersion             = "1.36.0"
	DefaultLogColorMode                 = log.LogColorModeAuto
	DefaultMapperNoMatchRetryInterval   = 500 * time.Millisecond
	DefaultMapperNoMatchRetryTimeout    = 10 * time.Second
	DefaultNetworkParallelism           = 30
	DefaultProgressPrintInterval        = 5 * time.Second
	DefaultQPSLimit                     = 30
	DefaultReleaseHistoryLimit          = 10
	DefaultWebhookRetryTimeout          = 4 * time.Minute
	KubectlEditFieldManager             = "kubectl-edit"
	LockConfigMapName                   = "werf-synchronization"
	OldDeckhouseControllerManager       = "deckhouse-controller"
	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"
	TSDefaultRenderContextType          = TSGenericRenderContextType
	// TSGenericRenderContextType is the TypeScript render context type name for nelm charts.
	TSGenericRenderContextType = "RenderContext"
	// TSWerfRenderContextType is the TypeScript render context type name for werf charts.
	TSWerfRenderContextType = "WerfRenderContext"
)

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}
	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$`)
	AnnotationKeyHumanWerfResourcePolicy                = "werf.io/resource-policy"
	AnnotationKeyPatternWerfResourcePolicy              = regexp.MustCompile(`^werf.io/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>.+)$`)
	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()
	DefaultDockerConfig                                 = filepath.Join(userHomeDir(), ".docker")
	DefaultPlanArtifactLifetime                         = 2 * time.Hour
	DefaultResourceValidationCacheLifetime              = 48 * time.Hour
)
View Source
var (
	ChartFileReader ChartFileReaderer

	ChartFileWriter ChartFileWriterer

	LegacyCoalesceTablesFunc func(dst, src map[string]interface{}) map[string]interface{}
)

Functions

func ContextWithHelmOptions

func ContextWithHelmOptions(ctx context.Context, opts HelmOptions) context.Context

func HasHelmOptions

func HasHelmOptions(ctx context.Context) bool

func StagesSortHandler

func StagesSortHandler(stage1, stage2 Stage) bool

Types

type BufferedFile

type BufferedFile struct {
	Data []byte
	Name string
}

type ChartDepsDownloader

type ChartDepsDownloader interface {
	Build(ctx context.Context) error
	Update(ctx context.Context) error
	UpdateRepositories(ctx context.Context) error
	SetChartPath(path string)
}

type ChartFileReaderer

type ChartFileReaderer interface {
	LocateChart(ctx context.Context, name string) (string, error)
	ReadChartFile(ctx context.Context, filePath string) ([]byte, error)
	ChartFileExists(ctx context.Context, filePath string) (bool, error)
	LoadChartDir(ctx context.Context, dir string) ([]*BufferedFile, error)
	ChartIsDir(relPath string) (bool, error)
}

type ChartFileWriterer

type ChartFileWriterer interface {
	WriteChartFile(ctx context.Context, filePath string, data []byte) error
	CreateChartDir(ctx context.Context, dir string) error
}

type ChartLoadOptions

type ChartLoadOptions struct {
	ChartAppVersion            string
	ChartDepsDownloader        ChartDepsDownloader
	ChartType                  LegacyChartType
	DefaultChartAPIVersion     string
	DefaultChartName           string
	DefaultChartVersion        string
	DefaultSecretValuesDisable bool
	DefaultValuesDisable       bool
	ExtraValues                map[string]interface{}
	NoSecrets                  bool
	SecretKeyIgnore            bool
	SecretValuesFiles          []string
	SecretWorkDir              string
}

type ChartRepoConnectionOptions

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

func (opts *ChartRepoConnectionOptions) ApplyDefaults()

type DeletePolicy

type DeletePolicy string

Configures resource deletions during deployment of this resource.

type DependencyExternal

type DependencyExternal string

External dependency mode.

type DeployType

type DeployType string

Type of the current operation.

type HelmOptions

type HelmOptions struct {
	ChartLoadOpts  ChartLoadOptions
	TypeScriptOpts TypeScriptOptions
}

func HelmOptionsFromContext

func HelmOptionsFromContext(ctx context.Context) HelmOptions

type KubeConnectionOptions

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

func (opts *KubeConnectionOptions) ApplyDefaults(homeDir string)

type LegacyChartType

type LegacyChartType string
const (
	LegacyChartTypeChart     LegacyChartType = ""
	LegacyChartTypeBundle    LegacyChartType = "bundle"
	LegacyChartTypeSubchart  LegacyChartType = "subchart"
	LegacyChartTypeChartStub LegacyChartType = "chartstub"
)

type On

type On string

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

type Ownership

type Ownership string

Resource ownership.

type ReleaseInstallRuntimeOptions

type ReleaseInstallRuntimeOptions struct {
	ResourceValidationOptions

	// DefaultDeletePropagation sets the deletion propagation policy for resource deletions.
	DefaultDeletePropagation string `json:"defaultDeletePropagation"`
	// PatchesFiles are paths to patches files (same format as a chart-shipped
	// patches.yaml) whose rules are applied on top of chart-shipped ones. Render
	// patches are applied to the rendered resources, so they change what is
	// released and applied. Diff patches affect ONLY drift detection: each
	// matching rule's jq transform is applied identically to the live and the
	// dry-apply object before comparison, so normalized-away fields never produce
	// a diff. Rules from these files are UNSCOPED (they may match any resource),
	// unlike chart-shipped rules which are scoped to their chart subtree.
	PatchesFiles []string `json:"patchesFiles"`
	// DefaultPatchesDisable, when true, ignores chart-shipped patches.yaml files
	// (from the top-level chart and subcharts).
	DefaultPatchesDisable bool `json:"defaultPatchesDisable"`
	// 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

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

func (*ResourceDiffOptions) ApplyDefaults

func (opts *ResourceDiffOptions) ApplyDefaults()

type ResourcePolicy

type ResourcePolicy string

Configures which lifecycle operations are allowed for this resource.

type ResourceState

type ResourceState string

The state of the resource in the cluster.

type ResourceValidationOptions

type ResourceValidationOptions struct {
	// NoResourceValidation Disable resource validation.
	NoResourceValidation bool `json:"noResourceValidation"`
	// NoValuesSchemaValidation disables values validation against json schema.
	NoValuesSchemaValidation bool `json:"noValuesSchemaValidation"`
	// 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"`
	// ValidationExtraSchemas are additional schema sources to validate Kubernetes resources
	// against. They are preferred over the json schemas embedded into the binary, which are used
	// for whatever these sources have no schema for.
	ValidationExtraSchemas []string `json:"validationExtraSchemas"`
}

func (*ResourceValidationOptions) ApplyDefaults

func (opts *ResourceValidationOptions) ApplyDefaults()

type SecretValuesOptions

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

func (opts *SecretValuesOptions) ApplyDefaults(currentDir string)

type Stage

type Stage string

A sequential stage of the plan.

func SubStageWeighted

func SubStageWeighted(stage Stage, weight int) Stage

type StoreAs

type StoreAs string

How the resource should be stored in the Helm release.

type TrackingOptions

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

func (opts *TrackingOptions) ApplyDefaults()

type TypeScriptOptions

type TypeScriptOptions struct {
	DenoBinaryPath         string
	EmbeddedDenoCompressed []byte
}

type ValuesOptions

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
	// 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

func (opts *ValuesOptions) ApplyDefaults()

Jump to

Keyboard shortcuts

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