@@ -12,8 +12,8 @@ import (
1212
1313// GetParameterHelmImageName gets the value for image-name option for the image
1414// from a set of annotations
15- func (img * ContainerImage ) GetParameterHelmImageName (annotations map [string ]string ) string {
16- key := fmt .Sprintf (common .HelmParamImageNameAnnotation , img .normalizedSymbolicName ())
15+ func (img * ContainerImage ) GetParameterHelmImageName (annotations map [string ]string , annotationPrefix string ) string {
16+ key := fmt .Sprintf (common .Prefixed ( annotationPrefix , common . HelmParamImageNameAnnotationSuffix ) , img .normalizedSymbolicName ())
1717 val , ok := annotations [key ]
1818 if ! ok {
1919 return ""
@@ -23,8 +23,8 @@ func (img *ContainerImage) GetParameterHelmImageName(annotations map[string]stri
2323
2424// GetParameterHelmImageTag gets the value for image-tag option for the image
2525// from a set of annotations
26- func (img * ContainerImage ) GetParameterHelmImageTag (annotations map [string ]string ) string {
27- key := fmt .Sprintf (common .HelmParamImageTagAnnotation , img .normalizedSymbolicName ())
26+ func (img * ContainerImage ) GetParameterHelmImageTag (annotations map [string ]string , annotationPrefix string ) string {
27+ key := fmt .Sprintf (common .Prefixed ( annotationPrefix , common . HelmParamImageTagAnnotationSuffix ) , img .normalizedSymbolicName ())
2828 val , ok := annotations [key ]
2929 if ! ok {
3030 return ""
@@ -34,8 +34,8 @@ func (img *ContainerImage) GetParameterHelmImageTag(annotations map[string]strin
3434
3535// GetParameterHelmImageSpec gets the value for image-spec option for the image
3636// from a set of annotations
37- func (img * ContainerImage ) GetParameterHelmImageSpec (annotations map [string ]string ) string {
38- key := fmt .Sprintf (common .HelmParamImageSpecAnnotation , img .normalizedSymbolicName ())
37+ func (img * ContainerImage ) GetParameterHelmImageSpec (annotations map [string ]string , annotationPrefix string ) string {
38+ key := fmt .Sprintf (common .Prefixed ( annotationPrefix , common . HelmParamImageSpecAnnotationSuffix ) , img .normalizedSymbolicName ())
3939 val , ok := annotations [key ]
4040 if ! ok {
4141 return ""
@@ -45,8 +45,8 @@ func (img *ContainerImage) GetParameterHelmImageSpec(annotations map[string]stri
4545
4646// GetParameterKustomizeImageName gets the value for image-spec option for the
4747// image from a set of annotations
48- func (img * ContainerImage ) GetParameterKustomizeImageName (annotations map [string ]string ) string {
49- key := fmt .Sprintf (common .KustomizeApplicationNameAnnotation , img .normalizedSymbolicName ())
48+ func (img * ContainerImage ) GetParameterKustomizeImageName (annotations map [string ]string , annotationPrefix string ) string {
49+ key := fmt .Sprintf (common .Prefixed ( annotationPrefix , common . KustomizeApplicationNameAnnotationSuffix ) , img .normalizedSymbolicName ())
5050 val , ok := annotations [key ]
5151 if ! ok {
5252 return ""
@@ -56,10 +56,10 @@ func (img *ContainerImage) GetParameterKustomizeImageName(annotations map[string
5656
5757// HasForceUpdateOptionAnnotation gets the value for force-update option for the
5858// image from a set of annotations
59- func (img * ContainerImage ) HasForceUpdateOptionAnnotation (annotations map [string ]string ) bool {
59+ func (img * ContainerImage ) HasForceUpdateOptionAnnotation (annotations map [string ]string , annotationPrefix string ) bool {
6060 forceUpdateAnnotations := []string {
61- fmt .Sprintf (common .ForceUpdateOptionAnnotation , img .normalizedSymbolicName ()),
62- common .ApplicationWideForceUpdateOptionAnnotation ,
61+ fmt .Sprintf (common .Prefixed ( annotationPrefix , common . ForceUpdateOptionAnnotationSuffix ) , img .normalizedSymbolicName ()),
62+ common .Prefixed ( annotationPrefix , common . ApplicationWideForceUpdateOptionAnnotationSuffix ) ,
6363 }
6464 var forceUpdateVal = ""
6565 for _ , key := range forceUpdateAnnotations {
@@ -73,10 +73,10 @@ func (img *ContainerImage) HasForceUpdateOptionAnnotation(annotations map[string
7373
7474// GetParameterSort gets and validates the value for the sort option for the
7575// image from a set of annotations
76- func (img * ContainerImage ) GetParameterUpdateStrategy (annotations map [string ]string ) UpdateStrategy {
76+ func (img * ContainerImage ) GetParameterUpdateStrategy (annotations map [string ]string , annotationPrefix string ) UpdateStrategy {
7777 updateStrategyAnnotations := []string {
78- fmt .Sprintf (common .UpdateStrategyAnnotation , img .normalizedSymbolicName ()),
79- common .ApplicationWideUpdateStrategyAnnotation ,
78+ fmt .Sprintf (common .Prefixed ( annotationPrefix , common . UpdateStrategyAnnotationSuffix ) , img .normalizedSymbolicName ()),
79+ common .Prefixed ( annotationPrefix , common . ApplicationWideUpdateStrategyAnnotationSuffix ) ,
8080 }
8181 var updateStrategyVal = ""
8282 for _ , key := range updateStrategyAnnotations {
@@ -121,10 +121,10 @@ func (img *ContainerImage) ParseUpdateStrategy(val string) UpdateStrategy {
121121// GetParameterMatch returns the match function and pattern to use for matching
122122// tag names. If an invalid option is found, it returns MatchFuncNone as the
123123// default, to prevent accidental matches.
124- func (img * ContainerImage ) GetParameterMatch (annotations map [string ]string ) (MatchFuncFn , interface {}) {
124+ func (img * ContainerImage ) GetParameterMatch (annotations map [string ]string , annotationPrefix string ) (MatchFuncFn , interface {}) {
125125 allowTagsAnnotations := []string {
126- fmt .Sprintf (common .AllowTagsOptionAnnotation , img .normalizedSymbolicName ()),
127- common .ApplicationWideAllowTagsOptionAnnotation ,
126+ fmt .Sprintf (common .Prefixed ( annotationPrefix , common . AllowTagsOptionAnnotationSuffix ) , img .normalizedSymbolicName ()),
127+ common .Prefixed ( annotationPrefix , common . ApplicationWideAllowTagsOptionAnnotationSuffix ) ,
128128 }
129129 var allowTagsVal = ""
130130 for _ , key := range allowTagsAnnotations {
@@ -137,7 +137,7 @@ func (img *ContainerImage) GetParameterMatch(annotations map[string]string) (Mat
137137 if allowTagsVal == "" {
138138 // The old match-tag annotation is deprecated and will be subject to removal
139139 // in a future version.
140- key := fmt .Sprintf (common .OldMatchOptionAnnotation , img .normalizedSymbolicName ())
140+ key := fmt .Sprintf (common .Prefixed ( annotationPrefix , common . OldMatchOptionAnnotationSuffix ) , img .normalizedSymbolicName ())
141141 val , ok := annotations [key ]
142142 if ok {
143143 logCtx .Warnf ("The 'tag-match' annotation is deprecated and subject to removal. Please use 'allow-tags' annotation instead." )
@@ -180,10 +180,10 @@ func (img *ContainerImage) ParseMatchfunc(val string) (MatchFuncFn, interface{})
180180}
181181
182182// GetParameterPullSecret retrieves an image's pull secret credentials
183- func (img * ContainerImage ) GetParameterPullSecret (annotations map [string ]string ) * CredentialSource {
183+ func (img * ContainerImage ) GetParameterPullSecret (annotations map [string ]string , annotationPrefix string ) * CredentialSource {
184184 pullSecretAnnotations := []string {
185- fmt .Sprintf (common .PullSecretAnnotation , img .normalizedSymbolicName ()),
186- common .ApplicationWidePullSecretAnnotation ,
185+ fmt .Sprintf (common .Prefixed ( annotationPrefix , common . PullSecretAnnotationSuffix ) , img .normalizedSymbolicName ()),
186+ common .Prefixed ( annotationPrefix , common . ApplicationWidePullSecretAnnotationSuffix ) ,
187187 }
188188 var pullSecretVal = ""
189189 for _ , key := range pullSecretAnnotations {
@@ -206,10 +206,10 @@ func (img *ContainerImage) GetParameterPullSecret(annotations map[string]string)
206206}
207207
208208// GetParameterIgnoreTags retrieves a list of tags to ignore from a comma-separated string
209- func (img * ContainerImage ) GetParameterIgnoreTags (annotations map [string ]string ) []string {
209+ func (img * ContainerImage ) GetParameterIgnoreTags (annotations map [string ]string , annotationPrefix string ) []string {
210210 ignoreTagsAnnotations := []string {
211- fmt .Sprintf (common .IgnoreTagsOptionAnnotation , img .normalizedSymbolicName ()),
212- common .ApplicationWideIgnoreTagsOptionAnnotation ,
211+ fmt .Sprintf (common .Prefixed ( annotationPrefix , common . IgnoreTagsOptionAnnotationSuffix ) , img .normalizedSymbolicName ()),
212+ common .Prefixed ( annotationPrefix , common . ApplicationWideIgnoreTagsOptionAnnotationSuffix ) ,
213213 }
214214 var ignoreTagsVal = ""
215215 for _ , key := range ignoreTagsAnnotations {
@@ -239,10 +239,10 @@ func (img *ContainerImage) GetParameterIgnoreTags(annotations map[string]string)
239239// is specified in the annotations, we restrict the platform for images to the
240240// platform we're executed on unless unrestricted is set to true, in which case
241241// we do not setup a platform restriction if no platform annotation is found.
242- func (img * ContainerImage ) GetPlatformOptions (annotations map [string ]string , unrestricted bool ) * options.ManifestOptions {
242+ func (img * ContainerImage ) GetPlatformOptions (annotations map [string ]string , unrestricted bool , annotationPrefix string ) * options.ManifestOptions {
243243 logCtx := img .LogContext ()
244244 var opts * options.ManifestOptions = options .NewManifestOptions ()
245- key := fmt .Sprintf (common .PlatformsAnnotation , img .normalizedSymbolicName ())
245+ key := fmt .Sprintf (common .Prefixed ( annotationPrefix , common . PlatformsAnnotationSuffix ) , img .normalizedSymbolicName ())
246246 val , ok := annotations [key ]
247247 if ! ok {
248248 if ! unrestricted {
0 commit comments