Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit a9247e5

Browse files
author
aiordache
committed
Kube backend: add compose convert for displaying the generated chart content
Signed-off-by: aiordache <[email protected]>
1 parent 9f56fc9 commit a9247e5

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

kube/compose.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,18 @@ func (s *composeService) Ps(ctx context.Context, projectName string, options com
164164

165165
// Convert translate compose model into backend's native format
166166
func (s *composeService) Convert(ctx context.Context, project *types.Project, options compose.ConvertOptions) ([]byte, error) {
167-
return nil, errdefs.ErrNotImplemented
167+
chart, err := helm.GetChartInMemory(project)
168+
if err != nil {
169+
return nil, err
170+
}
171+
buff := []byte{}
172+
for _, f := range chart.Raw {
173+
header := "\n" + f.Name + "\n" + strings.Repeat("-", len(f.Name)) + "\n"
174+
buff = append(buff, []byte(header)...)
175+
buff = append(buff, f.Data...)
176+
buff = append(buff, []byte("\n")...)
177+
}
178+
return buff, nil
168179
}
169180

170181
func (s *composeService) Kill(ctx context.Context, project *types.Project, options compose.KillOptions) error {

0 commit comments

Comments
 (0)