Skip to content

Commit

Permalink
Refactor godoc for API fields starting with field names
Browse files Browse the repository at this point in the history
  • Loading branch information
tsuzu committed Oct 31, 2024
1 parent 9b0190f commit f3d3974
Show file tree
Hide file tree
Showing 88 changed files with 3,619 additions and 3,618 deletions.
108 changes: 54 additions & 54 deletions api/v1beta1/cluster_types.go

Large diffs are not rendered by default.

238 changes: 119 additions & 119 deletions api/v1beta1/clusterclass_types.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion api/v1beta1/common_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ type ObjectMeta struct {
// +optional
Labels map[string]string `json:"labels,omitempty"`

// Annotations is an unstructured key value map stored with a resource that may be
// annotations is an unstructured key value map stored with a resource that may be
// set by external tools to store and retrieve arbitrary metadata. They are not
// queryable and should be preserved when modifying objects.
// More info: http://kubernetes.io/docs/user-guide/annotations
Expand Down
6 changes: 3 additions & 3 deletions api/v1beta1/condition_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ type ConditionType string

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

// Status of the condition, one of True, False, Unknown.
// status of the condition, one of True, False, Unknown.
Status corev1.ConditionStatus `json:"status"`

// Severity provides an explicit classification of Reason code, so the users or machines can immediately
// severity provides an explicit classification of Reason code, so the users or machines can immediately
// understand the current situation and act accordingly.
// The Severity field MUST be set only when Status=False.
// +optional
Expand Down
46 changes: 23 additions & 23 deletions api/v1beta1/machine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,24 +335,24 @@ const (

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

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

// InfrastructureRef is a required reference to a custom resource
// infrastructureRef is a required reference to a custom resource
// offered by an infrastructure provider.
InfrastructureRef corev1.ObjectReference `json:"infrastructureRef"`

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// BootstrapReady is the state of the bootstrap provider.
// bootstrapReady is the state of the bootstrap provider.
// +optional
BootstrapReady bool `json:"bootstrapReady"`

// InfrastructureReady is the state of the infrastructure provider.
// infrastructureReady is the state of the infrastructure provider.
// +optional
InfrastructureReady bool `json:"infrastructureReady"`

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

// Conditions defines current service state of the Machine.
// conditions defines current service state of the Machine.
// +optional
Conditions Conditions `json:"conditions,omitempty"`

Expand Down Expand Up @@ -590,14 +590,14 @@ func (m *MachineStatus) GetTypedPhase() MachinePhase {

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

// DataSecretName is the name of the secret that stores the bootstrap data script.
// dataSecretName is the name of the secret that stores the bootstrap data script.
// If nil, the Machine should remain in the Pending state.
// +optional
DataSecretName *string `json:"dataSecretName,omitempty"`
Expand Down
22 changes: 11 additions & 11 deletions api/v1beta1/machinedeployment_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ const (

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

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

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

// Template describes the machines that will be created.
// template describes the machines that will be created.
Template MachineTemplateSpec `json:"template"`

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

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

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

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

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

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

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

// Conditions defines current service state of the MachineDeployment.
// conditions defines current service state of the MachineDeployment.
// +optional
Conditions Conditions `json:"conditions,omitempty"`

Expand Down
16 changes: 8 additions & 8 deletions api/v1beta1/machinehealthcheck_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ var (

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

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

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

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

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

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

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

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

// Conditions defines current service state of the MachineHealthCheck.
// conditions defines current service state of the MachineHealthCheck.
// +optional
Conditions Conditions `json:"conditions,omitempty"`

Expand Down
Loading

0 comments on commit f3d3974

Please sign in to comment.