4 ms·
Why order of fields is different? Example: https://kubespec.dev/apps/v1/Deployment https://kubespec.dev/apps/v1/Deployment https://kubernetes.io/docs/reference
by vbezhenar 2y ago
Why order of fields is different? Example:
https://kubespec.dev/apps/v1/Deployment https://kubespec.dev/apps/v1/Deployment
https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/deployment-v1/ https://kubernetes.io/docs/reference/kubernetes-api/workload...
minReadySeconds: integer
paused: boolean
progressDeadlineSeconds: integer
...
vs
selector
template
replicas
minReadySeconds
...
I'm very nitpicky about order of fields and I always follow kubernetes documentation order. Not sure where it really comes from, but generally it's good enough and better than alphabetical order (or inconsistent order).
- deleted 2y ago[deleted]
- mdaniel 2y ago> Not sure where it really comes from, It's almost certainly from the golang struct https://github.com/kubernetes/api/blob/v0.32.0/apps/v1/types.go#L376 https://github.com/kubernetes/api/blob/v0.32.0/apps/v1/types... or its more succinct generated.proto friend https://github.com/kubernetes/api/blob/v0.32.0/apps/v1/generated.proto#L271 https://github.com/kubernetes/api/blob/v0.32.0/apps/v1/gener... and, as you pointed out, the .dev one appears to just be alphabetical. In their defense, I would guess for humans that are looking for "paused" it's much easier to scan down to the "mnop" area and then look for "paused" than, lol, guess where the paused was introduced in the timeline of a golang struct