Refine PipelineRuns management and viewing roles
What this PR dose
- Add
pipelines/runs
,pipelines/pipelineruns
andpipelineruns/nodedetails
resources into PipelineRun's RolBase. - Adjust role dependencies for
view-pipelines
andmanage-pipelines
roles.
Why we need it
Firstly, we need a finer grained permissions for PipelineRuns. Then, if the missing resources were not added, users has Pipeline Viewing
and PipelineRun Viewing
roles could not view any PipelineRuns in console.
BTW, this PR is related with #1828.
Steps to test
- Apply the role templates into cluster
kubectl apply -f https://raw.githubusercontent.com/kubesphere/ks-installer/aacef83af34391bda2ce43143c0cc0df2956d6ce/roles/ks-core/prepare/files/ks-init/role-templates.yaml
- Create a Workspace, DevOps Project and simple Pipeline.
pipeline { agent none stages { stage('Example') { input { message "Should we continue?" ok "Yes, we should." submitter "alice,bob" parameters { string(name: 'PERSON', defaultValue: 'Mr Jenkins', description: 'Who should I say hello to?') } } steps { echo "Hello, ${PERSON}, nice to meet you." } } } }
- Run the Pipeline
- Create a role for the DevOps Project created before, which has
view-pipelines
permissions - Create a user and assign the role created before to the user
- Validate the result
/kind bug /area devops /cc @kubesphere/sig-devops /milestone v3.2