Report error if project name is empty after normalization

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De Loof 2023-03-01 14:07:15 +01:00 committed by Nicolas De loof
parent 4ea44797f5
commit ae26426cc8

View File

@ -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,