diff --git a/pkg/compose/create.go b/pkg/compose/create.go index f82b3c105bf..aa0baa4eab1 100644 --- a/pkg/compose/create.go +++ b/pkg/compose/create.go @@ -976,10 +976,6 @@ func buildContainerConfigMounts(p types.Project, s types.ServiceConfig) ([]mount target = configsBaseDir + config.Target } - if config.UID != "" || config.GID != "" || config.Mode != nil { - logrus.Warn("config `uid`, `gid` and `mode` are not supported, they will be ignored") - } - definedConfig := p.Configs[config.Source] if definedConfig.External { return nil, fmt.Errorf("unsupported external config %s", definedConfig.Name) @@ -996,6 +992,10 @@ func buildContainerConfigMounts(p types.Project, s types.ServiceConfig) ([]mount continue } + if config.UID != "" || config.GID != "" || config.Mode != nil { + logrus.Warn("config `uid`, `gid` and `mode` are not supported, they will be ignored") + } + bindMount, err := buildMount(p, types.ServiceVolumeConfig{ Type: types.VolumeTypeBind, Source: definedConfig.File, @@ -1026,10 +1026,6 @@ func buildContainerSecretMounts(p types.Project, s types.ServiceConfig) ([]mount target = secretsDir + secret.Target } - if secret.UID != "" || secret.GID != "" || secret.Mode != nil { - logrus.Warn("secrets `uid`, `gid` and `mode` are not supported, they will be ignored") - } - definedSecret := p.Secrets[secret.Source] if definedSecret.External { return nil, fmt.Errorf("unsupported external secret %s", definedSecret.Name) @@ -1046,6 +1042,10 @@ func buildContainerSecretMounts(p types.Project, s types.ServiceConfig) ([]mount continue } + if secret.UID != "" || secret.GID != "" || secret.Mode != nil { + logrus.Warn("secrets `uid`, `gid` and `mode` are not supported, they will be ignored") + } + if _, err := os.Stat(definedSecret.File); os.IsNotExist(err) { logrus.Warnf("secret file %s does not exist", definedSecret.Name) }