Add set image test with patchesJson6902.

This commit is contained in:
Eyob Tefera
2020-09-11 18:48:48 +00:00
parent badc1177d9
commit f889ca8885

View File

@@ -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{