From c746fb2be4f9c7183ce4f4e2eb0ca510a8da1e41 Mon Sep 17 00:00:00 2001 From: Feny Mehta Date: Wed, 8 Jan 2025 16:10:09 +0530 Subject: [PATCH] KUBESAW-250: Updating GolangCiLint to v1.63.1 Signed-off-by: Feny Mehta --- .github/workflows/ci-golang-sbom.yml | 2 +- pkg/configuration/configuration_test.go | 4 ++-- pkg/log/log_test.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-golang-sbom.yml b/.github/workflows/ci-golang-sbom.yml index ea4b61b0..591aef6a 100644 --- a/.github/workflows/ci-golang-sbom.yml +++ b/.github/workflows/ci-golang-sbom.yml @@ -25,7 +25,7 @@ jobs: - name: Lint uses: golangci/golangci-lint-action@v6 with: - version: v1.60.3 + version: v1.63.1 skip-pkg-cache: true skip-build-cache: true args: --config=./.golangci.yml --verbose diff --git a/pkg/configuration/configuration_test.go b/pkg/configuration/configuration_test.go index 294df8f1..1a77f569 100644 --- a/pkg/configuration/configuration_test.go +++ b/pkg/configuration/configuration_test.go @@ -48,7 +48,7 @@ func TestRegistrationService(t *testing.T) { assert.Empty(t, regServiceCfg.Analytics().DevSpacesSegmentWriteKey()) assert.Equal(t, "https://sso.devsandbox.dev/auth/js/keycloak.js", regServiceCfg.Auth().AuthClientLibraryURL()) assert.Equal(t, "application/json; charset=utf-8", regServiceCfg.Auth().AuthClientConfigContentType()) - assert.Equal(t, `{"realm": "sandbox-dev","auth-server-url": "https://sso.devsandbox.dev/auth","ssl-required": "none","resource": "sandbox-public","clientId": "sandbox-public","public-client": true, "confidential-port": 0}`, + assert.JSONEq(t, `{"realm": "sandbox-dev","auth-server-url": "https://sso.devsandbox.dev/auth","ssl-required": "none","resource": "sandbox-public","clientId": "sandbox-public","public-client": true, "confidential-port": 0}`, regServiceCfg.Auth().AuthClientConfigRaw()) assert.Equal(t, "https://sso.devsandbox.dev/auth/realms/sandbox-dev/protocol/openid-connect/certs", regServiceCfg.Auth().AuthClientPublicKeysURL()) assert.Equal(t, "https://sso.devsandbox.dev", regServiceCfg.Auth().SSOBaseURL()) @@ -127,7 +127,7 @@ func TestRegistrationService(t *testing.T) { assert.Equal(t, "keyabc", regServiceCfg.Analytics().SegmentWriteKey()) assert.Equal(t, "https://sso.openshift.com/auth/js/keycloak.js", regServiceCfg.Auth().AuthClientLibraryURL()) assert.Equal(t, "application/xml", regServiceCfg.Auth().AuthClientConfigContentType()) - assert.Equal(t, `{"realm": "toolchain-private"}`, regServiceCfg.Auth().AuthClientConfigRaw()) + assert.JSONEq(t, `{"realm": "toolchain-private"}`, regServiceCfg.Auth().AuthClientConfigRaw()) //using as per linter suggestion encoded-compare: use assert.JSONEq (testifylint) assert.Equal(t, "https://sso.openshift.com/certs", regServiceCfg.Auth().AuthClientPublicKeysURL()) assert.Equal(t, "https://sso.test.org", regServiceCfg.Auth().SSOBaseURL()) assert.Equal(t, "my-realm", regServiceCfg.Auth().SSORealm()) diff --git a/pkg/log/log_test.go b/pkg/log/log_test.go index de837486..cf372e5a 100644 --- a/pkg/log/log_test.go +++ b/pkg/log/log_test.go @@ -220,7 +220,7 @@ func TestLog(t *testing.T) { buf := new(bytes.Buffer) _, err := buf.ReadFrom(req.Body) require.NoError(t, err, "it should still be possible to read the body after it was passed to the logs") - assert.Equal(t, `{"testing-body":"test"}`, buf.String(), "body contents should be unchanged") + assert.JSONEq(t, `{"testing-body":"test"}`, buf.String(), "body contents should be unchanged") }) t.Run("log infof withValues", func(t *testing.T) {