Skip to content
This repository was archived by the owner on Oct 28, 2024. It is now read-only.

Commit 25cd7de

Browse files
Fixing golangci lint errors
Signed-off-by: Chris Hein <[email protected]>
1 parent 948b43b commit 25cd7de

28 files changed

+174
-170
lines changed

api/v1alpha4/groupversion_info.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
// Package v1alpha4 contains API Schema definitions for the infrastructure v1alpha4 API group
18-
//+kubebuilder:object:generate=true
19-
//+groupName=infrastructure.cluster.x-k8s.io
17+
// Package v1alpha4 contains API Schema definitions for the infrastructure v1alpha4 API group.
18+
// +kubebuilder:object:generate=true
19+
// +groupName=infrastructure.cluster.x-k8s.io
2020
package v1alpha4
2121

2222
import (
@@ -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: "v1alpha4"}
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/v1alpha4/nestedcluster_types.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ import (
2121
clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4"
2222
)
2323

24-
// NestedClusterSpec defines the desired state of NestedCluster
24+
// NestedClusterSpec defines the desired state of NestedCluster.
2525
type NestedClusterSpec struct {
2626
// ControlPlaneEndpoint represents the endpoint used to communicate with the control plane.
2727
// +optional
2828
ControlPlaneEndpoint clusterv1.APIEndpoint `json:"controlPlaneEndpoint"`
2929
}
3030

31-
// NestedClusterStatus defines the observed state of NestedCluster
31+
// NestedClusterStatus defines the observed state of NestedCluster.
3232
type NestedClusterStatus struct {
3333
// Ready is when the NestedControlPlane has a API server URL.
3434
// +optional
@@ -41,7 +41,7 @@ type NestedClusterStatus struct {
4141
//+kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
4242
//+kubebuilder:subresource:status
4343

44-
// NestedCluster is the Schema for the nestedclusters API
44+
// NestedCluster is the Schema for the nestedclusters API.
4545
type NestedCluster struct {
4646
metav1.TypeMeta `json:",inline"`
4747
metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -52,7 +52,7 @@ type NestedCluster struct {
5252

5353
//+kubebuilder:object:root=true
5454

55-
// NestedClusterList contains a list of NestedCluster
55+
// NestedClusterList contains a list of NestedCluster.
5656
type NestedClusterList struct {
5757
metav1.TypeMeta `json:",inline"`
5858
metav1.ListMeta `json:"metadata,omitempty"`

controllers/nestedcluster_controller.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17+
// Package controllers contains all the Infrastructure group controllers for
18+
// running nested clusters.
1719
package controllers
1820

1921
import (
@@ -37,7 +39,7 @@ import (
3739
//+kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=nestedclusters/finalizers,verbs=update
3840
//+kubebuilder:rbac:groups=controlplane.cluster.x-k8s.io,resources=nestedcontrolplanes,verbs=get;list;watch
3941

40-
// NestedClusterReconciler reconciles a NestedCluster object
42+
// NestedClusterReconciler reconciles a NestedCluster object.
4143
type NestedClusterReconciler struct {
4244
client.Client
4345
Log logr.Logger

controlplane/nested/api/v1alpha4/groupversion_info.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
// Package v1alpha4 contains API Schema definitions for the controlplane v1alpha4 API group
17+
// Package v1alpha4 contains API Schema definitions for the controlplane v1alpha4 API group.
1818
// +kubebuilder:object:generate=true
1919
// +groupName=controlplane.cluster.x-k8s.io
2020
package v1alpha4
@@ -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: "controlplane.cluster.x-k8s.io", Version: "v1alpha4"}
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.

controlplane/nested/api/v1alpha4/nestedapiserver_types.go

+12-12
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,21 @@ import (
2222
addonv1alpha1 "sigs.k8s.io/kubebuilder-declarative-pattern/pkg/patterns/addon/pkg/apis/v1alpha1"
2323
)
2424

25-
// NestedAPIServerSpec defines the desired state of NestedAPIServer
25+
// NestedAPIServerSpec defines the desired state of NestedAPIServer.
2626
type NestedAPIServerSpec struct {
2727
// NestedComponentSpec contains the common and user-specified information that are
28-
// required for creating the component
28+
// required for creating the component.
2929
// +optional
3030
NestedComponentSpec `json:",inline"`
3131
}
3232

33-
// NestedAPIServerStatus defines the observed state of NestedAPIServer
33+
// NestedAPIServerStatus defines the observed state of NestedAPIServer.
3434
type NestedAPIServerStatus struct {
35-
// APIServerService is the reference to the service that expose the APIServer
35+
// APIServerService is the reference to the service that expose the APIServer.
3636
// +optional
3737
APIServerService *corev1.ObjectReference `json:"apiserverService,omitempty"`
3838

39-
// CommonStatus allows addons status monitoring
39+
// CommonStatus allows addons status monitoring.
4040
addonv1alpha1.CommonStatus `json:",inline"`
4141
}
4242

@@ -46,7 +46,7 @@ type NestedAPIServerStatus struct {
4646
//+kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
4747
//+kubebuilder:subresource:status
4848

49-
// NestedAPIServer is the Schema for the nestedapiservers API
49+
// NestedAPIServer is the Schema for the nestedapiservers API.
5050
type NestedAPIServer struct {
5151
metav1.TypeMeta `json:",inline"`
5252
metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -57,7 +57,7 @@ type NestedAPIServer struct {
5757

5858
//+kubebuilder:object:root=true
5959

60-
// NestedAPIServerList contains a list of NestedAPIServer
60+
// NestedAPIServerList contains a list of NestedAPIServer.
6161
type NestedAPIServerList struct {
6262
metav1.TypeMeta `json:",inline"`
6363
metav1.ListMeta `json:"metadata,omitempty"`
@@ -72,30 +72,30 @@ var _ addonv1alpha1.CommonObject = &NestedAPIServer{}
7272
var _ addonv1alpha1.Patchable = &NestedAPIServer{}
7373

7474
// ComponentName returns the name of the component for use with
75-
// addonv1alpha1.CommonObject
75+
// addonv1alpha1.CommonObject.
7676
func (c *NestedAPIServer) ComponentName() string {
7777
return string(APIServer)
7878
}
7979

8080
// CommonSpec returns the addons spec of the object allowing common funcs like
81-
// Channel & Version to be usable
81+
// Channel & Version to be usable.
8282
func (c *NestedAPIServer) CommonSpec() addonv1alpha1.CommonSpec {
8383
return c.Spec.CommonSpec
8484
}
8585

8686
// GetCommonStatus will return the common status for checking is a component
87-
// was successfully deployed
87+
// was successfully deployed.
8888
func (c *NestedAPIServer) GetCommonStatus() addonv1alpha1.CommonStatus {
8989
return c.Status.CommonStatus
9090
}
9191

9292
// SetCommonStatus will set the status so that abstract representations can set
93-
// Ready and Phases
93+
// Ready and Phases.
9494
func (c *NestedAPIServer) SetCommonStatus(s addonv1alpha1.CommonStatus) {
9595
c.Status.CommonStatus = s
9696
}
9797

98-
// PatchSpec returns the patches to be applied
98+
// PatchSpec returns the patches to be applied.
9999
func (c *NestedAPIServer) PatchSpec() addonv1alpha1.PatchSpec {
100100
return c.Spec.PatchSpec
101101
}

controlplane/nested/api/v1alpha4/nestedcomponent_types.go

+17-8
Original file line numberDiff line numberDiff line change
@@ -21,38 +21,47 @@ import (
2121
addonv1alpha1 "sigs.k8s.io/kubebuilder-declarative-pattern/pkg/patterns/addon/pkg/apis/v1alpha1"
2222
)
2323

24-
// NestedComponentSpec defines the common fields for nested components
24+
// NestedComponentSpec defines the common fields for nested components.
2525
type NestedComponentSpec struct {
2626
// NestedComponentSpec defines the common information for creating the
27-
// component
27+
// component.
2828
// +optional
2929
addonv1alpha1.CommonSpec `json:",inline"`
3030

31-
// PatchSpecs includes the user specified settings
31+
// PatchSpecs includes the user specified settings.
3232
// +optional
3333
addonv1alpha1.PatchSpec `json:",inline"`
3434

3535
// Resources defines the amount of computing resources that will be used
36-
// by this component
36+
// by this component.
3737
// +optional
3838
Resources corev1.ResourceRequirements `json:"resources,omitempty"`
3939

40-
// Replicas defines the number of replicas in the component's workload
40+
// Replicas defines the number of replicas in the component's workload.
4141
// +optional
4242
Replicas int32 `json:"replicas,omitempty"`
4343
}
4444

45+
// ComponentPhase defines the state of the component.
4546
type ComponentPhase string
4647

4748
const (
48-
Ready ComponentPhase = "Ready"
49+
// Ready defines that the component is available and control plane can
50+
// continue provisioning.
51+
Ready ComponentPhase = "Ready"
52+
53+
// Unready defines that the component is unavailable.
4954
Unready ComponentPhase = "Unready"
5055
)
5156

57+
// ComponentKind defines the available kinds.
5258
type ComponentKind string
5359

5460
const (
55-
APIServer ComponentKind = "NestedAPIServer"
56-
Etcd ComponentKind = "NestedEtcd"
61+
// APIServer defines the Kind name for the apiserver.
62+
APIServer ComponentKind = "NestedAPIServer"
63+
// Etcd defines the Kind name for the etcd.
64+
Etcd ComponentKind = "NestedEtcd"
65+
// ControllerManager defines the kind name for the controller-manager.
5766
ControllerManager ComponentKind = "NestedControllerManager"
5867
)

controlplane/nested/api/v1alpha4/nestedcontrollermanager_types.go

+11-11
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ import (
2121
addonv1alpha1 "sigs.k8s.io/kubebuilder-declarative-pattern/pkg/patterns/addon/pkg/apis/v1alpha1"
2222
)
2323

24-
// NestedControllerManagerSpec defines the desired state of NestedControllerManager
24+
// NestedControllerManagerSpec defines the desired state of NestedControllerManager.
2525
type NestedControllerManagerSpec struct {
2626
// NestedComponentSpec contains the common and user-specified information
27-
// that are required for creating the component
27+
// that are required for creating the component.
2828
// +optional
2929
NestedComponentSpec `json:",inline"`
3030
}
3131

32-
// NestedControllerManagerStatus defines the observed state of NestedControllerManager
32+
// NestedControllerManagerStatus defines the observed state of NestedControllerManager.
3333
type NestedControllerManagerStatus struct {
34-
// CommonStatus allows addons status monitoring
34+
// CommonStatus allows addons status monitoring.
3535
addonv1alpha1.CommonStatus `json:",inline"`
3636
}
3737

@@ -41,7 +41,7 @@ type NestedControllerManagerStatus struct {
4141
//+kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
4242
//+kubebuilder:subresource:status
4343

44-
// NestedControllerManager is the Schema for the nestedcontrollermanagers API
44+
// NestedControllerManager is the Schema for the nestedcontrollermanagers API.
4545
type NestedControllerManager struct {
4646
metav1.TypeMeta `json:",inline"`
4747
metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -52,7 +52,7 @@ type NestedControllerManager struct {
5252

5353
//+kubebuilder:object:root=true
5454

55-
// NestedControllerManagerList contains a list of NestedControllerManager
55+
// NestedControllerManagerList contains a list of NestedControllerManager.
5656
type NestedControllerManagerList struct {
5757
metav1.TypeMeta `json:",inline"`
5858
metav1.ListMeta `json:"metadata,omitempty"`
@@ -67,30 +67,30 @@ var _ addonv1alpha1.CommonObject = &NestedControllerManager{}
6767
var _ addonv1alpha1.Patchable = &NestedControllerManager{}
6868

6969
// ComponentName returns the name of the component for use with
70-
// addonv1alpha1.CommonObject
70+
// addonv1alpha1.CommonObject.
7171
func (c *NestedControllerManager) ComponentName() string {
7272
return string(ControllerManager)
7373
}
7474

7575
// CommonSpec returns the addons spec of the object allowing common funcs like
76-
// Channel & Version to be usable
76+
// Channel & Version to be usable.
7777
func (c *NestedControllerManager) CommonSpec() addonv1alpha1.CommonSpec {
7878
return c.Spec.CommonSpec
7979
}
8080

8181
// GetCommonStatus will return the common status for checking is a component
82-
// was successfully deployed
82+
// was successfully deployed.
8383
func (c *NestedControllerManager) GetCommonStatus() addonv1alpha1.CommonStatus {
8484
return c.Status.CommonStatus
8585
}
8686

8787
// SetCommonStatus will set the status so that abstract representations can set
88-
// Ready and Phases
88+
// Ready and Phases.
8989
func (c *NestedControllerManager) SetCommonStatus(s addonv1alpha1.CommonStatus) {
9090
c.Status.CommonStatus = s
9191
}
9292

93-
// PatchSpec returns the patches to be applied
93+
// PatchSpec returns the patches to be applied.
9494
func (c *NestedControllerManager) PatchSpec() addonv1alpha1.PatchSpec {
9595
return c.Spec.PatchSpec
9696
}

0 commit comments

Comments
 (0)