From 7731d8b314b71688b9933c504e814dba93316ca3 Mon Sep 17 00:00:00 2001 From: Simon Emms Date: Wed, 23 Feb 2022 17:01:36 +0000 Subject: [PATCH] [installer]: correct the stored config to include apiVersion This also changes the format from JSON to YAML --- install/installer/pkg/components/gitpod/configmap.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/install/installer/pkg/components/gitpod/configmap.go b/install/installer/pkg/components/gitpod/configmap.go index a6ad388875b8d7..a85b67e5221fa8 100644 --- a/install/installer/pkg/components/gitpod/configmap.go +++ b/install/installer/pkg/components/gitpod/configmap.go @@ -8,6 +8,7 @@ import ( "fmt" "github.com/gitpod-io/gitpod/installer/pkg/common" + "github.com/gitpod-io/gitpod/installer/pkg/config" "github.com/gitpod-io/gitpod/installer/pkg/config/versions" corev1 "k8s.io/api/core/v1" @@ -24,7 +25,7 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) { VersionManifest: ctx.VersionManifest, } - config, err := common.ToJSONString(ctx.Config) + cfg, err := config.Marshal(config.CurrentVersion, ctx.Config) if err != nil { return nil, fmt.Errorf("failed to marshal Gitpod config: %w", err) } @@ -43,7 +44,7 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) { Labels: common.DefaultLabels(Component), }, Data: map[string]string{ - "config.json": string(config), + "config.yaml": string(cfg), "versions.json": string(versions), }, },