mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-17 18:25:26 +00:00
Merge pull request #3506 from natasha41575/FixSmpDirectiveWhenElementNotFound
$patch:delete should not add elements when element is not found
This commit is contained in:
@@ -69,28 +69,6 @@ spec:
|
||||
image: helloworld
|
||||
name: whatever
|
||||
`
|
||||
// Allow expected variable to be unused
|
||||
_ = expected
|
||||
|
||||
// Currently, kustomize inserts $patch: delete elements into the resulting resources
|
||||
erroneousActual := `
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: whatever
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- env:
|
||||
- $patch: delete
|
||||
name: NOT_EXISTING_FOR_REMOVAL
|
||||
- name: EXISTING
|
||||
value: EXISTING_VALUE
|
||||
image: helloworld
|
||||
name: whatever
|
||||
`
|
||||
|
||||
m := th.Run(".", th.MakeDefaultOptions())
|
||||
th.AssertActualEqualsExpected(m, erroneousActual)
|
||||
th.AssertActualEqualsExpected(m, expected)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user