mirror of
https://github.com/docker/compose.git
synced 2026-08-27 03:45:29 +00:00
Report error if project name is empty after normalization
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
4ea44797f5
commit
ae26426cc8
1 changed files with 4 additions and 0 deletions
|
|
@ -189,6 +189,10 @@ func (o *ProjectOptions) ToProject(services []string, po ...cli.ProjectOptionsFn
|
|||
return nil, compose.WrapComposeError(err)
|
||||
}
|
||||
|
||||
if project.Name == "" {
|
||||
return nil, errors.New("project name can't be empty. Use `--project-name` to set a valid name")
|
||||
}
|
||||
|
||||
for i, s := range project.Services {
|
||||
s.CustomLabels = map[string]string{
|
||||
api.ProjectLabel: project.Name,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue