Can't find anything on custom objects
dbazhal opened this issue · 2 comments
So I'm trying to get my custom resource api:
dyn_client.resources.get(api_version='customs.domain.tld/v1alpha1', kind='Custom')
and get this error:
openshift.dynamic.exceptions.ResourceNotFoundError: No matches found for <...>
(but I can get my crd by typing oc get crd customs.domain.tld
)
Project main page says
The dynamic client also works with resources that are defined by aggregated API servers or Custom Resource Definitions.
but code search says there are only two usages of word 'custom', so I'm starting to think there actually is no custom objects support.
My request is to add support of CR's or to add CR usage example to the main doc page if it's already implemented.
Custom resources should work the same as any other resource - for example, if I have created a CRD for a resource with:
group
: apps.example.com
version
: v1alpha
kind
: Foo
,
then
dyn_client.resources.get(api_version='apps.example.com/v1alpha1', kind='Foo')
Should get me the object for interacting with that API resource.
If I had to guess, I think your kind
or api_version
might not be correct, can you paste your CRD
and verify that the group
/version
/kind
of your CRD
is customs.domain.tld
/v1alpha1
/Custom
?
You can also get a list of all API resources that match your group with
dyn_client.resources.search(group='customs.domain.tld')
and see if you can see the discovered API resource there.
+1 to adding a CustomResource to the examples in the documentation, definitely an oversight.
Oh, my bad, always mix it up :) tx for your answer