Skip to content

Commit

Permalink
[CI] generate antrea manifests in hw-offload CI with a custom image
Browse files Browse the repository at this point in the history
Following antrea-io#1617, the default image name in the antrea.yml file changed
to use the harbor image. Although the patch includes a change in the
make file to change the image name correctly in case the image was
built, the hw-offload CI uses `docker build` to build the image, and
this made it so that the CI would not use the image it was building,
but the upstream latest image.

This patch fixes that by building the antrea manifests with the image
name being the same as the one that was built.
  • Loading branch information
abdallahyas committed Apr 13, 2021
1 parent 994ed3d commit 3906dd6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions ci/jenkins/mellanox/scripts/start_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,16 @@ EOF
if [[ -z "${ANTREA_CNI_PR}${ANTREA_CNI_BRANCH}" ]];then
change_image_name $ANTREA_CNI_HARBOR_IMAGE antrea/antrea-ubuntu
fi

bash $WORKSPACE/antrea-cni/hack/generate-manifest.sh --dev-image "antrea/antrea-ubuntu" > $ARTIFACTS/antrea.yml
let status=status+$?
if [ "$status" != 0 ]; then
echo "ERROR: Failed to generate antrea manifest!"
return $status
fi

if [[ -z "$(grep hw-offload $WORKSPACE/antrea-cni/build/yamls/antrea.yml)" ]];then
sed -i '/start_ovs/a\ - --hw-offload' $WORKSPACE/antrea-cni/build/yamls/antrea.yml
sed -i '/start_ovs/a\ - --hw-offload' $ARTIFACTS/antrea.yml
fi

cat > $ARTIFACTS/antrea-net.yaml <<EOF
Expand Down Expand Up @@ -158,7 +165,7 @@ kubectl create -f $ARTIFACTS/antrea-net.yaml
kubectl create -f $ARTIFACTS/configMap.yaml
kubectl create -f $(ls -l $WORKSPACE/sriov-network-device-plugin/deployments/*/sriovdp-daemonset.yaml|tail -n1|awk '{print $NF}')

kubectl create -f $WORKSPACE/antrea-cni/build/yamls/antrea.yml
kubectl create -f $ARTIFACTS/antrea.yml

cp $ARTIFACTS/antrea-net.yaml $(ls -l $WORKSPACE/sriov-network-device-plugin/deployments/*/sriovdp-daemonset.yaml|tail -n1|awk '{print $NF}') $ARTIFACTS/
echo "All code in $WORKSPACE"
Expand Down

0 comments on commit 3906dd6

Please sign in to comment.