Skip to content

Add support for the =~ constraint #1681

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 22, 2025
Merged

Conversation

egibs
Copy link
Member

@egibs egibs commented May 20, 2025

We were trying to use the =~ constraint via the Apko Terraform Provider which should be valid:

/ # apk add yara-x=~0.14.0
(1/1) Installing yara-x (0.14.0-r3)
Executing busybox-1.37.0-r40.trigger
OK: 166 MiB in 16 packages

but this was not a valid matcher case so we defaulted to versionAny which would instead pull in the latest version.

This PR adds a case for the =~ constraint and treats it like ~ so that we correctly resolve versions via includesVersion and updates a few tests to validate both the ~ and =~ constraints.

FWIW it does look like ~ works as expected.

@egibs egibs requested a review from imjasonh May 20, 2025 18:57
@egibs egibs enabled auto-merge (squash) May 21, 2025 12:05
@egibs egibs merged commit 6c23b26 into chainguard-dev:main May 22, 2025
16 checks 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.

2 participants