mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #31006 from vdemeester/30991-secret-mode-in-stack-deploy
Set 0444 as default secret mode in stack deploy
(cherry picked from commit a12454d7a9
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
87a53468b2
commit
46af6a6a41
2 changed files with 10 additions and 2 deletions
|
@ -219,19 +219,27 @@ func convertServiceSecrets(
|
|||
if gid == "" {
|
||||
gid = "0"
|
||||
}
|
||||
mode := secret.Mode
|
||||
if mode == nil {
|
||||
mode = uint32Ptr(0444)
|
||||
}
|
||||
|
||||
opts = append(opts, &types.SecretRequestOption{
|
||||
Source: source,
|
||||
Target: target,
|
||||
UID: uid,
|
||||
GID: gid,
|
||||
Mode: os.FileMode(secret.Mode),
|
||||
Mode: os.FileMode(*mode),
|
||||
})
|
||||
}
|
||||
|
||||
return servicecli.ParseSecrets(client, opts)
|
||||
}
|
||||
|
||||
func uint32Ptr(value uint32) *uint32 {
|
||||
return &value
|
||||
}
|
||||
|
||||
func convertExtraHosts(extraHosts map[string]string) []string {
|
||||
hosts := []string{}
|
||||
for host, ip := range extraHosts {
|
||||
|
|
|
@ -199,7 +199,7 @@ type ServiceSecretConfig struct {
|
|||
Target string
|
||||
UID string
|
||||
GID string
|
||||
Mode uint32
|
||||
Mode *uint32
|
||||
}
|
||||
|
||||
// UlimitsConfig the ulimit configuration
|
||||
|
|
Loading…
Add table
Reference in a new issue