Skip to content

Commit

Permalink
E2E: use testclient.ControlPlaneClient for creating namespaces
Browse files Browse the repository at this point in the history
- using testclient.ControlPlaneClient allows to the client
to be used in hypershift and regular cluster

Signed-off-by: Niranjan M.R <mrniranjan@redhat.com>
  • Loading branch information
Niranjan M.R committed Sep 23, 2024
1 parent 446948b commit 8e13645
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
var _ = BeforeSuite(func() {
Expect(testclient.ClientsEnabled).To(BeTrue())
// create test namespace
err := testclient.Client.Create(context.TODO(), namespaces.TestingNamespace)
err := testclient.ControlPlaneClient.Create(context.TODO(), namespaces.TestingNamespace)
if errors.IsAlreadyExists(err) {
testlog.Warning("test namespace already exists, that is unexpected")
return
Expand All @@ -40,7 +40,7 @@ var _ = BeforeSuite(func() {
})

var _ = AfterSuite(func() {
err := testclient.Client.Delete(context.TODO(), namespaces.TestingNamespace)
err := testclient.ControlPlaneClient.Delete(context.TODO(), namespaces.TestingNamespace)
Expect(err).ToNot(HaveOccurred())
err = namespaces.WaitForDeletion(testutils.NamespaceTesting, 5*time.Minute)
nodeinspector.Delete(context.TODO())
Expand Down

0 comments on commit 8e13645

Please sign in to comment.