From fb06eb49574a8ceeb6e6104e30dd0eb2da7cc423 Mon Sep 17 00:00:00 2001 From: killianmuldoon Date: Wed, 30 Mar 2022 13:50:15 +0100 Subject: [PATCH] Downgrade golangci-lint to address gci autolint issues Signed-off-by: killianmuldoon --- .github/workflows/golangci-lint.yml | 2 +- internal/webhooks/cluster_test.go | 7 +++++-- internal/webhooks/clusterclass_test.go | 4 +++- util/container/image.go | 2 ++ 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 60872092f488..c939c674988c 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -17,5 +17,5 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v2 with: - version: v1.45.2 + version: v1.44.0 working-directory: ${{matrix.working-directory}} diff --git a/internal/webhooks/cluster_test.go b/internal/webhooks/cluster_test.go index 03474c6797f9..018c1145ef26 100644 --- a/internal/webhooks/cluster_test.go +++ b/internal/webhooks/cluster_test.go @@ -46,7 +46,9 @@ func TestClusterDefaultNamespaces(t *testing.T) { }, } webhook := &Cluster{} - t.Run("for Cluster", customDefaultValidateTest(ctx, c, webhook)) + tFunc := customDefaultValidateTest(ctx, c, webhook) + + t.Run("for Cluster", tFunc) g.Expect(webhook.Default(ctx, c)).To(Succeed()) g.Expect(c.Spec.InfrastructureRef.Namespace).To(Equal(c.Namespace)) @@ -348,7 +350,8 @@ func TestClusterDefaultTopologyVersion(t *testing.T) { // Create the webhook and add the fakeClient as its client. webhook := &Cluster{Client: fakeClient} - t.Run("for Cluster", customDefaultValidateTest(ctx, c, webhook)) + tFunc := customDefaultValidateTest(ctx, c, webhook) + t.Run("for Cluster", tFunc) g.Expect(webhook.Default(ctx, c)).To(Succeed()) g.Expect(c.Spec.Topology.Version).To(HavePrefix("v")) diff --git a/internal/webhooks/clusterclass_test.go b/internal/webhooks/clusterclass_test.go index 56f87439cf04..064146fe3582 100644 --- a/internal/webhooks/clusterclass_test.go +++ b/internal/webhooks/clusterclass_test.go @@ -76,7 +76,9 @@ func TestClusterClassDefaultNamespaces(t *testing.T) { // Create the webhook and add the fakeClient as its client. webhook := &ClusterClass{Client: fakeClient} - t.Run("for ClusterClass", customDefaultValidateTest(ctx, in, webhook)) + tFunc := customDefaultValidateTest(ctx, in, webhook) + + t.Run("for ClusterClass", tFunc) g := NewWithT(t) g.Expect(webhook.Default(ctx, in)).To(Succeed()) diff --git a/util/container/image.go b/util/container/image.go index 4da11c508d42..fa11667596f3 100644 --- a/util/container/image.go +++ b/util/container/image.go @@ -18,8 +18,10 @@ limitations under the License. package container import ( + // Import the crypto sha256 algorithm for the docker image parser to work _ "crypto/sha256" + // Import the crypto/sha512 algorithm for the docker image parser to work with 384 and 512 sha hashes _ "crypto/sha512" "fmt"