From 2f8ddb475fef1f473872604db02a02f691702485 Mon Sep 17 00:00:00 2001 From: Aleksandar Aleksandrov Date: Mon, 24 Oct 2022 09:24:59 +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 | 2 +- .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, 19 insertions(+), 24 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index bd50a30eb27e71..33bb6892cd745d 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.6 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..b58a4f02dda00d 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.6 workingDir: /workspace imagePullPolicy: Always volumeMounts: diff --git a/.werft/build.yaml b/.werft/build.yaml index 7cdf4c8abc1136..38740da0162dc1 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.6 workingDir: /workspace imagePullPolicy: IfNotPresent resources: diff --git a/.werft/cleanup-installer-tests.yaml b/.werft/cleanup-installer-tests.yaml index 9fa12676ad49c7..181a3564b94e3f 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.6 workingDir: /workspace imagePullPolicy: Always volumeMounts: diff --git a/.werft/debug.yaml b/.werft/debug.yaml index 7d4bb42dc67299..45f63379fef1ff 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.6 workingDir: /workspace imagePullPolicy: IfNotPresent volumeMounts: diff --git a/.werft/eks-installer-tests.yaml b/.werft/eks-installer-tests.yaml index 3c14069c33ec80..343283307264fe 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.6 workingDir: /workspace imagePullPolicy: Always volumeMounts: diff --git a/.werft/gke-installer-tests.yaml b/.werft/gke-installer-tests.yaml index d4aaaa1b66cbe5..9d6e19a5961fd4 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.6 workingDir: /workspace imagePullPolicy: Always volumeMounts: diff --git a/.werft/ide-integration-tests-startup.yaml b/.werft/ide-integration-tests-startup.yaml index 80c8f6ee17d8d1..2764559ef50df5 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.6 workingDir: /workspace imagePullPolicy: IfNotPresent env: diff --git a/.werft/k3s-installer-tests.yaml b/.werft/k3s-installer-tests.yaml index ea6724e4d4255d..ce023f197e2757 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.6 workingDir: /workspace imagePullPolicy: Always volumeMounts: diff --git a/.werft/platform-delete-preview-environment.yaml b/.werft/platform-delete-preview-environment.yaml index 474eb5be643244..5681dc74b2c0a6 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.6 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..25845c81ae4628 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.6 workingDir: /workspace imagePullPolicy: IfNotPresent volumeMounts: diff --git a/.werft/platform-trigger-artificial-job.yaml b/.werft/platform-trigger-artificial-job.yaml index e7b2e3c2b438e4..56f68fcbd601c4 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.6 workingDir: /workspace imagePullPolicy: IfNotPresent volumeMounts: diff --git a/.werft/platform-trigger-werft-cleanup.yaml b/.werft/platform-trigger-werft-cleanup.yaml index 8d10681ac035db..a6b2f6264f2f67 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.6 workingDir: /workspace imagePullPolicy: IfNotPresent volumeMounts: diff --git a/.werft/workspace-run-integration-tests.yaml b/.werft/workspace-run-integration-tests.yaml index 5221c18d989d11..75792627bc7c90 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.6 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) }