Skip to content
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

Add support for "**" in image glob matching #1914

Merged
merged 2 commits into from May 24, 2022
Merged

Conversation

imjasonh
Copy link
Member

Signed-off-by: Jason Hall jason@chainguard.dev

Fixes #1903

This is WIP because it currently breaks a number of previous test cases, and I want to make sure this isn't considered a backward-incompatible change. Or if it is, that we're comfortable with this breakage.

Image policy globs now support ** to match any character; matching images that are specified like "ubuntu" or "myuser/myapp" should be matched with a glob like "index.docker.io/library/*" or "index.docker.io/*/*" respectively, rather than expecting "*" or "*/*" to match as before.

@hectorj2f @jdolitsky

Signed-off-by: Jason Hall <jason@chainguard.dev>
jdolitsky
jdolitsky previously approved these changes May 23, 2022
Copy link
Contributor

@jdolitsky jdolitsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome. if breaking change is an issue, we can deprecate and make GlobMatchWithWarnings 😅?

@hectorj2f
Copy link
Contributor

@imjasonh I believe you need to check the unit tests because they seem to be failing for the image_policies_test.

@imjasonh
Copy link
Member Author

@imjasonh I believe you need to check the unit tests because they seem to be failing for the image_policies_test.

Yeah, the failures indicate the API breakage I'm talking about actually. The tests check image names like rando, which under this new logic would need a glob like index.docker.io/library/rando to match it. I'll need to relax the glob matching logic to handle this case with a warning like the others.

Signed-off-by: Jason Hall <jason@chainguard.dev>
@dlorenc dlorenc merged commit b73da70 into sigstore:main May 24, 2022
@github-actions github-actions bot added this to the v1.9.0 milestone May 24, 2022
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.

Want to use GlobMatch on root level domain (e.g. "ghcr.io/*")
4 participants