mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-13 18:10:59 +00:00
Introduce envs field.
This commit is contained in:
@@ -159,16 +159,13 @@ func (mf *kustomizationFile) Read() (*types.Kustomization, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
data = types.DealWithDeprecatedFields(data)
|
||||
data = types.FixKustomizationPreUnmarshalling(data)
|
||||
var k types.Kustomization
|
||||
err = yaml.Unmarshal(data, &k)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
msgs := k.DealWithMissingFields()
|
||||
if len(msgs) > 0 {
|
||||
log.Printf(strings.Join(msgs, "\n"))
|
||||
}
|
||||
k.FixKustomizationPostUnmarshalling()
|
||||
err = mf.parseCommentedFields(data)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -81,7 +81,7 @@ func TestWriteAndRead(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("Couldn't read kustomization file: %v\n", err)
|
||||
}
|
||||
kustomization.DealWithMissingFields()
|
||||
kustomization.FixKustomizationPostUnmarshalling()
|
||||
if !reflect.DeepEqual(kustomization, content) {
|
||||
t.Fatal("Read kustomization is different from written kustomization")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user