Skip to content

Commit b690566

Browse files
committed
feat: allow space after the comma
Signed-off-by: Tchoupinax <corentinfiloche@hotmail.fr>
1 parent b6b8106 commit b690566

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pkg/argocd/argocd.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ func SetHelmImage(app *v1alpha1.Application, newImage *image.ContainerImage) err
429429
if hpImageName != "" {
430430
// Here is the case value1,value2
431431
if strings.Contains(hpImageName, ",") {
432-
var parameters = strings.Split(hpImageName, ",")
432+
var parameters = strings.Split(strings.ReplaceAll(hpImageName, " ", ""), ",")
433433
for _, parameterName := range parameters {
434434
p := v1alpha1.HelmParameter{Name: parameterName, Value: newImage.GetFullNameWithoutTag(), ForceString: true}
435435
mergeParams = append(mergeParams, p)
@@ -442,7 +442,7 @@ func SetHelmImage(app *v1alpha1.Application, newImage *image.ContainerImage) err
442442
if hpImageTag != "" {
443443
// Here is the case value1,value2
444444
if strings.Contains(hpImageTag, ",") {
445-
var parameters = strings.Split(hpImageTag, ",")
445+
var parameters = strings.Split(strings.ReplaceAll(hpImageTag, " ", ""), ",")
446446
for _, parameterName := range parameters {
447447
p := v1alpha1.HelmParameter{Name: parameterName, Value: newImage.GetTagWithDigest(), ForceString: true}
448448
mergeParams = append(mergeParams, p)

pkg/argocd/argocd_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ func Test_SetHelmImage(t *testing.T) {
10121012
Namespace: "testns",
10131013
Annotations: map[string]string{
10141014
fmt.Sprintf(common.HelmParamImageNameAnnotation, "foobar"): "foobar.image.name,foobar2.image.name",
1015-
fmt.Sprintf(common.HelmParamImageTagAnnotation, "foobar"): "foobar.image.tag, foobar2.image.tag",
1015+
fmt.Sprintf(common.HelmParamImageTagAnnotation, "foobar"): "foobar.image.tag, foobar2.image.tag", // Space is expected
10161016
},
10171017
},
10181018
Spec: v1alpha1.ApplicationSpec{

0 commit comments

Comments
 (0)