Skip to content

Add support for operator environment variables#215

Open
porridge wants to merge 1 commit into
mainfrom
operator-env-vars
Open

Add support for operator environment variables#215
porridge wants to merge 1 commit into
mainfrom
operator-env-vars

Conversation

@porridge

@porridge porridge commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add --operator-env KEY=VALUE CLI flag for setting env vars on the operator deployment
  • Support via YAML config file under operator.envVars map
  • Non-OLM path: injects env vars into the manager container of the CSV-derived deployment
  • OLM path: sets spec.config.env on the Subscription so OLM propagates to the deployment
  • Useful for overriding RELATED_IMAGE_* variables to test with custom-built component images, in particular to support custom images in stackrox "infra" service.

Usage

# CLI flag (repeatable, comma-separated)
roxie deploy --operator-env RELATED_IMAGE_MAIN=quay.io/rhacs-eng/main:4.7.0
roxie deploy --operator-env RELATED_IMAGE_MAIN=...,RELATED_IMAGE_SCANNER=...

# YAML config file
operator:
  envVars:
    RELATED_IMAGE_MAIN: quay.io/rhacs-eng/main:4.7.0
    RELATED_IMAGE_SCANNER: quay.io/rhacs-eng/scanner:4.7.0

Test plan

  • Unit tests for ParseOperatorEnvVars — valid pairs, comma-separated, missing =, empty key, duplicates
  • Unit test for operatorEnvVarsToSortedList — sort order
  • CLI flag tests — single, comma-separated, multiple flags
  • Config file test — YAML operator.envVars map
  • go build ./..., go test ./..., go vet ./... all pass

🤖 Generated with Claude Code

Allow overriding environment variables on the operator deployment,
useful for setting RELATED_IMAGE_* vars to test with custom-built
component images. Supports both non-OLM (direct injection into the
manager container) and OLM (via Subscription spec.config.env) paths.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

An error occurred during the review process. Please try again later.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch operator-env-vars

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

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.

1 participant