mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-17 18:25:26 +00:00
fix: namespace is not correctly propagate with nested kustomization files
This commit is contained in:
@@ -496,6 +496,11 @@ func (kt *KustTarget) accumulateDirectory(
|
||||
}
|
||||
subKt.kustomization.BuildMetadata = kt.kustomization.BuildMetadata
|
||||
subKt.origin = kt.origin
|
||||
// Propagate namespace to child kustomization if child doesn't have one
|
||||
// This ensures Helm charts in base kustomizations inherit namespace from overlays
|
||||
if subKt.kustomization.Namespace == "" && kt.kustomization.Namespace != "" {
|
||||
subKt.kustomization.Namespace = kt.kustomization.Namespace
|
||||
}
|
||||
var bytes []byte
|
||||
if openApiPath, exists := subKt.Kustomization().OpenAPI["path"]; exists {
|
||||
bytes, err = ldr.Load(openApiPath)
|
||||
|
||||
Reference in New Issue
Block a user