From 834b5fb03797d3979801dffd50b7dbf26ef903ff Mon Sep 17 00:00:00 2001 From: Rob Scott Date: Thu, 19 May 2022 09:13:54 +0000 Subject: [PATCH] Bumping golangci-lint, making related fixes --- .../httproute-invalid-reference-policy.go | 32 +++++++++---------- conformance/utils/http/http.go | 3 +- conformance/utils/kubernetes/helpers.go | 1 + conformance/utils/suite/suite.go | 8 ++--- hack/verify-golint.sh | 2 +- 5 files changed, 24 insertions(+), 22 deletions(-) diff --git a/conformance/tests/httproute-invalid-reference-policy.go b/conformance/tests/httproute-invalid-reference-policy.go index 2594c791df..ff0bb4c45e 100644 --- a/conformance/tests/httproute-invalid-reference-policy.go +++ b/conformance/tests/httproute-invalid-reference-policy.go @@ -73,22 +73,22 @@ var HTTPRouteInvalidReferencePolicy = suite.ConformanceTest{ // routes and any expected Listener conditions once // https://github.com/kubernetes-sigs/gateway-api/issues/1112 // has been resolved - t.Skip("Gateway listener should have a ResolvedRefs condition with status False and reason RefNotPermitted", func(t *testing.T) { - listeners := []v1alpha2.ListenerStatus{{ - Name: v1alpha2.SectionName("http"), - SupportedKinds: []v1alpha2.RouteGroupKind{{ - Group: (*v1alpha2.Group)(&v1alpha2.GroupVersion.Group), - Kind: v1alpha2.Kind("HTTPRoute"), - }}, - Conditions: []metav1.Condition{{ - Type: string(v1alpha2.RouteConditionResolvedRefs), - Status: metav1.ConditionFalse, - Reason: string(v1alpha2.RouteReasonRefNotPermitted), - }}, - }} - - kubernetes.GatewayStatusMustHaveListeners(t, s.Client, gwNN, listeners, 60) - }) + // t.Skip("Gateway listener should have a ResolvedRefs condition with status False and reason RefNotPermitted", func(t *testing.T) { + // listeners := []v1alpha2.ListenerStatus{{ + // Name: v1alpha2.SectionName("http"), + // SupportedKinds: []v1alpha2.RouteGroupKind{{ + // Group: (*v1alpha2.Group)(&v1alpha2.GroupVersion.Group), + // Kind: v1alpha2.Kind("HTTPRoute"), + // }}, + // Conditions: []metav1.Condition{{ + // Type: string(v1alpha2.RouteConditionResolvedRefs), + // Status: metav1.ConditionFalse, + // Reason: string(v1alpha2.RouteReasonRefNotPermitted), + // }}, + // }} + + // kubernetes.GatewayStatusMustHaveListeners(t, s.Client, gwNN, listeners, 60) + // }) gwAddr := kubernetes.GatewayAndHTTPRoutesMustBeReady(t, s.Client, s.ControllerName, gwNN, routeNN) diff --git a/conformance/utils/http/http.go b/conformance/utils/http/http.go index a6391fbdad..28a5b75bdc 100644 --- a/conformance/utils/http/http.go +++ b/conformance/utils/http/http.go @@ -23,6 +23,7 @@ import ( "time" "github.com/stretchr/testify/assert" + "sigs.k8s.io/gateway-api/conformance/utils/roundtripper" ) @@ -90,7 +91,7 @@ func MakeRequestAndExpectEventuallyConsistentResponse(t *testing.T, r roundtripp } // awaitConvergence runs the given function until it returns 'true' `threshold` times in a row. -// Each failed attempt has a 1s delay; succesful attempts have no delay. +// Each failed attempt has a 1s delay; successful attempts have no delay. func awaitConvergence(t *testing.T, threshold int, fn func() bool) { successes := 0 attempts := 0 diff --git a/conformance/utils/kubernetes/helpers.go b/conformance/utils/kubernetes/helpers.go index 33771fce0d..c4295e5aec 100644 --- a/conformance/utils/kubernetes/helpers.go +++ b/conformance/utils/kubernetes/helpers.go @@ -32,6 +32,7 @@ import ( "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/wait" "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/gateway-api/apis/v1alpha2" ) diff --git a/conformance/utils/suite/suite.go b/conformance/utils/suite/suite.go index d19045fe1c..5950a270df 100644 --- a/conformance/utils/suite/suite.go +++ b/conformance/utils/suite/suite.go @@ -161,19 +161,19 @@ func (test *ConformanceTest) Run(t *testing.T, suite *ConformanceTestSuite) { t.Parallel() } - // Check that all features excerised by the test have been opted into by + // Check that all features exercised by the test have been opted into by // the suite. for _, feature := range test.Features { if !slices.Contains(suite.SupportedFeatures, feature) { - t.Skip("Skipping %s: suite does not support %s", test.ShortName, feature) + t.Skipf("Skipping %s: suite does not support %s", test.ShortName, feature) } } - // Check that no features excerised by the test have been opted out of by + // Check that no features exercised by the test have been opted out of by // the suite. for _, feature := range test.Exemptions { if !slices.Contains(suite.ExemptFeatures, feature) { - t.Skip("Skipping %s: suite exempts %s", test.ShortName, feature) + t.Skipf("Skipping %s: suite exempts %s", test.ShortName, feature) } } diff --git a/hack/verify-golint.sh b/hack/verify-golint.sh index 96d3329bdc..3822e42b0b 100755 --- a/hack/verify-golint.sh +++ b/hack/verify-golint.sh @@ -18,7 +18,7 @@ set -o errexit set -o nounset set -o pipefail -readonly VERSION="v1.43.0" +readonly VERSION="v1.46.2" readonly KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. cd "${KUBE_ROOT}"