Closed clux closed 3 years ago
As best I can tell, this corresponds to the first invocation of serialize_field
in:
impl serde::Serialize for CustomResourceDefinition {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
let mut state = serializer.serialize_struct(
<Self as crate::Resource>::KIND,
4 + self.status.as_ref().map_or(0, |_| 1),
)?;
serde::ser::SerializeStruct::serialize_field(
&mut state,
"apiVersion",
<Self as crate::Resource>::API_VERSION,
)?;
serde::ser::SerializeStruct::serialize_field(
&mut state,
"kind",
<Self as crate::Resource>::KIND,
)?;
serde::ser::SerializeStruct::serialize_field(&mut state, "metadata", &self.metadata)?;
serde::ser::SerializeStruct::serialize_field(&mut state, "spec", &self.spec)?;
if let Some(value) = &self.status {
serde::ser::SerializeStruct::serialize_field(&mut state, "status", value)?;
}
serde::ser::SerializeStruct::end(state)
}
}
It's from a rustc change that cracked done on some misuses of std::mem::uninitialized
. Update your linked-hash-map dep to v0.5.3 so that it has https://github.com/contain-rs/linked-hash-map/commit/da9e3fb458d1a0f383b033ea41bdb466e3d96805 and https://github.com/contain-rs/linked-hash-map/commit/df65b33f8a9dbd06b95b0a6af7521f0d47233545 It's not related to k8s-openapi
Ah. Sorry! Thank you.
cargo upgrade serde_yaml
fixed it.
When creating a v1
CustomResourcDefinition
, and using k8s-openapi's serialize impls to create yaml via serde_yaml, we get a crash.toml:
code:
Backtrace
( Downstream issue https://github.com/clux/kube-rs/issues/349 )
The json serialization is fine, but the yaml one always seem to fail after upgrading to 0.10. This worked in 0.9.