fix: Simplify enforce instance type policy by using sets#67
Merged
KNiepok merged 1 commit intospacelift-io:mainfrom Feb 24, 2026
Merged
Conversation
KNiepok
previously approved these changes
May 21, 2025
Contributor
|
Hey @FidelusAleksander - Apologies for the hold up. I see @KNiepok approved but seems like there is a conflict. Can you please resolve it whenever you get the chance? you can @ me here and I'll be happy to approve and merge the changes :) |
KNiepok
approved these changes
Feb 24, 2026
Co-Authored-By: Aleksander Fidelus <aleksander.fidelus@hitachivantara.com>
5309514 to
b2b49bf
Compare
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.
Description of the change
Helper functions and iteration seem unnecessary here
Checklist
Please make sure that the proposed change checks all the boxes below before requesting a review:
mainbranch.If the proposed change is ready to be merged, please request a review from
@spacelift-io/solutions-engineering. Someone will review and merge the pull request.Spacelift employees should request reviews from the relevant engineers and are allowed to merge pull requests after they got at least one approval.
Thank you for your contribution! 🙇
Note
Low Risk
Small refactor of a sample Rego policy that changes data structures and membership checks but keeps the same enforcement intent.
Overview
Refactors
examples/plan/enforce-instance-type-list.regoto representallow_list/deny_listas Rego sets instead of arrays and performs membership tests via direct set indexing.Removes the
is_in_allow_list/is_in_deny_listhelper rules and updates thedeny/warnconditions to use the new set-based checks.Written by Cursor Bugbot for commit b2b49bf. This will update automatically on new commits. Configure here.