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

chore: only add auth and pubkeys when they're not empty #260

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

ahmad-ibra
Copy link
Contributor

Issue

N/A

Description

We were always populating the auth and allPubKeys maps which meant that we were unneccesarily calling the oci clients WithVerificationPublicKeys and WithBasicAuth functions for every rule (even those with no auth or pubkeys).

Nothing was actually broken, but this is a more correct implementation

Copy link

codecov bot commented Aug 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

@@           Coverage Diff           @@
##             main     #260   +/-   ##
=======================================
  Coverage        ?   63.22%           
=======================================
  Files           ?        8           
  Lines           ?      503           
  Branches        ?        0           
=======================================
  Hits            ?      318           
  Misses          ?      151           
  Partials        ?       34           
Files Coverage Δ
internal/controller/ocivalidator_controller.go 63.10% <100.00%> (ø)

Continue to review full report in Codecov by Sentry.

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

@ahmad-ibra ahmad-ibra marked this pull request as ready for review August 11, 2024 05:48
@ahmad-ibra ahmad-ibra requested a review from a team as a code owner August 11, 2024 05:48
@ahmad-ibra ahmad-ibra requested a review from mattwelke August 11, 2024 05:48
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. enhancement Enhancement to an existing feature labels Aug 11, 2024
Copy link
Member

@TylerGillson TylerGillson left a comment

Choose a reason for hiding this comment

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

It was needed when the logic was just using indices, but not now that they're stored in maps. Thanks!

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Aug 12, 2024
@ahmad-ibra ahmad-ibra merged commit 5b21888 into main Aug 12, 2024
8 checks passed
@ahmad-ibra ahmad-ibra deleted the chore/only-add-auth-and-pubkeys-when-available branch August 12, 2024 13:55
ahmad-ibra pushed a commit that referenced this pull request Aug 16, 2024
🤖 I have created a release *beep* *boop*
---


##
[0.2.1](v0.2.0...v0.2.1)
(2024-08-16)


### Bug Fixes

* support private ecr registry validation with a per rule aws env vars
([#268](#268))
([42a5610](42a5610))


### Other

* only add auth and pubkeys when they're not empty
([#260](#260))
([5b21888](5b21888))


### Dependency Updates

* **deps:** update
github.com/awslabs/amazon-ecr-credential-helper/ecr-login digest to
d4ae6cf
([#265](#265))
([1c4f7f2](1c4f7f2))
* **deps:** update module github.com/validator-labs/validator to v0.1.3
([#258](#258))
([4161664](4161664))
* **deps:** update module github.com/validator-labs/validator to v0.1.5
([#263](#263))
([a5fc455](a5fc455))
* **deps:** update module sigs.k8s.io/cluster-api to v1.8.0
([#261](#261))
([9847a0a](9847a0a))
* **deps:** update module sigs.k8s.io/controller-runtime to v0.18.5
([#262](#262))
([e2f73a2](e2f73a2))
* **deps:** update module sigs.k8s.io/controller-runtime to v0.19.0
([#267](#267))
([eaa40aa](eaa40aa))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement to an existing feature lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants