mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-17 18:25:26 +00:00
Add set image test with patchesJson6902.
This commit is contained in:
@@ -145,6 +145,47 @@ func TestSetImage(t *testing.T) {
|
||||
" newTag: my-tag2",
|
||||
}},
|
||||
},
|
||||
{
|
||||
description: "override file with patch",
|
||||
given: given{
|
||||
args: []string{"image1=foo.bar.foo:8800/foo/image1:foo-bar"},
|
||||
infileImages: []string{
|
||||
"images:",
|
||||
"- name: image1",
|
||||
" newName: my-image1",
|
||||
" newTag: my-tag",
|
||||
"- name: image2",
|
||||
" newName: my-image2",
|
||||
" newTag: my-tag2",
|
||||
"patchesJson6902:",
|
||||
"- patch: |-",
|
||||
" - op: remove",
|
||||
" path: /spec/selector",
|
||||
" target:",
|
||||
" kind: Service",
|
||||
" name: foo",
|
||||
" version: v1",
|
||||
},
|
||||
},
|
||||
expected: expected{
|
||||
fileOutput: []string{
|
||||
"images:",
|
||||
"- name: image1",
|
||||
" newName: foo.bar.foo:8800/foo/image1",
|
||||
" newTag: foo-bar",
|
||||
"- name: image2",
|
||||
" newName: my-image2",
|
||||
" newTag: my-tag2",
|
||||
"patchesJson6902:",
|
||||
"- patch: |-",
|
||||
" - op: remove",
|
||||
" path: /spec/selector",
|
||||
" target:",
|
||||
" kind: Service",
|
||||
" name: foo",
|
||||
" version: v1",
|
||||
}},
|
||||
},
|
||||
{
|
||||
description: "override new tag and new name with just a new tag",
|
||||
given: given{
|
||||
|
||||
Reference in New Issue
Block a user