0

When I run oc get bc, I got "no resource found". I have no problem to get results on other commands, e.g. oc get dc, oc status. The build process was kicked off by Jenkins.

What am I missing here?

rickcoup
  • 275
  • 1
  • 5
  • 20
  • What do you get from `oc get all`? – Will Gordon Jan 29 '19 at 15:25
  • Yes. I see deployemntConfigs, routes, ..., hpa. But not the buildconfigs. – rickcoup Jan 29 '19 at 18:17
  • You could always try increasing your log level `oc get bc --loglevel=6`. This should show you the actual API calls made. On my machine, it looks like `GET https://api.example.com:443/apis/build.openshift.io/v1/namespaces/my-project/buildconfigs?limit=500 200 OK in 427 milliseconds` – Will Gordon Jan 29 '19 at 20:02
  • It's similar, but with "no resources found". GET https://:/oapi/v1/namespaces//buildconfigs 200 OK in 16 milliseconds No resources found. – rickcoup Jan 29 '19 at 20:22
  • Interesting, your's is trying to access `oapi` versus mine at `apis/build.openshift.io`. My first guess is that your `oc` client and `openshift` server have a version mismatch. What's the output from `oc version`? – Will Gordon Jan 29 '19 at 22:49
  • Yes. You are right. My client version is behind as just had the server upgrade. Will try to upgrade my client and see. – rickcoup Jan 30 '19 at 19:00
  • updated my client with same version on server. It still has the issue. GET https://hostname:port/apis/build.openshift.io/v1/namespaces//buildconfigs?limit=500 200 OK in 249 milliseconds No resources found. – rickcoup Jan 30 '19 at 19:22
  • And they show up fine in the Web Console? Maybe you really just don't have any `buildconfig`s in this namespace? – Will Gordon Jan 30 '19 at 20:35

1 Answers1

1

Make sure you are on the right project (project is OpenShift parlance for a Kubernetes namespace and the oc client uses it to set your current context namespace): oc project will tell you which project you are currently on and oc projects will list all of the projects you have access to on the cluster. Use oc project foo to change project contexts for the oc client.

Jason Kincl
  • 968
  • 6
  • 11