Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Commit

Permalink
Stop setting original image annotation on auto-upgrade apps (#1774) (#…
Browse files Browse the repository at this point in the history
…1953)

Signed-off-by: Grant Linville <[email protected]>
  • Loading branch information
g-linville authored Jul 20, 2023
1 parent 4bf05b4 commit 2008864
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
11 changes: 7 additions & 4 deletions pkg/controller/appdefinition/acorn.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,7 @@ func toAcorn(appInstance *v1.AppInstance, tag name.Reference, pullSecrets *PullS
Namespace: appInstance.Namespace,
Labels: labelMap,
Annotations: labels.Merge(appInstanceScoped(acornName, appInstance.Status.AppSpec.Annotations, appInstance.Spec.Annotations, acorn.Annotations),
map[string]string{
labels.AcornOriginalImage: acorn.GetOriginalImage(),
labels.AcornAppGeneration: strconv.FormatInt(appInstance.Generation, 10),
}),
map[string]string{labels.AcornAppGeneration: strconv.FormatInt(appInstance.Generation, 10)}),
},
Spec: v1.AppInstanceSpec{
Region: appInstance.GetRegion(),
Expand All @@ -153,6 +150,12 @@ func toAcorn(appInstance *v1.AppInstance, tag name.Reference, pullSecrets *PullS
},
}

// Only set the original image annotation if auto-upgrade is off. Setting the original image annotation
// on auto-upgrade apps will cause the pattern to be shown to the user instead of the actual image, which is bad.
if _, on := autoupgrade.Mode(acornInstance.Spec); !on {
acornInstance.Annotations[labels.AcornOriginalImage] = acorn.GetOriginalImage()
}

return acornInstance
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ kind: AppInstance
metadata:
annotations:
acorn.io/app-generation: "0"
acorn.io/original-image: foo
myAnnotation: myValue
creationTimestamp: null
labels:
Expand Down

0 comments on commit 2008864

Please sign in to comment.