util

package
v1.6.5 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdminKubeconfigSercretName

func AdminKubeconfigSercretName(karmada string) string

AdminKubeconfigSercretName returns secret name of karmada-admin kubeconfig

func CreateBasic

func CreateBasic(serverURL, clusterName, userName string, caCert []byte) *clientcmdapi.Config

CreateBasic creates a basic, general KubeConfig object that then can be extended

func CreateWithCerts

func CreateWithCerts(serverURL, clusterName, userName string, caCert []byte, clientKey []byte, clientCert []byte) *clientcmdapi.Config

CreateWithCerts creates a KubeConfig object with access to the API server with client certificates

func DownloadFile

func DownloadFile(url, filePath string) error

DownloadFile Download files via URL

func EtcdCertSecretName

func EtcdCertSecretName(karmada string) string

EtcdCertSecretName returns secret name of etcd cert

func GetAPIServiceIP

func GetAPIServiceIP(clientset clientset.Interface) (string, error)

GetAPIServiceIP returns a valid node IP address.

func GetControlplaneEndpoint

func GetControlplaneEndpoint(address, port string) (string, error)

GetControlplaneEndpoint parses an Endpoint and returns it as a string, or returns an error in case it cannot be parsed.

func KarmadaAPIServerName

func KarmadaAPIServerName(karmada string) string

KarmadaAPIServerName returns secret name of karmada-apiserver

func KarmadaAggregatedAPIServerName

func KarmadaAggregatedAPIServerName(karmada string) string

KarmadaAggregatedAPIServerName returns secret name of karmada-aggregated-apiserver

func KarmadaCertSecretName

func KarmadaCertSecretName(karmada string) string

KarmadaCertSecretName returns secret name of karmada certs

func KarmadaControllerManagerName

func KarmadaControllerManagerName(karmada string) string

KarmadaControllerManagerName returns name of karmada-controller-manager

func KarmadaDeschedulerName

func KarmadaDeschedulerName(karmada string) string

KarmadaDeschedulerName returns name of karmada-descheduler

func KarmadaEtcdClientName

func KarmadaEtcdClientName(karmada string) string

KarmadaEtcdClientName returns name of karmada-etcd client

func KarmadaEtcdName

func KarmadaEtcdName(karmada string) string

KarmadaEtcdName returns name of karmada-etcd

func KarmadaSchedulerName

func KarmadaSchedulerName(karmada string) string

KarmadaSchedulerName returns name of karmada-scheduler

func KarmadaWebhookName

func KarmadaWebhookName(karmada string) string

KarmadaWebhookName returns name of karmada-webhook

func KubeControllerManagerName

func KubeControllerManagerName(karmada string) string

KubeControllerManagerName returns name of kube-controller-manager

func ListFiles

func ListFiles(path string) []os.FileInfo

ListFiles traverse directory files

func ParseTemplate

func ParseTemplate(strtmpl string, obj interface{}) ([]byte, error)

ParseTemplate validates and parses passed as argument template

func PathExists

func PathExists(path string) (bool, error)

PathExists check whether the path is exist

func ReadYamlFile

func ReadYamlFile(path string) ([]byte, error)

ReadYamlFile ready file given path with yaml format

func RelpaceYamlForReg

func RelpaceYamlForReg(path, destResource string, reg *regexp.Regexp) ([]byte, error)

RelpaceYamlForReg replace content of yaml file with a Regexp

func Unpack

func Unpack(file, targetPath string) error

Unpack unpack a given file to target path

func WebhookCertSecretName

func WebhookCertSecretName(karmada string) string

WebhookCertSecretName returns secret name of karmada-webhook cert

Types

type Downloader

type Downloader struct {
	io.Reader
	Total   int64
	Current int64
}

Downloader Download progress

func (*Downloader) Read

func (d *Downloader) Read(p []byte) (n int, err error)

Read Implementation of Downloader

type Namefunc

type Namefunc func(karmada string) string

Namefunc defines a function to generate resource name according to karmada resource name.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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