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

Fix #1583 #1582. Disallow regex now until implemented. #1584

Merged
merged 1 commit into from
Mar 10, 2022

Conversation

vaikas
Copy link
Contributor

@vaikas vaikas commented Mar 10, 2022

Signed-off-by: Ville Aikas vaikas@chainguard.dev

Summary

Implement glob support for ClusterImagePolicy. Supports trailing '*' only. Fixes #1582
Disallow regex until there's actually support for implementing it.
Fix incorrect error message fields. #1583

Ticket Link

Fixes: #1582
Fixed: #1583

Release Note


Signed-off-by: Ville Aikas <vaikas@chainguard.dev>
@codecov-commenter
Copy link

Codecov Report

Merging #1584 (5bf00b7) into main (c341168) will increase coverage by 0.27%.
The diff coverage is 93.22%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1584      +/-   ##
==========================================
+ Coverage   27.19%   27.46%   +0.27%     
==========================================
  Files         136      137       +1     
  Lines        7712     7741      +29     
==========================================
+ Hits         2097     2126      +29     
  Misses       5386     5386              
  Partials      229      229              
Impacted Files Coverage Δ
...cosigned/v1alpha1/clusterimagepolicy_validation.go 87.23% <92.30%> (+4.37%) ⬆️
pkg/apis/config/glob.go 100.00% <100.00%> (ø)
pkg/apis/config/image_policies.go 70.73% <100.00%> (-0.70%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c341168...5bf00b7. Read the comment docs.

Copy link
Contributor

@hectorj2f hectorj2f left a comment

Choose a reason for hiding this comment

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

lgtm

Comment on lines +22 to +24
// to find, since they handle '*' anywhere in the string as a wildcard. For our
// use we only want to handle it at the end, and hence this effectively turns
// into 'hasPrefix' string matching up to the trailing *.
Copy link
Member

Choose a reason for hiding this comment

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

I think we want to handle it in a bunch of places as well, e.g. to glob out the account number of region in an ECR repo.

One other thing we will need to consider is normalizing image names, e.g. ubuntu vs. docker.io/ubuntu vs. docker.io/ubuntu:latest`.

Copy link
Member

Choose a reason for hiding this comment

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

This is fine for now, but I think we should plan to expand this in subsequent changes.

@dlorenc dlorenc merged commit bf799ed into sigstore:main Mar 10, 2022
@github-actions github-actions bot added this to the v1.7.0 milestone Mar 10, 2022
@vaikas vaikas deleted the issue-1582 branch March 10, 2022 15:58
mlieberman85 pushed a commit to mlieberman85/cosign that referenced this pull request May 6, 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.

Incorrect error messages in validating CIP Implement glob in CIP
5 participants