File tree 1 file changed +13
-2
lines changed
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -795,7 +795,7 @@ install_snapshot_controller() {
795
795
kind load docker-image --name csi-prow ${NEW_IMG} || die " could not load the snapshot-controller:csiprow image into the kind cluster"
796
796
797
797
# deploy snapshot-controller
798
- echo " Deploying snapshot-controller"
798
+ echo " Deploying snapshot-controller from ${SNAPSHOT_CONTROLLER_YAML} with $NEW_IMG . "
799
799
# Replace image in SNAPSHOT_CONTROLLER_YAML with snapshot-controller:csiprow and deploy
800
800
# NOTE: This logic is similar to the logic here:
801
801
# https://github.com/kubernetes-csi/csi-driver-host-path/blob/v1.4.0/deploy/util/deploy-hostpath.sh#L155
@@ -832,8 +832,19 @@ install_snapshot_controller() {
832
832
echo " $modified "
833
833
exit 1
834
834
fi
835
- echo " kubectl apply -f ${SNAPSHOT_CONTROLLER_YAML} (modified)"
836
835
done
836
+ elif [ " ${CSI_PROW_DRIVER_CANARY} " = " canary" ]; then
837
+ echo " Deploying snapshot-controller from ${SNAPSHOT_CONTROLLER_YAML} with canary images."
838
+ yaml=" $( kubectl apply --dry-run=client -o yaml -f " $SNAPSHOT_CONTROLLER_YAML " ) "
839
+ # Ignore: See if you can use ${variable// search/ replace} instead.
840
+ # shellcheck disable=SC2001
841
+ modified=" $( echo " $yaml " | sed -e " s;image: .*/\([^/:]*\):.*;image: ${CSI_PROW_DRIVER_CANARY_REGISTRY} /\1:canary;" ) "
842
+ diff <(echo " $yaml " ) <(echo " $modified " )
843
+ if ! echo " $modified " | kubectl apply -f -; then
844
+ echo " modified version of $SNAPSHOT_CONTROLLER_YAML :"
845
+ echo " $modified "
846
+ exit 1
847
+ fi
837
848
else
838
849
echo " kubectl apply -f $SNAPSHOT_CONTROLLER_YAML "
839
850
kubectl apply -f " $SNAPSHOT_CONTROLLER_YAML "
You can’t perform that action at this time.
0 commit comments