IBM / ibm-garage-tekton-tasks

Contains a set of generic Tekton Tasks for use with Tekton Pipelines
Apache License 2.0
34 stars 60 forks source link

Build task fails on ocp4.7 #139

Open RamyaRaghuveera opened 3 years ago

RamyaRaghuveera commented 3 years ago

Build task fails with the following error: "failed to create task run pod "template-node-cshell-17b4dcee565-build-zb5l5": pods "template-node-cshell-17b4dcee565-build-zb5l5-pod-v9cq5" is forbidden: unable to validate against any security context constraint: [spec.containers[1].securityContext.privileged: Invalid value: true: Privileged containers are not allowed spec.containers[1].securityContext.privileged: Invalid value: true: Privileged containers are not allowed spec.containers[1].securityContext.privileged: Invalid value: true: Privileged containers are not allowed spec.containers[1].securityContext.privileged: Invalid value: true: Privileged containers are not allowed]. Maybe missing or invalid Task build-test/ibm-build-tag-push-v2-7-2".

Temporary solution: oc adm policy add-scc-to-user privileged -z pipeline Challenge: This command can be run by cluster admin or any person who has permission to create scc. This issue will really effect an normal end-user's cloud-native toolkit experience(https://ibm-gsi-ecosystem.github.io/ibm-gsi-cloudnative-journey/developer-intermediate/deploy-app) as their first pipeline will fail and can be fixed only by one of the cluster admin's help.

ega4432 commented 2 years ago

I have encountered this same issue. As she said, running oc adm policy add-scc-to-user privilleged -z <service-account-name> command solved the problem temporarily.

Is this the officially recommended way to deal with the problem?