Skip to content

OLS-3200: implement generic LIGHTSPEED_* env var contract (operator)#27

Open
onmete wants to merge 5 commits into
openshift:mainfrom
onmete:ols-3200-env-var-contract
Open

OLS-3200: implement generic LIGHTSPEED_* env var contract (operator)#27
onmete wants to merge 5 commits into
openshift:mainfrom
onmete:ols-3200-env-var-contract

Conversation

@onmete
Copy link
Copy Markdown
Contributor

@onmete onmete commented Jun 2, 2026

Summary

  • Rewrites patchLLMCredentials to set only generic LIGHTSPEED_* env vars instead of SDK-specific vars
  • Operator now sets: LIGHTSPEED_PROVIDER, LIGHTSPEED_MODEL, plus optional LIGHTSPEED_MODEL_PROVIDER, LIGHTSPEED_PROVIDER_URL, LIGHTSPEED_PROVIDER_PROJECT, LIGHTSPEED_PROVIDER_REGION, LIGHTSPEED_PROVIDER_API_VERSION
  • Credentials mounted unconditionally for all providers via envFrom + volume at /var/run/secrets/llm-credentials/ (previously Vertex-only at /var/secrets/google)
  • Removes all SDK-specific env vars: ANTHROPIC_MODEL, CLAUDE_CODE_USE_VERTEX, GCP_PROJECT, GCP_REGION, GOOGLE_APPLICATION_CREDENTIALS, AZURE_OPENAI_ENDPOINT, OPENAI_BASE_URL, ANTHROPIC_BASE_URL, etc.
  • Azure URL resolution: url overrides endpoint for LIGHTSPEED_PROVIDER_URL

Companion PR: sandbox env var mapping in openshift/lightspeed-agentic-sandbox#62 (must merge together)

Jira: OLS-3200
Supersedes: OLS-3044, OLS-3051

Test plan

  • Updated tests for Anthropic, Vertex, Bedrock providers
  • Added tests for OpenAI, Azure, Azure URL override providers
  • All tests assert LIGHTSPEED_* vars and absence of SDK-specific vars
  • All tests assert unconditional credential volume mount
  • Full operator test suite passes
  • Coordinated merge with sandbox companion PR

Made with Cursor

Summary by CodeRabbit

Release Notes

  • Documentation

    • Clarified sandbox environment variable specifications for LLM provider configuration and removed outdated configuration options.
  • Refactor

    • Standardized credential mounting and environment variable handling across all supported LLM providers with improved consistency.
  • Tests

    • Expanded test coverage for LLM provider credential configurations, environment variables, and provider-specific settings.

onmete and others added 2 commits June 2, 2026 09:46
…200)

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jun 2, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Jun 2, 2026

@onmete: This pull request references OLS-3200 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the epic to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Summary

  • Rewrites patchLLMCredentials to set only generic LIGHTSPEED_* env vars instead of SDK-specific vars
  • Operator now sets: LIGHTSPEED_PROVIDER, LIGHTSPEED_MODEL, plus optional LIGHTSPEED_MODEL_PROVIDER, LIGHTSPEED_PROVIDER_URL, LIGHTSPEED_PROVIDER_PROJECT, LIGHTSPEED_PROVIDER_REGION, LIGHTSPEED_PROVIDER_API_VERSION
  • Credentials mounted unconditionally for all providers via envFrom + volume at /var/run/secrets/llm-credentials/ (previously Vertex-only at /var/secrets/google)
  • Removes all SDK-specific env vars: ANTHROPIC_MODEL, CLAUDE_CODE_USE_VERTEX, GCP_PROJECT, GCP_REGION, GOOGLE_APPLICATION_CREDENTIALS, AZURE_OPENAI_ENDPOINT, OPENAI_BASE_URL, ANTHROPIC_BASE_URL, etc.
  • Azure URL resolution: url overrides endpoint for LIGHTSPEED_PROVIDER_URL

Companion PR: sandbox env var mapping in openshift/lightspeed-agentic-sandbox#62 (must merge together)

Jira: OLS-3200
Supersedes: OLS-3044, OLS-3051

Test plan

  • Updated tests for Anthropic, Vertex, Bedrock providers
  • Added tests for OpenAI, Azure, Azure URL override providers
  • All tests assert LIGHTSPEED_* vars and absence of SDK-specific vars
  • All tests assert unconditional credential volume mount
  • Full operator test suite passes
  • Coordinated merge with sandbox companion PR

Made with Cursor

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 openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 2, 2026

Warning

Review limit reached

@onmete, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 39 minutes and 34 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 2c5ea6fb-2d35-4f88-b36b-7c9b489eefb1

📥 Commits

Reviewing files that changed from the base of the PR and between e5c69b8 and 57f7333.

📒 Files selected for processing (1)
  • controller/proposal/sandbox_templates_test.go
📝 Walkthrough

Walkthrough

This PR unifies LLM credential mounting and environment variable configuration across all provider types. The specification defines the new LIGHTSPEED_* environment variables, the implementation refactors credential patching logic to use shared mounting with provider-specific configuration, and the test suite validates the contract for all supported LLM providers.

Changes

Unified LLM Credential Mounting Architecture

Layer / File(s) Summary
Environment variable specification update
.ai/spec/what/sandbox-execution.md
Specification clarifies the new LIGHTSPEED_PROVIDER and LIGHTSPEED_MODEL environment variables with provider-specific conditional field mappings, removes the obsolete LIGHTSPEED_MODE row, and removes the planned-change reference to this contract migration.
Credential mounting and provider-specific environment variable patching
controller/proposal/sandbox_templates.go
Credential mount constants updated to introduce shared llm-credentials path. patchLLMCredentials function refactored to set unified LIGHTSPEED_PROVIDER and LIGHTSPEED_MODEL variables, mount all credentials via shared volume, and configure provider-specific settings via LIGHTSPEED_PROVIDER_URL and provider-scoped variables (Vertex: model provider/project/region; Bedrock: region; Azure: endpoint/API version).
Test suite for credential mounting across all provider types
controller/proposal/sandbox_templates_test.go
New helper assertCredentialVolumeMount validates read-only credential mount presence. Anthropic, Vertex, and Bedrock tests refactored to assert LIGHTSPEED_* variables and credential mounts. New exported tests for OpenAI and Azure validate provider-specific configuration. Azure URL override test updated to assert LIGHTSPEED_PROVIDER_URL precedence.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

lgtm

Suggested reviewers

  • harche
  • blublinsky
  • raptorsun
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 58.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately reflects the main change: implementing the generic LIGHTSPEED_* environment variable contract in the operator, which is the core focus of the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci Bot requested review from blublinsky and harche June 2, 2026 07:50
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Jun 2, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign blublinsky for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

onmete and others added 2 commits June 2, 2026 10:06
Remove brittle assertNoSDKEnvVars denylist — positive assertions on
LIGHTSPEED_* vars already verify correct behavior. Add doc comments
to each patchLLMCredentials test describing what it exercises.

Co-authored-by: Cursor <cursoragent@cursor.com>
- providerTypeString lowercases model provider via strings.ToLower
- Remove LIGHTSPEED_MODE from spec rule 16a (per OLS-3204)
- Replace vague "When applicable" with explicit provider conditions

Co-authored-by: Cursor <cursoragent@cursor.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@controller/proposal/sandbox_templates_test.go`:
- Around line 245-267: Update the assertCredentialVolumeMount helper to validate
the full credential contract: in addition to verifying the volume mount named
llmCredsVolumeName at llmCredsMountPath and that it is readOnly (current checks
in assertCredentialVolumeMount), also assert the container has an envFrom entry
that references the secret (inspect container["envFrom"] for a secretRef with a
name) to ensure unconditional secret injection, and assert the container's env
does NOT include legacy SDK-specific variables (e.g. OPENAI_API_KEY,
AZURE_OPENAI_KEY, BEDROCK_API_KEY) so only the LIGHTSPEED_* / secret-based
config is present; locate these checks inside assertCredentialVolumeMount (which
reads containers via unstructured.NestedSlice) and fail the test with
t.Error/t.Fatalf when the envFrom secret is missing or legacy env vars are
present.

In `@controller/proposal/sandbox_templates.go`:
- Around line 31-33: The llmCredsMountPath constant currently uses
"/var/run/secrets/llm-credentials" but the spec requires the trailing slash
"/var/run/secrets/llm-credentials/"; update the llmCredsMountPath declaration to
include the trailing slash and ensure any related uses/tests referencing
llmCredsMountPath (and the new tests added) are aligned to the exact literal
with the trailing slash so the operator/spec/sandbox contract matches precisely.
- Around line 267-334: Replace inline error message strings in the fmt.Errorf
calls with package-level constant labels and wrap the original error using
fmt.Errorf("%s: %w", Err..., err); add const declarations (e.g.
ErrSetLightspeedProvider, ErrSetLightspeedModel, ErrAddCredentialsEnvFrom,
ErrAddCredentialsVolume, ErrMountCredentials, ErrSetProviderURL,
ErrSetModelProvider, ErrSetProviderProject, ErrSetProviderRegion,
ErrSetProviderAPIVersion) and update all occurrences in the code that call
setEnvVar, addEnvFromSecret, addSecretVolume, addVolumeMount and the
provider-specific branches to use fmt.Errorf("%s: %w", <const>, err) instead of
inline strings so the error labels are consistent with the repository guideline.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: e9e60bfc-3ae5-4983-b4f9-09c9e61eae33

📥 Commits

Reviewing files that changed from the base of the PR and between d0644d5 and e5c69b8.

📒 Files selected for processing (3)
  • .ai/spec/what/sandbox-execution.md
  • controller/proposal/sandbox_templates.go
  • controller/proposal/sandbox_templates_test.go

Comment on lines +245 to +267
func assertCredentialVolumeMount(t *testing.T, tmpl *unstructured.Unstructured) {
t.Helper()
containers, _, _ := unstructured.NestedSlice(tmpl.Object, "spec", "podTemplate", "spec", "containers")
if len(containers) == 0 {
t.Fatal("no containers")
}
container := containers[0].(map[string]any)
mounts, _, _ := unstructured.NestedSlice(container, "volumeMounts")
found := false
for _, m := range mounts {
mount := m.(map[string]any)
if mount["name"] == llmCredsVolumeName && mount["mountPath"] == llmCredsMountPath {
found = true
if mount["readOnly"] != true {
t.Error("credential volume mount should be readOnly")
}
break
}
}
if !found {
t.Errorf("missing credential volume mount at %s", llmCredsMountPath)
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Broaden the shared helper to assert the full credential contract.

Right now it only checks the volume mount, so the new OpenAI/Azure/Bedrock cases no longer verify the unconditional envFrom secret injection. It also leaves room for a regression where legacy SDK-specific env vars come back alongside LIGHTSPEED_* and the tests still pass.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@controller/proposal/sandbox_templates_test.go` around lines 245 - 267, Update
the assertCredentialVolumeMount helper to validate the full credential contract:
in addition to verifying the volume mount named llmCredsVolumeName at
llmCredsMountPath and that it is readOnly (current checks in
assertCredentialVolumeMount), also assert the container has an envFrom entry
that references the secret (inspect container["envFrom"] for a secretRef with a
name) to ensure unconditional secret injection, and assert the container's env
does NOT include legacy SDK-specific variables (e.g. OPENAI_API_KEY,
AZURE_OPENAI_KEY, BEDROCK_API_KEY) so only the LIGHTSPEED_* / secret-based
config is present; locate these checks inside assertCredentialVolumeMount (which
reads containers via unstructured.NestedSlice) and fail the test with
t.Error/t.Fatalf when the envFrom secret is missing or legacy env vars are
present.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 57f7333. Folded envFrom check into renamed assertCredentialMounts — all 6 provider tests now verify both envFrom and volume mount unconditionally. Skipped the SDK denylist suggestion: a static blocklist rots and the positive LIGHTSPEED_* assertions already catch regressions.

Comment on lines +31 to +33
llmCredsMountPath = "/var/run/secrets/llm-credentials"
llmCredsVolumeName = "llm-credentials"
mcpHeadersMountRoot = "/var/secrets/mcp"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Align the credential mount path literal with the documented contract.

The spec describes /var/run/secrets/llm-credentials/, but this constant and the new tests use /var/run/secrets/llm-credentials. Even if the filesystem behavior is equivalent, the operator/spec/sandbox contract should use one exact literal before the companion PR merges.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@controller/proposal/sandbox_templates.go` around lines 31 - 33, The
llmCredsMountPath constant currently uses "/var/run/secrets/llm-credentials" but
the spec requires the trailing slash "/var/run/secrets/llm-credentials/"; update
the llmCredsMountPath declaration to include the trailing slash and ensure any
related uses/tests referencing llmCredsMountPath (and the new tests added) are
aligned to the exact literal with the trailing slash so the
operator/spec/sandbox contract matches precisely.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Skipping. The operator constant is a Kubernetes volumeMounts.mountPath where trailing slash is irrelevant — the kubelet treats both identically. The sandbox uses the same path as a prefix for f"{path}/filename" where no trailing slash is correct. The spec trailing slash is a documentation convention, not a contract violation.

Comment on lines +267 to +334
if err := setEnvVar(tmpl, "LIGHTSPEED_PROVIDER", providerTypeString(llm.Spec.Type)); err != nil {
return fmt.Errorf("set LIGHTSPEED_PROVIDER: %w", err)
}
if err := setEnvVar(tmpl, "LIGHTSPEED_MODEL", model); err != nil {
return fmt.Errorf("set LIGHTSPEED_MODEL: %w", err)
}
if err := addEnvFromSecret(tmpl, secretName); err != nil {
return fmt.Errorf("add credentials envFrom: %w", err)
}
if err := setEnvVar(tmpl, "ANTHROPIC_MODEL", model); err != nil {
return fmt.Errorf("set ANTHROPIC_MODEL: %w", err)
if err := addSecretVolume(tmpl, llmCredsVolumeName, secretName); err != nil {
return fmt.Errorf("add credentials volume: %w", err)
}

if u := providerURL(llm); u != "" {
if err := setEnvVar(tmpl, providerURLEnvVar(llm.Spec.Type), u); err != nil {
return fmt.Errorf("set provider URL: %w", err)
}
if err := addVolumeMount(tmpl, llmCredsVolumeName, llmCredsMountPath, true); err != nil {
return fmt.Errorf("mount credentials: %w", err)
}

switch llm.Spec.Type {
case agenticv1alpha1.LLMProviderAnthropic:
if u := providerURL(llm); u != "" {
if err := setEnvVar(tmpl, "LIGHTSPEED_PROVIDER_URL", u); err != nil {
return fmt.Errorf("set LIGHTSPEED_PROVIDER_URL: %w", err)
}
}
case agenticv1alpha1.LLMProviderGoogleCloudVertex:
cfg := llm.Spec.GoogleCloudVertex
if err := setEnvVar(tmpl, "CLAUDE_CODE_USE_VERTEX", "1"); err != nil {
return fmt.Errorf("set CLAUDE_CODE_USE_VERTEX: %w", err)
if err := setEnvVar(tmpl, "LIGHTSPEED_MODEL_PROVIDER", strings.ToLower(string(cfg.ModelProvider))); err != nil {
return fmt.Errorf("set LIGHTSPEED_MODEL_PROVIDER: %w", err)
}
if err := setEnvVar(tmpl, "GCP_PROJECT", cfg.ProjectID); err != nil {
return fmt.Errorf("set GCP_PROJECT: %w", err)
if err := setEnvVar(tmpl, "LIGHTSPEED_PROVIDER_PROJECT", cfg.ProjectID); err != nil {
return fmt.Errorf("set LIGHTSPEED_PROVIDER_PROJECT: %w", err)
}
if err := setEnvVar(tmpl, "GCP_REGION", cfg.Region); err != nil {
return fmt.Errorf("set GCP_REGION: %w", err)
if err := setEnvVar(tmpl, "LIGHTSPEED_PROVIDER_REGION", cfg.Region); err != nil {
return fmt.Errorf("set LIGHTSPEED_PROVIDER_REGION: %w", err)
}
if err := setEnvVar(tmpl, "GOOGLE_APPLICATION_CREDENTIALS", vertexCredsMountPath+"/"+vertexCredsFileName); err != nil {
return fmt.Errorf("set GOOGLE_APPLICATION_CREDENTIALS: %w", err)
}
if err := addSecretVolume(tmpl, llmCredsVolumeName, secretName); err != nil {
return fmt.Errorf("add Vertex credentials volume: %w", err)
if u := providerURL(llm); u != "" {
if err := setEnvVar(tmpl, "LIGHTSPEED_PROVIDER_URL", u); err != nil {
return fmt.Errorf("set LIGHTSPEED_PROVIDER_URL: %w", err)
}
}
if err := addVolumeMount(tmpl, llmCredsVolumeName, vertexCredsMountPath, true); err != nil {
return fmt.Errorf("mount Vertex credentials: %w", err)
case agenticv1alpha1.LLMProviderOpenAI:
if u := providerURL(llm); u != "" {
if err := setEnvVar(tmpl, "LIGHTSPEED_PROVIDER_URL", u); err != nil {
return fmt.Errorf("set LIGHTSPEED_PROVIDER_URL: %w", err)
}
}
case agenticv1alpha1.LLMProviderAzureOpenAI:
cfg := llm.Spec.AzureOpenAI
if err := setEnvVar(tmpl, "AZURE_OPENAI_ENDPOINT", cfg.Endpoint); err != nil {
return fmt.Errorf("set AZURE_OPENAI_ENDPOINT: %w", err)
providerURLValue := cfg.Endpoint
if u := cfg.URL; u != "" {
providerURLValue = u
}
if err := setEnvVar(tmpl, "LIGHTSPEED_PROVIDER_URL", providerURLValue); err != nil {
return fmt.Errorf("set LIGHTSPEED_PROVIDER_URL: %w", err)
}
if cfg.APIVersion != "" {
if err := setEnvVar(tmpl, "AZURE_OPENAI_API_VERSION", cfg.APIVersion); err != nil {
return fmt.Errorf("set AZURE_OPENAI_API_VERSION: %w", err)
if err := setEnvVar(tmpl, "LIGHTSPEED_PROVIDER_API_VERSION", cfg.APIVersion); err != nil {
return fmt.Errorf("set LIGHTSPEED_PROVIDER_API_VERSION: %w", err)
}
}
case agenticv1alpha1.LLMProviderAWSBedrock:
cfg := llm.Spec.AWSBedrock
if err := setEnvVar(tmpl, "CLAUDE_CODE_USE_BEDROCK", "1"); err != nil {
return fmt.Errorf("set CLAUDE_CODE_USE_BEDROCK: %w", err)
if err := setEnvVar(tmpl, "LIGHTSPEED_PROVIDER_REGION", cfg.Region); err != nil {
return fmt.Errorf("set LIGHTSPEED_PROVIDER_REGION: %w", err)
}
if err := setEnvVar(tmpl, "AWS_REGION", cfg.Region); err != nil {
return fmt.Errorf("set AWS_REGION: %w", err)
if u := providerURL(llm); u != "" {
if err := setEnvVar(tmpl, "LIGHTSPEED_PROVIDER_URL", u); err != nil {
return fmt.Errorf("set LIGHTSPEED_PROVIDER_URL: %w", err)
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Use constant error labels for the new fmt.Errorf branches.

These added paths introduce new inline error strings ("set LIGHTSPEED_PROVIDER", "add credentials volume", etc.). The repo guideline for Go files requires defining the labels as constants and wrapping with fmt.Errorf("%s: %w", Err..., err) for consistent context.

As per coding guidelines, **/*.go: Define errors as constants using const ErrFoo = "…" and wrap them with fmt.Errorf("%s: %w", …) for context.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@controller/proposal/sandbox_templates.go` around lines 267 - 334, Replace
inline error message strings in the fmt.Errorf calls with package-level constant
labels and wrap the original error using fmt.Errorf("%s: %w", Err..., err); add
const declarations (e.g. ErrSetLightspeedProvider, ErrSetLightspeedModel,
ErrAddCredentialsEnvFrom, ErrAddCredentialsVolume, ErrMountCredentials,
ErrSetProviderURL, ErrSetModelProvider, ErrSetProviderProject,
ErrSetProviderRegion, ErrSetProviderAPIVersion) and update all occurrences in
the code that call setEnvVar, addEnvFromSecret, addSecretVolume, addVolumeMount
and the provider-specific branches to use fmt.Errorf("%s: %w", <const>, err)
instead of inline strings so the error labels are consistent with the repository
guideline.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Skipping — pre-existing pattern across sandbox_templates.go. All existing fmt.Errorf calls use inline strings. Extracting error constants for every wrapper would be a separate refactor touching the entire file, not scoped to this PR.

…(OLS-3200)

Fold envFrom check into assertCredentialMounts so all 6 provider tests
verify both envFrom and volume mount unconditionally.

Co-authored-by: Cursor <cursoragent@cursor.com>
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Jun 2, 2026

@onmete: all tests passed!

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants