Path: blob/main/install/installer/pkg/components/ws-manager-bridge/objects.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 wsmanagerbridge56import (7"fmt"89"github.com/gitpod-io/gitpod/installer/pkg/common"10wsmanagermk2 "github.com/gitpod-io/gitpod/installer/pkg/components/ws-manager-mk2"11"github.com/gitpod-io/gitpod/installer/pkg/config/v1/experimental"12)1314var Objects = common.CompositeRenderFunc(15configmap,16deployment,17rolebinding,18common.DefaultServiceAccount(Component),19)2021func WSManagerList(ctx *common.RenderContext) []WorkspaceCluster {22skipSelf := false23wsmanagerAddr := fmt.Sprintf("dns:///%s:%d", wsmanagermk2.Component, wsmanagermk2.RPCPort)24_ = ctx.WithExperimental(func(cfg *experimental.Config) error {25if cfg.WebApp != nil && cfg.WebApp.WorkspaceManagerBridge != nil {26skipSelf = cfg.WebApp.WorkspaceManagerBridge.SkipSelf27}2829if !common.WithLocalWsManager(ctx) {30// Must skip self if cluster does not contain ws-manager.31skipSelf = true32}3334return nil35})3637// Registering a local cluster ws-manager only makes sense when we actually deploy one,38// (ie when we are doing a full self hosted installation rather than a SaaS install to gitpod.io).39if skipSelf {40return []WorkspaceCluster{}41}4243return []WorkspaceCluster{{44Name: ctx.Config.Metadata.InstallationShortname,45URL: wsmanagerAddr,46TLS: WorkspaceClusterTLS{47Authority: "/ws-manager-client-tls-certs/ca.crt",48Certificate: "/ws-manager-client-tls-certs/tls.crt",49Key: "/ws-manager-client-tls-certs/tls.key",50},51State: WorkspaceClusterStateAvailable,52MaxScore: 100,53Score: 50,54Govern: true,55AdmissionConstraints: nil,56ApplicationCluster: ctx.Config.Metadata.InstallationShortname,57}}58}596061