kubernetes-sigs / cluster-api

Home for Cluster API, a subproject of sig-cluster-lifecycle
https://cluster-api.sigs.k8s.io
Apache License 2.0
3.6k stars 1.33k forks source link

Check API for optional vs required for next revision #10915

Open sivchari opened 4 months ago

sivchari commented 4 months ago

This issue is similar with https://github.com/kubernetes-sigs/cluster-api/issues/6416 I listed the fields that we should discuss about which the data type is better for each field for next revision.

I listed the field that is optional, but the type isn't pointer or that isn't optional, but the type is pointer. ref: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#optional-vs-required

They have the +optional comment tag in Go. They are a pointer type in the Go definition (e.g. AwesomeFlag *SomeFlag) or have a built-in nil value (e.g. maps and slices). The API server should allow POSTing and PUTing a resource with this field unset.

Sorry if this is too delicated for the community, but I think it should do it to be good stable API because.

Thanks.

ClusterSpec

ClusterStatus

ClusterClassSpec

ClusterClassStatus

MachineStatus

MachineDeploymentSpec

MachineDeploymentStatus

MachineHealthCheckStatus

MachineSetSpec

MachineSetStatus

KubeadmConfigSpec

KubeadmConfigStatus

KubeadmControlPlaneSpec

KubeadmControlPlaneStatus

KubeadmControlPlaneTemplateSpec

k8s-ci-robot commented 4 months ago

This issue is currently awaiting triage.

If CAPI contributors determine this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
fabriziopandini commented 4 months ago

We have to take a closer look Some time ago we even considered to implement a linter to enforce some rules about optional vs required. But first we need to figure out if the rules defined in API conventions apply to CRDs / To CAPI (we found some nuances in the past)

k8s-triage-robot commented 1 month ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot commented 1 day ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten