From af239738f12516992fa479288cc3f475788fec81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Cunha?= <j.a.cunha@gmail.com> Date: Wed, 23 Nov 2022 15:51:09 -0300 Subject: [PATCH] Configures agentk to know when to talk to canary QA tests run against canary when the environment var QA_COOKIES="gitlab_canary=true" is set. Up to now, agentk was always talking to the non-canary infrastructure even if this cookie was set. With this change we tell kas to add a canary cookie to its requests so that its requests get redirected to the KAS canary server. Issue: https://gitlab.com/gitlab-com/gl-infra/delivery/-/issues/2557 --- .../kubernetes_agent/agentk-manifest.yaml.erb | 17 +++++++++++++++++ qa/qa/runtime/env.rb | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/qa/qa/fixtures/kubernetes_agent/agentk-manifest.yaml.erb b/qa/qa/fixtures/kubernetes_agent/agentk-manifest.yaml.erb index 8eac841902287..e6ec4528d0d13 100644 --- a/qa/qa/fixtures/kubernetes_agent/agentk-manifest.yaml.erb +++ b/qa/qa/fixtures/kubernetes_agent/agentk-manifest.yaml.erb @@ -25,9 +25,26 @@ spec: - --token-file=/config/token - --kas-address - "<%= kas_wss_address %>" + <% if QA::Runtime::Env.qa_cookies.to_s.include?("gitlab_canary=true") %> + - --kas-header + - "Cookie: gitlab_canary=true" + <% end %> volumeMounts: - name: token-volume mountPath: /config + env: + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: SERVICE_ACCOUNT_NAME + valueFrom: + fieldRef: + fieldPath: spec.serviceAccountName volumes: - name: token-volume secret: diff --git a/qa/qa/runtime/env.rb b/qa/qa/runtime/env.rb index 33ef37fcc2e2e..3d958ecd75b7e 100644 --- a/qa/qa/runtime/env.rb +++ b/qa/qa/runtime/env.rb @@ -431,7 +431,7 @@ def geo_environment? end def gitlab_agentk_version - ENV.fetch('GITLAB_AGENTK_VERSION', 'v14.5.0') + ENV.fetch('GITLAB_AGENTK_VERSION', 'fe716ea') end def transient_trials -- GitLab