Documentation ¶
Index ¶
- Constants
- func CreateCustomResourceDefinitionIfNeed(client *crdsclient.Clientset, obj *apiextensionsv1.CustomResourceDefinition) error
- func CreateNamespace(client clientset.Interface, ns *corev1.Namespace) error
- func CreateOrUpdateAPIService(apiRegistrationClient *aggregator.Clientset, ...) error
- func CreateOrUpdateClusterRole(client clientset.Interface, clusterrole *rbacv1.ClusterRole) error
- func CreateOrUpdateDeployment(client clientset.Interface, deployment *appsv1.Deployment) error
- func CreateOrUpdateMutatingWebhookConfiguration(client clientset.Interface, ...) error
- func CreateOrUpdateSecret(client clientset.Interface, secret *corev1.Secret) error
- func CreateOrUpdateService(client clientset.Interface, service *corev1.Service) error
- func CreateOrUpdateStatefulSet(client clientset.Interface, statefulSet *appsv1.StatefulSet) error
- func CreateOrUpdateValidatingWebhookConfiguration(client clientset.Interface, ...) error
- func DeleteDeploymentIfHasLabels(client clientset.Interface, name, namespace string, ls labels.Set) error
- func DeleteSecretIfHasLabels(client clientset.Interface, name, namespace string, ls labels.Set) error
- func DeleteServiceIfHasLabels(client clientset.Interface, name, namespace string, ls labels.Set) error
- func DeleteStatefulSetIfHasLabels(client clientset.Interface, name, namespace string, ls labels.Set) error
- func GetService(client clientset.Interface, name, namespace string) (*corev1.Service, error)
- func NewAPIRegistrationClient(c *rest.Config) (*aggregator.Clientset, error)
- func NewCRDsClient(c *rest.Config) (*crdsclient.Clientset, error)
- func PatchCustomResourceDefinition(client *crdsclient.Clientset, name string, data []byte) error
- func TryRunCommand(f func() error, failureThreshold int) error
- type KarmadaWaiter
- func (w *KarmadaWaiter) SetTimeout(timeout time.Duration)
- func (w *KarmadaWaiter) WaitForAPI() error
- func (w *KarmadaWaiter) WaitForAPIService(name string) error
- func (w *KarmadaWaiter) WaitForPods(label, namespace string) error
- func (w *KarmadaWaiter) WaitForSomePods(label, namespace string, podNum int32) error
- type Waiter
Constants ¶
const ( // APICallRetryInterval defines how long kubeadm should wait before retrying a failed API operation APICallRetryInterval = 500 * time.Millisecond )
Variables ¶
This section is empty.
Functions ¶
func CreateCustomResourceDefinitionIfNeed ¶
func CreateCustomResourceDefinitionIfNeed(client *crdsclient.Clientset, obj *apiextensionsv1.CustomResourceDefinition) error
CreateCustomResourceDefinitionIfNeed creates a CustomResourceDefinition if the target resource doesn't exist. If the resource exists already, this function will update the resource instead.
func CreateNamespace ¶
CreateNamespace creates given namespace when the namespace is not existing.
func CreateOrUpdateAPIService ¶
func CreateOrUpdateAPIService(apiRegistrationClient *aggregator.Clientset, apiservice *apiregistrationv1.APIService) error
CreateOrUpdateAPIService creates a APIService if the target resource doesn't exist. If the resource exists already, this function will update the resource instead.
func CreateOrUpdateClusterRole ¶ added in v1.7.0
func CreateOrUpdateClusterRole(client clientset.Interface, clusterrole *rbacv1.ClusterRole) error
CreateOrUpdateClusterRole creates a Clusterrole if the target resource doesn't exist. If the resource exists already, this function will update the resource instead.
func CreateOrUpdateDeployment ¶
func CreateOrUpdateDeployment(client clientset.Interface, deployment *appsv1.Deployment) error
CreateOrUpdateDeployment creates a Deployment if the target resource doesn't exist. If the resource exists already, this function will update the resource instead.
func CreateOrUpdateMutatingWebhookConfiguration ¶
func CreateOrUpdateMutatingWebhookConfiguration(client clientset.Interface, mwc *admissionregistrationv1.MutatingWebhookConfiguration) error
CreateOrUpdateMutatingWebhookConfiguration creates a MutatingWebhookConfiguration if the target resource doesn't exist. If the resource exists already, this function will update the resource instead.
func CreateOrUpdateSecret ¶
CreateOrUpdateSecret creates a Sercret if the target resource doesn't exist. If the resource exists already, this function will update the resource instead.
func CreateOrUpdateService ¶
CreateOrUpdateService creates a Service if the target resource doesn't exist. If the resource exists already, this function will update the resource instead.
func CreateOrUpdateStatefulSet ¶
func CreateOrUpdateStatefulSet(client clientset.Interface, statefulSet *appsv1.StatefulSet) error
CreateOrUpdateStatefulSet creates a StatefulSet if the target resource doesn't exist. If the resource exists already, this function will update the resource instead.
func CreateOrUpdateValidatingWebhookConfiguration ¶
func CreateOrUpdateValidatingWebhookConfiguration(client clientset.Interface, vwc *admissionregistrationv1.ValidatingWebhookConfiguration) error
CreateOrUpdateValidatingWebhookConfiguration creates a ValidatingWebhookConfiguration if the target resource doesn't exist. If the resource exists already, this function will update the resource instead.
func DeleteDeploymentIfHasLabels ¶
func DeleteDeploymentIfHasLabels(client clientset.Interface, name, namespace string, ls labels.Set) error
DeleteDeploymentIfHasLabels deletes a Deployment that exists the given labels.
func DeleteSecretIfHasLabels ¶
func DeleteSecretIfHasLabels(client clientset.Interface, name, namespace string, ls labels.Set) error
DeleteSecretIfHasLabels deletes a secret that exists the given labels.
func DeleteServiceIfHasLabels ¶
func DeleteServiceIfHasLabels(client clientset.Interface, name, namespace string, ls labels.Set) error
DeleteServiceIfHasLabels deletes a service that exists the given labels.
func DeleteStatefulSetIfHasLabels ¶
func DeleteStatefulSetIfHasLabels(client clientset.Interface, name, namespace string, ls labels.Set) error
DeleteStatefulSetIfHasLabels deletes a StatefulSet that exists the given labels.
func GetService ¶
GetService returns service resource with specified name and namespace.
func NewAPIRegistrationClient ¶
func NewAPIRegistrationClient(c *rest.Config) (*aggregator.Clientset, error)
NewAPIRegistrationClient is to create an apiregistration ClientSet
func NewCRDsClient ¶
func NewCRDsClient(c *rest.Config) (*crdsclient.Clientset, error)
NewCRDsClient is to create a Clientset
func PatchCustomResourceDefinition ¶
func PatchCustomResourceDefinition(client *crdsclient.Clientset, name string, data []byte) error
PatchCustomResourceDefinition patchs a crd resource.
func TryRunCommand ¶
TryRunCommand runs a function a maximum of failureThreshold times, and retries on error. If failureThreshold is hit; the last error is returned
Types ¶
type KarmadaWaiter ¶
type KarmadaWaiter struct {
// contains filtered or unexported fields
}
KarmadaWaiter is an implementation of Waiter that is backed by a Kubernetes client
func (*KarmadaWaiter) SetTimeout ¶
func (w *KarmadaWaiter) SetTimeout(timeout time.Duration)
SetTimeout adjusts the timeout to the specified duration
func (*KarmadaWaiter) WaitForAPI ¶
func (w *KarmadaWaiter) WaitForAPI() error
WaitForAPI waits for the API Server's /healthz endpoint to report "ok"
func (*KarmadaWaiter) WaitForAPIService ¶
func (w *KarmadaWaiter) WaitForAPIService(name string) error
WaitForAPIService waits for the APIService condition to become "true"
func (*KarmadaWaiter) WaitForPods ¶
func (w *KarmadaWaiter) WaitForPods(label, namespace string) error
WaitForPods will lookup pods with the given label and wait until they are all reporting status as running.
func (*KarmadaWaiter) WaitForSomePods ¶
func (w *KarmadaWaiter) WaitForSomePods(label, namespace string, podNum int32) error
WaitForSomePods lookup pods with the given label and wait until desired number of pods reporting status as running.
type Waiter ¶
type Waiter interface { // WaitForAPI waits for the API Server's /healthz endpoint to become "ok" WaitForAPI() error // WaitForAPIService waits for the APIService condition to become "true" WaitForAPIService(name string) error // WaitForPods waits for Pods in the namespace to become Ready WaitForPods(label, namespace string) error // WaitForSomePods waits for the specified number of Pods in the namespace to become Ready WaitForSomePods(label, namespace string, podNum int32) error // SetTimeout adjusts the timeout to the specified duration SetTimeout(timeout time.Duration) }
Waiter is an interface for waiting for criteria in Karmada to happen