Skip to content

feat: add functionality to do a patch apply with exclusions

What

  1. add terra-transformer protected-apply --patch functionality generate targets on current state with exclusions.
  2. upgrade to the latest shunit
  3. make tests extract XMLs and format them nicely, e.g of a test report with failures: https://gitlab.com/gitlab-com/gl-infra/terra-transformer/-/pipelines/1995335460/test_report => this is much nicer than several thousands of lines of unformatted shell output.

Why

The resulting list of targets is a "patch" on top of the existing state, rather than a full terraform plan. This allows for terraform patches to be appleid to the remaining items in the state in the scenarios such as:

  1. A whole AWS region is out, and none of the API endpoints can be called.
  2. Resources are corrupt and cannot be targeted, data lookups are likely to fail.

Examples of output of the filtered targets is in internal/terraform/patchtargets/patch-target-extractor_test.go

Further background in relation to GitLab Dedicated: https://gitlab.com/gitlab-com/gl-infra/gitlab-dedicated/team/-/issues/8080

Closes: https://gitlab.com/gitlab-com/gl-infra/gitlab-dedicated/team/-/work_items/9617

Edited by Konst Tchernov

Merge request reports

Loading