diff --git a/pkg/hub/controllers/cluster/deregister.go b/pkg/hub/controllers/cluster/deregister.go index 3e44afb2a..0404c3867 100644 --- a/pkg/hub/controllers/cluster/deregister.go +++ b/pkg/hub/controllers/cluster/deregister.go @@ -280,6 +280,10 @@ func constructConfigMap(data string) *corev1.ConfigMap { } func constructJobForClusterDeregister() *batchv1.Job { + workerInstallerImage := os.Getenv("WORKER_INSTALLER_IMAGE") + if workerInstallerImage == "" { + workerInstallerImage = WORKER_INSTALLER_DEFAULT_IMAGE + } backOffLimit := int32(0) ttlSecondsAfterFinished := int32(600) job := &batchv1.Job{ @@ -304,7 +308,7 @@ func constructJobForClusterDeregister() *batchv1.Job { ServiceAccountName: serviceAccountName, Containers: []corev1.Container{{ Name: cleanupContainer, - Image: "aveshasystems/worker-installer:1.1.8", + Image: workerInstallerImage, Command: []string{ "/bin/bash", "/tmp/kubeslice-cleanup.sh", diff --git a/pkg/hub/controllers/cluster/vars.go b/pkg/hub/controllers/cluster/vars.go index 9d6ce97cd..ee17958ca 100644 --- a/pkg/hub/controllers/cluster/vars.go +++ b/pkg/hub/controllers/cluster/vars.go @@ -25,12 +25,13 @@ import ( ) var ( - ControlPlaneNamespace = "kubeslice-system" - HubSecretSuffix = "-kubernetes-dashboard" - KubeSliceDashboardSA = "kubeslice-kubernetes-dashboard" - ProjectNamespace = os.Getenv("HUB_PROJECT_NAMESPACE") - HubEndpoint = os.Getenv("HUB_HOST_ENDPOINT") - HubTokenFile = utils.GetEnvOrDefault("HUB_TOKEN_FILE", "/var/run/secrets/kubernetes.io/hub-serviceaccount/token") - HubCAFile = utils.GetEnvOrDefault("HUB_CA_FILE", "/var/run/secrets/kubernetes.io/hub-serviceaccount/ca.crt") - ClusterName = os.Getenv("CLUSTER_NAME") + ControlPlaneNamespace = "kubeslice-system" + HubSecretSuffix = "-kubernetes-dashboard" + KubeSliceDashboardSA = "kubeslice-kubernetes-dashboard" + ProjectNamespace = os.Getenv("HUB_PROJECT_NAMESPACE") + HubEndpoint = os.Getenv("HUB_HOST_ENDPOINT") + HubTokenFile = utils.GetEnvOrDefault("HUB_TOKEN_FILE", "/var/run/secrets/kubernetes.io/hub-serviceaccount/token") + HubCAFile = utils.GetEnvOrDefault("HUB_CA_FILE", "/var/run/secrets/kubernetes.io/hub-serviceaccount/ca.crt") + ClusterName = os.Getenv("CLUSTER_NAME") + WORKER_INSTALLER_DEFAULT_IMAGE = "aveshasystems/worker-installer:1.1.8" )