fix 1769 karmada-agent build twice when execute local-up-karmada.sh

Signed-off-by: hanweisen <hanweisen_yewu@cmss.chinamobile.com>
This commit is contained in:
hanweisen 2022-05-13 20:54:11 +08:00
parent a35672271f
commit 9af6fd8a8a
1 changed files with 1 additions and 11 deletions

View File

@ -59,17 +59,7 @@ fi
export KUBECONFIG="${MEMBER_CLUSTER_KUBECONFIG}" # switch to member cluster
kubectl config use-context "${MEMBER_CLUSTER_NAME}"
AGENT_IMAGE_PULL_POLICY="Always" # default is 'always' for standalone member cluster to try to use the latest version
# load image if member cluster created by kind (if kubeconfig clusters' name contains kind-xxx)
if kubectl config get-clusters | grep "kind-${MEMBER_CLUSTER_NAME}"
then
# make agent image
export VERSION="latest"
export REGISTRY="swr.ap-southeast-1.myhuaweicloud.com/karmada"
make image-karmada-agent --directory="${REPO_ROOT}"
kind load docker-image "${REGISTRY}/karmada-agent:${VERSION}" --name="${MEMBER_CLUSTER_NAME}"
AGENT_IMAGE_PULL_POLICY="IfNotPresent" # It must not reload the image when member cluster created by kind
fi
AGENT_IMAGE_PULL_POLICY=${IMAGE_PULL_POLICY:-IfNotPresent}
# create namespace for karmada agent
kubectl apply -f "${REPO_ROOT}/artifacts/agent/namespace.yaml"