util

package
v0.3.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyPropagationPolicy added in v0.2.0

func ApplyPropagationPolicy(c *client.Client, clusters []string, obj runtime.Object) error

func CreateBearerTokenKubeconfig

func CreateBearerTokenKubeconfig(caData, token []byte, clusterName, server string) *api.Config

func DownloadResource

func DownloadResource(url, path string) (raw string, err error)

DownloadResource retrieves resources from remote url. If path is provided, it will also write it to the dir. If the resource is a tar file, it will first untar it.

func IsClustersReady

func IsClustersReady(karmada karmadaclientset.Interface, clusterNames ...string) error

func JoinUrlPath

func JoinUrlPath(base string, elem ...string) (result string, err error)

JoinUrlPath returns a URL string with the provided path elements joined to the existing path of base and the resulting path cleaned of any ./ or ../ elements.

func OSExt

func OSExt() string

func PrintFlags added in v0.3.0

func PrintFlags(l logr.Logger, flags *pflag.FlagSet)

func RunCommand

func RunCommand(cmd *exec.Cmd) error

RunCommand executes the given cmd, and streaming the realtime output.

func Untar

func Untar(r io.Reader, dir string) error

Untar reads the gzip-compressed tar file from r and writes it into dir.

func VerifyExecutableBinary

func VerifyExecutableBinary(binaryPath string) (string, error)

func WaitAPIEnableInClusters

func WaitAPIEnableInClusters(karmadaClient karmadaclientset.Interface, gvk schema.GroupVersionKind, clusters []string, interval, timeout time.Duration) error

func WaitCRDReady

func WaitCRDReady(crdClient crdclientset.Interface, crdName string, interval, timeout time.Duration) error

func WaitMemberClusterPodReady

func WaitMemberClusterPodReady(client *client.Client, cluster, namespace, selector string, interval, timeout time.Duration) error

WaitMemberClusterPodReady return until the member cluster's pod is ready or an error occurs. Note: client is the karmada apiserver client, cluster should be a valid member cluster name.

func WaitNamespaceDelete added in v0.2.0

func WaitNamespaceDelete(client kubeclient.Interface, namespace string, interval, timeout time.Duration) error

WaitNamespaceDelete will wait until namespace is completely deleted

func WaitPodReady

func WaitPodReady(client kubeclient.Interface, namespace, selector string, interval, timeout time.Duration) error

func WaitServiceReady

func WaitServiceReady(client kubeclient.Interface, namespace, name string, interval, timeout time.Duration) (*v1.Service, error)

WaitServiceReady will wait until loadbalancer type service allocated an IP.

Types

This section is empty.

Jump to

Keyboard shortcuts

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