From c8cf011bae7c934df94343ea631c31270dd15142 Mon Sep 17 00:00:00 2001 From: Simon Emms Date: Mon, 13 Dec 2021 11:32:49 +0000 Subject: [PATCH 1/3] [installer]: make the config/versions file owned by all teams --- installer/pkg/config/versions/OWNERS | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 installer/pkg/config/versions/OWNERS diff --git a/installer/pkg/config/versions/OWNERS b/installer/pkg/config/versions/OWNERS new file mode 100644 index 00000000000000..ddef511722a169 --- /dev/null +++ b/installer/pkg/config/versions/OWNERS @@ -0,0 +1,15 @@ + +options: + no_parent_owners: true + +approvers: + - engineering-ide + - engineering-meta + - engineering-self-hosted + - engineering-workspace + +labels: + - "team: IDE" + - "team: meta" + - "team: self-hosted" + - "team: workspace" \ No newline at end of file From e5fb617f8cf04f426211cf7115a61d9ce0e27959 Mon Sep 17 00:00:00 2001 From: Simon Emms Date: Mon, 13 Dec 2021 11:48:26 +0000 Subject: [PATCH 2/3] [installer]: separate out server ide to separate package This is to ensure the correct team ownership --- installer/pkg/components/server/ide/OWNERS | 9 ++++ .../{ide-configmap.go => ide/configmap.go} | 4 +- .../pkg/components/server/ide/constants.go | 13 ++++++ .../pkg/components/server/ide/objects.go | 15 +++++++ installer/pkg/components/server/ide/types.go | 42 +++++++++++++++++++ installer/pkg/components/server/objects.go | 3 +- installer/pkg/components/server/types.go | 35 ---------------- 7 files changed, 83 insertions(+), 38 deletions(-) create mode 100644 installer/pkg/components/server/ide/OWNERS rename installer/pkg/components/server/{ide-configmap.go => ide/configmap.go} (98%) create mode 100644 installer/pkg/components/server/ide/constants.go create mode 100644 installer/pkg/components/server/ide/objects.go create mode 100644 installer/pkg/components/server/ide/types.go diff --git a/installer/pkg/components/server/ide/OWNERS b/installer/pkg/components/server/ide/OWNERS new file mode 100644 index 00000000000000..375272a3e18213 --- /dev/null +++ b/installer/pkg/components/server/ide/OWNERS @@ -0,0 +1,9 @@ + +options: + no_parent_owners: true + +approvers: + - engineering-ide + +labels: + - "team: IDE" \ No newline at end of file diff --git a/installer/pkg/components/server/ide-configmap.go b/installer/pkg/components/server/ide/configmap.go similarity index 98% rename from installer/pkg/components/server/ide-configmap.go rename to installer/pkg/components/server/ide/configmap.go index 57c1f211886714..3999c64a9946a1 100644 --- a/installer/pkg/components/server/ide-configmap.go +++ b/installer/pkg/components/server/ide/configmap.go @@ -2,7 +2,7 @@ // Licensed under the GNU Affero General Public License (AGPL). // See License-AGPL.txt in the project root for license information. -package server +package ide import ( "encoding/json" @@ -17,7 +17,7 @@ import ( "k8s.io/utils/pointer" ) -func ideconfigmap(ctx *common.RenderContext) ([]runtime.Object, error) { +func configmap(ctx *common.RenderContext) ([]runtime.Object, error) { typeBrowser := "browser" typeDesktop := "desktop" idecfg := IDEConfig{ diff --git a/installer/pkg/components/server/ide/constants.go b/installer/pkg/components/server/ide/constants.go new file mode 100644 index 00000000000000..344f02a7aac6ad --- /dev/null +++ b/installer/pkg/components/server/ide/constants.go @@ -0,0 +1,13 @@ +// Copyright (c) 2021 Gitpod GmbH. All rights reserved. +// Licensed under the GNU Affero General Public License (AGPL). +// See License-AGPL.txt in the project root for license information. + +package ide + +import ( + "github.com/gitpod-io/gitpod/installer/pkg/common" +) + +const ( + Component = common.ServerComponent +) diff --git a/installer/pkg/components/server/ide/objects.go b/installer/pkg/components/server/ide/objects.go new file mode 100644 index 00000000000000..5197a916cca8b4 --- /dev/null +++ b/installer/pkg/components/server/ide/objects.go @@ -0,0 +1,15 @@ +// Copyright (c) 2021 Gitpod GmbH. All rights reserved. +// Licensed under the GNU Affero General Public License (AGPL). +// See License-AGPL.txt in the project root for license information. + +// Logically, this package belongs to the server component. However, +// from an ownership sense, this package belongs to a different team +// to the server so it's separated out + +package ide + +import "github.com/gitpod-io/gitpod/installer/pkg/common" + +var Objects = common.CompositeRenderFunc( + configmap, +) diff --git a/installer/pkg/components/server/ide/types.go b/installer/pkg/components/server/ide/types.go new file mode 100644 index 00000000000000..0033ec8f99ce2a --- /dev/null +++ b/installer/pkg/components/server/ide/types.go @@ -0,0 +1,42 @@ +// Copyright (c) 2021 Gitpod GmbH. All rights reserved. +// Licensed under the GNU Affero General Public License (AGPL). +// See License-AGPL.txt in the project root for license information. + +package ide + +// These types are from TypeScript files + +// IDEConfig RawIDEConfig interface from components/server/src/ide-config.ts +type IDEConfig struct { + // Deprecated + IDEVersion string `json:"ideVersion"` + // Deprecated + IDEImageRepo string `json:"ideImageRepo"` + // Deprecated + IDEImageAliases map[string]string `json:"ideImageAliases"` + // Deprecated + DesktopIDEImageAliases map[string]string `json:"desktopIdeImageAliases"` + SupervisorImage string `json:"supervisorImage"` + IDEOptions IDEOptions `json:"ideOptions"` +} + +// IDEOptions interface from components/gitpod-protocol/src/ide-protocol.ts +type IDEOptions struct { + Options map[string]IDEOption `json:"options"` + DefaultIDE string `json:"defaultIde"` + DefaultDesktopIDE string `json:"defaultDesktopIde"` +} + +// IDEOption interface from components/gitpod-protocol/src/ide-protocol.ts +type IDEOption struct { + OrderKey *string `json:"orderKey,omitempty"` + Title string `json:"title"` + Type string `json:"type"` + Logo string `json:"logo"` + Tooltip *string `json:"tooltip,omitempty"` + Label *string `json:"label,omitempty"` + Notes []string `json:"notes,omitempty"` + Hidden *bool `json:"hidden,omitempty"` + Image string `json:"image"` + ResolveImageDigest *bool `json:"resolveImageDigest,omitempty"` +} diff --git a/installer/pkg/components/server/objects.go b/installer/pkg/components/server/objects.go index 58f072566b1000..f3267cc9bbe8f0 100644 --- a/installer/pkg/components/server/objects.go +++ b/installer/pkg/components/server/objects.go @@ -6,12 +6,13 @@ package server import ( "github.com/gitpod-io/gitpod/installer/pkg/common" + "github.com/gitpod-io/gitpod/installer/pkg/components/server/ide" ) var Objects = common.CompositeRenderFunc( configmap, deployment, - ideconfigmap, + ide.Objects, networkpolicy, role, rolebinding, diff --git a/installer/pkg/components/server/types.go b/installer/pkg/components/server/types.go index 7fea8cda0710f8..7c3cdf4f62229b 100644 --- a/installer/pkg/components/server/types.go +++ b/installer/pkg/components/server/types.go @@ -8,41 +8,6 @@ import "github.com/gitpod-io/gitpod/installer/pkg/config/v1" // These types are from TypeScript files -// IDEConfig RawIDEConfig interface from components/server/src/ide-config.ts -type IDEConfig struct { - // Deprecated - IDEVersion string `json:"ideVersion"` - // Deprecated - IDEImageRepo string `json:"ideImageRepo"` - // Deprecated - IDEImageAliases map[string]string `json:"ideImageAliases"` - // Deprecated - DesktopIDEImageAliases map[string]string `json:"desktopIdeImageAliases"` - SupervisorImage string `json:"supervisorImage"` - IDEOptions IDEOptions `json:"ideOptions"` -} - -// IDEOptions interface from components/gitpod-protocol/src/ide-protocol.ts -type IDEOptions struct { - Options map[string]IDEOption `json:"options"` - DefaultIDE string `json:"defaultIde"` - DefaultDesktopIDE string `json:"defaultDesktopIde"` -} - -// IDEOption interface from components/gitpod-protocol/src/ide-protocol.ts -type IDEOption struct { - OrderKey *string `json:"orderKey,omitempty"` - Title string `json:"title"` - Type string `json:"type"` - Logo string `json:"logo"` - Tooltip *string `json:"tooltip,omitempty"` - Label *string `json:"label,omitempty"` - Notes []string `json:"notes,omitempty"` - Hidden *bool `json:"hidden,omitempty"` - Image string `json:"image"` - ResolveImageDigest *bool `json:"resolveImageDigest,omitempty"` -} - // ConfigSerialized interface from components/server/src/config.ts type ConfigSerialized struct { Version string `json:"version"` From a2d9783ca42d977dd7798cc411f160b209ff7dc1 Mon Sep 17 00:00:00 2001 From: Pudong Zheng Date: Mon, 13 Dec 2021 15:27:54 +0000 Subject: [PATCH 3/3] [installer] cleanup deprecated ide-config --- installer/pkg/components/server/ide/configmap.go | 12 ------------ installer/pkg/components/server/ide/types.go | 12 ++---------- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/installer/pkg/components/server/ide/configmap.go b/installer/pkg/components/server/ide/configmap.go index 3999c64a9946a1..0ff821e24d15f2 100644 --- a/installer/pkg/components/server/ide/configmap.go +++ b/installer/pkg/components/server/ide/configmap.go @@ -21,18 +21,6 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) { typeBrowser := "browser" typeDesktop := "desktop" idecfg := IDEConfig{ - IDEVersion: workspace.CodeIDEImageStableVersion, - IDEImageRepo: common.RepoName(ctx.Config.Repository, workspace.CodeIDEImage), - IDEImageAliases: map[string]string{ - "code": common.ImageName(ctx.Config.Repository, workspace.CodeIDEImage, workspace.CodeIDEImageStableVersion), - "code-latest": common.ImageName(ctx.Config.Repository, workspace.CodeIDEImage, ctx.VersionManifest.Components.Workspace.CodeImage.Version), - }, - DesktopIDEImageAliases: map[string]string{ - "code-desktop": common.ImageName(ctx.Config.Repository, workspace.CodeDesktopIDEImage, ctx.VersionManifest.Components.Workspace.DesktopIdeImages.CodeDesktopImage.Version), - "code-desktop-insiders": common.ImageName(ctx.Config.Repository, workspace.CodeDesktopInsidersIDEImage, ctx.VersionManifest.Components.Workspace.DesktopIdeImages.CodeDesktopImageInsiders.Version), - "intellij": common.ImageName(ctx.Config.Repository, workspace.IntelliJDesktopIDEImage, ctx.VersionManifest.Components.Workspace.DesktopIdeImages.IntelliJImage.Version), - "goland": common.ImageName(ctx.Config.Repository, workspace.GoLandDesktopIdeImage, ctx.VersionManifest.Components.Workspace.DesktopIdeImages.GoLandImage.Version), - }, SupervisorImage: common.ImageName(ctx.Config.Repository, workspace.SupervisorImage, ctx.VersionManifest.Components.Workspace.Supervisor.Version), IDEOptions: IDEOptions{ Options: map[string]IDEOption{ diff --git a/installer/pkg/components/server/ide/types.go b/installer/pkg/components/server/ide/types.go index 0033ec8f99ce2a..4cd3cd631ae673 100644 --- a/installer/pkg/components/server/ide/types.go +++ b/installer/pkg/components/server/ide/types.go @@ -8,16 +8,8 @@ package ide // IDEConfig RawIDEConfig interface from components/server/src/ide-config.ts type IDEConfig struct { - // Deprecated - IDEVersion string `json:"ideVersion"` - // Deprecated - IDEImageRepo string `json:"ideImageRepo"` - // Deprecated - IDEImageAliases map[string]string `json:"ideImageAliases"` - // Deprecated - DesktopIDEImageAliases map[string]string `json:"desktopIdeImageAliases"` - SupervisorImage string `json:"supervisorImage"` - IDEOptions IDEOptions `json:"ideOptions"` + SupervisorImage string `json:"supervisorImage"` + IDEOptions IDEOptions `json:"ideOptions"` } // IDEOptions interface from components/gitpod-protocol/src/ide-protocol.ts