From dea8ed2cbca4a500c2068625412c20b6a7dad750 Mon Sep 17 00:00:00 2001 From: Kanika Rana Date: Tue, 8 Oct 2024 22:27:38 -0400 Subject: [PATCH] fix lint, replace deprecated functions --- cmd/main.go | 2 +- pkg/server/server_test.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/main.go b/cmd/main.go index 202273b5..cd62d7aa 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -171,7 +171,7 @@ func newCachedClient(ctx context.Context, cfg *rest.Config) (client.Client, erro hostCluster, err := runtimecluster.New(cfg, func(options *runtimecluster.Options) { options.Scheme = scheme // cache only in the host-operator namespace - options.Namespace = configuration.Namespace() + options.Cache.Namespaces = []string{configuration.Namespace()} }) if err != nil { return nil, err diff --git a/pkg/server/server_test.go b/pkg/server/server_test.go index dc12f33a..be52de93 100644 --- a/pkg/server/server_test.go +++ b/pkg/server/server_test.go @@ -1,6 +1,7 @@ package server_test import ( + "context" "io" "net/http" "testing" @@ -63,7 +64,7 @@ func (s *TestServerSuite) TestServer() { assert.NoError(t, err) // require must only be used in the goroutine running the test function (testifylint) }(t) - err := wait.Poll(DefaultRetryInterval, DefaultTimeout, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.TODO(), DefaultRetryInterval, DefaultTimeout, false, func(context.Context) (done bool, err error) { req, err := http.NewRequest("GET", "http://localhost:8080/api/v1/health", nil) if err != nil { return false, err