Skip to content

Commit 0669a86

Browse files
authored
Merge pull request #252 from chengxiangdong/fix_workflow
fix E2E workflow
2 parents d602479 + fdf3e20 commit 0669a86

File tree

4 files changed

+20
-15
lines changed

4 files changed

+20
-15
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
- name: run e2e
7171
run: |
7272
export ARTIFACTS_PATH=${{ github.workspace }}/e2e-logs
73-
sh hack/run-e2e.sh
73+
./hack/run-e2e.sh
7474
- name: upload logs
7575
if: always()
7676
uses: actions/upload-artifact@v3

hack/deploy/huawei-cloud-controller-manager.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ spec:
169169
effect: NoSchedule
170170
- key: node-role.kubernetes.io/control-plane
171171
effect: NoSchedule
172+
- key: node-role.kubernetes.io/controlplane
173+
effect: NoSchedule
172174
serviceAccountName: cloud-controller-manager
173175
containers:
174176
- name: huawei-cloud-controller-manager

hack/pre-run-e2e.sh

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,30 +22,33 @@ export REGISTRY_SERVER_ADDRESS=swr.ap-southeast-1.myhuaweicloud.com
2222
export REGISTRY=${REGISTRY_SERVER_ADDRESS}/cloud-native
2323
export 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.
2737
make image-huawei-cloud-controller-manager
2838

2939
tmpPath=$(mktemp -d)
30-
is_containerd=`command -v containerd`
40+
is_containerd=$(command -v containerd)
3141
echo "is_containerd: ${is_containerd}"
3242
if [[ -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
3646
fi
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.
4649
kubectl 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

5053
REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
5154
image_url=${REGISTRY}/huawei-cloud-controller-manager:${VERSION}

hack/run-e2e.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,21 @@ GOPATH=$(go env GOPATH | awk -F ':' '{print $1}')
3131
export PATH=$PATH:$GOPATH/bin
3232

3333
# Pre run e2e for extra components
34-
echo -e "\nRun pre run e2e"
34+
echo -e "\n:::::: Run pre run e2e ::::::"
3535
"${REPO_ROOT}"/hack/pre-run-e2e.sh
3636

3737
# Run e2e
38-
echo -e "\nRun e2e"
38+
echo -e "\n:::::: Run e2e ::::::"
3939
set +e
4040
ginkgo -v --race --trace --fail-fast -p --randomize-all ./test/e2e/
4141
TESTING_RESULT=$?
4242

4343
# Collect logs
4444
kubectl logs deployment/huawei-cloud-controller-manager -n kube-system > ${ARTIFACTS_PATH}/huawei-cloud-controller-manager.log
45-
echo -e "\nCollected logs at ${ARTIFACTS_PATH}:"
45+
echo -e "\n:::::: Collected logs at ${ARTIFACTS_PATH}:"
4646

4747
# Post run e2e for delete extra components
48-
echo -e "\nRun post run e2e"
48+
echo -e "\n:::::: Run post run e2e ::::::"
4949
"${REPO_ROOT}"/hack/post-run-e2e.sh
5050

5151
exit $TESTING_RESULT

0 commit comments

Comments
 (0)