Skip to content

Commit a4ee6ca

Browse files
committed
don't warn about uid/gid not being supported while ... they are
Signed-off-by: Nicolas De Loof <[email protected]>
1 parent 5617eff commit a4ee6ca

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

pkg/compose/create.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -977,10 +977,6 @@ func buildContainerConfigMounts(p types.Project, s types.ServiceConfig) ([]mount
977977
target = configsBaseDir + config.Target
978978
}
979979

980-
if config.UID != "" || config.GID != "" || config.Mode != nil {
981-
logrus.Warn("config `uid`, `gid` and `mode` are not supported, they will be ignored")
982-
}
983-
984980
definedConfig := p.Configs[config.Source]
985981
if definedConfig.External {
986982
return nil, fmt.Errorf("unsupported external config %s", definedConfig.Name)
@@ -997,6 +993,10 @@ func buildContainerConfigMounts(p types.Project, s types.ServiceConfig) ([]mount
997993
continue
998994
}
999995

996+
if config.UID != "" || config.GID != "" || config.Mode != nil {
997+
logrus.Warn("config `uid`, `gid` and `mode` are not supported, they will be ignored")
998+
}
999+
10001000
bindMount, err := buildMount(p, types.ServiceVolumeConfig{
10011001
Type: types.VolumeTypeBind,
10021002
Source: definedConfig.File,
@@ -1027,10 +1027,6 @@ func buildContainerSecretMounts(p types.Project, s types.ServiceConfig) ([]mount
10271027
target = secretsDir + secret.Target
10281028
}
10291029

1030-
if secret.UID != "" || secret.GID != "" || secret.Mode != nil {
1031-
logrus.Warn("secrets `uid`, `gid` and `mode` are not supported, they will be ignored")
1032-
}
1033-
10341030
definedSecret := p.Secrets[secret.Source]
10351031
if definedSecret.External {
10361032
return nil, fmt.Errorf("unsupported external secret %s", definedSecret.Name)
@@ -1047,6 +1043,10 @@ func buildContainerSecretMounts(p types.Project, s types.ServiceConfig) ([]mount
10471043
continue
10481044
}
10491045

1046+
if secret.UID != "" || secret.GID != "" || secret.Mode != nil {
1047+
logrus.Warn("secrets `uid`, `gid` and `mode` are not supported, they will be ignored")
1048+
}
1049+
10501050
if _, err := os.Stat(definedSecret.File); os.IsNotExist(err) {
10511051
logrus.Warnf("secret file %s does not exist", definedSecret.Name)
10521052
}

0 commit comments

Comments
 (0)