mirror of
https://github.com/SAP/jenkins-library.git
synced 2024-12-12 10:55:20 +02:00
feat(kubernetesDeploy): Better support for sub-charts (#4829)
This commit is contained in:
parent
f1234114be
commit
d0f99c3e99
@ -554,6 +554,9 @@ func defineDeploymentValues(config kubernetesDeployOptions, containerRegistry st
|
|||||||
|
|
||||||
dv.add(createKey("image", key, "repository"), fmt.Sprintf("%v/%v", containerRegistry, name))
|
dv.add(createKey("image", key, "repository"), fmt.Sprintf("%v/%v", containerRegistry, name))
|
||||||
dv.add(createKey("image", key, "tag"), tag)
|
dv.add(createKey("image", key, "tag"), tag)
|
||||||
|
// usable for subcharts:
|
||||||
|
dv.add(createKey(key, "image", "repository"), fmt.Sprintf("%v/%v", containerRegistry, name))
|
||||||
|
dv.add(createKey(key, "image", "tag"), tag)
|
||||||
|
|
||||||
if len(config.ImageNames) == 1 {
|
if len(config.ImageNames) == 1 {
|
||||||
dv.singleImage = true
|
dv.singleImage = true
|
||||||
|
@ -724,7 +724,7 @@ func TestRunKubernetesDeploy(t *testing.T) {
|
|||||||
|
|
||||||
assert.Equal(t, "helm", mockUtils.Calls[1].Exec, "Wrong upgrade command")
|
assert.Equal(t, "helm", mockUtils.Calls[1].Exec, "Wrong upgrade command")
|
||||||
|
|
||||||
assert.Contains(t, mockUtils.Calls[1].Params, `image.myImage.repository=my.registry:55555/myImage,image.myImage.tag=myTag,image.myImage_sub1.repository=my.registry:55555/myImage-sub1,image.myImage_sub1.tag=myTag,image.myImage_sub2.repository=my.registry:55555/myImage-sub2,image.myImage_sub2.tag=myTag,secret.name=testSecret,secret.dockerconfigjson=ThisIsOurBase64EncodedSecret==,imagePullSecrets[0].name=testSecret`, "Wrong upgrade parameters")
|
assert.Contains(t, mockUtils.Calls[1].Params, `image.myImage.repository=my.registry:55555/myImage,image.myImage.tag=myTag,myImage.image.repository=my.registry:55555/myImage,myImage.image.tag=myTag,image.myImage_sub1.repository=my.registry:55555/myImage-sub1,image.myImage_sub1.tag=myTag,myImage_sub1.image.repository=my.registry:55555/myImage-sub1,myImage_sub1.image.tag=myTag,image.myImage_sub2.repository=my.registry:55555/myImage-sub2,image.myImage_sub2.tag=myTag,myImage_sub2.image.repository=my.registry:55555/myImage-sub2,myImage_sub2.image.tag=myTag,secret.name=testSecret,secret.dockerconfigjson=ThisIsOurBase64EncodedSecret==,imagePullSecrets[0].name=testSecret`, "Wrong upgrade parameters")
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -774,7 +774,7 @@ func TestRunKubernetesDeploy(t *testing.T) {
|
|||||||
|
|
||||||
assert.Equal(t, "helm", mockUtils.Calls[1].Exec, "Wrong upgrade command")
|
assert.Equal(t, "helm", mockUtils.Calls[1].Exec, "Wrong upgrade command")
|
||||||
|
|
||||||
assert.Contains(t, mockUtils.Calls[1].Params, `image.myImage.repository=my.registry:55555/myImage,image.myImage.tag=myTag,image.repository=my.registry:55555/myImage,image.tag=myTag,secret.name=testSecret,secret.dockerconfigjson=ThisIsOurBase64EncodedSecret==,imagePullSecrets[0].name=testSecret`, "Wrong upgrade parameters")
|
assert.Contains(t, mockUtils.Calls[1].Params, `image.myImage.repository=my.registry:55555/myImage,image.myImage.tag=myTag,myImage.image.repository=my.registry:55555/myImage,myImage.image.tag=myTag,image.repository=my.registry:55555/myImage,image.tag=myTag,secret.name=testSecret,secret.dockerconfigjson=ThisIsOurBase64EncodedSecret==,imagePullSecrets[0].name=testSecret`, "Wrong upgrade parameters")
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -867,7 +867,8 @@ func TestRunKubernetesDeploy(t *testing.T) {
|
|||||||
assert.Contains(t, mockUtils.Calls[1].Params[pos], "image.myImage_sub1.repository=my.registry:55555/myImage-sub1", "Missing update parameter")
|
assert.Contains(t, mockUtils.Calls[1].Params[pos], "image.myImage_sub1.repository=my.registry:55555/myImage-sub1", "Missing update parameter")
|
||||||
assert.Contains(t, mockUtils.Calls[1].Params[pos], "image.myImage_sub1.tag=myTag", "Missing update parameter")
|
assert.Contains(t, mockUtils.Calls[1].Params[pos], "image.myImage_sub1.tag=myTag", "Missing update parameter")
|
||||||
assert.Contains(t, mockUtils.Calls[1].Params[pos], "image.myImage_sub2.repository=my.registry:55555/myImage-sub2", "Missing update parameter")
|
assert.Contains(t, mockUtils.Calls[1].Params[pos], "image.myImage_sub2.repository=my.registry:55555/myImage-sub2", "Missing update parameter")
|
||||||
assert.Contains(t, mockUtils.Calls[1].Params[pos], "image.myImage_sub2.tag=myTag,secret.name=testSecret,secret.dockerconfigjson=ThisIsOurBase64EncodedSecret==", "Missing update parameter")
|
assert.Contains(t, mockUtils.Calls[1].Params[pos], "image.myImage_sub2.tag=myTag")
|
||||||
|
assert.Contains(t, mockUtils.Calls[1].Params[pos], "secret.name=testSecret,secret.dockerconfigjson=ThisIsOurBase64EncodedSecret==", "Missing update parameter")
|
||||||
assert.Contains(t, mockUtils.Calls[1].Params[pos], "imagePullSecrets[0].name=testSecret", "Missing update parameter")
|
assert.Contains(t, mockUtils.Calls[1].Params[pos], "imagePullSecrets[0].name=testSecret", "Missing update parameter")
|
||||||
assert.Contains(t, mockUtils.Calls[1].Params[pos], "subchart.image.registry=my.registry:55555/myImage", "Missing update parameter")
|
assert.Contains(t, mockUtils.Calls[1].Params[pos], "subchart.image.registry=my.registry:55555/myImage", "Missing update parameter")
|
||||||
assert.Contains(t, mockUtils.Calls[1].Params[pos], "subchart.image.tag=myTag", "Missing update parameter")
|
assert.Contains(t, mockUtils.Calls[1].Params[pos], "subchart.image.tag=myTag", "Missing update parameter")
|
||||||
|
Loading…
Reference in New Issue
Block a user