Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion cmd/compose/compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,13 @@ func (o *ProjectOptions) ToModel(ctx context.Context, dockerCli command.Cli, ser

// ToProject loads a Compose project using the LoadProject API.
// Accepts optional cli.ProjectOptionsFn to control loader behavior.
func (o *ProjectOptions) ToProject(ctx context.Context, dockerCli command.Cli, backend api.Compose, services []string, po ...cli.ProjectOptionsFn) (*types.Project, tracing.Metrics, error) {
func (o *ProjectOptions) ToProject(
ctx context.Context,
dockerCli command.Cli,
backend api.Compose,
services []string,
po ...cli.ProjectOptionsFn,
) (*types.Project, tracing.Metrics, error) {
var metrics tracing.Metrics
remotes := o.remoteLoaders(dockerCli)

Expand Down Expand Up @@ -357,6 +363,9 @@ func (o *ProjectOptions) ToProject(ctx context.Context, dockerCli command.Cli, b
return nil, metrics, err
}

// Warn about unsupported attributes (e.g. deploy)
warnUnsupportedAttributes(project)

return project, metrics, nil
}

Expand Down
17 changes: 17 additions & 0 deletions cmd/compose/warnings.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package compose

import (
"github.com/compose-spec/compose-go/v2/types"
"github.com/sirupsen/logrus"
)

func warnUnsupportedAttributes(project *types.Project) {
for _, service := range project.Services {
if service.Deploy != nil {
logrus.Warnf(
"Service %q uses 'deploy' which is not supported by docker compose and will be ignored",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's wrong. most of deploy section is ignored by compose, but some attributes are considered. Typically replica and some device requests (used for gpu support)

service.Name,
)
}
}
}