Documentation ¶
Index ¶
- Variables
- func NewConfigWithWildcardIdentities(config *rest.Config, groupExportNames map[string]string, ...) (identityConfig *rest.Config, resolve func(ctx context.Context) error)
- func NewWildcardIdentitiesWrappingRoundTripper(groupExportNames map[string]string, ...) (func(rt http.RoundTripper) http.RoundTripper, func(ctx context.Context) error)
Constants ¶
This section is empty.
Variables ¶
var ( // KcpRootGroupExportNames lists the APIExports in the root workspace for standard kcp groups KcpRootGroupExportNames = map[string]string{ "tenancy.kcp.dev": "tenancy.kcp.dev", "scheduling.kcp.dev": "scheduling.kcp.dev", "workload.kcp.dev": "workload.kcp.dev", "apiresource.kcp.dev": "apiresource.kcp.dev", } // KcpRootGroupResourceExportNames lists the APIExports in the root workspace for standard kcp group resources KcpRootGroupResourceExportNames = map[schema.GroupResource]string{ {Group: "tenancy.kcp.dev", Resource: "clusterworkspaceshards"}: "shards.tenancy.kcp.dev", } )
Functions ¶
func NewConfigWithWildcardIdentities ¶
func NewConfigWithWildcardIdentities(config *rest.Config, groupExportNames map[string]string, grouptResourceExportNames map[schema.GroupResource]string, kcpClient kcpclient.Interface) (identityConfig *rest.Config, resolve func(ctx context.Context) error)
NewConfigWithWildcardIdentities creates a rest.Config with injected resource identities for individual group or group resources. Each group or resource is coming from one APIExport whose names are passed in as a map.
The returned resolve function will get the APIExports and extract the identities. The resolve func might return an error if the APIExport is not found or for other reason. Only after it succeeds a client using the returned rest.Config can use the group and group resources with identities.
func NewWildcardIdentitiesWrappingRoundTripper ¶ added in v0.7.0
func NewWildcardIdentitiesWrappingRoundTripper(groupExportNames map[string]string, groupResourceExportNames map[schema.GroupResource]string, kcpClient kcpclient.Interface) (func(rt http.RoundTripper) http.RoundTripper, func(ctx context.Context) error)
NewWildcardIdentitiesWrappingRoundTripper creates an HTTP RoundTripper that injected resource identities for individual group or group resources. Each group or resource is coming from one APIExport whose names are passed in as a map. The RoundTripper is exposed as a function that allows wrapping the RoundTripper
The method also returns the resolve function that gets the APIExports and extract the identities. The resolve func might return an error if the APIExport is not found or for other reason. Only after it succeeds a client using the returned RoundTripper can use the group and group resources with identities.
Types ¶
This section is empty.