Handle case when no dc exists
This commit is contained in:
parent
72556b8876
commit
9b90a395b0
1 changed files with 1 additions and 1 deletions
|
@ -4,7 +4,7 @@ def getOcCmd() {
|
||||||
|
|
||||||
def getReplicasOpt(deploymentConfig, project) {
|
def getReplicasOpt(deploymentConfig, project) {
|
||||||
def ocCmd = getOcCmd()
|
def ocCmd = getOcCmd()
|
||||||
def replicas = sh(script: "${ocCmd} get dc ${deploymentConfig} --template='{{ .spec.replicas }}' -n ${project}", returnStdout: true).trim()
|
def replicas = sh(script: "${ocCmd} get dc ${deploymentConfig} --template='{{ .spec.replicas }}' -n ${project} || true", returnStdout: true).trim()
|
||||||
return replicas ? "-v REPLICAS=${replicas}" : ""
|
return replicas ? "-v REPLICAS=${replicas}" : ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue