mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-13 01:50:55 +00:00
Add support for helm --no-hooks flag
This commit adds the `skipHooks` option to the helm chart support in order to expose the --no-hooks flag introduced to Helm in [1]. Using Kustomize to inflate a Helm chart would in some situations result in different results than using `helm install`. This is because `helm template`, by default, will render chart tests in the `templates/test` directory, which can lead to undesired resources in the output. See [2] for additional discussion. [1]: https://github.com/helm/helm/pull/6444 [2]: https://github.com/helm/helm/issues/6443 Signed-off-by: Lars Kellogg-Stedman <lars@oddbit.com>
This commit is contained in:
@@ -282,6 +282,9 @@ func (p *HelmChartInflationGeneratorPlugin) templateCommand() []string {
|
||||
if p.IncludeCRDs {
|
||||
args = append(args, "--include-crds")
|
||||
}
|
||||
if p.SkipHooks {
|
||||
args = append(args, "--no-hooks")
|
||||
}
|
||||
return args
|
||||
}
|
||||
|
||||
|
||||
@@ -72,6 +72,10 @@ type HelmChart struct {
|
||||
// IncludeCRDs specifies if Helm should also generate CustomResourceDefinitions.
|
||||
// Defaults to 'false'.
|
||||
IncludeCRDs bool `json:"includeCRDs,omitempty" yaml:"includeCRDs,omitempty"` //nolint: tagliatelle
|
||||
|
||||
// SkipHooks sets the --no-hooks flag when calling helm template. This prevents
|
||||
// helm from erroneously rendering test templates.
|
||||
SkipHooks bool `json:"skipHooks,omitempty" yaml:"skipHooks,omitempty"`
|
||||
}
|
||||
|
||||
// HelmChartArgs contains arguments to helm.
|
||||
|
||||
Reference in New Issue
Block a user