Creation fails when the CRD property is ServiceAccount #129392
Labels
kind/bug
Categorizes issue or PR as related to a bug.
needs-sig
Indicates an issue or PR lacks a `sig/foo` label and requires one.
needs-triage
Indicates an issue or PR lacks a `triage/foo` label and requires one.
What happened?
My CRD property use the ServiceAccount type, When I use
kubelet apply -f <crds>
to create CRDs generated by controller-gen, get an error message:This is because ServiceAccount.Secret.Name property is in x-kubernetes-list-map-keys, but it is not have a default and not be a required property.
Structure definition:
What did you expect to happen?
I expect to generate CRDs that can be created successfully.
Solutions:
//+default=""
and//+kubebuilder:default=""
) for ObjectReference.Name.How can we reproduce it (as minimally and precisely as possible)?
Refer to "What happened"
Anything else we need to know?
No response
Kubernetes version
v1.30+
Cloud provider
OS version
Install tools
Container runtime (CRI) and version (if applicable)
Related plugins (CNI, CSI, ...) and versions (if applicable)
The text was updated successfully, but these errors were encountered: