Skip to content

Commit 60d3e58

Browse files
conformance: remove RESTClient in suite.Options, use interface where possible
We can use the Clientset to get a RESTClient
1 parent 88d0a9b commit 60d3e58

File tree

4 files changed

+2
-7
lines changed

4 files changed

+2
-7
lines changed

conformance/conformance_test.go

-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import (
2828

2929
"k8s.io/client-go/kubernetes"
3030
_ "k8s.io/client-go/plugin/pkg/client/auth"
31-
"k8s.io/client-go/rest"
3231
"sigs.k8s.io/controller-runtime/pkg/client"
3332
"sigs.k8s.io/controller-runtime/pkg/client/config"
3433
)
@@ -60,7 +59,6 @@ func TestConformance(t *testing.T) {
6059

6160
cSuite := suite.New(suite.Options{
6261
Client: client,
63-
RESTClient: clientset.CoreV1().RESTClient().(*rest.RESTClient),
6462
RestConfig: cfg,
6563
// This clientset is needed in addition to the client only because
6664
// controller-runtime client doesn't support non CRUD sub-resources yet (https://github.com/kubernetes-sigs/controller-runtime/issues/452).

conformance/utils/echo/pod.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ type MeshPod struct {
4242
Name string
4343
Namespace string
4444
Address string
45-
rc *rest.RESTClient
45+
rc rest.Interface
4646
rcfg *rest.Config
4747
}
4848

@@ -171,7 +171,7 @@ func ConnectToAppInNamespace(t *testing.T, s *suite.ConformanceTestSuite, app Me
171171
Name: podName,
172172
Namespace: podNamespace,
173173
Address: pod.Status.PodIP,
174-
rc: s.RESTClient,
174+
rc: s.Clientset.CoreV1().RESTClient(),
175175
rcfg: s.RestConfig,
176176
}
177177
}

conformance/utils/suite/experimental_suite.go

-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ func NewExperimentalConformanceTestSuite(s ExperimentalConformanceOptions) (*Exp
151151
suite.ConformanceTestSuite = ConformanceTestSuite{
152152
Client: s.Client,
153153
Clientset: s.Clientset,
154-
RESTClient: s.RESTClient,
155154
RestConfig: s.RestConfig,
156155
RoundTripper: roundTripper,
157156
GatewayClassName: s.GatewayClassName,

conformance/utils/suite/suite.go

-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ type ConformanceTestSuite struct {
5757
type Options struct {
5858
Client client.Client
5959
Clientset clientset.Interface
60-
RESTClient *rest.RESTClient
6160
RestConfig *rest.Config
6261
GatewayClassName string
6362
Debug bool
@@ -111,7 +110,6 @@ func New(s Options) *ConformanceTestSuite {
111110
suite := &ConformanceTestSuite{
112111
Client: s.Client,
113112
Clientset: s.Clientset,
114-
RESTClient: s.RESTClient,
115113
RestConfig: s.RestConfig,
116114
RoundTripper: roundTripper,
117115
GatewayClassName: s.GatewayClassName,

0 commit comments

Comments
 (0)