Skip to content

Cluster aware Client does not use cluster aware RESTMapper #58

Closed
@RedbackThomson

Description

@RedbackThomson

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions