Current and expected behavior
A kube derived CRD spec using say;
#[derive(CustomResource, Deserialize, Serialize, Clone, Debug, JsonSchema)]
#[kube(kind = "Document", group = "kube.rs", version = "v1", namespaced)]
#[kube(status = "DocumentStatus")]
pub struct DocumentSpec {
pub title: String,
}
injects the following .spec properties (outside the schema):
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: documents.kube.rs
spec:
group: kube.rs
names:
categories: []
kind: Document
plural: documents
shortNames: []
singular: document
scope: Namespaced
versions:
- additionalPrinterColumns: []
name: v1
schema: BIGBLOB_NOT_RELEVANT_HERE
in particular
.spec.names.categories and .spec.names.shortNames and .spec.versions[].additionalPrinterColumn are set even without us explicitly setting the corresponding kube attributes for printcolumn, shortname, nor category.
This is a violation of the spec for CRDs;
Possible solution
Only emit these vectors when they are non-empty. If there are no values in our internal code we have never called any of the attributes and so they should be treated as unset rather than explicit empty.
Additional context
See #1678
Affected crates
kube-derive
Would you like to work on fixing this bug?
maybe
Current and expected behavior
A kube derived CRD spec using say;
injects the following
.specproperties (outside the schema):in particular
.spec.names.categoriesand.spec.names.shortNamesand.spec.versions[].additionalPrinterColumnare set even without us explicitly setting the corresponding kube attributes for printcolumn, shortname, nor category.This is a violation of the spec for CRDs;
.spec.names.spec.versions[]Possible solution
Only emit these vectors when they are non-empty. If there are no values in our internal code we have never called any of the attributes and so they should be treated as unset rather than explicit empty.
Additional context
See #1678
Affected crates
kube-derive
Would you like to work on fixing this bug?
maybe