Skip to content

Commit 128493d

Browse files
authored
Merge pull request #1444 from mboersma/add-godot-linter
Add godot linter
2 parents d3881d2 + c878bb9 commit 128493d

File tree

137 files changed

+549
-545
lines changed

Some content is hidden

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

137 files changed

+549
-545
lines changed

.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ linters:
1313
- errorlint
1414
- goconst
1515
- gocyclo
16+
- godot
1617
- gofmt
1718
- goimports
1819
- golint

api/v1alpha3/azurecluster_types.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ const (
2727
// removing it from the apiserver.
2828
ClusterFinalizer = "azurecluster.infrastructure.cluster.x-k8s.io"
2929

30-
// ClusterLabelNamespace indicates the namespace of the cluster
30+
// ClusterLabelNamespace indicates the namespace of the cluster.
3131
ClusterLabelNamespace = "azurecluster.infrastructure.cluster.x-k8s.io/cluster-namespace"
3232
)
3333

34-
// AzureClusterSpec defines the desired state of AzureCluster
34+
// AzureClusterSpec defines the desired state of AzureCluster.
3535
type AzureClusterSpec struct {
3636
// NetworkSpec encapsulates all things related to Azure network.
3737
NetworkSpec NetworkSpec `json:"networkSpec,omitempty"`
@@ -58,7 +58,7 @@ type AzureClusterSpec struct {
5858
IdentityRef *corev1.ObjectReference `json:"identityRef,omitempty"`
5959
}
6060

61-
// AzureClusterStatus defines the observed state of AzureCluster
61+
// AzureClusterStatus defines the observed state of AzureCluster.
6262
type AzureClusterStatus struct {
6363
// FailureDomains specifies the list of unique failure domains for the location/region of the cluster.
6464
// A FailureDomain maps to Availability Zone with an Azure Region (if the region support them). An
@@ -87,7 +87,7 @@ type AzureClusterStatus struct {
8787
// +kubebuilder:resource:path=azureclusters,scope=Namespaced,categories=cluster-api
8888
// +kubebuilder:subresource:status
8989

90-
// AzureCluster is the Schema for the azureclusters API
90+
// AzureCluster is the Schema for the azureclusters API.
9191
type AzureCluster struct {
9292
metav1.TypeMeta `json:",inline"`
9393
metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -98,7 +98,7 @@ type AzureCluster struct {
9898

9999
// +kubebuilder:object:root=true
100100

101-
// AzureClusterList contains a list of AzureCluster
101+
// AzureClusterList contains a list of AzureClusters.
102102
type AzureClusterList struct {
103103
metav1.TypeMeta `json:",inline"`
104104
metav1.ListMeta `json:"metadata,omitempty"`
@@ -110,7 +110,7 @@ func (c *AzureCluster) GetConditions() clusterv1.Conditions {
110110
return c.Status.Conditions
111111
}
112112

113-
// SetConditions will set the given conditions on an AzureCluster object
113+
// SetConditions will set the given conditions on an AzureCluster object.
114114
func (c *AzureCluster) SetConditions(conditions clusterv1.Conditions) {
115115
c.Status.Conditions = conditions
116116
}

api/v1alpha3/azureclusteridentity_types.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3"
2323
)
2424

25-
// AzureClusterIdentitySpec defines the parameters that are used to create an AzureIdentity
25+
// AzureClusterIdentitySpec defines the parameters that are used to create an AzureIdentity.
2626
type AzureClusterIdentitySpec struct {
2727
// UserAssignedMSI or Service Principal
2828
Type IdentityType `json:"type"`
@@ -46,7 +46,7 @@ type AzureClusterIdentitySpec struct {
4646
AllowedNamespaces []string `json:"allowedNamespaces"`
4747
}
4848

49-
// AzureClusterIdentityStatus defines the observed state of AzureClusterIdentity
49+
// AzureClusterIdentityStatus defines the observed state of AzureClusterIdentity.
5050
type AzureClusterIdentityStatus struct {
5151
// Conditions defines current service state of the AzureClusterIdentity.
5252
// +optional
@@ -57,7 +57,7 @@ type AzureClusterIdentityStatus struct {
5757
// +kubebuilder:resource:path=azureclusteridentities,scope=Namespaced,categories=cluster-api
5858
// +kubebuilder:subresource:status
5959

60-
// AzureClusterIdentity is the Schema for the azureclustersidentities API
60+
// AzureClusterIdentity is the Schema for the azureclustersidentities API.
6161
type AzureClusterIdentity struct {
6262
metav1.TypeMeta `json:",inline"`
6363
metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -68,7 +68,7 @@ type AzureClusterIdentity struct {
6868

6969
// +kubebuilder:object:root=true
7070

71-
// AzureClusterIdentityList contains a list of AzureClusterIdentity
71+
// AzureClusterIdentityList contains a list of AzureClusterIdentities.
7272
type AzureClusterIdentityList struct {
7373
metav1.TypeMeta `json:",inline"`
7474
metav1.ListMeta `json:"metadata,omitempty"`
@@ -80,12 +80,12 @@ func (c *AzureClusterIdentity) GetConditions() clusterv1.Conditions {
8080
return c.Status.Conditions
8181
}
8282

83-
// SetConditions will set the given conditions on an AzureClusterIdentity object
83+
// SetConditions will set the given conditions on an AzureClusterIdentity object.
8484
func (c *AzureClusterIdentity) SetConditions(conditions clusterv1.Conditions) {
8585
c.Status.Conditions = conditions
8686
}
8787

88-
// ClusterNamespaceAllowed indicates if the cluster namespace is allowed
88+
// ClusterNamespaceAllowed indicates if the cluster namespace is allowed.
8989
func (c *AzureClusterIdentity) ClusterNamespaceAllowed(namespace string) bool {
9090
if len(c.Spec.AllowedNamespaces) == 0 {
9191
return true

api/v1alpha3/azuremachine_types.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const (
3030
MachineFinalizer = "azuremachine.infrastructure.cluster.x-k8s.io"
3131
)
3232

33-
// AzureMachineSpec defines the desired state of AzureMachine
33+
// AzureMachineSpec defines the desired state of AzureMachine.
3434
type AzureMachineSpec struct {
3535
// ProviderID is the unique identifier as specified by the cloud provider.
3636
// +optional
@@ -107,7 +107,7 @@ type AzureMachineSpec struct {
107107
// +optional
108108
AcceleratedNetworking *bool `json:"acceleratedNetworking,omitempty"`
109109

110-
// SpotVMOptions allows the ability to specify the Machine should use a Spot VM
110+
// SpotVMOptions allows the ability to specify the Machine should use a Spot VM.
111111
// +optional
112112
SpotVMOptions *SpotVMOptions `json:"spotVMOptions,omitempty"`
113113

@@ -116,14 +116,14 @@ type AzureMachineSpec struct {
116116
SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"`
117117
}
118118

119-
// SpotVMOptions defines the options relevant to running the Machine on Spot VMs
119+
// SpotVMOptions defines the options relevant to running the Machine on Spot VMs.
120120
type SpotVMOptions struct {
121121
// MaxPrice defines the maximum price the user is willing to pay for Spot VM instances
122122
// +optional
123123
MaxPrice *resource.Quantity `json:"maxPrice,omitempty"`
124124
}
125125

126-
// AzureMachineStatus defines the observed state of AzureMachine
126+
// AzureMachineStatus defines the observed state of AzureMachine.
127127
type AzureMachineStatus struct {
128128
// Ready is true when the provider resource is ready.
129129
// +optional
@@ -189,7 +189,7 @@ type AzureMachineStatus struct {
189189
// +kubebuilder:resource:path=azuremachines,scope=Namespaced,categories=cluster-api
190190
// +kubebuilder:subresource:status
191191

192-
// AzureMachine is the Schema for the azuremachines API
192+
// AzureMachine is the Schema for the azuremachines API.
193193
type AzureMachine struct {
194194
metav1.TypeMeta `json:",inline"`
195195
metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -200,7 +200,7 @@ type AzureMachine struct {
200200

201201
// +kubebuilder:object:root=true
202202

203-
// AzureMachineList contains a list of AzureMachine
203+
// AzureMachineList contains a list of AzureMachines.
204204
type AzureMachineList struct {
205205
metav1.TypeMeta `json:",inline"`
206206
metav1.ListMeta `json:"metadata,omitempty"`
@@ -212,7 +212,7 @@ func (m *AzureMachine) GetConditions() clusterv1.Conditions {
212212
return m.Status.Conditions
213213
}
214214

215-
// SetConditions will set the given conditions on an AzureMachine object
215+
// SetConditions will set the given conditions on an AzureMachine object.
216216
func (m *AzureMachine) SetConditions(conditions clusterv1.Conditions) {
217217
m.Status.Conditions = conditions
218218
}

api/v1alpha3/azuremachinetemplate_types.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ import (
2020
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2121
)
2222

23-
// AzureMachineTemplateSpec defines the desired state of AzureMachineTemplate
23+
// AzureMachineTemplateSpec defines the desired state of AzureMachineTemplate.
2424
type AzureMachineTemplateSpec struct {
2525
Template AzureMachineTemplateResource `json:"template"`
2626
}
2727

2828
// +kubebuilder:object:root=true
2929
// +kubebuilder:resource:path=azuremachinetemplates,scope=Namespaced,categories=cluster-api
3030

31-
// AzureMachineTemplate is the Schema for the azuremachinetemplates API
31+
// AzureMachineTemplate is the Schema for the azuremachinetemplates API.
3232
type AzureMachineTemplate struct {
3333
metav1.TypeMeta `json:",inline"`
3434
metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -38,7 +38,7 @@ type AzureMachineTemplate struct {
3838

3939
// +kubebuilder:object:root=true
4040

41-
// AzureMachineTemplateList contains a list of AzureMachineTemplate
41+
// AzureMachineTemplateList contains a list of AzureMachineTemplate.
4242
type AzureMachineTemplateList struct {
4343
metav1.TypeMeta `json:",inline"`
4444
metav1.ListMeta `json:"metadata,omitempty"`
@@ -49,7 +49,7 @@ func init() {
4949
SchemeBuilder.Register(&AzureMachineTemplate{}, &AzureMachineTemplateList{})
5050
}
5151

52-
// AzureMachineTemplateResource describes the data needed to create an AzureMachine from a template
52+
// AzureMachineTemplateResource describes the data needed to create an AzureMachine from a template.
5353
type AzureMachineTemplateResource struct {
5454
// Spec is the specification of the desired behavior of the machine.
5555
Spec AzureMachineSpec `json:"spec"`

api/v1alpha3/conditions_consts.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@ package v1alpha3
1818

1919
import clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3"
2020

21-
// AzureCluster Conditions and Reasons
21+
// AzureCluster Conditions and Reasons.
2222
const (
23-
// NetworkInfrastructureReadyCondition reports of current status of cluster infrastructure
23+
// NetworkInfrastructureReadyCondition reports of current status of cluster infrastructure.
2424
NetworkInfrastructureReadyCondition = "NetworkInfrastructureReady"
25-
// LoadBalancerProvisioningReason API Server endpoint for the loadbalancer
25+
// LoadBalancerProvisioningReason API Server endpoint for the loadbalancer.
2626
LoadBalancerProvisioningReason = "LoadBalancerProvisioning"
2727
// LoadBalancerProvisioningFailedReason used for failure during provisioning of loadbalancer.
2828
LoadBalancerProvisioningFailedReason = "LoadBalancerProvisioningFailed"
29-
// NamespaceNotAllowedByIdentity used to indicate cluster in a namespace not allowed by identity
29+
// NamespaceNotAllowedByIdentity used to indicate cluster in a namespace not allowed by identity.
3030
NamespaceNotAllowedByIdentity = "NamespaceNotAllowedByIdentity"
3131
)
3232

33-
// AzureMachine Conditions and Reasons
33+
// AzureMachine Conditions and Reasons.
3434
const (
3535
// VMRunningCondition reports on current status of the Azure VM.
3636
VMRunningCondition clusterv1.ConditionType = "VMRunning"

api/v1alpha3/groupversion_info.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ import (
2525
)
2626

2727
var (
28-
// GroupVersion is group version used to register these objects
28+
// GroupVersion is group version used to register these objects.
2929
GroupVersion = schema.GroupVersion{Group: "infrastructure.cluster.x-k8s.io", Version: "v1alpha3"}
3030

31-
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
31+
// SchemeBuilder is used to add go types to the GroupVersionKind scheme.
3232
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
3333

3434
// AddToScheme adds the types in this group-version to the given scheme.

api/v1alpha3/tags.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func (t Tags) HasAzureCloudProviderOwned(cluster string) bool {
4747
return ok && ResourceLifecycle(value) == ResourceLifecycleOwned
4848
}
4949

50-
// GetRole returns the Cluster API role for the tagged resource
50+
// GetRole returns the Cluster API role for the tagged resource.
5151
func (t Tags) GetRole() string {
5252
return t[NameAzureClusterAPIRole]
5353
}
@@ -74,13 +74,13 @@ func (t Tags) Merge(other Tags) {
7474
}
7575
}
7676

77-
// AddSpecVersionHashTag adds a spec version hash to the Azure resource tags to determine if state has changed quickly
77+
// AddSpecVersionHashTag adds a spec version hash to the Azure resource tags to determine if state has changed quickly.
7878
func (t Tags) AddSpecVersionHashTag(hash string) Tags {
7979
t[SpecVersionHashTagKey()] = hash
8080
return t
8181
}
8282

83-
// ResourceLifecycle configures the lifecycle of a resource
83+
// ResourceLifecycle configures the lifecycle of a resource.
8484
type ResourceLifecycle string
8585

8686
const (
@@ -99,36 +99,36 @@ const (
9999
// to be permissive about state changes.
100100
// logically independent clusters running in the same AZ.
101101
// The tag key = NameKubernetesAzureCloudProviderPrefix + clusterID
102-
// The tag value is an ownership value
102+
// The tag value is an ownership value.
103103
NameKubernetesAzureCloudProviderPrefix = "kubernetes.io_cluster_"
104104

105105
// NameAzureProviderPrefix is the tag prefix we use to differentiate
106106
// cluster-api-provider-azure owned components from other tooling that
107-
// uses NameKubernetesClusterPrefix
107+
// uses NameKubernetesClusterPrefix.
108108
NameAzureProviderPrefix = "sigs.k8s.io_cluster-api-provider-azure_"
109109

110110
// NameAzureProviderOwned is the tag name we use to differentiate
111111
// cluster-api-provider-azure owned components from other tooling that
112-
// uses NameKubernetesClusterPrefix
112+
// uses NameKubernetesClusterPrefix.
113113
NameAzureProviderOwned = NameAzureProviderPrefix + "cluster_"
114114

115115
// NameAzureClusterAPIRole is the tag name we use to mark roles for resources
116116
// dedicated to this cluster api provider implementation.
117117
NameAzureClusterAPIRole = NameAzureProviderPrefix + "role"
118118

119-
// APIServerRole describes the value for the apiserver role
119+
// APIServerRole describes the value for the apiserver role.
120120
APIServerRole = "apiserver"
121121

122-
// NodeOutboundRole describes the value for the node outbound LB role
122+
// NodeOutboundRole describes the value for the node outbound LB role.
123123
NodeOutboundRole = "nodeOutbound"
124124

125-
// ControlPlaneOutboundRole describes the value for the control plane outbound LB role
125+
// ControlPlaneOutboundRole describes the value for the control plane outbound LB role.
126126
ControlPlaneOutboundRole = "controlPlaneOutbound"
127127

128-
// BastionRole describes the value for the bastion role
128+
// BastionRole describes the value for the bastion role.
129129
BastionRole = "bastion"
130130

131-
// CommonRole describes the value for the common role
131+
// CommonRole describes the value for the common role.
132132
CommonRole = "common"
133133

134134
// VMTagsLastAppliedAnnotation is the key for the machine object annotation
@@ -138,7 +138,7 @@ const (
138138
VMTagsLastAppliedAnnotation = "sigs.k8s.io/cluster-api-provider-azure-last-applied-tags-vm"
139139
)
140140

141-
// SpecVersionHashTagKey is the key for the spec version hash used to enable quick spec difference comparison
141+
// SpecVersionHashTagKey is the key for the spec version hash used to enable quick spec difference comparison.
142142
func SpecVersionHashTagKey() string {
143143
return fmt.Sprintf("%s%s", NameAzureProviderPrefix, "spec-version-hash")
144144
}

0 commit comments

Comments
 (0)