Skip to content

Commit a75fa14

Browse files
committed
fix: address review feedback
1 parent 1dc457d commit a75fa14

2 files changed

Lines changed: 13 additions & 8 deletions

File tree

docs/modules/opa/pages/usage-guide/configuration-environment-overrides.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ This will lead to faulty installations.
88

99
== Configuration properties
1010

11-
OPA's `config.json` can be overridden using `configOverrides`, the supported override strategies are `jsonMergePatch` (RFC 7396) and `jsonPatches` (RFC 6902).
11+
OPA's `config.json` can be overridden using `configOverrides`.
12+
For details on the supported override strategies, see the xref:concepts:overrides.adoc#config-overrides[config overrides documentation].
1213

1314
For example per role group:
1415

rust/operator-binary/src/controller.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,22 +1230,26 @@ fn build_config_file(
12301230

12311231
let config = OpaClusterConfigFile::new(decision_logging);
12321232

1233-
let mut config_value = serde_json::to_value(&config).context(SerializeConfigFileSnafu {
1234-
file: CONFIG_FILE.to_string(),
1235-
})?;
1233+
let mut config_value =
1234+
serde_json::to_value(&config).with_context(|_| SerializeConfigFileSnafu {
1235+
file: CONFIG_FILE.to_string(),
1236+
})?;
12361237

12371238
// Apply role-level overrides first, then rolegroup-level on top.
12381239
// This way rolegroup settings take precedence over role settings.
12391240
for overrides in [role_config_override, rolegroup_config_override]
12401241
.into_iter()
12411242
.flatten()
12421243
{
1243-
config_value = overrides.apply(&config_value).context(ApplyConfigOverridesSnafu {
1244-
file: CONFIG_FILE.to_string(),
1245-
})?;
1244+
config_value =
1245+
overrides
1246+
.apply(&config_value)
1247+
.with_context(|_| ApplyConfigOverridesSnafu {
1248+
file: CONFIG_FILE.to_string(),
1249+
})?;
12461250
}
12471251

1248-
serde_json::to_string_pretty(&config_value).context(SerializeConfigFileSnafu {
1252+
serde_json::to_string_pretty(&config_value).with_context(|_| SerializeConfigFileSnafu {
12491253
file: CONFIG_FILE.to_string(),
12501254
})
12511255
}

0 commit comments

Comments
 (0)