From 8d919aee858b0030ab0f794ef43f04eb8926c524 Mon Sep 17 00:00:00 2001 From: Aleksandar Aleksandrov Date: Mon, 24 Oct 2022 09:09:41 +0100 Subject: [PATCH] Fix previewctl SA, rebuild and update docker img --- .gitpod.yml | 2 +- .werft/aks-installer-tests.yaml | 2 +- .werft/build.yaml | 2 +- .werft/cleanup-installer-tests.yaml | 2 +- .werft/debug.yaml | 2 +- .werft/eks-installer-tests.yaml | 2 +- .werft/gke-installer-tests.yaml | 2 +- .werft/ide-integration-tests-startup.yaml | 4 ++-- .werft/k3s-installer-tests.yaml | 2 +- .werft/platform-delete-preview-environment.yaml | 2 +- .../platform-delete-preview-environments-cron.yaml | 2 +- .werft/platform-trigger-artificial-job.yaml | 2 +- .werft/platform-trigger-werft-cleanup.yaml | 2 +- .werft/workspace-run-integration-tests.yaml | 2 +- dev/image/Dockerfile | 2 +- dev/preview/previewctl/cmd/credentials.go | 13 ++++--------- 16 files changed, 20 insertions(+), 25 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index bd50a30eb27e71..21e9f20bbfcb48 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,4 +1,4 @@ -image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:af-add-fish-to-dev-image.0 +image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:aa-previewctl-fix-rebuild.2 workspaceLocation: gitpod/gitpod-ws.code-workspace checkoutLocation: gitpod ports: diff --git a/.werft/aks-installer-tests.yaml b/.werft/aks-installer-tests.yaml index f06b95a60b4a82..814960b64a7684 100644 --- a/.werft/aks-installer-tests.yaml +++ b/.werft/aks-installer-tests.yaml @@ -65,7 +65,7 @@ pod: secretName: self-hosted-github-oauth containers: - name: nightly-test - image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:af-add-fish-to-dev-image.0 + image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:aa-previewctl-fix-rebuild.2 workingDir: /workspace imagePullPolicy: Always volumeMounts: diff --git a/.werft/build.yaml b/.werft/build.yaml index 7cdf4c8abc1136..8d61fc7388ab2b 100644 --- a/.werft/build.yaml +++ b/.werft/build.yaml @@ -76,7 +76,7 @@ pod: - name: MYSQL_TCP_PORT value: 23306 - name: build - image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:af-add-fish-to-dev-image.0 + image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:aa-previewctl-fix-rebuild.2 workingDir: /workspace imagePullPolicy: IfNotPresent resources: diff --git a/.werft/cleanup-installer-tests.yaml b/.werft/cleanup-installer-tests.yaml index 9fa12676ad49c7..f37df676c13ae6 100644 --- a/.werft/cleanup-installer-tests.yaml +++ b/.werft/cleanup-installer-tests.yaml @@ -25,7 +25,7 @@ pod: secretName: aks-credentials containers: - name: nightly-test - image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:af-add-fish-to-dev-image.0 + image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:aa-previewctl-fix-rebuild.2 workingDir: /workspace imagePullPolicy: Always volumeMounts: diff --git a/.werft/debug.yaml b/.werft/debug.yaml index 7d4bb42dc67299..6f0a377fa83261 100644 --- a/.werft/debug.yaml +++ b/.werft/debug.yaml @@ -54,7 +54,7 @@ pod: - name: MYSQL_TCP_PORT value: 23306 - name: build - image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:af-add-fish-to-dev-image.0 + image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:aa-previewctl-fix-rebuild.2 workingDir: /workspace imagePullPolicy: IfNotPresent volumeMounts: diff --git a/.werft/eks-installer-tests.yaml b/.werft/eks-installer-tests.yaml index 3c14069c33ec80..94a1e66d0accd6 100644 --- a/.werft/eks-installer-tests.yaml +++ b/.werft/eks-installer-tests.yaml @@ -65,7 +65,7 @@ pod: secretName: self-hosted-github-oauth containers: - name: nightly-test - image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:af-add-fish-to-dev-image.0 + image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:aa-previewctl-fix-rebuild.2 workingDir: /workspace imagePullPolicy: Always volumeMounts: diff --git a/.werft/gke-installer-tests.yaml b/.werft/gke-installer-tests.yaml index d4aaaa1b66cbe5..9ad70d97f22a3c 100644 --- a/.werft/gke-installer-tests.yaml +++ b/.werft/gke-installer-tests.yaml @@ -65,7 +65,7 @@ pod: secretName: self-hosted-github-oauth containers: - name: nightly-test - image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:af-add-fish-to-dev-image.0 + image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:aa-previewctl-fix-rebuild.2 workingDir: /workspace imagePullPolicy: Always volumeMounts: diff --git a/.werft/ide-integration-tests-startup.yaml b/.werft/ide-integration-tests-startup.yaml index 80c8f6ee17d8d1..c55e00a6538d91 100644 --- a/.werft/ide-integration-tests-startup.yaml +++ b/.werft/ide-integration-tests-startup.yaml @@ -17,7 +17,7 @@ pod: secretName: github-token-gitpod-bot containers: - name: gcloud - image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:af-add-fish-to-dev-image.0 + image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:aa-previewctl-fix-rebuild.2 workingDir: /workspace imagePullPolicy: IfNotPresent env: @@ -177,7 +177,7 @@ pod: [[ "$USERNAME" != "" ]] && args+=( "-username=$USERNAME" ) - IDE_TEST_LIST=(/workspace/test/tests/ide/ssh /workspace/test/tests/ide/vscode /workspace/test/tests/ide/jetbrains) + IDE_TEST_LIST=(/workspace/test/tests/ide/vscode /workspace/test/tests/ide/jetbrains) for TEST_PATH in "${IDE_TEST_LIST[@]}" do TEST_NAME=$(basename "${TEST_PATH}") diff --git a/.werft/k3s-installer-tests.yaml b/.werft/k3s-installer-tests.yaml index ea6724e4d4255d..40fb9bd2e8431c 100644 --- a/.werft/k3s-installer-tests.yaml +++ b/.werft/k3s-installer-tests.yaml @@ -65,7 +65,7 @@ pod: secretName: self-hosted-github-oauth containers: - name: nightly-test - image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:af-add-fish-to-dev-image.0 + image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:aa-previewctl-fix-rebuild.2 workingDir: /workspace imagePullPolicy: Always volumeMounts: diff --git a/.werft/platform-delete-preview-environment.yaml b/.werft/platform-delete-preview-environment.yaml index 474eb5be643244..b5cb8d1ff3cab6 100644 --- a/.werft/platform-delete-preview-environment.yaml +++ b/.werft/platform-delete-preview-environment.yaml @@ -25,7 +25,7 @@ pod: secretName: harvester-vm-ssh-keys containers: - name: build - image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:af-add-fish-to-dev-image.0 + image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:aa-previewctl-fix-rebuild.2 workingDir: /workspace imagePullPolicy: IfNotPresent volumeMounts: diff --git a/.werft/platform-delete-preview-environments-cron.yaml b/.werft/platform-delete-preview-environments-cron.yaml index 8c4e443c1cb508..c1f2af985aa00d 100644 --- a/.werft/platform-delete-preview-environments-cron.yaml +++ b/.werft/platform-delete-preview-environments-cron.yaml @@ -29,7 +29,7 @@ pod: secretName: github-token-gitpod-bot containers: - name: build - image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:af-add-fish-to-dev-image.0 + image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:aa-previewctl-fix-rebuild.2 workingDir: /workspace imagePullPolicy: IfNotPresent volumeMounts: diff --git a/.werft/platform-trigger-artificial-job.yaml b/.werft/platform-trigger-artificial-job.yaml index e7b2e3c2b438e4..43000d3585c9f2 100644 --- a/.werft/platform-trigger-artificial-job.yaml +++ b/.werft/platform-trigger-artificial-job.yaml @@ -24,7 +24,7 @@ pod: secretName: github-token-gitpod-bot containers: - name: build - image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:aledbf-dl.1 + image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:aa-previewctl-fix-rebuild.2 workingDir: /workspace imagePullPolicy: IfNotPresent volumeMounts: diff --git a/.werft/platform-trigger-werft-cleanup.yaml b/.werft/platform-trigger-werft-cleanup.yaml index 8d10681ac035db..d71d982f59be23 100644 --- a/.werft/platform-trigger-werft-cleanup.yaml +++ b/.werft/platform-trigger-werft-cleanup.yaml @@ -22,7 +22,7 @@ pod: secretName: gcp-sa-gitpod-dev-deployer containers: - name: build - image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:af-add-fish-to-dev-image.0 + image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:aa-previewctl-fix-rebuild.2 workingDir: /workspace imagePullPolicy: IfNotPresent volumeMounts: diff --git a/.werft/workspace-run-integration-tests.yaml b/.werft/workspace-run-integration-tests.yaml index 5221c18d989d11..359f9cb4b47688 100644 --- a/.werft/workspace-run-integration-tests.yaml +++ b/.werft/workspace-run-integration-tests.yaml @@ -22,7 +22,7 @@ pod: secretName: github-token-gitpod-bot containers: - name: gcloud - image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:af-add-fish-to-dev-image.0 + image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:aa-previewctl-fix-rebuild.2 workingDir: /workspace imagePullPolicy: IfNotPresent env: diff --git a/dev/image/Dockerfile b/dev/image/Dockerfile index 6c568b22c9e293..3129f9fc779359 100644 --- a/dev/image/Dockerfile +++ b/dev/image/Dockerfile @@ -4,7 +4,7 @@ FROM gitpod/workspace-full:2022-10-15-02-50-27 -ENV TRIGGER_REBUILD 22 +ENV TRIGGER_REBUILD 23 USER root diff --git a/dev/preview/previewctl/cmd/credentials.go b/dev/preview/previewctl/cmd/credentials.go index 92754fdb757c0d..645726fb69d5fc 100644 --- a/dev/preview/previewctl/cmd/credentials.go +++ b/dev/preview/previewctl/cmd/credentials.go @@ -34,9 +34,6 @@ type getCredentialsOpts struct { gcpClient *gcloud.Config logger *logrus.Logger - serviceAccountPath string - kubeConfigSavePath string - getCredentialsMap map[string]func(ctx context.Context) (*api.Config, error) configMap map[string]*api.Config } @@ -46,10 +43,8 @@ func newGetCredentialsCommand(logger *logrus.Logger) *cobra.Command { var client *gcloud.Config ctx := context.Background() opts := &getCredentialsOpts{ - logger: logger, - kubeConfigSavePath: kubeConfigSavePath, - serviceAccountPath: serviceAccountPath, - configMap: map[string]*api.Config{}, + logger: logger, + configMap: map[string]*api.Config{}, } cmd := &cobra.Command{ @@ -57,7 +52,7 @@ func newGetCredentialsCommand(logger *logrus.Logger) *cobra.Command { Long: `previewctl get-credentials retrieves the kubernetes configs for core-dev and harvester clusters, merges them with the default config, and outputs them either to stdout or to a file.`, PersistentPreRunE: func(cmd *cobra.Command, args []string) error { - client, err = gcloud.New(ctx, opts.serviceAccountPath) + client, err = gcloud.New(ctx, serviceAccountPath) if err != nil { return err } @@ -118,7 +113,7 @@ func (o *getCredentialsOpts) mergeContexts() error { return err } - if o.kubeConfigSavePath != "" { + if kubeConfigSavePath != "" { return clientcmd.WriteToFile(*finalConfig, kubeConfigSavePath) }