fix: performance recession when propagating namespace to helm

This commit is contained in:
Niklas Wagner
2025-08-25 09:24:50 +02:00
parent 39086340ad
commit c7612d1dba

View File

@@ -127,11 +127,13 @@ func (kt *KustTarget) MakeCustomizedResMap() (resmap.ResMap, error) {
} }
func (kt *KustTarget) makeCustomizedResMap() (resmap.ResMap, error) { func (kt *KustTarget) makeCustomizedResMap() (resmap.ResMap, error) {
// Track origin for all resources so builtins can make decisions // Only track origin if we have Helm charts or build metadata is requested
// based on where resources originated from. // This optimization avoids unnecessary overhead when origins aren't needed
// Origin annotations will be stripped from the output if not var origin *resource.Origin
// requested via build metadata options. if len(kt.kustomization.BuildMetadata) != 0 || len(kt.kustomization.HelmCharts) > 0 {
kt.origin = &resource.Origin{} origin = &resource.Origin{}
}
kt.origin = origin
ra, err := kt.AccumulateTarget() ra, err := kt.AccumulateTarget()
if err != nil { if err != nil {
return nil, err return nil, err