diff --git a/CHANGELOG.md b/CHANGELOG.md index e0e81585..1644d6bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/rust/operator-binary/src/controller.rs b/rust/operator-binary/src/controller.rs index 0c6f0384..d0f97a90 100644 --- a/rust/operator-binary/src/controller.rs +++ b/rust/operator-binary/src/controller.rs @@ -449,6 +449,7 @@ pub async fn reconcile_opa( ( vec![ PropertyNameKind::File(CONFIG_FILE.to_string()), + PropertyNameKind::Env, PropertyNameKind::Cli, ], opa.spec.servers.clone(), diff --git a/tests/templates/kuttl/smoke/10-install-opa.yaml.j2 b/tests/templates/kuttl/smoke/10-install-opa.yaml.j2 index 78b443bb..25d5aa57 100644 --- a/tests/templates/kuttl/smoke/10-install-opa.yaml.j2 +++ b/tests/templates/kuttl/smoke/10-install-opa.yaml.j2 @@ -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" diff --git a/tests/templates/kuttl/smoke/32-assert.yaml b/tests/templates/kuttl/smoke/32-assert.yaml new file mode 100644 index 00000000..f6044238 --- /dev/null +++ b/tests/templates/kuttl/smoke/32-assert.yaml @@ -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