From d909f607d1d7d0a4a27dd05496bc301a0c58bf90 Mon Sep 17 00:00:00 2001 From: zhzhuang-zju Date: Mon, 27 May 2024 11:44:41 +0800 Subject: [PATCH] karmadactl init: set default value of imagePullPolicy to IfNotPresent Signed-off-by: zhzhuang-zju --- .../cmdinit/kubernetes/deployments.go | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/pkg/karmadactl/cmdinit/kubernetes/deployments.go b/pkg/karmadactl/cmdinit/kubernetes/deployments.go index da7c8b912e8c..f51348748ba9 100644 --- a/pkg/karmadactl/cmdinit/kubernetes/deployments.go +++ b/pkg/karmadactl/cmdinit/kubernetes/deployments.go @@ -444,8 +444,9 @@ func (i *CommandInitOption) makeKarmadaSchedulerDeployment() *appsv1.Deployment }, Containers: []corev1.Container{ { - Name: schedulerDeploymentNameAndServiceAccountName, - Image: i.karmadaSchedulerImage(), + Name: schedulerDeploymentNameAndServiceAccountName, + Image: i.karmadaSchedulerImage(), + ImagePullPolicy: corev1.PullIfNotPresent, Command: []string{ "/bin/karmada-scheduler", "--kubeconfig=/etc/kubeconfig", @@ -559,8 +560,9 @@ func (i *CommandInitOption) makeKarmadaControllerManagerDeployment() *appsv1.Dep }, Containers: []corev1.Container{ { - Name: controllerManagerDeploymentAndServiceName, - Image: i.karmadaControllerManagerImage(), + Name: controllerManagerDeploymentAndServiceName, + Image: i.karmadaControllerManagerImage(), + ImagePullPolicy: corev1.PullIfNotPresent, Command: []string{ "/bin/karmada-controller-manager", "--kubeconfig=/etc/kubeconfig", @@ -677,8 +679,9 @@ func (i *CommandInitOption) makeKarmadaWebhookDeployment() *appsv1.Deployment { AutomountServiceAccountToken: pointer.Bool(false), Containers: []corev1.Container{ { - Name: webhookDeploymentAndServiceAccountAndServiceName, - Image: i.karmadaWebhookImage(), + Name: webhookDeploymentAndServiceAccountAndServiceName, + Image: i.karmadaWebhookImage(), + ImagePullPolicy: corev1.PullIfNotPresent, Command: []string{ "/bin/karmada-webhook", "--kubeconfig=/etc/kubeconfig", @@ -847,9 +850,10 @@ func (i *CommandInitOption) makeKarmadaAggregatedAPIServerDeployment() *appsv1.D AutomountServiceAccountToken: pointer.Bool(false), Containers: []corev1.Container{ { - Name: karmadaAggregatedAPIServerDeploymentAndServiceName, - Image: i.karmadaAggregatedAPIServerImage(), - Command: command, + Name: karmadaAggregatedAPIServerDeploymentAndServiceName, + Image: i.karmadaAggregatedAPIServerImage(), + ImagePullPolicy: corev1.PullIfNotPresent, + Command: command, VolumeMounts: []corev1.VolumeMount{ { Name: KubeConfigSecretAndMountName,