mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-07-18 18:18:36 +00:00
Copy reference nodes before copying comments and syncing order
This commit is contained in:
@@ -351,6 +351,30 @@ apiVersion: v1
|
||||
kind: ConfigMap
|
||||
data:
|
||||
somekey: "012345678901234567890123456789012345678901234567890123456789012345678901234" # x
|
||||
`,
|
||||
},
|
||||
{
|
||||
name: "sort fields with null value",
|
||||
from: `apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: workspaces.app.terraform.io
|
||||
creationTimestamp: null # this field is null
|
||||
namespace: staging
|
||||
`,
|
||||
to: `apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: workspaces.app.terraform.io
|
||||
creationTimestamp: null
|
||||
namespace: staging
|
||||
`,
|
||||
expected: `apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: workspaces.app.terraform.io
|
||||
creationTimestamp: null # this field is null
|
||||
namespace: staging
|
||||
`,
|
||||
},
|
||||
}
|
||||
@@ -378,9 +402,18 @@ data:
|
||||
t.FailNow()
|
||||
}
|
||||
|
||||
actualFrom, err := from.String()
|
||||
if !assert.NoError(t, err) {
|
||||
t.FailNow()
|
||||
}
|
||||
|
||||
if !assert.Equal(t, strings.TrimSpace(tc.expected), strings.TrimSpace(actual)) {
|
||||
t.FailNow()
|
||||
}
|
||||
|
||||
if !assert.Equal(t, strings.TrimSpace(tc.from), strings.TrimSpace(actualFrom)) {
|
||||
t.FailNow()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user