mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-07 00:35:17 -04:00
Wait for kube api during init (#440)
* kubernetes: wait for KubeAPI to be reachable
This commit is contained in:
parent
b89fae8062
commit
9ad377284d
9 changed files with 190 additions and 10 deletions
|
@ -30,6 +30,7 @@ type Client interface {
|
|||
AddNodeSelectorsToDeployment(ctx context.Context, selectors map[string]string, name string, namespace string) error
|
||||
// WaitForCRD waits for the given CRD to be established.
|
||||
WaitForCRD(ctx context.Context, crd string) error
|
||||
ListAllNamespaces(ctx context.Context) (*corev1.NamespaceList, error)
|
||||
}
|
||||
|
||||
// clientGenerator can generate new clients from a kubeconfig.
|
||||
|
@ -86,12 +87,17 @@ func (k *Kubectl) CreateConfigMap(ctx context.Context, configMap corev1.ConfigMa
|
|||
return err
|
||||
}
|
||||
|
||||
err = client.CreateConfigMap(ctx, configMap)
|
||||
return client.CreateConfigMap(ctx, configMap)
|
||||
}
|
||||
|
||||
// ListAllNamespaces returns all namespaces in the cluster.
|
||||
func (k *Kubectl) ListAllNamespaces(ctx context.Context) (*corev1.NamespaceList, error) {
|
||||
client, err := k.clientGenerator.NewClient(k.kubeconfig)
|
||||
if err != nil {
|
||||
return err
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil
|
||||
return client.ListAllNamespaces(ctx)
|
||||
}
|
||||
|
||||
func (k *Kubectl) AddTolerationsToDeployment(ctx context.Context, tolerations []corev1.Toleration, name string, namespace string) error {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue