Skip to content

Commit 7e45799

Browse files
committed
rename to helmRootNamespace
1 parent 4e75138 commit 7e45799

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

api/internal/target/kusttarget.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ import (
2929

3030
// KustTarget encapsulates the entirety of a kustomization build.
3131
type KustTarget struct {
32-
kustomization *types.Kustomization
33-
kustFileName string
34-
ldr ifc.Loader
35-
validator ifc.Validator
36-
rFactory *resmap.Factory
37-
pLdr *loader.Loader
38-
origin *resource.Origin
39-
parentNamespace string // namespace inherited from parent kustomization for HelmCharts
32+
kustomization *types.Kustomization
33+
kustFileName string
34+
ldr ifc.Loader
35+
validator ifc.Validator
36+
rFactory *resmap.Factory
37+
pLdr *loader.Loader
38+
origin *resource.Origin
39+
helmRootNamespace string // namespace inherited from parent kustomization for HelmCharts
4040
}
4141

4242
// NewKustTarget returns a new instance of KustTarget.
@@ -497,15 +497,15 @@ func (kt *KustTarget) accumulateDirectory(
497497
}
498498
subKt.kustomization.BuildMetadata = kt.kustomization.BuildMetadata
499499
subKt.origin = kt.origin
500-
// Propagate namespace to child kustomization's parentNamespace for HelmCharts
500+
// Propagate namespace to child kustomization's helmRootNamespace for HelmCharts
501501
// This ensures Helm charts in base kustomizations inherit namespace from overlays
502502
// without affecting other transformers like patches
503503
// Fixes https://github.com/kubernetes-sigs/kustomize/issues/6031
504504
// Fixes https://github.com/kubernetes-sigs/kustomize/issues/6027
505505
if kt.kustomization.Namespace != "" {
506-
subKt.parentNamespace = kt.kustomization.Namespace
507-
} else if kt.parentNamespace != "" {
508-
subKt.parentNamespace = kt.parentNamespace
506+
subKt.helmRootNamespace = kt.kustomization.Namespace
507+
} else if kt.helmRootNamespace != "" {
508+
subKt.helmRootNamespace = kt.helmRootNamespace
509509
}
510510
var bytes []byte
511511
if openApiPath, exists := subKt.Kustomization().OpenAPI["path"]; exists {

api/internal/target/kusttarget_configplugin.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ var generatorConfigurators = map[builtinhelpers.BuiltinPluginType]func(
172172
if c.HelmChart.Namespace == "" {
173173
if kt.kustomization.Namespace != "" {
174174
c.HelmChart.Namespace = kt.kustomization.Namespace
175-
} else if kt.parentNamespace != "" {
176-
c.HelmChart.Namespace = kt.parentNamespace
175+
} else if kt.helmRootNamespace != "" {
176+
c.HelmChart.Namespace = kt.helmRootNamespace
177177
}
178178
}
179179
p := f()

0 commit comments

Comments
 (0)