mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-17 18:25:26 +00:00
rename to helmRootNamespace
This commit is contained in:
@@ -36,7 +36,7 @@ type KustTarget struct {
|
|||||||
rFactory *resmap.Factory
|
rFactory *resmap.Factory
|
||||||
pLdr *loader.Loader
|
pLdr *loader.Loader
|
||||||
origin *resource.Origin
|
origin *resource.Origin
|
||||||
parentNamespace string // namespace inherited from parent kustomization for HelmCharts
|
helmRootNamespace string // namespace inherited from parent kustomization for HelmCharts
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewKustTarget returns a new instance of KustTarget.
|
// NewKustTarget returns a new instance of KustTarget.
|
||||||
@@ -497,15 +497,15 @@ func (kt *KustTarget) accumulateDirectory(
|
|||||||
}
|
}
|
||||||
subKt.kustomization.BuildMetadata = kt.kustomization.BuildMetadata
|
subKt.kustomization.BuildMetadata = kt.kustomization.BuildMetadata
|
||||||
subKt.origin = kt.origin
|
subKt.origin = kt.origin
|
||||||
// Propagate namespace to child kustomization's parentNamespace for HelmCharts
|
// Propagate namespace to child kustomization's helmRootNamespace for HelmCharts
|
||||||
// This ensures Helm charts in base kustomizations inherit namespace from overlays
|
// This ensures Helm charts in base kustomizations inherit namespace from overlays
|
||||||
// without affecting other transformers like patches
|
// without affecting other transformers like patches
|
||||||
// Fixes https://github.com/kubernetes-sigs/kustomize/issues/6031
|
// Fixes https://github.com/kubernetes-sigs/kustomize/issues/6031
|
||||||
// Fixes https://github.com/kubernetes-sigs/kustomize/issues/6027
|
// Fixes https://github.com/kubernetes-sigs/kustomize/issues/6027
|
||||||
if kt.kustomization.Namespace != "" {
|
if kt.kustomization.Namespace != "" {
|
||||||
subKt.parentNamespace = kt.kustomization.Namespace
|
subKt.helmRootNamespace = kt.kustomization.Namespace
|
||||||
} else if kt.parentNamespace != "" {
|
} else if kt.helmRootNamespace != "" {
|
||||||
subKt.parentNamespace = kt.parentNamespace
|
subKt.helmRootNamespace = kt.helmRootNamespace
|
||||||
}
|
}
|
||||||
var bytes []byte
|
var bytes []byte
|
||||||
if openApiPath, exists := subKt.Kustomization().OpenAPI["path"]; exists {
|
if openApiPath, exists := subKt.Kustomization().OpenAPI["path"]; exists {
|
||||||
|
|||||||
@@ -172,8 +172,8 @@ var generatorConfigurators = map[builtinhelpers.BuiltinPluginType]func(
|
|||||||
if c.HelmChart.Namespace == "" {
|
if c.HelmChart.Namespace == "" {
|
||||||
if kt.kustomization.Namespace != "" {
|
if kt.kustomization.Namespace != "" {
|
||||||
c.HelmChart.Namespace = kt.kustomization.Namespace
|
c.HelmChart.Namespace = kt.kustomization.Namespace
|
||||||
} else if kt.parentNamespace != "" {
|
} else if kt.helmRootNamespace != "" {
|
||||||
c.HelmChart.Namespace = kt.parentNamespace
|
c.HelmChart.Namespace = kt.helmRootNamespace
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
p := f()
|
p := f()
|
||||||
|
|||||||
Reference in New Issue
Block a user