Wait for kube api during init (#440)

* kubernetes: wait for KubeAPI to be reachable
This commit is contained in:
3u13r 2022-11-04 12:36:26 +01:00 committed by GitHub
parent b89fae8062
commit 9ad377284d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 190 additions and 10 deletions

View file

@ -116,6 +116,11 @@ func (c *Client) CreateConfigMap(ctx context.Context, configMap corev1.ConfigMap
return nil
}
// ListAllNamespaces returns a list of all namespaces.
func (c *Client) ListAllNamespaces(ctx context.Context) (*corev1.NamespaceList, error) {
return c.clientset.CoreV1().Namespaces().List(ctx, metav1.ListOptions{})
}
func (c *Client) AddTolerationsToDeployment(ctx context.Context, tolerations []corev1.Toleration, name string, namespace string) error {
deployments := c.clientset.AppsV1().Deployments(namespace)