boostrap

package
v0.8.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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,
	groupResourceExportNames map[schema.GroupResource]string,
	localShardKubeClusterClient kubernetesclient.ClusterInterface) (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,
	config *rest.Config,
	localShardKubeClusterClient kubernetesclient.ClusterInterface) (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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL