Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add conformance suite client options #3343

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion conformance/conformance.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ import (
func DefaultOptions(t *testing.T) suite.ConformanceOptions {
cfg, err := config.GetConfig()
require.NoError(t, err, "error loading Kubernetes config")
client, err := client.New(cfg, client.Options{})
clientOptions := client.Options{}
client, err := client.New(cfg, clientOptions)
require.NoError(t, err, "error initializing Kubernetes client")

// This clientset is needed in addition to the client only because
Expand Down Expand Up @@ -79,6 +80,7 @@ func DefaultOptions(t *testing.T) suite.ConformanceOptions {
AllowCRDsMismatch: *flags.AllowCRDsMismatch,
CleanupBaseResources: *flags.CleanupBaseResources,
Client: client,
ClientOptions: clientOptions,
Clientset: clientset,
ConformanceProfiles: conformanceProfiles,
Debug: *flags.ShowDebug,
Expand Down
5 changes: 4 additions & 1 deletion conformance/utils/suite/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ import (
// conformance tests.
type ConformanceTestSuite struct {
Client client.Client
ClientOptions client.Options
Clientset clientset.Interface
RESTClient *rest.RESTClient
RestConfig *rest.Config
Expand Down Expand Up @@ -123,6 +124,7 @@ type ConformanceTestSuite struct {
// Options can be used to initialize a ConformanceTestSuite.
type ConformanceOptions struct {
Client client.Client
ClientOptions client.Options
Clientset clientset.Interface
RestConfig *rest.Config
GatewayClassName string
Expand Down Expand Up @@ -234,6 +236,7 @@ func NewConformanceTestSuite(options ConformanceOptions) (*ConformanceTestSuite,

suite := &ConformanceTestSuite{
Client: options.Client,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there much point allowing someone to pass in a Client anymore if its going to be ignored anyways?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a fair comment. It should be removed

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would a follow up PR be suitable?

ClientOptions: options.ClientOptions,
Clientset: options.Clientset,
RestConfig: options.RestConfig,
RoundTripper: roundTripper,
Expand Down Expand Up @@ -398,7 +401,7 @@ func (suite *ConformanceTestSuite) setClientsetForTest(test ConformanceTest) err
strings.Join(featureNames, ","),
},
"::")
client, err := client.New(suite.RestConfig, client.Options{})
client, err := client.New(suite.RestConfig, suite.ClientOptions)
if err != nil {
return err
}
Expand Down