exec

package
v0.30.2 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2024 License: Apache-2.0 Imports: 9 Imported by: 5

Documentation

Overview

Package exec contains helper utilities for exec credential plugins.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadExecCredential

func LoadExecCredential(data []byte) (runtime.Object, *rest.Config, error)

LoadExecCredential loads the configuration needed for an exec plugin to communicate with a cluster.

LoadExecCredential expects the provided data to be a serialized client.authentication.k8s.io ExecCredential object (of any version). If the provided data is invalid (i.e., it cannot be unmarshalled into any known client.authentication.k8s.io ExecCredential version), an error will be returned. A successfully unmarshalled ExecCredential will be returned as the first return value.

If the provided data is successfully unmarshalled, but it does not contain cluster information (i.e., ExecCredential.Spec.Cluster == nil), then an error will be returned.

Note that the returned rest.Config will use anonymous authentication, since the exec plugin has not returned credentials for this cluster yet.

func LoadExecCredentialFromEnv

func LoadExecCredentialFromEnv() (runtime.Object, *rest.Config, error)

LoadExecCredentialFromEnv is a helper-wrapper around LoadExecCredential that loads from the well-known KUBERNETES_EXEC_INFO environment variable.

When the KUBERNETES_EXEC_INFO environment variable is not set or is empty, then this function will immediately return an error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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