mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-17 18:25:26 +00:00
change: components apply after all generators and transformers applied (#5170)
* change: components apply after all generator and transformer applied * fix name for a test case * add comment about when the components will be executed * components are applied before transformer
This commit is contained in:
@@ -202,10 +202,6 @@ func (kt *KustTarget) accumulateTarget(ra *accumulator.ResAccumulator) (
|
||||
if err != nil {
|
||||
return nil, errors.WrapPrefixf(err, "accumulating resources")
|
||||
}
|
||||
ra, err = kt.accumulateComponents(ra, kt.kustomization.Components)
|
||||
if err != nil {
|
||||
return nil, errors.WrapPrefixf(err, "accumulating components")
|
||||
}
|
||||
tConfig, err := builtinconfig.MakeTransformerConfig(
|
||||
kt.ldr, kt.kustomization.Configurations)
|
||||
if err != nil {
|
||||
@@ -230,6 +226,14 @@ func (kt *KustTarget) accumulateTarget(ra *accumulator.ResAccumulator) (
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// components are expected to execute after reading resources and adding generators ,before applying transformers and validation.
|
||||
// https://github.com/kubernetes-sigs/kustomize/pull/5170#discussion_r1212101287
|
||||
ra, err = kt.accumulateComponents(ra, kt.kustomization.Components)
|
||||
if err != nil {
|
||||
return nil, errors.WrapPrefixf(err, "accumulating components")
|
||||
}
|
||||
|
||||
err = kt.runTransformers(ra)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user