Path: blob/main/install/installer/pkg/components/content-service/configmap.go
2501 views
// Copyright (c) 2021 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 content_service56import (7"fmt"89"github.com/gitpod-io/gitpod/common-go/baseserver"1011"github.com/gitpod-io/gitpod/content-service/api/config"12"github.com/gitpod-io/gitpod/installer/pkg/common"13corev1 "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) {19cscfg := config.ServiceConfig{20Service: baseserver.ServerConfiguration{21Address: fmt.Sprintf("0.0.0.0:%d", RPCPort),22},23Storage: common.StorageConfig(ctx),24}2526fc, err := common.ToJSONString(cscfg)27if err != nil {28return nil, fmt.Errorf("failed to marshal content-service config: %w", err)29}3031return []runtime.Object{&corev1.ConfigMap{32TypeMeta: common.TypeMetaConfigmap,33ObjectMeta: metav1.ObjectMeta{34Name: Component,35Namespace: ctx.Namespace,36Labels: common.CustomizeLabel(ctx, Component, common.TypeMetaConfigmap),37Annotations: common.CustomizeAnnotation(ctx, Component, common.TypeMetaConfigmap),38},39Data: map[string]string{40"config.json": string(fc),41},42}}, nil43}444546