diff --git a/discovery/discovery_client.go b/discovery/discovery_client.go index 96159ab7..50e59c5d 100644 --- a/discovery/discovery_client.go +++ b/discovery/discovery_client.go @@ -27,7 +27,7 @@ import ( "sync" "time" - //lint:ignore SA1019 Keep using module since it's still being maintained and the api of google.golang.org/protobuf/proto differs + //nolint:staticcheck // SA1019 Keep using module since it's still being maintained and the api of google.golang.org/protobuf/proto differs "github.com/golang/protobuf/proto" openapi_v2 "github.com/googleapis/gnostic/openapiv2" diff --git a/go.mod b/go.mod index 2ddee888..ecac2027 100644 --- a/go.mod +++ b/go.mod @@ -31,7 +31,7 @@ require ( golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac google.golang.org/protobuf v1.27.1 k8s.io/api v0.0.0-20211117032144-b7adf12040d3 - k8s.io/apimachinery v0.0.0-20211117031932-cc08b72c0267 + k8s.io/apimachinery v0.0.0-20211117172554-9edaf59fbc7f k8s.io/klog/v2 v2.30.0 k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b @@ -41,5 +41,5 @@ require ( replace ( k8s.io/api => k8s.io/api v0.0.0-20211117032144-b7adf12040d3 - k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20211117031932-cc08b72c0267 + k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20211117172554-9edaf59fbc7f ) diff --git a/go.sum b/go.sum index a8649e04..bd1e3d8a 100644 --- a/go.sum +++ b/go.sum @@ -612,8 +612,8 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= k8s.io/api v0.0.0-20211117032144-b7adf12040d3 h1:OUKo3mc2wSOr2GGk0MiMWhZOca1INVHD0Ol0zHOmlKU= k8s.io/api v0.0.0-20211117032144-b7adf12040d3/go.mod h1:B1McGV/Uyv/c0sGZKsHMP4FArbyZZ8Emx+a7h5d/tMs= -k8s.io/apimachinery v0.0.0-20211117031932-cc08b72c0267 h1:vbR4nyGR/pk2oRTy+vNbzFR5cJQz5vg5NceVPvJuzso= -k8s.io/apimachinery v0.0.0-20211117031932-cc08b72c0267/go.mod h1:SqloDTPqePPNhEp8K4qUgqpKc3tE+ymn05iIUbSAQ7g= +k8s.io/apimachinery v0.0.0-20211117172554-9edaf59fbc7f h1:gvsqJqL6FCUf5MHZMT0oSXH0JlvV34DroJIEbm8tz7E= +k8s.io/apimachinery v0.0.0-20211117172554-9edaf59fbc7f/go.mod h1:SqloDTPqePPNhEp8K4qUgqpKc3tE+ymn05iIUbSAQ7g= k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= diff --git a/rest/request_test.go b/rest/request_test.go index 7b1d83ad..30ae87d8 100644 --- a/rest/request_test.go +++ b/rest/request_test.go @@ -47,7 +47,6 @@ import ( "k8s.io/apimachinery/pkg/runtime/serializer" "k8s.io/apimachinery/pkg/runtime/serializer/streaming" "k8s.io/apimachinery/pkg/util/diff" - "k8s.io/apimachinery/pkg/util/httpstream" "k8s.io/apimachinery/pkg/util/intstr" utilnet "k8s.io/apimachinery/pkg/util/net" "k8s.io/apimachinery/pkg/watch" @@ -1436,40 +1435,6 @@ func TestRequestStream(t *testing.T) { } } -type fakeUpgradeConnection struct{} - -func (c *fakeUpgradeConnection) CreateStream(headers http.Header) (httpstream.Stream, error) { - return nil, nil -} -func (c *fakeUpgradeConnection) Close() error { - return nil -} -func (c *fakeUpgradeConnection) CloseChan() <-chan bool { - return make(chan bool) -} -func (c *fakeUpgradeConnection) SetIdleTimeout(timeout time.Duration) { -} - -type fakeUpgradeRoundTripper struct { - req *http.Request - conn httpstream.Connection -} - -func (f *fakeUpgradeRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { - f.req = req - b := []byte{} - body := ioutil.NopCloser(bytes.NewReader(b)) - resp := &http.Response{ - StatusCode: http.StatusSwitchingProtocols, - Body: body, - } - return resp, nil -} - -func (f *fakeUpgradeRoundTripper) NewConnection(resp *http.Response) (httpstream.Connection, error) { - return f.conn, nil -} - func TestRequestDo(t *testing.T) { testCases := []struct { Request *Request diff --git a/tools/clientcmd/loader_test.go b/tools/clientcmd/loader_test.go index 1e770e67..bebc7fea 100644 --- a/tools/clientcmd/loader_test.go +++ b/tools/clientcmd/loader_test.go @@ -669,7 +669,9 @@ func Example_noMergingOnExplicitPaths() { } mergedConfig, err := loadingRules.Load() - + if err != nil { + fmt.Printf("Unexpected error: %v", err) + } json, err := runtime.Encode(clientcmdlatest.Codec, mergedConfig) if err != nil { fmt.Printf("Unexpected error: %v", err) @@ -715,7 +717,9 @@ func Example_mergingSomeWithConflict() { } mergedConfig, err := loadingRules.Load() - + if err != nil { + fmt.Printf("Unexpected error: %v", err) + } json, err := runtime.Encode(clientcmdlatest.Codec, mergedConfig) if err != nil { fmt.Printf("Unexpected error: %v", err) @@ -774,7 +778,9 @@ func Example_mergingEverythingNoConflicts() { } mergedConfig, err := loadingRules.Load() - + if err != nil { + fmt.Printf("Unexpected error: %v", err) + } json, err := runtime.Encode(clientcmdlatest.Codec, mergedConfig) if err != nil { fmt.Printf("Unexpected error: %v", err)