Skip to content

Commit 4e0e3e2

Browse files
sbueringerkillianmuldoon
authored andcommitted
Bump golangci-lint to v1.47.1
1 parent e29d7fb commit 4e0e3e2

File tree

6 files changed

+9
-16
lines changed

6 files changed

+9
-16
lines changed

.github/workflows/golangci-lint.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ jobs:
2121
- uses: actions/checkout@v3
2222
- uses: actions/setup-go@v3
2323
with:
24-
go-version: 1.17
24+
go-version: 1.18.4
2525
- name: golangci-lint
2626
uses: golangci/[email protected]
2727
with:
28-
version: v1.44.0
28+
version: v1.47.1
2929
working-directory: ${{matrix.working-directory}}

controllers/remote/cluster_cache_reconciler_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func TestClusterCacheReconciler(t *testing.T) {
4545

4646
// createAndWatchCluster creates a new cluster and ensures the clusterCacheTracker has a clusterAccessor for it
4747
createAndWatchCluster := func(clusterName string, testNamespace *corev1.Namespace, g *WithT) {
48-
t.Log(fmt.Sprintf("Creating a cluster %q", clusterName))
48+
t.Logf("Creating a cluster %q", clusterName)
4949
testCluster := &clusterv1.Cluster{
5050
ObjectMeta: metav1.ObjectMeta{
5151
Name: clusterName,
@@ -136,7 +136,7 @@ func TestClusterCacheReconciler(t *testing.T) {
136136
defer teardown(t, g, testNamespace)
137137

138138
for _, clusterName := range []string{"cluster-1", "cluster-2", "cluster-3"} {
139-
t.Log(fmt.Sprintf("Deleting cluster %q", clusterName))
139+
t.Logf("Deleting cluster %q", clusterName)
140140
obj := &clusterv1.Cluster{
141141
ObjectMeta: metav1.ObjectMeta{
142142
Namespace: testNamespace.Name,
@@ -145,7 +145,7 @@ func TestClusterCacheReconciler(t *testing.T) {
145145
}
146146
g.Expect(k8sClient.Delete(ctx, obj)).To(Succeed())
147147

148-
t.Log(fmt.Sprintf("Checking cluster %q's clusterAccessor is removed", clusterName))
148+
t.Logf("Checking cluster %q's clusterAccessor is removed", clusterName)
149149
g.Eventually(func() bool { return cct.clusterAccessorExists(util.ObjectKey(obj)) }, timeout).Should(BeFalse())
150150
}
151151
})

internal/controllers/topology/cluster/patches/template.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func (t *requestItemBuilder) WithHolder(object client.Object, fieldPath string)
6262
}
6363

6464
// uuidGenerator is defined as a package variable to enable changing it during testing.
65-
var uuidGenerator func() types.UID = uuid.NewUUID
65+
var uuidGenerator = uuid.NewUUID
6666

6767
// Build builds a GeneratePatchesRequestItem.
6868
func (t *requestItemBuilder) Build() (*runtimehooksv1.GeneratePatchesRequestItem, error) {

internal/webhooks/cluster_test.go

+2-5
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@ func TestClusterDefaultNamespaces(t *testing.T) {
4747
},
4848
}
4949
webhook := &Cluster{}
50-
tFunc := util.CustomDefaultValidateTest(ctx, c, webhook)
51-
52-
t.Run("for Cluster", tFunc)
50+
t.Run("for Cluster", util.CustomDefaultValidateTest(ctx, c, webhook))
5351
g.Expect(webhook.Default(ctx, c)).To(Succeed())
5452

5553
g.Expect(c.Spec.InfrastructureRef.Namespace).To(Equal(c.Namespace))
@@ -351,8 +349,7 @@ func TestClusterDefaultTopologyVersion(t *testing.T) {
351349

352350
// Create the webhook and add the fakeClient as its client.
353351
webhook := &Cluster{Client: fakeClient}
354-
tFunc := util.CustomDefaultValidateTest(ctx, c, webhook)
355-
t.Run("for Cluster", tFunc)
352+
t.Run("for Cluster", util.CustomDefaultValidateTest(ctx, c, webhook))
356353
g.Expect(webhook.Default(ctx, c)).To(Succeed())
357354

358355
g.Expect(c.Spec.Topology.Version).To(HavePrefix("v"))

internal/webhooks/clusterclass_test.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,7 @@ func TestClusterClassDefaultNamespaces(t *testing.T) {
7777

7878
// Create the webhook and add the fakeClient as its client.
7979
webhook := &ClusterClass{Client: fakeClient}
80-
tFunc := util.CustomDefaultValidateTest(ctx, in, webhook)
81-
82-
t.Run("for ClusterClass", tFunc)
80+
t.Run("for ClusterClass", util.CustomDefaultValidateTest(ctx, in, webhook))
8381

8482
g := NewWithT(t)
8583
g.Expect(webhook.Default(ctx, in)).To(Succeed())

util/container/image.go

-2
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@ limitations under the License.
1818
package container
1919

2020
import (
21-
2221
// Import the crypto sha256 algorithm for the docker image parser to work
2322
_ "crypto/sha256"
24-
2523
// Import the crypto/sha512 algorithm for the docker image parser to work with 384 and 512 sha hashes
2624
_ "crypto/sha512"
2725
"fmt"

0 commit comments

Comments
 (0)