Skip to content

Commit

Permalink
don't warn about uid/gid not being supported while ... they are
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas De Loof <[email protected]>
  • Loading branch information
ndeloof committed Oct 25, 2024
1 parent 5617eff commit a4ee6ca
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions pkg/compose/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -977,10 +977,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)
Expand All @@ -997,6 +993,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,
Expand Down Expand Up @@ -1027,10 +1027,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)
Expand All @@ -1047,6 +1043,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)
}
Expand Down

0 comments on commit a4ee6ca

Please sign in to comment.