1
0
mirror of https://github.com/tektoncd/catalog.git synced 2024-11-21 05:55:35 +00:00

Fix creation of ServiceAccount in helm tasks

Upstream catalog nightly is failing with the error
`error: error parsing STDIN: error converting YAML to JSON: yaml: line
2: mapping values are not allowed in this context` which is occuring
while creating the SA in `pre-apply-task-hook.sh` as the SA YAML was
first created and then applied and during this process the error is
occuring.

The PR fixes that by directly creating the SA and not first generating
the YAML and then applying in next step.

Signed-off-by: vinamra28 <vinjain@redhat.com>
This commit is contained in:
vinamra28 2021-01-19 11:02:56 +05:30 committed by tekton-robot
parent 197c3862e5
commit 8d53c6ecf0
3 changed files with 3 additions and 3 deletions

View File

@ -4,7 +4,7 @@
add_task git-clone latest
# Add service account
kubectl -n ${tns} create serviceaccount helm-pipeline-run-sa -o yaml --dry-run=client | kubectl apply -f -
kubectl -n ${tns} create serviceaccount helm-pipeline-run-sa
# Add edit role to service account
kubectl -n ${tns} create rolebinding helm-pipeline-run-sa-edit --clusterrole edit --serviceaccount ${tns}:helm-pipeline-run-sa -o yaml --dry-run=client | kubectl apply -f -

View File

@ -4,7 +4,7 @@
add_task git-clone latest
# Add service account
kubectl -n ${tns} create serviceaccount helm-pipeline-run-sa -o yaml --dry-run=client | kubectl apply -f -
kubectl -n ${tns} create serviceaccount helm-pipeline-run-sa
# Add edit role to service account
kubectl -n ${tns} create rolebinding helm-pipeline-run-sa-edit --clusterrole edit --serviceaccount ${tns}:helm-pipeline-run-sa -o yaml --dry-run=client | kubectl apply -f -

View File

@ -4,7 +4,7 @@
add_task git-clone latest
# Add service account
kubectl -n ${tns} create serviceaccount helm-pipeline-run-sa -o yaml --dry-run=client | kubectl apply -f -
kubectl -n ${tns} create serviceaccount helm-pipeline-run-sa
# Add edit role to service account
kubectl -n ${tns} create rolebinding helm-pipeline-run-sa-edit --clusterrole edit --serviceaccount ${tns}:helm-pipeline-run-sa -o yaml --dry-run=client | kubectl apply -f -