helpers

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2022 License: Apache-2.0 Imports: 27 Imported by: 42

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DryRunMessage

func DryRunMessage(dryRun bool)

func GetAPIServer

func GetAPIServer(kubeClient kubernetes.Interface) (string, error)

GetAPIServer gets the api server url

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 GetCACert

func GetCACert(kubeClient kubernetes.Interface) ([]byte, error)

GetCACert returns the CA cert. First by looking in the cluster-info configmap of the kube-public ns and if not found, it searches in the kube-root-ca.crt configmap.

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 UsageTempate

func UsageTempate(cmd *cobra.Command, reader asset.ScenarioReader, valuesTemplatePath string) string

func WaitCRDToBeReady

func WaitCRDToBeReady(apiExtensionsClient apiextensionsclient.Interface, name string, b wait.Backoff) 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