helpers

package
v0.0.0-...-b86b35d Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2023 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Copyright Contributors to the Open Cluster Management project

Index

Constants

View Source
const (
	ApiserverConfigName      = "cluster"
	OpenshiftConfigNamespace = "openshift-config"
	ServiceAccountNamespace  = "kube-system"
	ServiceAccountName       = "default"

	ConfigmapNamespace   = "kube-public"
	CrtConfigmapName     = "kube-root-ca.crt"
	ClusterinfoConfigmap = "cluster-info"
)

Variables

This section is empty.

Functions

func AppendErrors

func AppendErrors(errsList ...[]error) []error

appendErrors append errs, return appended result

func ClusterIsOffLine

func ClusterIsOffLine(conditions []metav1.Condition) bool

func ContainsString

func ContainsString(slice []string, s string) bool

func EnsureCRDs

func EnsureCRDs(ctx context.Context, scheme *runtime.Scheme, client apiextensionsclient.Interface, fs embed.FS, crds ...string) error

func GetCAFromApiserver

func GetCAFromApiserver(ctx context.Context, ocpClient openshiftclientset.Interface, kubeClient kubernetes.Interface, kubeAPIServer string) ([]byte, error)

func GetCAFromConfigMap

func GetCAFromConfigMap(ctx context.Context, kubeClient kubernetes.Interface) ([]byte, error)

GetCACert returns the CA cert. It searches in the kube-root-ca.crt configmap in kube-public ns.

func GetCAFromServiceAccount

func GetCAFromServiceAccount(ctx context.Context, kubeClient kubernetes.Interface) ([]byte, error)

func GetComponentNamespace

func GetComponentNamespace() (string, error)

func GetKubeAPIServerAddress

func GetKubeAPIServerAddress(ctx context.Context, openshiftClient openshiftclientset.Interface) (string, error)

func NewMultiLineAggregate

func NewMultiLineAggregate(errList []error) error

NewMultiLineAggregate returns an aggregate error with multi-line output

func RemoveString

func RemoveString(slice []string, s string) (result []string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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