Skip to content

fix: Simplify enforce instance type policy by using sets#67

Merged
KNiepok merged 1 commit intospacelift-io:mainfrom
FidelusAleksander:simplify-enforce-instance-types
Feb 24, 2026
Merged

fix: Simplify enforce instance type policy by using sets#67
KNiepok merged 1 commit intospacelift-io:mainfrom
FidelusAleksander:simplify-enforce-instance-types

Conversation

@FidelusAleksander
Copy link

@FidelusAleksander FidelusAleksander commented Apr 23, 2024

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:

  • Each new policy has corresponding tests.
  • All the tests pass.
  • The pull request is opened against the main branch.
  • The pull request is no longer marked as a draft.
  • You agree to license your contribution under the MIT license to Spacelift (not required for Spacelift employees).

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.rego to represent allow_list/deny_list as Rego sets instead of arrays and performs membership tests via direct set indexing.

Removes the is_in_allow_list/is_in_deny_list helper rules and updates the deny/warn conditions to use the new set-based checks.

Written by Cursor Bugbot for commit b2b49bf. This will update automatically on new commits. Configure here.

KNiepok
KNiepok previously approved these changes May 21, 2025
@jubranNassar
Copy link
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 KNiepok requested a review from a team as a code owner February 24, 2026 12:58
Co-Authored-By: Aleksander Fidelus <aleksander.fidelus@hitachivantara.com>
@KNiepok KNiepok force-pushed the simplify-enforce-instance-types branch from 5309514 to b2b49bf Compare February 24, 2026 13:12
@KNiepok KNiepok merged commit c77a473 into spacelift-io:main Feb 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants