mirror of https://github.com/docker/compose.git
Kube backend: add `compose convert` for displaying the generated chart content
Signed-off-by: aiordache <anca.iordache@docker.com>
This commit is contained in:
parent
9f56fc9fd6
commit
a9247e5412
|
@ -164,7 +164,18 @@ func (s *composeService) Ps(ctx context.Context, projectName string, options com
|
|||
|
||||
// Convert translate compose model into backend's native format
|
||||
func (s *composeService) Convert(ctx context.Context, project *types.Project, options compose.ConvertOptions) ([]byte, error) {
|
||||
return nil, errdefs.ErrNotImplemented
|
||||
chart, err := helm.GetChartInMemory(project)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
buff := []byte{}
|
||||
for _, f := range chart.Raw {
|
||||
header := "\n" + f.Name + "\n" + strings.Repeat("-", len(f.Name)) + "\n"
|
||||
buff = append(buff, []byte(header)...)
|
||||
buff = append(buff, f.Data...)
|
||||
buff = append(buff, []byte("\n")...)
|
||||
}
|
||||
return buff, nil
|
||||
}
|
||||
|
||||
func (s *composeService) Kill(ctx context.Context, project *types.Project, options compose.KillOptions) error {
|
||||
|
|
Loading…
Reference in New Issue