Reinstate configmap/secret generator env field.

This commit is contained in:
monopole
2021-03-07 20:03:43 -08:00
parent 9c4966ccc8
commit a8b851f84a
4 changed files with 43 additions and 4 deletions

View File

@@ -155,7 +155,6 @@ type Kustomization struct {
// moving content of deprecated fields to newer
// fields.
func (k *Kustomization) FixKustomizationPostUnmarshalling() {
if k.Kind == "" {
k.Kind = KustomizationKind
}
@@ -168,6 +167,20 @@ func (k *Kustomization) FixKustomizationPostUnmarshalling() {
}
k.Resources = append(k.Resources, k.Bases...)
k.Bases = nil
for i, g := range k.ConfigMapGenerator {
if g.EnvSource != "" {
k.ConfigMapGenerator[i].EnvSources =
append(g.EnvSources, g.EnvSource)
k.ConfigMapGenerator[i].EnvSource = ""
}
}
for i, g := range k.SecretGenerator {
if g.EnvSource != "" {
k.SecretGenerator[i].EnvSources =
append(g.EnvSources, g.EnvSource)
k.SecretGenerator[i].EnvSource = ""
}
}
}
// FixKustomizationPreMarshalling fixes things