diff --git a/cmd/manager/main.go b/cmd/manager/main.go index 35ffff6d87..9580005a5f 100644 --- a/cmd/manager/main.go +++ b/cmd/manager/main.go @@ -26,6 +26,7 @@ import ( // Go build-time variables var ( ImageRepository string + ImageVersion string LegacyServingCertificateMountVersion string ProductName string ServerRootDirectory string @@ -128,6 +129,7 @@ func operatorRun(namespace string, cfg *rest.Config) error { // Setup all Controllers bv := util.BuildVariables{ ImageRepository: ImageRepository, + ImageVersion: ImageVersion, LegacyServingCertificateMountVersion: LegacyServingCertificateMountVersion, ProductName: ProductName, ServerRootDirectory: ServerRootDirectory, diff --git a/pkg/resources/deployment.go b/pkg/resources/deployment.go index 4bf3e96412..db16fc9133 100644 --- a/pkg/resources/deployment.go +++ b/pkg/resources/deployment.go @@ -1,6 +1,7 @@ package resources import ( + "fmt" "os" "path" @@ -237,11 +238,13 @@ func getServingCertificateMountPath(version string, legacyServingCertificateMoun } func getVersion(buildVariables util.BuildVariables) string { + fmt.Println("Getting version from IMAGE_VERSION environment variable ...") version := os.Getenv("IMAGE_VERSION") if version == "" { - if len(version) > 0 { - version = buildVariables.ImageVersion - } else { + fmt.Println("Getting version from build variable ImageVersion") + version = buildVariables.ImageVersion + if len(version) == 0 { + fmt.Println("Defaulting to version being latest") version = "latest" } }