Skip to content

Move kubernetes_variables to scoped_variables

What does this MR do and why?

Only scoped_variables are available within rules blocks. We want the CI/CD tunnel's KUBECONFIG to be available for rules-based filtering, so we are moving it here.

Screenshots or screen recordings

With an agent on the same project, running a pipeline with the following .gitlab-ci.yml:

job:
  script: echo "$KUBECONFIG"
  rules:
    - if: $KUBECONFIG
Before After
Screenshot_2021-11-03_at_22.17.33 Screenshot_2021-11-03_at_22.18.47

How to set up and validate locally

Create a project in your GDK and grab its ID. In a rails console, run:

project = Project.find(project_id)
agent = Clusters::Agents.create!(project: project, name: 'agent-000')

Then run a pipeline in the project with the .gitlab-ci.yml from the previous section.

  • On master, the pipeline fails to create because there are no jobs
  • On this branch, the pipeline gets created and the job runs

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Hordur Freyr Yngvason

Merge request reports