add -oidc-scopes parameter only if scopes are actually provided#4221
add -oidc-scopes parameter only if scopes are actually provided#4221mikeywuu wants to merge 2 commits intokubernetes-sigs:mainfrom
Conversation
|
|
|
Welcome @mikeywuu! |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mikeywuu The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
skoeva
left a comment
There was a problem hiding this comment.
Hi, thanks for looking into this issue! If you can, please sign the CLA so we can review and merge any changes
skoeva
left a comment
There was a problem hiding this comment.
there's a failing test in the CI:
Test failed! To update expected templates to match current output:
1. Review the differences above carefully
2. If the changes are related to version, run:
make helm-update-template-version
This will update ALL expected templates with current Helm version
3. Verify the changes and commit them
|
After thinking about it, im not sure if this might break something for other people. With this change, it would no longer be possible to get the Maybe you have an opinion about that? |
|
I need some time to think about this, I assigned myself. |
There was a problem hiding this comment.
Pull request overview
This pull request fixes a bug in the Headlamp Helm chart where the -oidc-scopes argument was being added to the deployment even when OIDC scopes were not provided in the external secret configuration. This caused authentication failures with Azure Entra ID when using external secrets without the OIDC_SCOPES variable.
Changes:
- Added a conditional check to only include the
-oidc-scopesargument when scopes are actually provided, matching the pattern already present in the non-externalSecret configuration branch
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - "-oidc-client-id=$(OIDC_CLIENT_ID)" | ||
| - "-oidc-client-secret=$(OIDC_CLIENT_SECRET)" | ||
| - "-oidc-idp-issuer-url=$(OIDC_ISSUER_URL)" | ||
| {{- if or (ne $oidc.scopes "") (ne $scopes "") }} |
There was a problem hiding this comment.
For consistency with the corresponding check in the non-externalSecret branch (line 259), consider adding a comment here explaining the conditional check. The comment at line 259 reads: "# Check if scopes are non empty either from env or oidc.config"
| {{- if or (ne $oidc.scopes "") (ne $scopes "") }} | |
| {{- if or (ne $oidc.scopes "") (ne $scopes "") }} | |
| # Check if scopes are non empty either from env or oidc.config |
This pull request introduces a conditional check to the Helm chart deployment template for Headlamp, ensuring that the OIDC scopes argument is only included when the relevant value is set. This improves the flexibility and correctness of the deployment configuration.
Enhancement to OIDC configuration:
charts/headlamp/templates/deployment.yaml: Added a conditional block so that the-oidc-scopes=$(OIDC_SCOPES)argument is only included if either$oidc.scopesor$scopesis not empty, preventing unnecessary or empty configuration arguments.## SummaryRelated Issue
Fixes #4220