Skip to content

Commit 196c441

Browse files
fix: Add ENV to product config machinery to fix env overrides (#754)
* add env to product config * add changelog * check for role env var * Update CHANGELOG.md Co-authored-by: Sebastian Bernauer <[email protected]> --------- Co-authored-by: Sebastian Bernauer <[email protected]>
1 parent fa1cc76 commit 196c441

File tree

4 files changed

+21
-1
lines changed

4 files changed

+21
-1
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,13 @@ All notable changes to this project will be documented in this file.
1616
- BREAKING: The per-role server service is now prefixed with `-server` to be consistent with other operators ([#748]).
1717
- The User info fetcher is no longer an experimental feature ([#752]).
1818

19+
### Fixed
20+
21+
- Fixed `envOverrides` not getting applied due to not being added to the product config machinery ([#754]).
22+
1923
[#748]: https://github.com/stackabletech/opa-operator/pull/748
2024
[#752]: https://github.com/stackabletech/opa-operator/pull/752
25+
[#754]: https://github.com/stackabletech/opa-operator/pull/754
2126

2227
## [25.7.0] - 2025-07-23
2328

rust/operator-binary/src/controller.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,7 @@ pub async fn reconcile_opa(
449449
(
450450
vec![
451451
PropertyNameKind::File(CONFIG_FILE.to_string()),
452+
PropertyNameKind::Env,
452453
PropertyNameKind::Cli,
453454
],
454455
opa.spec.servers.clone(),

tests/templates/kuttl/smoke/10-install-opa.yaml.j2

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,9 @@ spec:
3838
config:
3939
logging:
4040
enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }}
41+
envOverrides:
42+
SERVER_ROLE_LEVEL_ENV_VAR: "SERVER_ROLE_LEVEL_ENV_VAR"
4143
roleGroups:
42-
default: {}
44+
default:
45+
envOverrides:
46+
SERVER_ROLE_GROUP_LEVEL_ENV_VAR: "SERVER_ROLE_GROUP_LEVEL_ENV_VAR"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
apiVersion: kuttl.dev/v1beta1
3+
kind: TestAssert
4+
metadata:
5+
name: test-env-overrides
6+
commands:
7+
# Role level env var
8+
- script: kubectl exec -n $NAMESPACE -c opa svc/test-opa-server -- env | grep SERVER_ROLE_LEVEL_ENV_VAR
9+
# RoleGroup level env var
10+
- script: kubectl exec -n $NAMESPACE -c opa svc/test-opa-server -- env | grep SERVER_ROLE_GROUP_LEVEL_ENV_VAR

0 commit comments

Comments
 (0)