Issue editing Jenkins pipeline serviceaccount role

Solution Verified - Updated -

Issue

The following jenkins pipelines created using the system:admin user:

apiVersion: v1
kind: Template
metadata:
  name: deploy-pipeline
parameters:
objects:
- apiVersion: v1
  kind: "BuildConfig"
  metadata:
    name: "moo-deploy-pipeline"
  spec:
    source:
      git:
        uri: "https://test.example.com/SO000223/moo-config.git"
      sourceSecret:
        name: "gitcredential"
    strategy:
      jenkinsPipelineStrategy:
        jenkinsfilePath: moo-deploy.groovy
  • The jenkins serviceaccount was automatically created with "edit" role. Then tried to substitute the edit role applied to the jenkins sa, removing "edit" and adding a new "vnf-edit" role by running the following command:
   # oc adm policy remove-role-from-user edit system:serviceaccount:moo-pvv-totp:jenkins -n moo-pvv-totp
    error: unable to find target [system:serviceaccount:moo-pvv-totp:jenkins]

Environment

  • Red Hat OpenShift Container Platform 3.11

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content