fix: verify deployed image
This adds code to verify that the image used in the kubefed
deployments is actually the one that was expected and prevents
regression for the bug fixed in
@@ -84,6 +84,9 @@ EOF
fi
${cmd}
+
+ deployment-image-as-expected ${NS} kubefed-admission-webhook ${repository}/${image}:${tag}
+ deployment-image-as-expected ${NS} kubefed-controller-manager ${repository}/${image}:${tag}
}
function helm-deploy-cmd {
@@ -108,6 +111,15 @@ function kubefed-admission-webhook-ready() {
[[ "${readyReplicas}" -ge "1" ]]
}
+function deployment-image-as-expected() {
+ local namespace="${1}"
+ local deployment="${2}"
+ local expected_image="${3}"
+
+ local deployed_image="$(kubectl -n ${namespace} get deployment ${deployment} -o jsonpath={.spec.template.spec.containers[0].image})"
+ [[ "${deployed_image}" == "${expected_image}" ]]
+}
+
function check-command-installed() {
local cmdName="${1}"
