@@ -1250,7 +1250,6 @@ helm:
1250
1250
parameters:
1251
1251
- name: baz
1252
1252
value: baz
1253
- forceString: false
1254
1253
- name: foo
1255
1254
value: bar
1256
1255
forceString: true
@@ -1444,8 +1443,8 @@ replicas: 1
1444
1443
"argocd-image-updater.argoproj.io/image-list" : "nginx" ,
1445
1444
"argocd-image-updater.argoproj.io/write-back-method" : "git" ,
1446
1445
"argocd-image-updater.argoproj.io/write-back-target" : "helmvalues:./test-values.yaml" ,
1447
- "argocd-image-updater.argoproj.io/nginx.helm.image-name" : "image.name" ,
1448
- "argocd-image-updater.argoproj.io/nginx.helm.image-tag" : "image.tag" ,
1446
+ "argocd-image-updater.argoproj.io/nginx.helm.image-name" : "' image.name' " ,
1447
+ "argocd-image-updater.argoproj.io/nginx.helm.image-tag" : "' image.tag' " ,
1449
1448
},
1450
1449
},
1451
1450
Spec : v1alpha1.ApplicationSpec {
@@ -1501,7 +1500,7 @@ replicas: 1
1501
1500
"argocd-image-updater.argoproj.io/image-list" : "nginx" ,
1502
1501
"argocd-image-updater.argoproj.io/write-back-method" : "git" ,
1503
1502
"argocd-image-updater.argoproj.io/write-back-target" : "helmvalues:./test-values.yaml" ,
1504
- "argocd-image-updater.argoproj.io/nginx.helm.image-spec" : "image.spec.foo" ,
1503
+ "argocd-image-updater.argoproj.io/nginx.helm.image-spec" : "' image.spec.foo' " ,
1505
1504
},
1506
1505
},
1507
1506
Spec : v1alpha1.ApplicationSpec {
@@ -1537,20 +1536,6 @@ replicas: 1
1537
1536
require .NoError (t , err )
1538
1537
assert .NotEmpty (t , yaml )
1539
1538
assert .Equal (t , strings .TrimSpace (strings .ReplaceAll (expected , "\t " , " " )), strings .TrimSpace (string (yaml )))
1540
-
1541
- // when image.spec.foo fields are missing in the target helm value file,
1542
- // they should be auto created without corrupting any other pre-existing elements.
1543
- originalData = []byte ("test-value1: one" )
1544
- expected = `
1545
- test-value1: one
1546
- image:
1547
- spec:
1548
- foo: nginx:v1.0.0
1549
- `
1550
- yaml , err = marshalParamsOverride (& app , originalData )
1551
- require .NoError (t , err )
1552
- assert .NotEmpty (t , yaml )
1553
- assert .Equal (t , strings .TrimSpace (strings .ReplaceAll (expected , "\t " , " " )), strings .TrimSpace (string (yaml )))
1554
1539
})
1555
1540
1556
1541
t .Run ("Valid Helm source with Helm values file with multiple images" , func (t * testing.T ) {
@@ -1568,10 +1553,10 @@ replicas: 1
1568
1553
"argocd-image-updater.argoproj.io/image-list" : "nginx=nginx, redis=redis" ,
1569
1554
"argocd-image-updater.argoproj.io/write-back-method" : "git" ,
1570
1555
"argocd-image-updater.argoproj.io/write-back-target" : "helmvalues:./test-values.yaml" ,
1571
- "argocd-image-updater.argoproj.io/nginx.helm.image-name" : "nginx.image.name" ,
1572
- "argocd-image-updater.argoproj.io/nginx.helm.image-tag" : "nginx.image.tag" ,
1573
- "argocd-image-updater.argoproj.io/redis.helm.image-name" : "redis.image.name" ,
1574
- "argocd-image-updater.argoproj.io/redis.helm.image-tag" : "redis.image.tag" ,
1556
+ "argocd-image-updater.argoproj.io/nginx.helm.image-name" : "' nginx.image.name' " ,
1557
+ "argocd-image-updater.argoproj.io/nginx.helm.image-tag" : "' nginx.image.tag' " ,
1558
+ "argocd-image-updater.argoproj.io/redis.helm.image-name" : "' redis.image.name' " ,
1559
+ "argocd-image-updater.argoproj.io/redis.helm.image-tag" : "' redis.image.tag' " ,
1575
1560
},
1576
1561
},
1577
1562
Spec : v1alpha1.ApplicationSpec {
@@ -1639,25 +1624,6 @@ replicas: 1
1639
1624
require .NoError (t , err )
1640
1625
assert .NotEmpty (t , yaml )
1641
1626
assert .Equal (t , strings .TrimSpace (strings .ReplaceAll (expected , "\t " , " " )), strings .TrimSpace (string (yaml )))
1642
-
1643
- // when nginx.* and redis.* fields are missing in the target helm value file,
1644
- // they should be auto created without corrupting any other pre-existing elements.
1645
- originalData = []byte ("test-value1: one" )
1646
- expected = `
1647
- test-value1: one
1648
- nginx:
1649
- image:
1650
- tag: v1.0.0
1651
- name: nginx
1652
- redis:
1653
- image:
1654
- tag: v1.0.0
1655
- name: redis
1656
- `
1657
- yaml , err = marshalParamsOverride (& app , originalData )
1658
- require .NoError (t , err )
1659
- assert .NotEmpty (t , yaml )
1660
- assert .Equal (t , strings .TrimSpace (strings .ReplaceAll (expected , "\t " , " " )), strings .TrimSpace (string (yaml )))
1661
1627
})
1662
1628
1663
1629
t .Run ("Valid Helm source with Helm values file with multiple aliases" , func (t * testing.T ) {
@@ -1677,12 +1643,12 @@ replicas: 1
1677
1643
"argocd-image-updater.argoproj.io/image-list" : "foo=nginx, bar=nginx, bbb=nginx" ,
1678
1644
"argocd-image-updater.argoproj.io/write-back-method" : "git" ,
1679
1645
"argocd-image-updater.argoproj.io/write-back-target" : "helmvalues:./test-values.yaml" ,
1680
- "argocd-image-updater.argoproj.io/foo.helm.image-name" : "foo.image.name" ,
1681
- "argocd-image-updater.argoproj.io/foo.helm.image-tag" : "foo.image.tag" ,
1682
- "argocd-image-updater.argoproj.io/bar.helm.image-name" : "bar.image.name" ,
1683
- "argocd-image-updater.argoproj.io/bar.helm.image-tag" : "bar.image.tag" ,
1684
- "argocd-image-updater.argoproj.io/bbb.helm.image-name" : "bbb.image.name" ,
1685
- "argocd-image-updater.argoproj.io/bbb.helm.image-tag" : "bbb.image.tag" ,
1646
+ "argocd-image-updater.argoproj.io/foo.helm.image-name" : "' foo.image.name' " ,
1647
+ "argocd-image-updater.argoproj.io/foo.helm.image-tag" : "' foo.image.tag' " ,
1648
+ "argocd-image-updater.argoproj.io/bar.helm.image-name" : "' bar.image.name' " ,
1649
+ "argocd-image-updater.argoproj.io/bar.helm.image-tag" : "' bar.image.tag' " ,
1650
+ "argocd-image-updater.argoproj.io/bbb.helm.image-name" : "' bbb.image.name' " ,
1651
+ "argocd-image-updater.argoproj.io/bbb.helm.image-tag" : "' bbb.image.tag' " ,
1686
1652
},
1687
1653
},
1688
1654
Spec : v1alpha1.ApplicationSpec {
0 commit comments