Skip to content

Add fallback for fetchClientIdBySeedIdentifier#343

Merged
gardener-prow[bot] merged 1 commit intogardener:mainfrom
adenitiu:patch-1
Apr 8, 2026
Merged

Add fallback for fetchClientIdBySeedIdentifier#343
gardener-prow[bot] merged 1 commit intogardener:mainfrom
adenitiu:patch-1

Conversation

@adenitiu
Copy link
Copy Markdown
Contributor

@adenitiu adenitiu commented Apr 7, 2026

What this PR does / why we need it:
This PR introduces a fallback for fetchClientIdBySeedIdentifier , e.g. if only one client is configured and no annotation is set, use that client.

Which issue(s) this PR fixes:
The proposed change is intended for the use-case where one client for multiple seeds in a landscape should be used, instead of having to annotate each seed individually.

Special notes for your reviewer:
cc @nickytd

Release note:

Add fallback for `fetchClientIdBySeedIdentifier`

@adenitiu adenitiu requested a review from nickytd as a code owner April 7, 2026 16:57
@gardener-prow gardener-prow bot added the do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. label Apr 7, 2026
@hyperspace-insights
Copy link
Copy Markdown

Summary

The following content is AI-generated and provides a summary of the pull request:


How to categorize this PR?
/kind enhancement
/area oidc-apps

What this PR does / why we need it:
This PR introduces a fallback mechanism in the fetchClientIdBySeedIdentifier Helm template helper. Previously, the function required a seed to be annotated with oidc-apps.extensions.gardener.cloud/client-name to resolve the correct OIDC client ID. Now, if no annotation is set but exactly one client is configured, that single client will be used automatically. Additionally, the function now safely handles the case where gardener.seed.annotations is nil by defaulting to an empty dict before calling get.

Code changes:

  • In charts/oidc-apps-controller/templates/_helpers.tpl, the fetchClientIdBySeedIdentifier template was updated to:
    1. Use default (dict) when accessing seed annotations to avoid nil-map panics.
    2. Wrap the annotation-based client lookup in an {{- if $clientName }} block.
    3. Add an {{- else if eq (len .Values.clients) 1 }} fallback that automatically selects the single configured client's clientId when no annotation is present.

Additional context:
This enables a simpler operational model where a single OIDC client can be shared across multiple seeds in a landscape without needing to annotate each seed individually.

Which issue(s) this PR fixes:

Special notes for your reviewer:
cc @nickytd

Release note:

Add fallback in `fetchClientIdBySeedIdentifier` to automatically use the single configured OIDC client when no seed annotation is set, simplifying multi-seed landscapes that share one client.

  • 🔄 Regenerate and Update Summary
  • ✏️ Insert as PR Description (deletes this comment)
  • 🗑️ Delete comment
PR Bot Information

Version: 1.20.0 | 📖 Documentation | 🚨 Create Incident | 💬 Feedback

  • Summary Prompt: PR Prompt File
  • Output Template: PR Template File
  • LLM: anthropic--claude-4.6-sonnet
  • File Content Strategy: Full file content
  • Event Trigger: pull_request.opened
  • Correlation ID: dc3a8730-32a2-11f1-9ffd-fca4cb4234a0

💌 Have ideas or want to contribute? Create an issue and share your thoughts with us!
📑 Check out the documentation for more information.
📬 Subscribe to the Hyperspace PR Bot DL to get the latest announcements and pilot features!

Made with ❤️ by Hyperspace.

@gardener-prow gardener-prow bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. kind/enhancement Enhancement, improvement, extension labels Apr 7, 2026
@gardener-prow
Copy link
Copy Markdown

gardener-prow bot commented Apr 7, 2026

@hyperspace-insights[bot]: The label(s) area/oidc-apps cannot be applied, because the repository doesn't have them.

Details

In response to this:

Summary

The following content is AI-generated and provides a summary of the pull request:


How to categorize this PR?
/kind enhancement
/area oidc-apps

What this PR does / why we need it:
This PR introduces a fallback mechanism in the fetchClientIdBySeedIdentifier Helm template helper. Previously, the function required a seed to be annotated with oidc-apps.extensions.gardener.cloud/client-name to resolve the correct OIDC client ID. Now, if no annotation is set but exactly one client is configured, that single client will be used automatically. Additionally, the function now safely handles the case where gardener.seed.annotations is nil by defaulting to an empty dict before calling get.

Code changes:

  • In charts/oidc-apps-controller/templates/_helpers.tpl, the fetchClientIdBySeedIdentifier template was updated to:
  1. Use default (dict) when accessing seed annotations to avoid nil-map panics.
  2. Wrap the annotation-based client lookup in an {{- if $clientName }} block.
  3. Add an {{- else if eq (len .Values.clients) 1 }} fallback that automatically selects the single configured client's clientId when no annotation is present.

Additional context:
This enables a simpler operational model where a single OIDC client can be shared across multiple seeds in a landscape without needing to annotate each seed individually.

Which issue(s) this PR fixes:

Special notes for your reviewer:
cc @nickytd

Release note:

Add fallback in `fetchClientIdBySeedIdentifier` to automatically use the single configured OIDC client when no seed annotation is set, simplifying multi-seed landscapes that share one client.

  • 🔄 Regenerate and Update Summary
  • ✏️ Insert as PR Description (deletes this comment)
  • 🗑️ Delete comment
PR Bot Information

Version: 1.20.0 | 📖 Documentation | 🚨 Create Incident | 💬 Feedback

  • Summary Prompt: PR Prompt File
  • Output Template: PR Template File
  • LLM: anthropic--claude-4.6-sonnet
  • File Content Strategy: Full file content
  • Event Trigger: pull_request.opened
  • Correlation ID: dc3a8730-32a2-11f1-9ffd-fca4cb4234a0

💌 Have ideas or want to contribute? Create an issue and share your thoughts with us!
📑 Check out the documentation for more information.
📬 Subscribe to the Hyperspace PR Bot DL to get the latest announcements and pilot features!

Made with ❤️ by Hyperspace.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@gardener-prow gardener-prow bot removed the do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. label Apr 7, 2026
Copy link
Copy Markdown
Collaborator

@nickytd nickytd left a comment

Choose a reason for hiding this comment

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

/lgtm

@gardener-prow gardener-prow bot added the lgtm Indicates that a PR is ready to be merged. label Apr 8, 2026
@gardener-prow
Copy link
Copy Markdown

gardener-prow bot commented Apr 8, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nickytd

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@gardener-prow
Copy link
Copy Markdown

gardener-prow bot commented Apr 8, 2026

LGTM label has been added.

DetailsGit tree hash: fc7971581c3fe1859128a2ddd95332f29e15d939

@gardener-prow gardener-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 8, 2026
@gardener-prow gardener-prow bot merged commit d2b29ec into gardener:main Apr 8, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. kind/enhancement Enhancement, improvement, extension lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants