diff options
author | Ashley Cui <acui@redhat.com> | 2021-05-14 16:29:44 -0400 |
---|---|---|
committer | Ashley Cui <acui@redhat.com> | 2021-05-17 14:35:55 -0400 |
commit | cf30f160ad599cac0f3dc300f673d88f60128275 (patch) | |
tree | 140d265481fc1b2e02a0f903729253e6c631dada /libpod/options.go | |
parent | 2b0b97150a01c5a3c1706dd369a0caeb5cf6ec09 (diff) | |
download | podman-cf30f160ad599cac0f3dc300f673d88f60128275.tar.gz podman-cf30f160ad599cac0f3dc300f673d88f60128275.tar.bz2 podman-cf30f160ad599cac0f3dc300f673d88f60128275.zip |
Support uid,gid,mode options for secrets
Support UID, GID, Mode options for mount type secrets. Also, change
default secret permissions to 444 so all users can read secret.
Signed-off-by: Ashley Cui <acui@redhat.com>
Diffstat (limited to 'libpod/options.go')
-rw-r--r-- | libpod/options.go | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/libpod/options.go b/libpod/options.go index be26ced99..f942d264b 100644 --- a/libpod/options.go +++ b/libpod/options.go @@ -1695,23 +1695,12 @@ func WithUmask(umask string) CtrCreateOption { } // WithSecrets adds secrets to the container -func WithSecrets(secretNames []string) CtrCreateOption { +func WithSecrets(containerSecrets []*ContainerSecret) CtrCreateOption { return func(ctr *Container) error { if ctr.valid { return define.ErrCtrFinalized } - manager, err := secrets.NewManager(ctr.runtime.GetSecretsStorageDir()) - if err != nil { - return err - } - for _, name := range secretNames { - secr, err := manager.Lookup(name) - if err != nil { - return err - } - ctr.config.Secrets = append(ctr.config.Secrets, secr) - } - + ctr.config.Secrets = containerSecrets return nil } } @@ -1723,7 +1712,7 @@ func WithEnvSecrets(envSecrets map[string]string) CtrCreateOption { if ctr.valid { return define.ErrCtrFinalized } - manager, err := secrets.NewManager(ctr.runtime.GetSecretsStorageDir()) + manager, err := ctr.runtime.SecretsManager() if err != nil { return err } |