kubeconfig

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KubeConfigToSecret

func KubeConfigToSecret(
	objKey client.ObjectKey,
	cfg *api.Config,
) (*corev1.Secret, error)

KubeConfigToSecret returns a Secret with the given object key containing a kubeconfig serialized from the given *api.Config

func SecretToKubeConfig

func SecretToKubeConfig(
	secret *corev1.Secret,
) (clientcmd.ClientConfig, error)

SecretToKubeConfig returns clientcmd.ClientConfig from a Secret containing a serialized kubeconfig

func SecretToKubeConfigByKey

func SecretToKubeConfigByKey(
	secret *corev1.Secret,
	key string,
) (clientcmd.ClientConfig, error)

SecretToKubeConfigByKey returns clientcmd.ClientConfig from a Secret containing a serialized kubeconfig as the value for the provided key.

Types

type KeyNotFound

type KeyNotFound struct {
	ObjectKey client.ObjectKey
}

KeyNotFound is returned if the Secret does not contain the kubeConfigDataKey key.

func (KeyNotFound) Error

func (r KeyNotFound) Error() string

type SerializedKubeconfigInvalid

type SerializedKubeconfigInvalid struct {
	ObjectKey client.ObjectKey
	Err       error
}

func (SerializedKubeconfigInvalid) Error

Jump to

Keyboard shortcuts

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