bootstrap

package
v0.11.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2023 License: Apache-2.0 Imports: 22 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.io":     "tenancy.kcp.io",
		"scheduling.kcp.io":  "scheduling.kcp.io",
		"workload.kcp.io":    "workload.kcp.io",
		"apiresource.kcp.io": "apiresource.kcp.io",
		"topology.kcp.io":    "topology.kcp.io",
	}

	// KcpRootGroupResourceExportNames lists the APIExports in the root workspace for standard kcp group resources.
	KcpRootGroupResourceExportNames = map[schema.GroupResource]string{
		{Group: "core.kcp.io", Resource: "shards"}: "shards.core.kcp.io",
	}
)

Functions

func NewConfigWithWildcardIdentities

func NewConfigWithWildcardIdentities(config *rest.Config,
	groupExportNames map[string]string,
	groupResourceExportNames map[schema.GroupResource]string,
	localShardKubeClusterClient kcpkubernetesclientset.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 kcpkubernetesclientset.ClusterInterface) (func(rt http.RoundTripper) http.RoundTripper, func(ctx context.Context) error)

NewWildcardIdentitiesWrappingRoundTripper creates an HTTP RoundTripper that injects resource identities for individual groups 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