兼容查询已有工作负载不存在
This commit is contained in:
@@ -114,7 +114,9 @@ pipeline {
|
||||
steps {
|
||||
script {
|
||||
def oldImg = sh (
|
||||
script: "kubectl get deployment ${Deployment_name} -n ${K8s_namespace} -o=jsonpath='{.spec.template.spec.containers[*].image}'",
|
||||
script: """
|
||||
kubectl get deployment ${Deployment_name} -n ${K8s_namespace} -o=jsonpath='{.spec.template.spec.containers[*].image}' 2>/dev/null || echo "无(可能是首次部署)"
|
||||
""",
|
||||
returnStdout: true
|
||||
).trim()
|
||||
env.OLD_IMAGE_NAME = oldImg
|
||||
|
||||
Reference in New Issue
Block a user