Path: blob/main/install/installer/pkg/components/ide-service/configmap.go
2501 views
// Copyright (c) 2022 Gitpod GmbH. All rights reserved.1// Licensed under the GNU Affero General Public License (AGPL).2// See License.AGPL.txt in the project root for license information.34package ide_service56import (7"fmt"89"github.com/gitpod-io/gitpod/common-go/baseserver"10"github.com/gitpod-io/gitpod/ide-service-api/config"11"github.com/gitpod-io/gitpod/installer/pkg/common"1213corev1 "k8s.io/api/core/v1"14metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"15"k8s.io/apimachinery/pkg/runtime"16)1718func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {1920cfg := config.ServiceConfiguration{21Server: &baseserver.Configuration{22Services: baseserver.ServicesConfiguration{23GRPC: &baseserver.ServerConfiguration{24Address: fmt.Sprintf("0.0.0.0:%d", GRPCServicePort),25},26},27},28IDEConfigPath: "/ide-config/config.json",29DockerCfg: "/mnt/pull-secret/pull-secret.json",30}3132fc, err := common.ToJSONString(cfg)33if err != nil {34return nil, fmt.Errorf("failed to marshal ide-service config: %w", err)35}3637res := []runtime.Object{38&corev1.ConfigMap{39TypeMeta: common.TypeMetaConfigmap,40ObjectMeta: metav1.ObjectMeta{41Name: Component,42Namespace: ctx.Namespace,43Labels: common.CustomizeLabel(ctx, Component, common.TypeMetaConfigmap),44Annotations: common.CustomizeAnnotation(ctx, Component, common.TypeMetaConfigmap),45},46Data: map[string]string{47"config.json": string(fc),48},49},50}51return res, nil52}535455