diff --git a/install/installer/example-config.yaml b/install/installer/example-config.yaml index c0e404c5462958..f52565fc6c5e72 100644 --- a/install/installer/example-config.yaml +++ b/install/installer/example-config.yaml @@ -15,6 +15,7 @@ domain: "" kind: Full metadata: region: local + shortname: default objectStorage: inCluster: true observability: diff --git a/install/installer/pkg/components/server/configmap.go b/install/installer/pkg/components/server/configmap.go index 50770abd3aa75f..29709120f8e64e 100644 --- a/install/installer/pkg/components/server/configmap.go +++ b/install/installer/pkg/components/server/configmap.go @@ -29,8 +29,8 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) { scfg := ConfigSerialized{ Version: ctx.VersionManifest.Version, HostURL: fmt.Sprintf("https://%s", ctx.Config.Domain), - InstallationShortname: ctx.Namespace, // todo(sje): is this needed? - Stage: "production", // todo(sje): is this needed? + InstallationShortname: ctx.Config.Metadata.InstallationShortname, + Stage: "production", // todo(sje): is this needed? LicenseFile: license, WorkspaceHeartbeat: WorkspaceHeartbeat{ IntervalSeconds: 60, diff --git a/install/installer/pkg/components/server/deployment.go b/install/installer/pkg/components/server/deployment.go index 0ecfe9e7c33f90..c19fd75f656978 100644 --- a/install/installer/pkg/components/server/deployment.go +++ b/install/installer/pkg/components/server/deployment.go @@ -63,7 +63,7 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) { } // Convert to a JSON string - fc, err := common.ToJSONString(wsmanagerbridge.WSManagerList()) + fc, err := common.ToJSONString(wsmanagerbridge.WSManagerList(ctx)) if err != nil { return nil, fmt.Errorf("failed to marshal server.WorkspaceManagerList config: %w", err) } diff --git a/install/installer/pkg/components/ws-manager-bridge/configmap.go b/install/installer/pkg/components/ws-manager-bridge/configmap.go index 3bb7e863ac9334..4bccd1662a1da2 100644 --- a/install/installer/pkg/components/ws-manager-bridge/configmap.go +++ b/install/installer/pkg/components/ws-manager-bridge/configmap.go @@ -16,7 +16,7 @@ import ( func configmap(ctx *common.RenderContext) ([]runtime.Object, error) { wsmbcfg := Configuration{ - Installation: "", + Installation: ctx.Config.Metadata.InstallationShortname, WSClusterDBReconcileIntervalSeconds: 60, ControllerIntervalSeconds: 60, ControllerMaxDisconnectSeconds: 150, @@ -31,7 +31,7 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) { UnknownPhaseSeconds: 600, }, EmulatePreparingIntervalSeconds: 10, - StaticBridges: WSManagerList(), + StaticBridges: WSManagerList(ctx), } fc, err := common.ToJSONString(wsmbcfg) diff --git a/install/installer/pkg/components/ws-manager-bridge/objects.go b/install/installer/pkg/components/ws-manager-bridge/objects.go index b2a0ed032ffc11..f8dc655b40e6e2 100644 --- a/install/installer/pkg/components/ws-manager-bridge/objects.go +++ b/install/installer/pkg/components/ws-manager-bridge/objects.go @@ -18,9 +18,9 @@ var Objects = common.CompositeRenderFunc( common.DefaultServiceAccount(Component), ) -func WSManagerList() []WorkspaceCluster { +func WSManagerList(ctx *common.RenderContext) []WorkspaceCluster { return []WorkspaceCluster{{ - Name: "default", + Name: ctx.Config.Metadata.InstallationShortname, URL: fmt.Sprintf("dns:///%s:%d", wsmanager.Component, wsmanager.RPCPort), TLS: WorkspaceClusterTLS{ Authority: "/ws-manager-client-tls-certs/ca.crt", diff --git a/install/installer/pkg/config/v1/config.go b/install/installer/pkg/config/v1/config.go index 5b1c1711b554f6..1a2976987acc9e 100644 --- a/install/installer/pkg/config/v1/config.go +++ b/install/installer/pkg/config/v1/config.go @@ -47,6 +47,7 @@ func (v version) Defaults(in interface{}) error { cfg.Certificate.Name = "https-certificates" cfg.Database.InCluster = pointer.Bool(true) cfg.Metadata.Region = "local" + cfg.Metadata.InstallationShortname = "default" // TODO(gpl): we're tied to "default" here because that's what we put into static bridges in the past cfg.ObjectStorage.InCluster = pointer.Bool(true) cfg.ContainerRegistry.InCluster = pointer.Bool(true) cfg.Workspace.Resources.Requests = corev1.ResourceList{ @@ -99,6 +100,8 @@ type Config struct { type Metadata struct { Region string `json:"region" validate:"required"` + // InstallationShortname establishes the "identity" of the (application) cluster. + InstallationShortname string `json:"shortname" validate:"required"` } type Observability struct {