Skip to content

Commit 79e0218

Browse files
committed
fix: remove obsolete errors & cleanup
1 parent df6b63b commit 79e0218

4 files changed

Lines changed: 16 additions & 34 deletions

File tree

rust/operator-binary/src/zk_controller.rs

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -774,35 +774,29 @@ fn build_server_rolegroup_statefulset(
774774
})
775775
.service_account_name(service_account.name_any());
776776

777-
if let Some(ContainerLogConfig {
777+
// Use the user-provided custom log ConfigMap if one is configured, otherwise fall back to the
778+
// rolegroup's own ConfigMap.
779+
let log_config_map = if let Some(ContainerLogConfig {
778780
choice:
779781
Some(ContainerLogConfigChoice::Custom(CustomContainerLogConfig {
780782
custom: ConfigMapLogConfig { config_map },
781783
})),
782784
}) = logging.containers.get(&v1alpha1::Container::Zookeeper)
783785
{
784-
pod_builder
785-
.add_volume(Volume {
786-
name: "log-config".to_string(),
787-
config_map: Some(ConfigMapVolumeSource {
788-
name: config_map.into(),
789-
..ConfigMapVolumeSource::default()
790-
}),
791-
..Volume::default()
792-
})
793-
.context(AddVolumeSnafu)?;
786+
config_map.into()
794787
} else {
795-
pod_builder
796-
.add_volume(Volume {
797-
name: "log-config".to_string(),
798-
config_map: Some(ConfigMapVolumeSource {
799-
name: rolegroup_ref.object_name(),
800-
..ConfigMapVolumeSource::default()
801-
}),
802-
..Volume::default()
803-
})
804-
.context(AddVolumeSnafu)?;
805-
}
788+
rolegroup_ref.object_name()
789+
};
790+
pod_builder
791+
.add_volume(Volume {
792+
name: "log-config".to_string(),
793+
config_map: Some(ConfigMapVolumeSource {
794+
name: log_config_map,
795+
..ConfigMapVolumeSource::default()
796+
}),
797+
..Volume::default()
798+
})
799+
.context(AddVolumeSnafu)?;
806800

807801
if logging.enable_vector_agent {
808802
match &zk.spec.cluster_config.vector_aggregator_config_map_name {

rust/operator-binary/src/zk_controller/build/discovery.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ pub enum Error {
3030
#[snafu(display("object has no namespace associated"))]
3131
NoNamespace,
3232

33-
#[snafu(display("failed to list expected pods"))]
34-
ExpectedPods { source: crate::crd::Error },
35-
3633
#[snafu(display("{listener} does not have a port with the name {port_name:?}"))]
3734
PortNotFound {
3835
port_name: String,

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ pub enum Error {
5050
#[snafu(display("failed to validate authentication classes"))]
5151
InvalidAuthenticationClassConfiguration { source: authentication::Error },
5252

53-
#[snafu(display("object defines no server role"))]
54-
NoServerRole,
55-
5653
#[snafu(display("failed to retrieve role {role:?}"))]
5754
MissingRole {
5855
source: crate::crd::Error,

rust/operator-binary/src/znode_controller.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,6 @@ pub enum Error {
6262
))]
6363
ObjectMissingMetadata,
6464

65-
#[snafu(display("could not find server role service name for {zk:?}"))]
66-
NoZkSvcName {
67-
zk: ObjectRef<v1alpha1::ZookeeperCluster>,
68-
},
69-
7065
#[snafu(display("could not find server role service for {zk:?}"))]
7166
FindZkSvc {
7267
source: stackable_operator::client::Error,
@@ -159,7 +154,6 @@ impl ReconcilerError for Error {
159154
Error::Dereference { .. } => None,
160155
Error::ValidateCluster { .. } => None,
161156
Error::ObjectMissingMetadata => None,
162-
Error::NoZkSvcName { zk } => Some(zk.clone().erase()),
163157
Error::FindZkSvc { zk, .. } => Some(zk.clone().erase()),
164158
Error::NoZkFqdn { zk } => Some(zk.clone().erase()),
165159
Error::EnsureZnode { zk, .. } => Some(zk.clone().erase()),

0 commit comments

Comments
 (0)