Skip to content

Commit f3a78a3

Browse files
committed
Revert "refactor: Use cfg!"
This reverts commit 1e0cde4. It failed compilation, as it always compiles both branches, which fails when the crds feature is not enabled.
1 parent 00cfe1c commit f3a78a3

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

crates/stackable-operator/src/cluster_resources.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -671,16 +671,11 @@ impl<'a> ClusterResources<'a> {
671671
/// * `client` - The client which is used to access Kubernetes
672672
pub async fn delete_orphaned_resources(self, client: &Client) -> Result<()> {
673673
// We can only delete Listeners in case the "crds" feature is enabled, otherwise it's a NOP.
674-
let delete_listeners = async {
675-
if cfg!(feature = "crds") {
676-
self.delete_orphaned_resources_of_kind::<crate::crd::listener::v1alpha1::Listener>(
677-
client,
678-
)
679-
.await
680-
} else {
681-
Ok(())
682-
}
683-
};
674+
#[cfg(feature = "crds")]
675+
let delete_listeners = self
676+
.delete_orphaned_resources_of_kind::<crate::crd::listener::v1alpha1::Listener>(client);
677+
#[cfg(not(feature = "crds"))]
678+
let delete_listeners = async { Ok(()) };
684679

685680
tokio::try_join!(
686681
self.delete_orphaned_resources_of_kind::<Service>(client),

0 commit comments

Comments
 (0)