|
|
|
@ -520,13 +520,16 @@ func (b *Builder) do(ctx context.Context, kustomization kustomizev1.Kustomizatio
|
|
|
|
|
return nil, fmt.Errorf("kustomize build failed: %w", err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for _, res := range m.Resources() {
|
|
|
|
|
// run variable substitutions
|
|
|
|
|
if kustomization.Spec.PostBuild != nil {
|
|
|
|
|
if kustomization.Spec.PostBuild == nil {
|
|
|
|
|
return m, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
data, err := runtime.DefaultUnstructuredConverter.ToUnstructured(&kustomization)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
for _, res := range m.Resources() {
|
|
|
|
|
// run variable substitutions
|
|
|
|
|
outRes, err := kustomize.SubstituteVariables(ctx,
|
|
|
|
|
b.client,
|
|
|
|
|
unstructured.Unstructured{Object: data},
|
|
|
|
@ -545,7 +548,6 @@ func (b *Builder) do(ctx context.Context, kustomization kustomizev1.Kustomizatio
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return m, nil
|
|
|
|
|
}
|
|
|
|
|