You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
unfortunately, the only way we can do it atm AFAIKT is to require Serialize + Deserialize, then use the serde derives to parse the object as yaml/json, then safely try to check if the path .spec.conditions path exists and contains an object with cont[r#type] == condition and return true if condition + path exists and cond[r#type].status == required_value.
long term though, i think we could do a trait from codegen like HasConditions: HasSpec (we already have HasSpec and HasStatus) that lets you reach into that path and get a vector of maps because then we could use that trait and not have to do a pointless serialize+deserialize.
we could do the simple hack as a stop-gap, but we could also do a trait for it already in kube-core. wdyt?
The text was updated successfully, but these errors were encountered:
clux
added
question
Direction unclear; possibly a bug, possibly could be improved.
runtime
controller runtime related
core
generic apimachinery style work
labels
Oct 24, 2021
would like to have a generic helper to the
conditions
module so we don't have to special case every condition matching thing in there. something like:unfortunately, the only way we can do it atm AFAIKT is to require
Serialize + Deserialize
, then use the serde derives to parse the object as yaml/json, then safely try to check if the path.spec.conditions
path exists and contains an object withcont[r#type] == condition
and return true if condition + path exists andcond[r#type].status == required_value
.long term though, i think we could do a trait from codegen like
HasConditions: HasSpec
(we already haveHasSpec
andHasStatus
) that lets you reach into that path and get a vector of maps because then we could use that trait and not have to do a pointless serialize+deserialize.we could do the simple hack as a stop-gap, but we could also do a trait for it already in
kube-core
. wdyt?The text was updated successfully, but these errors were encountered: