@@ -29,14 +29,14 @@ import (
2929
3030// KustTarget encapsulates the entirety of a kustomization build.
3131type 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 {
0 commit comments