openshift/openshift-restclient-python

Getting openshift.dynamic.exceptions.ResourceNotFoundError trying to obtain projects using the SDK

pavelzagalsky-paloalto opened this issue · 1 comments

Hi!
Just started using the SDK and having an issue:

This is the code I am using:

from kubernetes import client, config
from openshift.dynamic import DynamicClient

k8s_client = config.new_client_from_config()
dyn_client = DynamicClient(k8s_client)

v1_projects = dyn_client.resources.get(api_version='project.openshift.io/v1', kind='Project')

project_list = v1_projects.get()

for project in project_list.items:
    print(project.metadata.name)

And I am failing on the v1_projects line with the following error:
openshift.dynamic.exceptions.ResourceNotFoundError: No matches found for {'api_version': 'project.openshift.io/v1', 'kind': 'Project'}
Google searches yield nothing of substance.
Thanks!

I forgot to add KUBECONFIG path on PyCharm with the kubeconfig file