Skip to content

Commit f436d17

Browse files
maltesanderclaude
andcommitted
refactor: Remove the product-config dependency
Drop the now-dead `impl Configuration for OpaConfigFragment` and `impl KeyValueOverridesProvider for OpaConfigOverrides` (both no-ops kept only to satisfy the product-config pipeline, which is no longer used), and remove the `product-config` crate from the workspace and operator-binary manifests. OPA never derived real config from product-config, so nothing is lost. The empty `deploy/config-spec/properties.yaml` is kept (it is still mounted by the Docker image and Helm chart) and normalized to match the other operators. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 0a3e135 commit f436d17

5 files changed

Lines changed: 2 additions & 45 deletions

File tree

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ edition = "2021"
1010
repository = "https://github.com/stackabletech/opa-operator"
1111

1212
[workspace.dependencies]
13-
product-config = { git = "https://github.com/stackabletech/product-config.git", tag = "0.8.0" }
1413
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", rev = "57d8d1270016fdbe159fdf39b60cd02b465935af", features = ["webhook"] }
1514
krb5 = { git = "https://github.com/stackabletech/krb5-rs.git", tag = "v0.1.0" }
1615

deploy/config-spec/properties.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
---
12
version: 0.1.0
23
spec:
34
units: []
4-
55
properties: []

rust/operator-binary/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ repository.workspace = true
99
publish = false
1010

1111
[dependencies]
12-
product-config.workspace = true
1312
stackable-operator.workspace = true
1413

1514
anyhow.workspace = true

rust/operator-binary/src/crd/mod.rs

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{collections::BTreeMap, str::FromStr};
1+
use std::str::FromStr;
22

33
use serde::{Deserialize, Serialize};
44
use snafu::{OptionExt, ResultExt, Snafu};
@@ -16,11 +16,9 @@ use stackable_operator::{
1616
fragment::{self, Fragment, ValidationError},
1717
merge::Merge,
1818
},
19-
config_overrides::KeyValueOverridesProvider,
2019
deep_merger::ObjectOverrides,
2120
k8s_openapi::apimachinery::pkg::api::resource::Quantity,
2221
kube::{CustomResource, ResourceExt},
23-
product_config_utils::Configuration,
2422
product_logging::{self, spec::Logging},
2523
role_utils::{EmptyRoleConfig, GenericCommonConfig, Role, RoleGroup, RoleGroupRef},
2624
schemars::{self, JsonSchema},
@@ -181,12 +179,6 @@ pub struct OpaConfigOverrides {
181179
pub config_json: JsonOrKeyValueConfigOverrides,
182180
}
183181

184-
// OPA has no key-value config files, all overrides go through JsonConfigOverrides.
185-
// This impl is still required because the shared product config pipeline
186-
// (`transform_all_roles_to_config`) requires the `KeyValueOverridesProvider` bound
187-
// at compile time. The default implementation returns an empty map.
188-
impl KeyValueOverridesProvider for OpaConfigOverrides {}
189-
190182
#[allow(clippy::derive_partial_eq_without_eq)]
191183
#[derive(Clone, Debug, Default, Fragment, JsonSchema, PartialEq)]
192184
#[fragment_attrs(
@@ -330,38 +322,6 @@ impl OpaConfig {
330322
}
331323
}
332324

333-
impl Configuration for OpaConfigFragment {
334-
type Configurable = v1alpha2::OpaCluster;
335-
336-
fn compute_env(
337-
&self,
338-
_resource: &Self::Configurable,
339-
_role_name: &str,
340-
) -> Result<BTreeMap<String, Option<String>>, stackable_operator::product_config_utils::Error>
341-
{
342-
Ok(BTreeMap::new())
343-
}
344-
345-
fn compute_cli(
346-
&self,
347-
_resource: &Self::Configurable,
348-
_role_name: &str,
349-
) -> Result<BTreeMap<String, Option<String>>, stackable_operator::product_config_utils::Error>
350-
{
351-
Ok(BTreeMap::new())
352-
}
353-
354-
fn compute_files(
355-
&self,
356-
_resource: &Self::Configurable,
357-
_role_name: &str,
358-
_file: &str,
359-
) -> Result<BTreeMap<String, Option<String>>, stackable_operator::product_config_utils::Error>
360-
{
361-
Ok(BTreeMap::new())
362-
}
363-
}
364-
365325
impl v1alpha2::OpaCluster {
366326
/// Returns a reference to the role.
367327
pub fn role(&self, role_variant: &OpaRole) -> &OpaRoleType {

0 commit comments

Comments
 (0)