Skip to content

Refactor godocs for API fields to start with the serialised versions #11238

@chrischdi

Description

@chrischdi

What would you like to be added (User Story)?

Godocs for api types in core k8s normally start with the serialised version for better readability in e.g. kubectl describe.

Example:

	// emptyDir represents a temporary directory that shares a pod's lifetime.
	// More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir
	// +optional
	EmptyDir *EmptyDirVolumeSource `json:"emptyDir,omitempty" protobuf:"bytes,2,opt,name=emptyDir"`

Source: https://github.com/kubernetes/api/blob/master/core/v1/types.go#L60-L63

This issue tracks refactoring all relevant godocs of our API types.

Maybe there could also be a linter to enforce this.

Detailed Description

I can't see it explicitly called out in the API conventions from upstream, but, take a look at the godoc across the core types (and I know the upstream API reviewers enforce this from experience), kubernetes/api@master/core/v1/types.go, all of the godocs on fields start with the json tag version of the field name, so that when docs are generated, they represent the serialised versions of the strings

[0]

Anything else you would like to add?

xref: Discussion at #11166 (comment)

Label(s) to be applied

/kind api

Metadata

Metadata

Assignees

Labels

help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/cleanupCategorizes issue or PR as related to cleaning up code, process, or technical debt.priority/backlogHigher priority than priority/awaiting-more-evidence.triage/acceptedIndicates an issue or PR is ready to be actively worked on.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions