Update apps/demo-nginx/Jenkinsfile
This commit is contained in:
14
apps/demo-nginx/Jenkinsfile
vendored
14
apps/demo-nginx/Jenkinsfile
vendored
@@ -440,23 +440,25 @@ EOF
|
|||||||
echo ""
|
echo ""
|
||||||
echo "2. Checking running pod images..."
|
echo "2. Checking running pod images..."
|
||||||
|
|
||||||
POD_IMAGES=$(kubectl get pods -n ${NAMESPACE} -l app=${APP_NAME} \
|
def POD_IMAGES = sh(
|
||||||
-o jsonpath='{range .items[*]}{.spec.containers[0].image}{" "}{end}')
|
script: "kubectl get pods -n ${NAMESPACE} -l app=${APP_NAME} -o jsonpath='{range .items[*]}{.spec.containers[0].image}{\" \"}{end}'",
|
||||||
|
returnStdout: true
|
||||||
|
).trim()
|
||||||
|
|
||||||
echo " Running pod images:"
|
echo " Running pod images:"
|
||||||
echo " ${POD_IMAGES}"
|
echo " ${POD_IMAGES}"
|
||||||
echo " Expected tag: ${IMAGE_TAG}"
|
echo " Expected tag: ${IMAGE_TAG}"
|
||||||
|
|
||||||
if ! echo "${POD_IMAGES}" | grep -q "${IMAGE_TAG}"; then
|
if (!POD_IMAGES.contains(IMAGE_TAG)) {
|
||||||
echo " ❌ FAILED: Running pods do not use expected image!"
|
error("❌ FAILED: Running pods do not use expected image!")
|
||||||
exit 1
|
}
|
||||||
fi
|
|
||||||
|
|
||||||
echo " ✅ All running pods use expected image"
|
echo " ✅ All running pods use expected image"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# 3. CRITICAL: Verify actual running pod images
|
# 3. CRITICAL: Verify actual running pod images
|
||||||
echo ""
|
echo ""
|
||||||
echo "3. Checking actual running pod images..."
|
echo "3. Checking actual running pod images..."
|
||||||
|
|||||||
Reference in New Issue
Block a user