Use Helm to install agent in GitOps QA test
What does this MR do and why?
Updates the agent/gitops QA tests to install the agent using Helm, to match the Auto DevOps test. Previously, this was not possible because the agent Helm chart did not support setting the canary cookie.
QA test output
Running without canary cookie (Helm uses --set config.kasHeaders="{Cookie: gitlab_canary=false}"
):
< snip >
[Mar 08 2023 16:54:23 AEDT (QA Tests)] INFO -- ==> Built a QA::Resource::Clusters::Agent with name 'my-agent' via api in 19.83 seconds
[Mar 08 2023 16:54:23 AEDT (QA Tests)] INFO -- ==> Built a QA::Resource::Clusters::AgentToken with id '39' via api in 19.91 seconds
[Mar 08 2023 16:54:23 AEDT (QA Tests)] INFO -- Executing: `helm repo add gitlab https://charts.gitlab.io && helm repo update && helm upgrade --install test gitlab/gitlab-agent --namespace gitlab-agent --create-namespace --set image.tag=fe716ea --set config.token=<TOKEN> --set config.kasAddress=kas.staging.gitlab.com --set config.kasHeaders="{Cookie: gitlab_canary=false}" `
............
[Mar 08 2023 16:54:29 AEDT (QA Tests)] INFO -- ==> Built a QA::Resource::Repository::Commit via api in 0.62 seconds
< snip >
Running with QA_COOKES=gitlab_canary=true
(Helm uses --set config.kasHeaders="{Cookie: gitlab_canary=true}"
):
< snip >
[Mar 08 2023 16:53:01 AEDT (QA Tests)] INFO -- ==> Built a QA::Resource::Clusters::Agent with name 'my-agent' via api in 46.53 seconds
[Mar 08 2023 16:53:01 AEDT (QA Tests)] INFO -- ==> Built a QA::Resource::Clusters::AgentToken with id '38' via api in 46.66 seconds
[Mar 08 2023 16:53:02 AEDT (QA Tests)] INFO -- Executing: `helm repo add gitlab https://charts.gitlab.io && helm repo update && helm upgrade --install test gitlab/gitlab-agent --namespace gitlab-agent --create-namespace --set image.tag=fe716ea --set config.token=<TOKEN> --set config.kasAddress=kas.staging.gitlab.com --set config.kasHeaders="{Cookie: gitlab_canary=true}" `
............
[Mar 08 2023 16:53:07 AEDT (QA Tests)] INFO -- ==> Built a QA::Resource::Repository::Commit via api in 1.05 seconds
< snip >
How to set up and validate locally
Unfortunately it is quite difficult to verify locally, as the test needs to a) create resources on staging, b) create a GKE cluster. Instructions can be found in this comment.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #384068 (closed)