Skip to content

Commit 9f4f8aa

Browse files
committed
name env key more clearly
1 parent 217547b commit 9f4f8aa

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

cmd/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,11 @@ func main() {
123123
}
124124
var ns corev1.Namespace
125125
if err := mgr.GetAPIReader().Get(context.Background(), types.NamespacedName{Name: podNamespace}, &ns); err != nil {
126-
setupLog.Error(err, "unable to fetch namespace UID for controller identity")
126+
setupLog.Error(err, "unable to fetch namespace UID for controller identity suffix")
127127
os.Exit(1)
128128
}
129-
if err := os.Setenv(controller.NamespaceUIDEnvKey, string(ns.UID)); err != nil {
130-
setupLog.Error(err, fmt.Sprintf("unable to set %s", controller.NamespaceUIDEnvKey))
129+
if err := os.Setenv(controller.IdentitySuffixEnvKey, string(ns.UID)); err != nil {
130+
setupLog.Error(err, fmt.Sprintf("unable to set %s", controller.IdentitySuffixEnvKey))
131131
os.Exit(1)
132132
}
133133

internal/controller/util.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const (
3636

3737
VersionEnvKey = "CONTROLLER_VERSION"
3838
IdentityEnvKey = "CONTROLLER_IDENTITY"
39-
NamespaceUIDEnvKey = "NAMESPACE_UID"
39+
IdentitySuffixEnvKey = "CONTROLLER_IDENTITY_SUFFIX"
4040
MaxDeploymentVersionsIneligibleForDeletionEnvKey = "CONTROLLER_MAX_DEPLOYMENT_VERSIONS_INELIGIBLE_FOR_DELETION"
4141

4242
serverDeleteVersionIdentity = "try-delete-for-add-version"
@@ -72,7 +72,7 @@ func getControllerIdentity() string {
7272
// getControllerIdentityWithNamespaceUID returns the identity which will be used in the
7373
// next release. Used in this release for smooth rollback identity reclamation.
7474
func getControllerIdentityWithNamespaceUID() string {
75-
return getControllerIdentity() + "/" + os.Getenv(NamespaceUIDEnvKey)
75+
return getControllerIdentity() + "/" + os.Getenv(IdentitySuffixEnvKey)
7676
}
7777

7878
func GetControllerMaxDeploymentVersionsIneligibleForDeletion() int32 {

0 commit comments

Comments
 (0)