Open
Conversation
This PR adds support for requiring Terraform plan approval before
applying.
As part of this:
* Add new `PlanApprovalRequired` bool to the `RemediationStrategy` type,
and add support for repo scoped and layer scoped usage
* Regenerate CRDs
* Add new `plan-approved` runner annotation
* Update `TerraformLayer` controller in order to:
1. Add a new `IsPlanApproved` condition
2. Update `Reconciler` logic to leverage the new
`PlanApprovalRequired` config item
3. Add a new `PlanApprovalRequired` state to differentiate
4. Update `ApplyNeeded` handler to still apply when `autoApply` is
disabled but `PlanApprovalRequired` is enabled.
* Add new `approve` POST endpoint to the API and supporting utils
function
Starts laying some foundations for padok-team#751
Also add supporting testdata fixture.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #797 +/- ##
==========================================
+ Coverage 39.79% 39.95% +0.15%
==========================================
Files 94 96 +2
Lines 5465 5541 +76
==========================================
+ Hits 2175 2214 +39
- Misses 3093 3128 +35
- Partials 197 199 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Member
|
Hi @fatmcgav Thanks for the PR. As a general rule, we prefer discussing implementation details of such contribution in a issue or on Burrito's Discord server (link in README). That being said, your PR looks complete, with test cases and generated files 😄 Regarding the apply-before-merged feature requested in #751 and your PR:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds support for requiring Terraform plan approval before
applying.
As part of this:
PlanApprovalRequiredbool to theRemediationStrategytype,and add support for repo scoped and layer scoped usage
plan-approvedrunner annotationTerraformLayercontroller in order to:IsPlanApprovedconditionReconcilerlogic to leverage the newPlanApprovalRequiredconfig itemPlanApprovalRequiredstate to differentiateApplyNeededhandler to still apply whenautoApplyisdisabled but
PlanApprovalRequiredis enabled.approvePOST endpoint to the API and supporting utilsfunction
Starts laying some foundations for #751
TODO: