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 bearer plugin OCI cloud registries issues #7308

Merged

Conversation

carabasdaniel
Copy link
Contributor

This change should fix #7092, #7189 and #6590

I've tested this with AWS, but I would appreciate if someone can please test this with ACR

@carabasdaniel carabasdaniel marked this pull request as draft January 24, 2025 11:13
@ashutosh-narkar
Copy link
Member

Thanks @carabasdaniel! It would be great if we had a test to exercise this if possible.

Copy link

netlify bot commented Jan 27, 2025

Deploy Preview for openpolicyagent ready!

Name Link
🔨 Latest commit 53fb052
🔍 Latest deploy log https://app.netlify.com/sites/openpolicyagent/deploys/679762db72c5f50009edf993
😎 Deploy Preview https://deploy-preview-7308--openpolicyagent.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@carabasdaniel carabasdaniel marked this pull request as ready for review January 27, 2025 13:41
Copy link

netlify bot commented Jan 28, 2025

Deploy Preview for openpolicyagent ready!

Name Link
🔨 Latest commit d915874
🔍 Latest deploy log https://app.netlify.com/sites/openpolicyagent/deploys/679a72207379c90008d58fda
😎 Deploy Preview https://deploy-preview-7308--openpolicyagent.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@ashutosh-narkar
Copy link
Member

Can you please squash your commits. Are you also able to test this with ACR?

@carabasdaniel carabasdaniel force-pushed the fix-bearer-plugin-oci branch 3 times, most recently from b381a5a to b6426f5 Compare January 29, 2025 09:43
@carabasdaniel
Copy link
Contributor Author

Can you please squash your commits. Are you also able to test this with ACR?

Squashed and rebased on latest main. I'm having some trouble with access to the azure portal at the moment and that is why I requested for someone to test the PR.

I'll try to test later today if I can get access to ACR

@carabasdaniel
Copy link
Contributor Author

Hi @ashutosh-narkar,

I finally managed to test this fix with ACR and it seems to work as expected with a standard private container registry. OPA is able to download the policy image and load the bundle as expected.

@@ -153,6 +157,9 @@ func (ap *bearerAuthPlugin) NewClient(c Config) (*http.Client, error) {

func (ap *bearerAuthPlugin) Prepare(req *http.Request) error {
token := ap.Token
if ap.logger == nil {
ap.logger = logging.Get()
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 the logger should be provided. This Get call is deprecated. Just noting this if we have to remove it later.

@ashutosh-narkar ashutosh-narkar merged commit bd19e8e into open-policy-agent:main Jan 29, 2025
28 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.

OCI: Downloading policy images from AWS private repository failure
2 participants