2

I have installed minishift with cask and openshift client with homebrew.

However, as developer user, I am not able to create a project from openshift cli, trigger a build, etc. I always have permissions errors :

Error from server (Forbidden): User "developer" cannot list all project.openshift.io.projectrequests in the cluster
Error from server (Forbidden): User "developer" cannot list authorization.openshift.io.rolebindings in project "my_awesome_project"
Error from server (Forbidden): User "developer" cannot create build.openshift.io.buildconfigs/instantiatebinary in project "my_awesome_project"

However, I am able to create projects from the UI. How can I grant developer user permissions from the command line ?

I am using MacOS High Sierra:

➜ minishift version
minishift v1.15.1+a5c47dd

➜ oc version
oc v3.9.0+191fece
kubernetes v1.9.1+a0ce1bc657
features: Basic-Auth

Server https://192.168.99.100:8443
openshift v1.5.0-rc.0+49a4a7a
kubernetes v1.5.2+43a9be4
Graham Dumpleton
  • 57,726
  • 6
  • 119
  • 134
rico
  • 1,843
  • 2
  • 24
  • 41
  • This suggest you are not logged in? Have you run ``oc login https://192.168.99.100:8443`` and entered ``developer`` for login and password. – Graham Dumpleton Apr 09 '18 at 10:16
  • Yes I am logged. Here is the error I have afterwards : ➜ oc start-build shopping-backend --from-dir=. --follow Uploading directory "." as binary input for the build ... Error from server (Forbidden): User "developer" cannot create build.openshift.io.buildconfigs/instantiatebinary in project "my_awesome_project" – rico Apr 09 '18 at 10:22
  • Can you create a new project? Can you run ``oc describe project/my_awesome_project --as system:admin``? Is there a chance the project was created as a different username? If the ``oc describe`` works it should display an annotation as to who the owner of the project is. – Graham Dumpleton Apr 09 '18 at 10:27
  • ➜ oc new-project my_awesome_project Error from server (Forbidden): User "developer" cannot list all project.openshift.io.projectrequests in the cluster – rico Apr 09 '18 at 10:34
  • run `oc new-project my_awesome_project --loglevel 5` to find more information. – ccshih Apr 09 '18 at 12:17

2 Answers2

5

You should downgrade your client or upgrade your minishift version to match if possible, as they are not 100% API compatible.

You can use the minishift oc binary in an easy way, so you still preserve you're other client if needed (maybe you need to run multiple versions). To do that do:

localhost# eval $(minishift oc-env)

This will execute:

export PATH="/Users/me/.minishift/cache/oc/v3.7.2/darwin:$PATH"

In this way, you'll always be using the same client version as your minishift instance.

3

The version of oc that you are using (3.9) is not compatible with the server (1.5 / 3.5). Use a newer version of Openshift or downgrade oc to 3.6.

monis
  • 496
  • 4
  • 10