kubeconfig

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package kubeconfig provides functionality for parsing Kubernetes secret with a KubeConfig in a key into a client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientFromSecret

func ClientFromSecret(ctx context.Context, cl client.Client, name types.NamespacedName, opts ClientOptions) (client.Client, error)

ClientFromSecret loads a secret from the provided name, and returns a parsed client.Client based on parsing the rest.Config from the secret.

Types

type ClientOptions

type ClientOptions struct {
	// REST is a set of RESTOptions.
	REST RESTOptions
	// Key is the key within the loaded secret to lookup the KubeConfig in.
	// If this key does not exist, an error is returned.
	Key string
}

ClientOptions can provide optional options when creating a client.

type RESTOptions

type RESTOptions struct {
	Impersonate *rest.ImpersonationConfig
}

RESTOptions provides additional information for creating REST config during the client secret parsing.

Jump to

Keyboard shortcuts

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