mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-06-21 20:54:24 -04:00
AB#2234: Introduce AddNodeSelectorsToDeployment
Add the above function to the different client interfaces. Remove previously used Command.Exec call.
This commit is contained in:
parent
6b6a3ee976
commit
ff5100f332
6 changed files with 109 additions and 21 deletions
|
@ -21,6 +21,7 @@ type Client interface {
|
|||
GetObjects(resources resources.Marshaler) ([]*resource.Info, error)
|
||||
CreateConfigMap(ctx context.Context, configMap corev1.ConfigMap) error
|
||||
AddTolerationsToDeployment(ctx context.Context, tolerations []corev1.Toleration, name string) error
|
||||
AddNodeSelectorsToDeployment(ctx context.Context, selectors map[string]string, name string) error
|
||||
}
|
||||
|
||||
// clientGenerator can generate new clients from a kubeconfig.
|
||||
|
@ -98,3 +99,15 @@ func (k *Kubectl) AddTolerationsToDeployment(ctx context.Context, tolerations []
|
|||
return nil
|
||||
}
|
||||
|
||||
func (k *Kubectl) AddNodeSelectorsToDeployment(ctx context.Context, selectors map[string]string, name string) error {
|
||||
client, err := k.clientGenerator.NewClient(k.kubeconfig)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err = client.AddNodeSelectorsToDeployment(ctx, selectors, name); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue