decentral1se
7c1a97be72
Some checks failed
continuous-integration/drone/push Build is failing
Closes coop-cloud/organising#389. Closes coop-cloud/organising#341. Closes coop-cloud/organising#326. Closes coop-cloud/organising#380. Closes coop-cloud/organising#360.
20 lines
422 B
Go
20 lines
422 B
Go
package client
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/docker/docker/api/types/swarm"
|
|
"github.com/docker/docker/client"
|
|
)
|
|
|
|
func StoreSecret(cl *client.Client, secretName, secretValue, server string) error {
|
|
ann := swarm.Annotations{Name: secretName}
|
|
spec := swarm.SecretSpec{Annotations: ann, Data: []byte(secretValue)}
|
|
|
|
if _, err := cl.SecretCreate(context.Background(), spec); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|