Skip to content

Commit 09388a5

Browse files
committed
refactor: drop cluster info from validate call
1 parent e7051c6 commit 09388a5

2 files changed

Lines changed: 1 addition & 14 deletions

File tree

rust/operator-binary/src/controller.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,6 @@ pub async fn reconcile_hive(
487487
let validated_cluster = validate::validate_cluster(
488488
hive,
489489
&ctx.operator_environment.image_repository,
490-
&client.kubernetes_cluster_info,
491490
dereferenced_objects,
492491
)
493492
.context(ValidateSnafu)?;
@@ -667,10 +666,7 @@ pub fn error_policy(
667666

668667
#[cfg(test)]
669668
pub(crate) mod test_support {
670-
use stackable_operator::{
671-
commons::networking::DomainName,
672-
utils::{cluster_info::KubernetesClusterInfo, yaml_from_str_singleton_map},
673-
};
669+
use stackable_operator::utils::yaml_from_str_singleton_map;
674670

675671
use super::{ValidatedCluster, dereference::DereferencedObjects, validate::validate_cluster};
676672
use crate::crd::v1alpha1;
@@ -701,18 +697,11 @@ pub(crate) mod test_support {
701697
yaml_from_str_singleton_map(yaml).expect("invalid test HiveCluster YAML")
702698
}
703699

704-
pub fn cluster_info() -> KubernetesClusterInfo {
705-
KubernetesClusterInfo {
706-
cluster_domain: DomainName::try_from("cluster.local").expect("valid domain"),
707-
}
708-
}
709-
710700
/// Runs the real validate step against a minimal (S3/OPA-free) fixture.
711701
pub fn validated_cluster(hive: &v1alpha1::HiveCluster) -> ValidatedCluster {
712702
validate_cluster(
713703
hive,
714704
"oci.example.org",
715-
&cluster_info(),
716705
DereferencedObjects {
717706
s3_connection_spec: None,
718707
hive_opa_config: None,

rust/operator-binary/src/controller/validate.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use stackable_operator::{
66
config::fragment,
77
product_logging::spec::Logging,
88
role_utils::GenericRoleConfig,
9-
utils::cluster_info::KubernetesClusterInfo,
109
v2::{
1110
builder::pod::container::{self, EnvVarName, EnvVarSet},
1211
controller_utils::{get_cluster_name, get_namespace, get_uid},
@@ -136,7 +135,6 @@ fn validate_logging(
136135
pub fn validate_cluster(
137136
hive: &v1alpha1::HiveCluster,
138137
image_repository: &str,
139-
cluster_info: &KubernetesClusterInfo,
140138
dereferenced_objects: DereferencedObjects,
141139
) -> Result<ValidatedCluster, Error> {
142140
let name = get_cluster_name(hive).context(ResolveClusterNameSnafu)?;

0 commit comments

Comments
 (0)