Skip to content

Commit 05ed072

Browse files
operator: fix upgradeImages
Operatorhub bundle can have sha256 image tags that are put through env vars. When operator controller manager gets upgraded, its operands (plugin daemonsets) should be updated to the image in the env vars. But it has not been working properly because of wrong parsing. Fix it to parse the image names that have sha256 tags correctly so env vars in operator can be used as intended. Signed-off-by: Hyeongju Johannes Lee <[email protected]>
1 parent 53efaae commit 05ed072

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/controllers/reconciler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ func UpgradeImages(ctx context.Context, image *string, initimage *string) (upgra
160160
}
161161

162162
if parts := strings.SplitN(*s, ":", 2); len(parts) == 2 && len(parts[0]) > 0 {
163-
name, version := parts[0], parts[1]
163+
name, version := strings.TrimSuffix(parts[0], "@sha256"), parts[1]
164164

165165
envVarValue := os.Getenv(strings.ReplaceAll(strings.ToUpper(filepath.Base(name)), "-", "_") + "_SHA")
166166

0 commit comments

Comments
 (0)