Skip to content

Commit aeabab4

Browse files
committed
fix: address review feedback
1 parent efe09f5 commit aeabab4

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
@@ -1237,22 +1237,26 @@ fn build_config_file(
12371237

12381238
let config = OpaClusterConfigFile::new(decision_logging);
12391239

1240-
let mut config_value = serde_json::to_value(&config).context(SerializeConfigFileSnafu {
1241-
file: CONFIG_FILE.to_string(),
1242-
})?;
1240+
let mut config_value =
1241+
serde_json::to_value(&config).with_context(|_| SerializeConfigFileSnafu {
1242+
file: CONFIG_FILE.to_string(),
1243+
})?;
12431244

12441245
// Apply role-level overrides first, then rolegroup-level on top.
12451246
// This way rolegroup settings take precedence over role settings.
12461247
for overrides in [role_config_override, rolegroup_config_override]
12471248
.into_iter()
12481249
.flatten()
12491250
{
1250-
config_value = overrides.apply(&config_value).context(ApplyConfigOverridesSnafu {
1251-
file: CONFIG_FILE.to_string(),
1252-
})?;
1251+
config_value =
1252+
overrides
1253+
.apply(&config_value)
1254+
.with_context(|_| ApplyConfigOverridesSnafu {
1255+
file: CONFIG_FILE.to_string(),
1256+
})?;
12531257
}
12541258

1255-
serde_json::to_string_pretty(&config_value).context(SerializeConfigFileSnafu {
1259+
serde_json::to_string_pretty(&config_value).with_context(|_| SerializeConfigFileSnafu {
12561260
file: CONFIG_FILE.to_string(),
12571261
})
12581262
}

0 commit comments

Comments
 (0)