Skip to content

Commit 9690a92

Browse files
committed
chore: Add znode ref to error message
1 parent 7ade449 commit 9690a92

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

rust/operator-binary/src/znode_controller.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,10 @@ pub enum Error {
125125
#[snafu(display("failed to initialize security context"))]
126126
FailedToInitializeSecurityContext { source: crate::crd::security::Error },
127127

128-
#[snafu(display("OwnerRef missing expected keys (name and/or namespace)"))]
129-
OwnerRefMissingExpectedKeys {
128+
#[snafu(display("Znode {znode:?} missing expected keys (name and/or namespace)"))]
129+
ZnodeMissingExpectedKeys {
130130
source: stackable_operator::cluster_resources::Error,
131+
znode: ObjectRef<v1alpha1::ZookeeperZnode>,
131132
},
132133
}
133134
type Result<T, E = Error> = std::result::Result<T, E>;
@@ -177,7 +178,7 @@ impl ReconcilerError for Error {
177178
Error::DeleteOrphans { .. } => None,
178179
Error::ObjectHasNoNamespace => None,
179180
Error::FailedToInitializeSecurityContext { .. } => None,
180-
Error::OwnerRefMissingExpectedKeys { .. } => None,
181+
Error::ZnodeMissingExpectedKeys { .. } => None,
181182
}
182183
}
183184
}
@@ -280,7 +281,7 @@ async fn reconcile_apply(
280281
&znode.object_ref(&()),
281282
ClusterResourceApplyStrategy::from(&zk.spec.cluster_operation),
282283
)
283-
.context(OwnerRefMissingExpectedKeysSnafu)?;
284+
.context(ZnodeMissingExpectedKeysSnafu { znode })?;
284285

285286
znode_mgmt::ensure_znode_exists(
286287
&zk_mgmt_addr(&zk, &zookeeper_security, &client.kubernetes_cluster_info)?,

0 commit comments

Comments
 (0)