(p *ProjectOptions, dockerCli command.Cli)
| 47 | } |
| 48 | |
| 49 | func 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 | |
| 65 | func runConvert(ctx context.Context, dockerCli command.Cli, p *ProjectOptions, opts bridge.ConvertOptions) error { |
| 66 | backend, err := compose.NewComposeService(dockerCli) |
no test coverage detected