MCPcopy
hub / github.com/docker/compose / convertCommand

Function convertCommand

cmd/compose/bridge.go:49–63  ·  cmd/compose/bridge.go::convertCommand
(p *ProjectOptions, dockerCli command.Cli)

Source from the content-addressed store, hash-verified

47}
48
49func convertCommand(p *ProjectOptions, dockerCli command.Cli) *cobra.Command {
50 convertOpts := bridge.ConvertOptions{}
51 cmd := &cobra.Command{
52 Use: "convert",
53 Short: "Convert compose files to Kubernetes manifests, Helm charts, or another model",
54 RunE: Adapt(func(ctx context.Context, args []string) error {
55 return runConvert(ctx, dockerCli, p, convertOpts)
56 }),
57 }
58 flags := cmd.Flags()
59 flags.StringVarP(&convertOpts.Output, "output", "o", "out", "The output directory for the Kubernetes resources")
60 flags.StringArrayVarP(&convertOpts.Transformations, "transformation", "t", nil, "Transformation to apply to compose model (default: docker/compose-bridge-kubernetes)")
61 flags.StringVar(&convertOpts.Templates, "templates", "", "Directory containing transformation templates")
62 return cmd
63}
64
65func runConvert(ctx context.Context, dockerCli command.Cli, p *ProjectOptions, opts bridge.ConvertOptions) error {
66 backend, err := compose.NewComposeService(dockerCli)

Callers 1

bridgeCommandFunction · 0.85

Calls 2

AdaptFunction · 0.85
runConvertFunction · 0.85

Tested by

no test coverage detected