File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -474,6 +474,7 @@ def labelPod(){
474474 }
475475
476476 def jsonLabels = groovy.json.JsonOutput . toJson([metadata : [labels : labels]])
477+ echo " jsonLabels" : $(jsonLabels)
477478
478479 bash '''
479480 set -eu
@@ -486,14 +487,15 @@ def labelPod(){
486487 TOKEN=$(cat $SA/token)
487488 CA=$SA/ca.crt
488489
490+ echo '${jsonLabels}' > /tmp/patch.json
489491
490492 if curl -sS --fail \
491493 --cacert "$CA" \
492494 -H "Authorization: Bearer $TOKEN" \
493495 -H "Content-Type: application/merge-patch+json" \
494496 -X PATCH \
495497 "https://kubernetes.default.svc/api/v1/namespaces/$NS/pods/$POD" \
496- -d '${jsonLabels}'
498+ --data-binary @/tmp/patch.json >/dev/null
497499 then
498500 echo "labeled jenkins-job=$JOB jenkins-build=$BUILD_NUMBER for pod $NS/$POD"
499501 else
You can’t perform that action at this time.
0 commit comments