From 5445604950a21f682f9f96275c671f2905df6e2a Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Fri, 8 May 2026 09:38:52 +0200 Subject: [PATCH 1/2] Document JSON configOverrides --- modules/concepts/pages/overrides.adoc | 69 ++++++++++++++++++++++++++- 1 file changed, 67 insertions(+), 2 deletions(-) diff --git a/modules/concepts/pages/overrides.adoc b/modules/concepts/pages/overrides.adoc index 2d3c4c5a2..0945afd59 100644 --- a/modules/concepts/pages/overrides.adoc +++ b/modules/concepts/pages/overrides.adoc @@ -51,13 +51,78 @@ spec: <4> `configOverride` on role group level, takes precedence over overrides at role level. The roles, as well as the configuration file and configuration settings available depend on the specific product. -All override property values must be strings. The properties will be formatted and escaped correctly into the file format used by the product, which is again product specific. -This can be a `.properities` file, XML, YAML or JSON. +This can be a `.properties` file, XML, or YAML. You can also set the property to an empty string (`my.property: ""`), which effectively disables the property the operator would write out normally. In case of a `.properties` file, this will show up as `my.property=` in the `.properties` file. +[#json-config-overrides] +=== JSON config overrides + +In some cases the product accepts a JSON file as a configuration file (e.g. the OpenPolicyAgent's `config.json`). +The above mentioned `Map` structure doesn't fit this, so there is a special mechanism for JSON config files. + +==== JSON Merge Patch (https://datatracker.ietf.org/doc/html/rfc7396[RFC 7386]) + +The `jsonMergePatch` is used best in case you want to make simple additions or changes to the config. + +[source,yaml] +---- +configOverrides: + config.json: + jsonMergePatch: + bundles: + authz: + polling: + min_delay_seconds: 3 +---- + +==== JSON Patch (https://datatracker.ietf.org/doc/html/rfc6902[RFC 6902]) + +The `jsonPatch` is more complicated than the `jsonMergePatch`, but offers more flexibility, e.g. to remove config items. + +[source,yaml] +---- +configOverrides: + config.json: + jsonPatches: + - '{"op": "test", "path": "/0/name", "value": "Andrew"}' + - '{"op": "add", "path": "/0/happy", "value": true}' + - '{"op": "remove", "path": "/0/birthDate"}' +---- + +==== User provided JSON + +As an escape hatch you can also provide your custom JSON config, which the operator will pass to the product. + +[source,yaml] +---- +configOverrides: + config.json: + userProvided: { + "myString": "test", + "myList": ["test"], + "myBool": true, + "my": {"nested.field.with.dots": 42} + } +---- + +Note: JSON is a valid subset of YAML, so you can inline JSON into YAML. +However, you can also use YAML syntax: + +[source,yaml] +---- +configOverrides: + config.json: + userProvided: + myString: test + myList: [test] + myBool: true + my: + nested.field.with.dots: 42 +---- + [#env-overrides] == Environment variable overrides From 0178dce1c56c34062004666fef424876fcc67ad2 Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Fri, 8 May 2026 10:26:07 +0200 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Lukas Krug --- modules/concepts/pages/overrides.adoc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/concepts/pages/overrides.adoc b/modules/concepts/pages/overrides.adoc index 0945afd59..97db60621 100644 --- a/modules/concepts/pages/overrides.adoc +++ b/modules/concepts/pages/overrides.adoc @@ -60,10 +60,10 @@ In case of a `.properties` file, this will show up as `my.property=` in the `.pr [#json-config-overrides] === JSON config overrides -In some cases the product accepts a JSON file as a configuration file (e.g. the OpenPolicyAgent's `config.json`). -The above mentioned `Map` structure doesn't fit this, so there is a special mechanism for JSON config files. +Some products accept JSON config files (e.g. Open Policy Agent's `config.json`). +The above mentioned `Map` structure doesn't fit this, so there is a special mechanism for these files. -==== JSON Merge Patch (https://datatracker.ietf.org/doc/html/rfc7396[RFC 7386]) +==== JSON Merge Patch (https://datatracker.ietf.org/doc/html/rfc7396[RFC 7396]) The `jsonMergePatch` is used best in case you want to make simple additions or changes to the config. @@ -108,7 +108,7 @@ configOverrides: } ---- -Note: JSON is a valid subset of YAML, so you can inline JSON into YAML. +NOTE: JSON is a valid subset of YAML, so you can inline JSON into YAML. However, you can also use YAML syntax: [source,yaml]