Skip to content

fixes empty secretkeyref in azureopenai#2225

Open
peterj wants to merge 2 commits into
mainfrom
peterj/fix-emptysecretref
Open

fixes empty secretkeyref in azureopenai#2225
peterj wants to merge 2 commits into
mainfrom
peterj/fix-emptysecretref

Conversation

@peterj

@peterj peterj commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

fixes #2212

Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
@peterj peterj requested a review from a team as a code owner July 13, 2026 12:11
Copilot AI review requested due to automatic review settings July 13, 2026 12:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This pull request fixes a bug in the Agent ADK API translator where the AzureOpenAI branch could inject an AZURE_OPENAI_API_KEY env var backed by a secretKeyRef with an empty Secret name when apiKeySecret was unset (e.g., when authenticating via azureADToken).

Changes:

  • Add the missing model.Spec.APIKeySecret != "" guard to the AzureOpenAI API-key env var injection logic.
  • Add a regression unit test to ensure no AzureOpenAI API-key Secret ref env var is injected when apiKeySecret is unset and azureADToken is used.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
go/core/internal/controller/translator/agent/adk_api_translator.go Prevents injecting an invalid secretKeyRef for AzureOpenAI when apiKeySecret is empty.
go/core/internal/controller/translator/agent/adk_api_translator_test.go Adds a regression test covering AzureOpenAI auth via azureADToken with no apiKeySecret.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

[BUG] AzureOpenAI translator builds SecretKeyRef with empty secret name

2 participants