Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add --no-consistency flag to convert command #9976

Merged
merged 1 commit into from Nov 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions cmd/compose/convert.go
Expand Up @@ -51,6 +51,7 @@ type convertOptions struct {
profiles bool
images bool
hash string
noConsistency bool
}

func convertCommand(p *projectOptions, backend api.Service) *cobra.Command {
Expand Down Expand Up @@ -101,6 +102,7 @@ func convertCommand(p *projectOptions, backend api.Service) *cobra.Command {
flags.BoolVarP(&opts.quiet, "quiet", "q", false, "Only validate the configuration, don't print anything.")
flags.BoolVar(&opts.noInterpolate, "no-interpolate", false, "Don't interpolate environment variables.")
flags.BoolVar(&opts.noNormalize, "no-normalize", false, "Don't normalize compose model.")
flags.BoolVar(&opts.noConsistency, "no-consistency", false, "Don't check model consistency - warning: may produce invalid Compose output")

flags.BoolVar(&opts.services, "services", false, "Print the service names, one per line.")
flags.BoolVar(&opts.volumes, "volumes", false, "Print the volume names, one per line.")
Expand All @@ -118,6 +120,7 @@ func runConvert(ctx context.Context, backend api.Service, opts convertOptions, s
cli.WithInterpolation(!opts.noInterpolate),
cli.WithResolvedPaths(true),
cli.WithNormalization(!opts.noNormalize),
cli.WithConsistency(!opts.noConsistency),
cli.WithDiscardEnvFile)

if err != nil {
Expand Down
1 change: 1 addition & 0 deletions docs/reference/compose_convert.md
Expand Up @@ -14,6 +14,7 @@ Converts the compose file to platform's canonical format
| `--format` | `string` | `yaml` | Format the output. Values: [yaml \| json] |
| `--hash` | `string` | | Print the service config hash, one per line. |
| `--images` | | | Print the image names, one per line. |
| `--no-consistency` | | | Don't check model consistency - warning: may produce invalid Compose output |
| `--no-interpolate` | | | Don't interpolate environment variables. |
| `--no-normalize` | | | Don't normalize compose model. |
| `-o`, `--output` | `string` | | Save to file (default to stdout) |
Expand Down
11 changes: 11 additions & 0 deletions docs/reference/docker_compose_convert.yaml
Expand Up @@ -40,6 +40,17 @@ options:
experimentalcli: false
kubernetes: false
swarm: false
- option: no-consistency
value_type: bool
default_value: "false"
description: |
Don't check model consistency - warning: may produce invalid Compose output
deprecated: false
hidden: false
experimental: false
experimentalcli: false
kubernetes: false
swarm: false
- option: no-interpolate
value_type: bool
default_value: "false"
Expand Down