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(api): fix list ops in authorizing client #3396

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

krancour
Copy link
Member

@krancour krancour commented Jan 29, 2025

Fixes #3296

Only the API server was affected by this.

When listing any sort of resource using our authorizing client wrapper, the following worked fine:

cl.List(ctx, &obj, client.InNamespace(ns))

But the following did not:

cli.List(ctx, &obj, &client.ListOptions{Namespace: project))

In the former case, the authorizing client wrapper would fail to glean namespace info from the options, resulting in the query not being constrained by namespace, and thus requiring the user to have cluster-scoped read on the affected types.

Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
Copy link

netlify bot commented Jan 29, 2025

Deploy Preview for docs-kargo-io ready!

Name Link
🔨 Latest commit 2595806
🔍 Latest deploy log https://app.netlify.com/sites/docs-kargo-io/deploys/679a51806c649f0008a61d42
😎 Deploy Preview https://deploy-preview-3396.docs.kargo.io
📱 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.

Copy link

codecov bot commented Jan 29, 2025

Codecov Report

Attention: Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.

Project coverage is 52.49%. Comparing base (d1441f1) to head (2595806).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/api/kubernetes/client.go 0.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3396      +/-   ##
==========================================
- Coverage   52.50%   52.49%   -0.02%     
==========================================
  Files         291      291              
  Lines       26625    26631       +6     
==========================================
  Hits        13979    13979              
- Misses      11882    11888       +6     
  Partials      764      764              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@krancour krancour added this pull request to the merge queue Jan 29, 2025
Merged via the queue into akuity:main with commit ae7213f Jan 29, 2025
27 of 29 checks passed
@krancour krancour deleted the krancour/authz-client-fix branch January 29, 2025 16:30
github-actions bot pushed a commit that referenced this pull request Jan 29, 2025
Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
(cherry picked from commit ae7213f)
@akuitybot
Copy link

Successfully created backport PR for release-1.2:

fykaa pushed a commit to fykaa/kargo that referenced this pull request Feb 6, 2025
Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UI: QueryFreight api requires LIST verb at cluster-level during promotion, bug?
3 participants