helpers

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 28 Imported by: 42

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateClientFromClientcmdapiv1Config added in v0.5.0

func CreateClientFromClientcmdapiv1Config(clientcmdapiv1Config clientcmdapiv1.Config) (*kubernetes.Clientset, error)

CreateClientFromClientcmdapiv1Config

func CreateDiscoveryClientFromClientcmdapiv1Config added in v0.5.0

func CreateDiscoveryClientFromClientcmdapiv1Config(clientcmdapiv1Config clientcmdapiv1.Config) (*discovery.DiscoveryClient, error)

CreateDiscoveryClientFromClientcmdapiv1Config

func CreateRESTConfigFromClientcmdapiv1Config added in v0.5.0

func CreateRESTConfigFromClientcmdapiv1Config(clientcmdapiv1Config clientcmdapiv1.Config) (*rest.Config, error)

CreateRESTConfigFromClientcmdapiv1Config

func DryRunMessage

func DryRunMessage(dryRun bool)

func GetBootstrapSecret

func GetBootstrapSecret(ctx context.Context, kubeClient kubernetes.Interface) (*corev1.Secret, error)

GetBootstrapSecret returns the secret in kube-system

func GetBootstrapToken

func GetBootstrapToken(ctx context.Context, kubeClient kubernetes.Interface) (string, error)

GetBootstrapToken returns the token in kube-system

func GetBootstrapTokenFromSA

func GetBootstrapTokenFromSA(ctx context.Context, kubeClient kubernetes.Interface) (string, error)

GetBootstrapSecretFromSA retrieves the service-account token secret

func GetClients

func GetClients(f util.Factory) (
	kubeClient kubernetes.Interface,
	apiExtensionsClient apiextensionsclient.Interface,
	dynamicClient dynamic.Interface,
	err error)

func GetExampleHeader

func GetExampleHeader() string

func IsClusterManagerInstalled

func IsClusterManagerInstalled(apiExtensionsClient apiextensionsclient.Interface) (bool, error)

IsClusterManagerInstalled checks if the hub is already initialized. It checks if the crd is already present to find out that the hub is already initialized.

func IsKlusterletsInstalled added in v0.2.0

func IsKlusterletsInstalled(apiExtensionsClient apiextensionsclient.Interface) (bool, error)

IsKlusterlets checks if the Managed cluster is already initialized. It checks if the crd is already present to find out that the managed cluster is already initialized.

func RandStringRunes_az09

func RandStringRunes_az09(n int) string

func ValidateKubeconfigFile added in v0.6.0

func ValidateKubeconfigFile(kubeconfig string) error

ValidateKubeconfigFile validate a given kubeconfig

func WaitCRDToBeReady

func WaitCRDToBeReady(apiExtensionsClient apiextensionsclient.Interface, name string, b wait.Backoff, wait bool) error

WaitCRDToBeReady waits if a crd is ready

func WatchUntil

func WatchUntil(
	watchFunc func() (watch.Interface, error),
	assertEvent func(event watch.Event) bool) error

WatchUntil starts a watch stream and holds until the condition is satisfied.

Types

type TokenType

type TokenType string
const (
	BootstrapToken      TokenType = "bootstrap-token"
	ServiceAccountToken TokenType = "service-account-token"
	UnknownToken        TokenType = "unknown-token"
)

func GetToken

func GetToken(ctx context.Context, kubeClient kubernetes.Interface) (string, TokenType, error)

GetToken returns the bootstrap token. It searches first for the service-account token and then if it is not found it looks for the bootstrap token in kube-system.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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