From 0824433260dfbf23bbb30c36e281c00df2bb995b Mon Sep 17 00:00:00 2001 From: Jingfang Liu Date: Thu, 18 Oct 2018 16:00:38 -0700 Subject: [PATCH] Add generatorOptions in Kustomization type --- pkg/types/kustomization.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/pkg/types/kustomization.go b/pkg/types/kustomization.go index 3e64ee4e1..665627068 100644 --- a/pkg/types/kustomization.go +++ b/pkg/types/kustomization.go @@ -113,6 +113,9 @@ type Kustomization struct { // the map will have a suffix hash generated from its contents. SecretGenerator []SecretArgs `json:"secretGenerator,omitempty" yaml:"secretGenerator,omitempty"` + // GeneratorOptions modify behavior of all ConfigMap and Secret generators. + GeneratorOptions *GeneratorOptions `json:"generatorOptions,omitempty" yaml:"generatorOptions,omitempty"` + // // Deprecated fields - See DealWithDeprecatedFields // @@ -175,6 +178,8 @@ type SecretArgs struct { // CommandSources for secret. CommandSources `json:",inline,omitempty" yaml:",inline,omitempty"` + // Deprecated. + // Replaced by GeneratorOptions.TimeoutSeconds // TimeoutSeconds specifies the timeout for commands. TimeoutSeconds *int64 `json:"timeoutSeconds,omitempty" yaml:"timeoutSeconds,omitempty"` } @@ -223,3 +228,26 @@ type ImageTag struct { // If digest is present NewTag value is ignored. Digest string `json:"digest,omitempty" yaml:"digest,omitempty"` } + +// GeneratorOptions modify behavior of all ConfigMap and Secret generators. +type GeneratorOptions struct { + // Labels to add to all generated resources. + Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` + + // Annotations to add to all generated resources. + Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` + + // TimeoutSeconds specifies the timeout for commands, if any, + // used in resource generation. At time of writing, the default + // was specified in configmapandsecret.defaultCommandTimeout. + TimeoutSeconds *int64 `json:"timeoutSeconds,omitempty" yaml:"timeoutSeconds,omitempty"` + + // Shell and arguments to use as a context for commands used in + // resource generation. Default at time of writing: {'sh', '-c'}. + Shell []string `json:"shell,omitempty" yaml:"shell,omitempty"` + + // DisableNameHash if true disables the default behavior of adding a + // suffix to the names of generated resources that is a hash of the + // resource contents. + DisableHash bool `json:"disableHash,omitempty" yaml:"disableHash,omitempty"` +}