cloud-native-toolkit / cloud-native-toolkit/planning

"Failure on task build" with Go Gin

Open
#885 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
4
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Environment:
OCP 4.7 cluster on ROKS, classic infrastructure

Following instructions located here: https://cloudnativetoolkit.dev/resources/workshop/ci/

Using `projectdemo1`:
```
$ oc sync $TOOLKIT_PROJECT-dev
Setting up namespace projectdemo1-dev
Setting up namespace: projectdemo1-dev
Checking for existing project: projectdemo1-dev
Creating project: projectdemo1-dev
Copying ConfigMaps
Copying Secrets
Setting current project to projectdemo1-dev
```

After setting up environment the pipeline creation seems to work:
```
$ oc pipeline --tekton
Creating pipeline on openshift cluster in projectdemo1-dev namespace
Retrieving git parameters
Project git repo: http://gogs-tools.cnt-test-f433feaa368a93b02bd421dffbb9576c-0000.us-south.containers.appdomain.cloud/userdemo/go-gin.git
Branch: master
Retrieving available template pipelines from tools
Pipeline templates filtered based on detected runtime: golang
? Select the Pipeline to use in the PipelineRun: ibm-golang
? scan-image: Enable the pipeline to scan the image for vulnerabilities? Yes
? lint-dockerfile: Enable the pipeline to lint the Dockerfile for best practices? Yes
Copying tasks from tools..
Copied Pipeline from tools/ibm-golang to projectdemo1-dev/go-gin
Creating TriggerTemplate for pipeline: go-gin
Creating TriggerBinding for pipeline: go-gin
Creating/updating TriggerEventListener for pipeline: tekton
Creating new event listener
Waiting for event listener rollout: projectdemo1-dev/el-tekton....................
Creating/updating Route for pipeline: tekton
Creating PipelineRun for pipeline: go-gin
Creating Gogs webhook for repo: http://gogs-tools.cnt-test-f433feaa368a93b02bd421dffbb9576c-0000.us-south.containers.appdomain.cloud/userdemo/go-gin.git

Pipeline run started: go-gin-17d247f0703

Next steps:
Tekton cli:
View PipelineRun info - tkn pr describe go-gin-17d247f0703
View PipelineRun logs - tkn pr logs -f go-gin-17d247f0703
OpenShift console:
View PipelineRun - https://console-openshift-console.cnt-test-f433feaa368a93b02bd421dffbb9576c-0000.us-south.containers.appdomain.cloud/k8s/ns/projectdemo1-dev/tekton.dev~v1beta1~PipelineRun/go-gin-17d247f0703
```

I also ran:
```
$ oc adm policy add-scc-to-user privilege -z pipeline
clusterrole.rbac.authorization.k8s.io/system:openshift:scc:privilege added: "pipeline"
```

But the pipeline is failing in the Build stage. These events are in the event log:

```
1 error occurred: * failed to create task run pod "go-gin-gne768-build-tc4qr": pods "go-gin-gne768-build-tc4qr-pod-pwqvx" 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]. Maybe missing or invalid Task projectdemo1-dev/ibm-build-tag-push-v2-7-3
```
and
```
failed to create task run pod "go-gin-gne768-build-tc4qr": pods "go-gin-gne768-build-tc4qr-pod-pwqvx" 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]. Maybe missing or invalid Task projectdemo1-dev/ibm-build-tag-push-v2-7-3
```

Thanks for any help in getting past this issue.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.