I was trying to get the Istio resources working which do not specify their status fields but rather use x-kubernetes-preserve-unknown-fields. Currently kopium does not generate a XyzStatus struct for that but still adds a #[kube(status = "XyzStatus")] line to the spec struct which causes compile errors. This PR changes that so that the status line is only added if we have an actual status container and that container has members. In every other case, kopium does not generate a status struct and uses a BTreeMap instead which cannot be used in the #[kube(status = ...)] line.
I was trying to get the Istio resources working which do not specify their
status
fields but rather usex-kubernetes-preserve-unknown-fields
. Currently kopium does not generate aXyzStatus
struct for that but still adds a#[kube(status = "XyzStatus")]
line to thespec
struct which causes compile errors. This PR changes that so that the status line is only added if we have an actual status container and that container has members. In every other case, kopium does not generate a status struct and uses a BTreeMap instead which cannot be used in the#[kube(status = ...)]
line.I'm not entirely sure if this breaks anything else down the line, however I was able to generate &
cargo check
every custom resource in https://github.com/metio/kube-custom-resources-rs/pull/222 with this change.