@@ -22,30 +22,33 @@ export REGISTRY_SERVER_ADDRESS=swr.ap-southeast-1.myhuaweicloud.com
2222export REGISTRY=${REGISTRY_SERVER_ADDRESS} /cloud-native
2323export VERSION=v$( echo $RANDOM | sha1sum | cut -c 1-5)
2424
25- echo -e " \nBuild images"
25+ echo -e " \n:::::: Check KUBECONFIG ::::::"
26+ echo " KUBECONFIG=" $KUBECONFIG
27+
28+ echo -e " \n:::::: Check cloud-config Secret ::::::"
29+ count=$( kubectl get -n kube-system secret | grep cloud-config | wc -l)
30+ if [[ " $count " -ne 1 ]]; then
31+ echo " :::::: Please create the cloud-config secret."
32+ exit 1
33+ fi
34+
35+ echo -e " \n:::::: Build images ::::::"
2636# todo: Maybe we need load the image to target cluster node.
2737make image-huawei-cloud-controller-manager
2838
2939tmpPath=$( mktemp -d)
30- is_containerd=` command -v containerd`
40+ is_containerd=$( command -v containerd)
3141echo " is_containerd: ${is_containerd} "
3242if [[ -x ${is_containerd} ]]; then
3343 docker save -o " ${tmpPath} /huawei-cloud-controller-manager.tar" ${REGISTRY} /huawei-cloud-controller-manager:${VERSION}
3444 ctr -n=k8s.io i import ${tmpPath} /huawei-cloud-controller-manager.tar
3545 rm -rf ${tmpPath} /huawei-cloud-controller-manager.tar
3646fi
3747
38- echo -e " \nCheck cloud-config secret"
39- count=` kubectl get -n kube-system secret cloud-config | grep cloud-config | wc -l`
40- if [[ " $count " -ne 1 ]]; then
41- echo " Please create the cloud-config secret."
42- exit 1
43- fi
44-
4548# Remove the existing provider if it exists.
4649kubectl delete -n kube-system deployment --ignore-not-found=true huawei-cloud-controller-manager
4750
48- echo -e " \nDeploy huawei-cloud-controller-manager"
51+ echo -e " \n:::::: Deploy huawei-cloud-controller-manager :::::: "
4952
5053REPO_ROOT=$( dirname " ${BASH_SOURCE[0]} " ) /..
5154image_url=${REGISTRY} /huawei-cloud-controller-manager:${VERSION}
0 commit comments