Skip to content

fix: Add ENV to product config machinery to fix env overrides #754

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,13 @@ All notable changes to this project will be documented in this file.
- BREAKING: The per-role server service is now prefixed with `-server` to be consistent with other operators ([#748]).
- The User info fetcher is no longer an experimental feature ([#752]).

### Fixed

- Fixed `envOverrides` not getting applied due to not being added to the product config machinery ([#754]).

[#748]: https://github.com/stackabletech/opa-operator/pull/748
[#752]: https://github.com/stackabletech/opa-operator/pull/752
[#754]: https://github.com/stackabletech/opa-operator/pull/754

## [25.7.0] - 2025-07-23

Expand Down
1 change: 1 addition & 0 deletions rust/operator-binary/src/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ pub async fn reconcile_opa(
(
vec![
PropertyNameKind::File(CONFIG_FILE.to_string()),
PropertyNameKind::Env,
PropertyNameKind::Cli,
],
opa.spec.servers.clone(),
Expand Down
6 changes: 5 additions & 1 deletion tests/templates/kuttl/smoke/10-install-opa.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,9 @@ spec:
config:
logging:
enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }}
envOverrides:
SERVER_ROLE_LEVEL_ENV_VAR: "SERVER_ROLE_LEVEL_ENV_VAR"
roleGroups:
default: {}
default:
envOverrides:
SERVER_ROLE_GROUP_LEVEL_ENV_VAR: "SERVER_ROLE_GROUP_LEVEL_ENV_VAR"
10 changes: 10 additions & 0 deletions tests/templates/kuttl/smoke/32-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
apiVersion: kuttl.dev/v1beta1
kind: TestAssert
metadata:
name: test-env-overrides
commands:
# Role level env var
- script: kubectl exec -n $NAMESPACE -c opa svc/test-opa-server -- env | grep SERVER_ROLE_LEVEL_ENV_VAR
# RoleGroup level env var
- script: kubectl exec -n $NAMESPACE -c opa svc/test-opa-server -- env | grep SERVER_ROLE_GROUP_LEVEL_ENV_VAR