Documentation ¶
Index ¶
- Variables
- func AdminKubeconfigSecretName(karmada string) string
- func BuildClientFromSecretRef(client clientset.Interface, ref *operatorv1alpha1.LocalSecretReference) (clientset.Interface, error)
- func ContainAllTasks(tasks, subset []workflow.Task) error
- func ContainsAllValues(container interface{}, values interface{}) bool
- func CreateBasic(serverURL, clusterName, userName string, caCert []byte) *clientcmdapi.Config
- func CreateWithCerts(serverURL, clusterName, userName string, caCert []byte, clientKey []byte, ...) *clientcmdapi.Config
- func DeepEqualTasks(t1, t2 workflow.Task) error
- func DownloadFile(url, filePath string) error
- func EtcdCertSecretName(karmada string) string
- func GetAPIServiceIP(clientset clientset.Interface) (string, error)
- func GetControlplaneEndpoint(address, port string) (string, error)
- func IsInCluster(hostCluster *operatorv1alpha1.HostCluster) bool
- func KarmadaAPIServerName(karmada string) string
- func KarmadaAggregatedAPIServerName(karmada string) string
- func KarmadaCertSecretName(karmada string) string
- func KarmadaControllerManagerName(karmada string) string
- func KarmadaDeschedulerName(karmada string) string
- func KarmadaEtcdClientName(karmada string) string
- func KarmadaEtcdName(karmada string) string
- func KarmadaMetricsAdapterName(karmada string) string
- func KarmadaSchedulerName(karmada string) string
- func KarmadaSearchAPIServerName(karmada string) string
- func KarmadaSearchName(karmada string) string
- func KarmadaWebhookName(karmada string) string
- func KubeControllerManagerName(karmada string) string
- func ListFiles(path string) []os.FileInfo
- func ParseTemplate(strtmpl string, obj interface{}) ([]byte, error)
- func PathExists(path string) (bool, error)
- func ReadYamlFile(path string) ([]byte, error)
- func ReplaceYamlForReg(path, destResource string, reg *regexp.Regexp) ([]byte, error)
- func Unpack(file, targetPath string) error
- func WebhookCertSecretName(karmada string) string
- type Downloader
- type FileExtInfo
- type Namefunc
Constants ¶
This section is empty.
Variables ¶
var ( // ClientFactory creates a new Kubernetes clientset from the provided kubeconfig. ClientFactory = func(kubeconfig *rest.Config) (clientset.Interface, error) { return clientset.NewForConfig(kubeconfig) } // BuildClientFromSecretRefFactory constructs a Kubernetes clientset using a LocalSecretReference. BuildClientFromSecretRefFactory = func(client clientset.Interface, ref *operatorv1alpha1.LocalSecretReference) (clientset.Interface, error) { return BuildClientFromSecretRef(client, ref) } )
Functions ¶
func AdminKubeconfigSecretName ¶ added in v1.7.0
AdminKubeconfigSecretName returns secret name of karmada-admin kubeconfig
func BuildClientFromSecretRef ¶ added in v1.8.0
func BuildClientFromSecretRef(client clientset.Interface, ref *operatorv1alpha1.LocalSecretReference) (clientset.Interface, error)
BuildClientFromSecretRef builds a clientset from the secret reference.
func ContainAllTasks ¶ added in v1.12.0
ContainAllTasks checks if all tasks in the subset are present in the tasks slice. Returns an error if any subset task is not found; nil otherwise.
func ContainsAllValues ¶ added in v1.12.0
func ContainsAllValues(container interface{}, values interface{}) bool
ContainsAllValues checks if all values in the 'values' slice exist in the 'container' slice or array.
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 DeepEqualTasks ¶ added in v1.12.0
DeepEqualTasks checks if two workflow.Task instances are deeply equal. It returns an error if they differ, or nil if they are equal. The comparison includes the task name, RunSubTasks flag, and the length and contents of the Tasks slice. Function references and behavior are not compared; only the values of the specified fields are considered. Any differences are detailed in the returned error.
func DownloadFile ¶
DownloadFile Download files via URL
func EtcdCertSecretName ¶
EtcdCertSecretName returns secret name of etcd cert
func GetAPIServiceIP ¶
GetAPIServiceIP returns a valid node IP address.
func GetControlplaneEndpoint ¶
GetControlplaneEndpoint parses an Endpoint and returns it as a string, or returns an error in case it cannot be parsed.
func IsInCluster ¶ added in v1.8.0
func IsInCluster(hostCluster *operatorv1alpha1.HostCluster) bool
IsInCluster checks if the specified host cluster is the local cluster. It returns true if: - the hostCluster is nil; - or its SecretRef is nil; - or the SecretRef's Name is an empty string. This indicates that the remote cluster is either not configured or not identifiable as the local cluster.
func KarmadaAPIServerName ¶
KarmadaAPIServerName returns secret name of karmada-apiserver
func KarmadaAggregatedAPIServerName ¶
KarmadaAggregatedAPIServerName returns secret name of karmada-aggregated-apiserver
func KarmadaCertSecretName ¶
KarmadaCertSecretName returns secret name of karmada certs
func KarmadaControllerManagerName ¶
KarmadaControllerManagerName returns name of karmada-controller-manager
func KarmadaDeschedulerName ¶
KarmadaDeschedulerName returns name of karmada-descheduler
func KarmadaEtcdClientName ¶
KarmadaEtcdClientName returns name of karmada-etcd client
func KarmadaEtcdName ¶
KarmadaEtcdName returns name of karmada-etcd
func KarmadaMetricsAdapterName ¶ added in v1.7.0
KarmadaMetricsAdapterName returns name of karmada-metric-adapter
func KarmadaSchedulerName ¶
KarmadaSchedulerName returns name of karmada-scheduler
func KarmadaSearchAPIServerName ¶ added in v1.9.0
KarmadaSearchAPIServerName returns secret name of karmada-search
func KarmadaSearchName ¶ added in v1.9.0
KarmadaSearchName returns name of karmada-search
func KarmadaWebhookName ¶
KarmadaWebhookName returns name of karmada-webhook
func KubeControllerManagerName ¶
KubeControllerManagerName returns name of kube-controller-manager
func ParseTemplate ¶
ParseTemplate validates and parses passed as argument template
func PathExists ¶
PathExists check whether the path is exist
func ReadYamlFile ¶
ReadYamlFile ready file given path with yaml format
func ReplaceYamlForReg ¶ added in v1.7.2
ReplaceYamlForReg replace content of yaml file with a Regexp
func WebhookCertSecretName ¶
WebhookCertSecretName returns secret name of karmada-webhook cert
Types ¶
type Downloader ¶
Downloader Download progress
type FileExtInfo ¶ added in v1.7.2
FileExtInfo file info with absolute path
func ListFileWithSuffix ¶ added in v1.7.2
func ListFileWithSuffix(path, suffix string) []FileExtInfo
ListFileWithSuffix traverse directory files with suffix