File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change 5
5
"fmt"
6
6
"os"
7
7
"path/filepath"
8
+ "regexp"
8
9
"strings"
9
10
"time"
10
11
@@ -747,13 +748,24 @@ func getImageFromSpec(app *v1alpha1.Application, targetImage *image.ContainerIma
747
748
switch appType {
748
749
case ApplicationTypeHelm :
749
750
if source .Helm != nil && source .Helm .Parameters != nil {
751
+ // Define regex patterns for tag/version parameters
752
+ tagPatterns := []* regexp.Regexp {
753
+ regexp .MustCompile (`^(.+\.)?(tag|version|imageTag)$` ),
754
+ regexp .MustCompile (`^(image|container)\.(.+\.)?(tag|version)$` ),
755
+ }
756
+
750
757
for _ , param := range source .Helm .Parameters {
751
- if param .Name == "image.tag" || param .Name == "image.version" {
752
- foundImage := image .NewFromIdentifier (fmt .Sprintf ("%s:%s" , targetImage .ImageName , param .Value ))
753
- if foundImage != nil && foundImage .ImageName == targetImage .ImageName {
754
- return foundImage
758
+ // Check if parameter matches tag/version patterns
759
+ for _ , pattern := range tagPatterns {
760
+ if pattern .MatchString (param .Name ) {
761
+ foundImage := image .NewFromIdentifier (fmt .Sprintf ("%s:%s" , targetImage .ImageName , param .Value ))
762
+ if foundImage != nil && foundImage .ImageName == targetImage .ImageName {
763
+ return foundImage
764
+ }
765
+ break
755
766
}
756
767
}
768
+
757
769
if param .Name == "image" || param .Name == "image.repository" {
758
770
foundImage := image .NewFromIdentifier (param .Value )
759
771
if foundImage != nil && foundImage .ImageName == targetImage .ImageName {
You can’t perform that action at this time.
0 commit comments