Skip to content

Commit 5fd336b

Browse files
Fix linting and controllers references:
Clean up missed from the reorg. Signed-off-by: Jacob Weinstock <[email protected]>
1 parent a94edd0 commit 5fd336b

File tree

10 files changed

+20
-16
lines changed

10 files changed

+20
-16
lines changed

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ issues:
8484
source: "^// \\+kubebuilder:"
8585
- linters:
8686
- lll
87-
path: "controllers/(.+)_test.go"
87+
path: "controller/*/(.+)_test.go"
8888
exclude-files:
8989
- "zz_generated.*\\.go$"
9090
- ".*conversion.*\\.go$"

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ generate-manifests: tools ## Generate manifests e.g. CRD, RBAC etc.
217217
output:webhook:dir=$(WEBHOOK_ROOT) \
218218
webhook
219219
$(CONTROLLER_GEN) \
220-
paths=./controllers/... \
220+
paths=./controller/... \
221221
output:rbac:dir=$(RBAC_ROOT) \
222222
rbac:roleName=manager-role
223223

controller/cluster/tinkerbellcluster.go

Lines changed: 1 addition & 1 deletion
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 controller contains Cluster API controllers for Tinkerbell.
17+
// Package cluster contains Cluster API controller for the TinkerbellCluster CR.
1818
package cluster
1919

2020
import (

controller/cluster/tinkerbellcluster_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ type testOptions struct {
111111
func validHardware(name, uuid, ip string, options ...testOptions) *tinkv1.Hardware {
112112
hw := &tinkv1.Hardware{
113113
ObjectMeta: metav1.ObjectMeta{
114-
Name: name,
115-
Namespace: clusterNamespace,
116-
UID: types.UID(uuid),
114+
Name: name,
115+
Namespace: clusterNamespace,
116+
UID: types.UID(uuid),
117117
},
118118
Spec: tinkv1.HardwareSpec{
119119
Disks: []tinkv1.Disk{

controller/machine/hardware.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"sort"
66
"strings"
77

8-
infrastructurev1 "github.com/tinkerbell/cluster-api-provider-tinkerbell/api/v1beta1"
98
tinkv1 "github.com/tinkerbell/tink/api/v1alpha1"
109
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1110
"k8s.io/apimachinery/pkg/labels"
@@ -14,6 +13,8 @@ import (
1413
"sigs.k8s.io/cluster-api/util/patch"
1514
"sigs.k8s.io/controller-runtime/pkg/client"
1615
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
16+
17+
infrastructurev1 "github.com/tinkerbell/cluster-api-provider-tinkerbell/api/v1beta1"
1718
)
1819

1920
const (
@@ -45,6 +46,7 @@ var (
4546
ErrHardwareMissingDiskConfiguration = fmt.Errorf("disk configuration is required")
4647
)
4748

49+
// HardwareIP returns the IP address of the first network interface of the given hardware.
4850
func HardwareIP(hardware *tinkv1.Hardware) (string, error) {
4951
if hardware == nil {
5052
return "", ErrHardwareIsNil

controller/machine/template.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ import (
88
"strings"
99
"text/template"
1010

11-
"github.com/tinkerbell/cluster-api-provider-tinkerbell/internal/templates"
1211
tinkv1 "github.com/tinkerbell/tink/api/v1alpha1"
1312
apierrors "k8s.io/apimachinery/pkg/api/errors"
1413
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1514
"k8s.io/apimachinery/pkg/types"
15+
16+
"github.com/tinkerbell/cluster-api-provider-tinkerbell/internal/templates"
1617
)
1718

1819
func (scope *machineReconcileScope) templateExists() (bool, error) {
@@ -188,6 +189,7 @@ func imageURL(imageFormat, baseRegistry, osDistro, osVersion, kubernetesVersion
188189
OSVersion string
189190
KubernetesVersion string
190191
}
192+
191193
imageParams := image{
192194
BaseRegistry: baseRegistry,
193195
OSDistro: strings.ToLower(osDistro),

controller/machine/tinkerbellmachine.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17+
// Package machine contains Cluster API controller for the TinkerbellMachine CR.
1718
package machine
1819

1920
import (

controller/machine/tinkerbellmachine_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ func validCluster(name, namespace string) *clusterv1.Cluster {
113113
}
114114
}
115115

116+
//nolint:unparam
116117
func validTinkerbellCluster(name, namespace string) *infrastructurev1.TinkerbellCluster {
117118
tinkCluster := &infrastructurev1.TinkerbellCluster{
118119
ObjectMeta: metav1.ObjectMeta{
@@ -178,9 +179,9 @@ func validSecret(name, namespace string) *corev1.Secret {
178179
func validHardware(name, uuid, ip string, options ...testOptions) *tinkv1.Hardware {
179180
hw := &tinkv1.Hardware{
180181
ObjectMeta: metav1.ObjectMeta{
181-
Name: name,
182-
Namespace: clusterNamespace,
183-
UID: types.UID(uuid),
182+
Name: name,
183+
Namespace: clusterNamespace,
184+
UID: types.UID(uuid),
184185
},
185186
Spec: tinkv1.HardwareSpec{
186187
Disks: []tinkv1.Disk{

controller/machine/workflow.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@ import (
99
"k8s.io/apimachinery/pkg/types"
1010
)
1111

12-
var (
13-
// errWorkflowFailed is the error returned when the workflow fails.
14-
errWorkflowFailed = fmt.Errorf("workflow failed")
15-
)
12+
// errWorkflowFailed is the error returned when the workflow fails.
13+
var errWorkflowFailed = fmt.Errorf("workflow failed")
1614

1715
// lastActionStarted returns the state of the final action in a hardware's workflow or an error if the workflow
1816
// has not reached the final action.

tilt-provider.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"config": {
44
"image": "ghcr.io/tinkerbell/cluster-api-provider-tinkerbell:dev",
55
"live_reload_deps": [
6-
"main.go", "go.mod", "go.sum", "api", "controllers", "tink", "internal"
6+
"main.go", "go.mod", "go.sum", "api", "controller", "tink", "internal"
77
],
88
"label": "tinkerbell",
99
"manager_name": "capt-controller-manager"

0 commit comments

Comments
 (0)