patcher

package
v2.18.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnnotateConnectRequest added in v2.17.0

func AnnotateConnectRequest(cr *connector.ConnectRequest, cacheDir, kubeContext string)

AnnotateConnectRequest is used when the CLI connects to a containerized user-daemon. It adds a ContainerKubeFlagOverrides to the given ConnectRequest containing the path to the modified kubeconfig file to be used in the container.

func AnnotateOutboundInfo added in v2.17.0

func AnnotateOutboundInfo(ctx context.Context, oi *daemon.OutboundInfo, kubeContext string)

AnnotateOutboundInfo is used when a non-containerized user-daemon connects to the root-daemon. The KubeFlags are modified to contain the path to the modified kubeconfig file.

func CreateExternalKubeConfig added in v2.17.0

func CreateExternalKubeConfig(ctx context.Context, kubeFlags map[string]string, authAddressFunc AddressProvider, patcher Patcher) (*clientcmdapi.Config, error)

CreateExternalKubeConfig will load the current kubeconfig and minimize it so that it just contains the current context. It will then check if that context contains an Exec config, and if it does, replace that config with an Exec config that instead runs a process that will use a gRPC call to the address returned by the given authAddressFunc.

Types

type AddressProvider added in v2.17.0

type AddressProvider func(configFiles []string) (string, string, error)

AddressProvider is a function that returns the path to the telepresence executable and an address to a service that implements the Authenticator gRPC.

The function will typically start the gRPC service, and the service is therefore given a list of files that it must listen to in order to reliably resolve requests. It is also passed a pointer to the minified config that will be stored in a file so that it has a chance to modify it.

type Patcher added in v2.17.0

type Patcher func(*clientcmdapi.Config) error

AddressProvider is a function that returns the path to the telepresence executable and an address to a service that implements the Authenticator gRPC.

The function will typically start the gRPC service, and the service is therefore given a list of files that it must listen to in order to reliably resolve requests. It is also passed a pointer to the minified config that will be stored in a file so that it has a chance to modify it.

Jump to

Keyboard shortcuts

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