Skip to content

Commit

Permalink
Drop pkg/dynamicmapper/fake_discovery.go
Browse files Browse the repository at this point in the history
pkg/dynamicmapper/fake_discovery.go was originally implemented as a copy
of k8s.io/client-go/discovery/fake because the original client-go
implementation returned `nil, nil` for some methods.

However, this has been fixed in client-go, so there is now no need
to copy this fake implementation here.
  • Loading branch information
olivierlemasle committed Nov 21, 2022
1 parent 9e9816d commit 2072e51
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 181 deletions.
3 changes: 1 addition & 2 deletions go.mod
Expand Up @@ -4,8 +4,6 @@ go 1.18

require (
github.com/emicklei/go-restful v2.16.0+incompatible
github.com/emicklei/go-restful-swagger12 v0.0.0-20201014110547-68ccff494617
github.com/google/gnostic v0.6.9
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.8.0
k8s.io/api v0.24.3
Expand Down Expand Up @@ -39,6 +37,7 @@ require (
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/gnostic v0.6.9 // indirect
github.com/google/go-cmp v0.5.5 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/uuid v1.1.2 // indirect
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Expand Up @@ -124,8 +124,6 @@ github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb
github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
github.com/emicklei/go-restful v2.16.0+incompatible h1:rgqiKNjTnFQA6kkhFe16D8epTksy9HQ1MyrbDXSdYhM=
github.com/emicklei/go-restful v2.16.0+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
github.com/emicklei/go-restful-swagger12 v0.0.0-20201014110547-68ccff494617 h1:jri9taV4TK9oItoWJCofXJi21Dp/k25u32NnfphqLAY=
github.com/emicklei/go-restful-swagger12 v0.0.0-20201014110547-68ccff494617/go.mod h1:qr0VowGBT4CS4Q8vFF8BSeKz34PuqKGxs/L0IAQA9DQ=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
Expand Down
175 changes: 0 additions & 175 deletions pkg/dynamicmapper/fake_discovery.go

This file was deleted.

5 changes: 3 additions & 2 deletions pkg/dynamicmapper/mapper_test.go
Expand Up @@ -25,13 +25,14 @@ import (

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/discovery/fake"
core "k8s.io/client-go/testing"
)

const testingMapperRefreshInterval = 1 * time.Second

func setupMapper(t *testing.T, stopChan <-chan struct{}) (*RegeneratingDiscoveryRESTMapper, *FakeDiscovery) {
fakeDiscovery := &FakeDiscovery{Fake: &core.Fake{}}
func setupMapper(t *testing.T, stopChan <-chan struct{}) (*RegeneratingDiscoveryRESTMapper, *fake.FakeDiscovery) {
fakeDiscovery := &fake.FakeDiscovery{Fake: &core.Fake{}}
mapper, err := NewRESTMapper(fakeDiscovery, testingMapperRefreshInterval)
require.NoError(t, err, "constructing the rest mapper shouldn't have produced an error")

Expand Down

0 comments on commit 2072e51

Please sign in to comment.