Skip to content

Commit 9f5a94e

Browse files
authored
Merge pull request #11273 from tsuzu/fix-godoc-comment-prefix
🌱 Refactor godoc for API fields starting with field names
2 parents 1d1118f + f3d3974 commit 9f5a94e

File tree

88 files changed

+3619
-3618
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+3619
-3618
lines changed

api/v1beta1/cluster_types.go

+54-54
Large diffs are not rendered by default.

api/v1beta1/clusterclass_types.go

+119-119
Large diffs are not rendered by default.

api/v1beta1/common_types.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ type ObjectMeta struct {
312312
// +optional
313313
Labels map[string]string `json:"labels,omitempty"`
314314

315-
// Annotations is an unstructured key value map stored with a resource that may be
315+
// annotations is an unstructured key value map stored with a resource that may be
316316
// set by external tools to store and retrieve arbitrary metadata. They are not
317317
// queryable and should be preserved when modifying objects.
318318
// More info: http://kubernetes.io/docs/user-guide/annotations

api/v1beta1/condition_types.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@ type ConditionType string
5353

5454
// Condition defines an observation of a Cluster API resource operational state.
5555
type Condition struct {
56-
// Type of condition in CamelCase or in foo.example.com/CamelCase.
56+
// type of condition in CamelCase or in foo.example.com/CamelCase.
5757
// Many .condition.type values are consistent across resources like Available, but because arbitrary conditions
5858
// can be useful (see .node.status.conditions), the ability to deconflict is important.
5959
Type ConditionType `json:"type"`
6060

61-
// Status of the condition, one of True, False, Unknown.
61+
// status of the condition, one of True, False, Unknown.
6262
Status corev1.ConditionStatus `json:"status"`
6363

64-
// Severity provides an explicit classification of Reason code, so the users or machines can immediately
64+
// severity provides an explicit classification of Reason code, so the users or machines can immediately
6565
// understand the current situation and act accordingly.
6666
// The Severity field MUST be set only when Status=False.
6767
// +optional

api/v1beta1/machine_types.go

+23-23
Original file line numberDiff line numberDiff line change
@@ -335,24 +335,24 @@ const (
335335

336336
// MachineSpec defines the desired state of Machine.
337337
type MachineSpec struct {
338-
// ClusterName is the name of the Cluster this object belongs to.
338+
// clusterName is the name of the Cluster this object belongs to.
339339
// +kubebuilder:validation:MinLength=1
340340
ClusterName string `json:"clusterName"`
341341

342-
// Bootstrap is a reference to a local struct which encapsulates
342+
// bootstrap is a reference to a local struct which encapsulates
343343
// fields to configure the Machine’s bootstrapping mechanism.
344344
Bootstrap Bootstrap `json:"bootstrap"`
345345

346-
// InfrastructureRef is a required reference to a custom resource
346+
// infrastructureRef is a required reference to a custom resource
347347
// offered by an infrastructure provider.
348348
InfrastructureRef corev1.ObjectReference `json:"infrastructureRef"`
349349

350-
// Version defines the desired Kubernetes version.
350+
// version defines the desired Kubernetes version.
351351
// This field is meant to be optionally used by bootstrap providers.
352352
// +optional
353353
Version *string `json:"version,omitempty"`
354354

355-
// ProviderID is the identification ID of the machine provided by the provider.
355+
// providerID is the identification ID of the machine provided by the provider.
356356
// This field must match the provider ID as seen on the node object corresponding to this machine.
357357
// This field is required by higher level consumers of cluster-api. Example use case is cluster autoscaler
358358
// with cluster-api as provider. Clean-up logic in the autoscaler compares machines to nodes to find out
@@ -365,7 +365,7 @@ type MachineSpec struct {
365365
// +optional
366366
ProviderID *string `json:"providerID,omitempty"`
367367

368-
// FailureDomain is the failure domain the machine will be created in.
368+
// failureDomain is the failure domain the machine will be created in.
369369
// Must match a key in the FailureDomains map stored on the cluster object.
370370
// +optional
371371
FailureDomain *string `json:"failureDomain,omitempty"`
@@ -394,18 +394,18 @@ type MachineSpec struct {
394394
// +kubebuilder:validation:MaxItems=32
395395
ReadinessGates []MachineReadinessGate `json:"readinessGates,omitempty"`
396396

397-
// NodeDrainTimeout is the total amount of time that the controller will spend on draining a node.
397+
// nodeDrainTimeout is the total amount of time that the controller will spend on draining a node.
398398
// The default value is 0, meaning that the node can be drained without any time limitations.
399399
// NOTE: NodeDrainTimeout is different from `kubectl drain --timeout`
400400
// +optional
401401
NodeDrainTimeout *metav1.Duration `json:"nodeDrainTimeout,omitempty"`
402402

403-
// NodeVolumeDetachTimeout is the total amount of time that the controller will spend on waiting for all volumes
403+
// nodeVolumeDetachTimeout is the total amount of time that the controller will spend on waiting for all volumes
404404
// to be detached. The default value is 0, meaning that the volumes can be detached without any time limitations.
405405
// +optional
406406
NodeVolumeDetachTimeout *metav1.Duration `json:"nodeVolumeDetachTimeout,omitempty"`
407407

408-
// NodeDeletionTimeout defines how long the controller will attempt to delete the Node that the Machine
408+
// nodeDeletionTimeout defines how long the controller will attempt to delete the Node that the Machine
409409
// hosts after the Machine is marked for deletion. A duration of 0 will retry deletion indefinitely.
410410
// Defaults to 10 seconds.
411411
// +optional
@@ -430,20 +430,20 @@ type MachineReadinessGate struct {
430430

431431
// MachineStatus defines the observed state of Machine.
432432
type MachineStatus struct {
433-
// NodeRef will point to the corresponding Node if it exists.
433+
// nodeRef will point to the corresponding Node if it exists.
434434
// +optional
435435
NodeRef *corev1.ObjectReference `json:"nodeRef,omitempty"`
436436

437-
// NodeInfo is a set of ids/uuids to uniquely identify the node.
437+
// nodeInfo is a set of ids/uuids to uniquely identify the node.
438438
// More info: https://kubernetes.io/docs/concepts/nodes/node/#info
439439
// +optional
440440
NodeInfo *corev1.NodeSystemInfo `json:"nodeInfo,omitempty"`
441441

442-
// LastUpdated identifies when the phase of the Machine last transitioned.
442+
// lastUpdated identifies when the phase of the Machine last transitioned.
443443
// +optional
444444
LastUpdated *metav1.Time `json:"lastUpdated,omitempty"`
445445

446-
// FailureReason will be set in the event that there is a terminal problem
446+
// failureReason will be set in the event that there is a terminal problem
447447
// reconciling the Machine and will contain a succinct value suitable
448448
// for machine interpretation.
449449
//
@@ -465,7 +465,7 @@ type MachineStatus struct {
465465
// +optional
466466
FailureReason *capierrors.MachineStatusError `json:"failureReason,omitempty"`
467467

468-
// FailureMessage will be set in the event that there is a terminal problem
468+
// failureMessage will be set in the event that there is a terminal problem
469469
// reconciling the Machine and will contain a more verbose string suitable
470470
// for logging and human consumption.
471471
//
@@ -487,34 +487,34 @@ type MachineStatus struct {
487487
// +optional
488488
FailureMessage *string `json:"failureMessage,omitempty"`
489489

490-
// Addresses is a list of addresses assigned to the machine.
490+
// addresses is a list of addresses assigned to the machine.
491491
// This field is copied from the infrastructure provider reference.
492492
// +optional
493493
Addresses MachineAddresses `json:"addresses,omitempty"`
494494

495-
// Phase represents the current phase of machine actuation.
495+
// phase represents the current phase of machine actuation.
496496
// E.g. Pending, Running, Terminating, Failed etc.
497497
// +optional
498498
Phase string `json:"phase,omitempty"`
499499

500-
// CertificatesExpiryDate is the expiry date of the machine certificates.
500+
// certificatesExpiryDate is the expiry date of the machine certificates.
501501
// This value is only set for control plane machines.
502502
// +optional
503503
CertificatesExpiryDate *metav1.Time `json:"certificatesExpiryDate,omitempty"`
504504

505-
// BootstrapReady is the state of the bootstrap provider.
505+
// bootstrapReady is the state of the bootstrap provider.
506506
// +optional
507507
BootstrapReady bool `json:"bootstrapReady"`
508508

509-
// InfrastructureReady is the state of the infrastructure provider.
509+
// infrastructureReady is the state of the infrastructure provider.
510510
// +optional
511511
InfrastructureReady bool `json:"infrastructureReady"`
512512

513-
// ObservedGeneration is the latest generation observed by the controller.
513+
// observedGeneration is the latest generation observed by the controller.
514514
// +optional
515515
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
516516

517-
// Conditions defines current service state of the Machine.
517+
// conditions defines current service state of the Machine.
518518
// +optional
519519
Conditions Conditions `json:"conditions,omitempty"`
520520

@@ -590,14 +590,14 @@ func (m *MachineStatus) GetTypedPhase() MachinePhase {
590590

591591
// Bootstrap encapsulates fields to configure the Machine’s bootstrapping mechanism.
592592
type Bootstrap struct {
593-
// ConfigRef is a reference to a bootstrap provider-specific resource
593+
// configRef is a reference to a bootstrap provider-specific resource
594594
// that holds configuration details. The reference is optional to
595595
// allow users/operators to specify Bootstrap.DataSecretName without
596596
// the need of a controller.
597597
// +optional
598598
ConfigRef *corev1.ObjectReference `json:"configRef,omitempty"`
599599

600-
// DataSecretName is the name of the secret that stores the bootstrap data script.
600+
// dataSecretName is the name of the secret that stores the bootstrap data script.
601601
// If nil, the Machine should remain in the Pending state.
602602
// +optional
603603
DataSecretName *string `json:"dataSecretName,omitempty"`

api/v1beta1/machinedeployment_types.go

+11-11
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ const (
204204

205205
// MachineDeploymentSpec defines the desired state of MachineDeployment.
206206
type MachineDeploymentSpec struct {
207-
// ClusterName is the name of the Cluster this object belongs to.
207+
// clusterName is the name of the Cluster this object belongs to.
208208
// +kubebuilder:validation:MinLength=1
209209
ClusterName string `json:"clusterName"`
210210

@@ -228,7 +228,7 @@ type MachineDeploymentSpec struct {
228228
// +optional
229229
Replicas *int32 `json:"replicas,omitempty"`
230230

231-
// RolloutAfter is a field to indicate a rollout should be performed
231+
// rolloutAfter is a field to indicate a rollout should be performed
232232
// after the specified time even if no changes have been made to the
233233
// MachineDeployment.
234234
// Example: In the YAML the time can be specified in the RFC3339 format.
@@ -242,15 +242,15 @@ type MachineDeploymentSpec struct {
242242
// It must match the machine template's labels.
243243
Selector metav1.LabelSelector `json:"selector"`
244244

245-
// Template describes the machines that will be created.
245+
// template describes the machines that will be created.
246246
Template MachineTemplateSpec `json:"template"`
247247

248248
// The deployment strategy to use to replace existing machines with
249249
// new ones.
250250
// +optional
251251
Strategy *MachineDeploymentStrategy `json:"strategy,omitempty"`
252252

253-
// MinReadySeconds is the minimum number of seconds for which a Node for a newly created machine should be ready before considering the replica available.
253+
// minReadySeconds is the minimum number of seconds for which a Node for a newly created machine should be ready before considering the replica available.
254254
// Defaults to 0 (machine will be considered available as soon as the Node is ready)
255255
// +optional
256256
MinReadySeconds *int32 `json:"minReadySeconds,omitempty"`
@@ -284,7 +284,7 @@ type MachineDeploymentSpec struct {
284284
// MachineDeploymentStrategy describes how to replace existing machines
285285
// with new ones.
286286
type MachineDeploymentStrategy struct {
287-
// Type of deployment. Allowed values are RollingUpdate and OnDelete.
287+
// type of deployment. Allowed values are RollingUpdate and OnDelete.
288288
// The default is RollingUpdate.
289289
// +kubebuilder:validation:Enum=RollingUpdate;OnDelete
290290
// +optional
@@ -295,7 +295,7 @@ type MachineDeploymentStrategy struct {
295295
// +optional
296296
RollingUpdate *MachineRollingUpdateDeployment `json:"rollingUpdate,omitempty"`
297297

298-
// Remediation controls the strategy of remediating unhealthy machines
298+
// remediation controls the strategy of remediating unhealthy machines
299299
// and how remediating operations should occur during the lifecycle of the dependant MachineSets.
300300
// +optional
301301
Remediation *RemediationStrategy `json:"remediation,omitempty"`
@@ -338,7 +338,7 @@ type MachineRollingUpdateDeployment struct {
338338
// +optional
339339
MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty"`
340340

341-
// DeletePolicy defines the policy used by the MachineDeployment to identify nodes to delete when downscaling.
341+
// deletePolicy defines the policy used by the MachineDeployment to identify nodes to delete when downscaling.
342342
// Valid values are "Random, "Newest", "Oldest"
343343
// When no value is supplied, the default DeletePolicy of MachineSet is used
344344
// +kubebuilder:validation:Enum=Random;Newest;Oldest
@@ -352,7 +352,7 @@ type MachineRollingUpdateDeployment struct {
352352

353353
// RemediationStrategy allows to define how the MachineSet can control scaling operations.
354354
type RemediationStrategy struct {
355-
// MaxInFlight determines how many in flight remediations should happen at the same time.
355+
// maxInFlight determines how many in flight remediations should happen at the same time.
356356
//
357357
// Remediation only happens on the MachineSet with the most current revision, while
358358
// older MachineSets (usually present during rollout operations) aren't allowed to remediate.
@@ -381,7 +381,7 @@ type MachineDeploymentStatus struct {
381381
// +optional
382382
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
383383

384-
// Selector is the same as the label selector but in the string format to avoid introspection
384+
// selector is the same as the label selector but in the string format to avoid introspection
385385
// by clients. The string will be in the same format as the query-param syntax.
386386
// More info about label selectors: http://kubernetes.io/docs/user-guide/labels#label-selectors
387387
// +optional
@@ -414,11 +414,11 @@ type MachineDeploymentStatus struct {
414414
// +optional
415415
UnavailableReplicas int32 `json:"unavailableReplicas"`
416416

417-
// Phase represents the current phase of a MachineDeployment (ScalingUp, ScalingDown, Running, Failed, or Unknown).
417+
// phase represents the current phase of a MachineDeployment (ScalingUp, ScalingDown, Running, Failed, or Unknown).
418418
// +optional
419419
Phase string `json:"phase,omitempty"`
420420

421-
// Conditions defines current service state of the MachineDeployment.
421+
// conditions defines current service state of the MachineDeployment.
422422
// +optional
423423
Conditions Conditions `json:"conditions,omitempty"`
424424

api/v1beta1/machinehealthcheck_types.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ var (
5151

5252
// MachineHealthCheckSpec defines the desired state of MachineHealthCheck.
5353
type MachineHealthCheckSpec struct {
54-
// ClusterName is the name of the Cluster this object belongs to.
54+
// clusterName is the name of the Cluster this object belongs to.
5555
// +kubebuilder:validation:MinLength=1
5656
ClusterName string `json:"clusterName"`
5757

5858
// Label selector to match machines whose health will be exercised
5959
Selector metav1.LabelSelector `json:"selector"`
6060

61-
// UnhealthyConditions contains a list of the conditions that determine
61+
// unhealthyConditions contains a list of the conditions that determine
6262
// whether a node is considered unhealthy. The conditions are combined in a
6363
// logical OR, i.e. if any of the conditions is met, the node is unhealthy.
6464
//
@@ -85,7 +85,7 @@ type MachineHealthCheckSpec struct {
8585
// +kubebuilder:validation:Pattern=^\[[0-9]+-[0-9]+\]$
8686
UnhealthyRange *string `json:"unhealthyRange,omitempty"`
8787

88-
// NodeStartupTimeout allows to set the maximum time for MachineHealthCheck
88+
// nodeStartupTimeout allows to set the maximum time for MachineHealthCheck
8989
// to consider a Machine unhealthy if a corresponding Node isn't associated
9090
// through a `Spec.ProviderID` field.
9191
//
@@ -100,7 +100,7 @@ type MachineHealthCheckSpec struct {
100100
// +optional
101101
NodeStartupTimeout *metav1.Duration `json:"nodeStartupTimeout,omitempty"`
102102

103-
// RemediationTemplate is a reference to a remediation template
103+
// remediationTemplate is a reference to a remediation template
104104
// provided by an infrastructure provider.
105105
//
106106
// This field is completely optional, when filled, the MachineHealthCheck controller
@@ -145,21 +145,21 @@ type MachineHealthCheckStatus struct {
145145
// +optional
146146
CurrentHealthy int32 `json:"currentHealthy"`
147147

148-
// RemediationsAllowed is the number of further remediations allowed by this machine health check before
148+
// remediationsAllowed is the number of further remediations allowed by this machine health check before
149149
// maxUnhealthy short circuiting will be applied
150150
// +kubebuilder:validation:Minimum=0
151151
// +optional
152152
RemediationsAllowed int32 `json:"remediationsAllowed"`
153153

154-
// ObservedGeneration is the latest generation observed by the controller.
154+
// observedGeneration is the latest generation observed by the controller.
155155
// +optional
156156
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
157157

158-
// Targets shows the current list of machines the machine health check is watching
158+
// targets shows the current list of machines the machine health check is watching
159159
// +optional
160160
Targets []string `json:"targets,omitempty"`
161161

162-
// Conditions defines current service state of the MachineHealthCheck.
162+
// conditions defines current service state of the MachineHealthCheck.
163163
// +optional
164164
Conditions Conditions `json:"conditions,omitempty"`
165165

0 commit comments

Comments
 (0)