You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was attempting to access the logical cluster using a client generated using kcp.ClusterAwareClient, and kept running in to the following error:
failed to get API group resources: unable to retrieve the complete list of server APIs: core.kcp.io/v1alpha1: forbidden: User "kcp-admin" cannot get path "/services/apiexport/root/<redacted>/apis/core.kcp.io/v1alpha1": Path not resolved to a valid virtual workspace
Upon debugging, I determined that the client created using kcp.ClusterAwareClient does not include the cluster aware RESTMapper when creating the HTTPClient. Without this mapper, the client cannot resolve any APIExports and therefore cannot make any API requests to exported resources.
My work around for this was to use the kcp.NewClusterAwareClientForConfig, passing in the kcp.ClusterAwareHTTPClient explicitly, since NewClusterAwareClientForConfig DOES correctly set the mapper.
Is this the intended effect, that ClusterAwareClient does not include the mapper, or should I open a pull request making a ClusterAwareMapperProvider is the default?
The text was updated successfully, but these errors were encountered:
I do see #57 fixes this, but with a lot more complexity for a caching RESTMapper. Should I just wait for this to be merged, and use that? Or is it acceptable to simply pass the RESTMapper to the cluster aware client as it is today?
I had the impression that NewClusterAwareMapperProvider is not what we need because it only once switches from the root URL to /cluster/*, but it is not dynamic in a sense that it is aware of the cluster in the context. But you are saying it is because it uses the http wrapper that does the mapping.
I was attempting to access the logical cluster using a client generated using
kcp.ClusterAwareClient
, and kept running in to the following error:Upon debugging, I determined that the client created using
kcp.ClusterAwareClient
does not include the cluster awareRESTMapper
when creating theHTTPClient
. Without this mapper, the client cannot resolve any APIExports and therefore cannot make any API requests to exported resources.My work around for this was to use the
kcp.NewClusterAwareClientForConfig
, passing in thekcp.ClusterAwareHTTPClient
explicitly, sinceNewClusterAwareClientForConfig
DOES correctly set the mapper.Is this the intended effect, that
ClusterAwareClient
does not include the mapper, or should I open a pull request making aClusterAwareMapperProvider
is the default?The text was updated successfully, but these errors were encountered: