From 91f60d7ed3f9580f77c68bf10e8353ce133e20ca Mon Sep 17 00:00:00 2001 From: Annaraya Narasagond Date: Tue, 20 Aug 2024 17:23:11 +0530 Subject: [PATCH] Correct lint errors Signed-off-by: Annaraya Narasagond Signed-off-by: Annaraya Narasagond Annaraya Narasagond Signed-off-by: Annaraya Narasagond --- e2e/util/context.go | 6 ++++-- e2e/util/crud.go | 10 +++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/e2e/util/context.go b/e2e/util/context.go index 8363a4fc9a..411def9efe 100644 --- a/e2e/util/context.go +++ b/e2e/util/context.go @@ -25,8 +25,10 @@ import ( placementrule "open-cluster-management.io/multicloud-operators-subscription/pkg/apis/apps/placementrule/v1" ) -var ConfigFile string -var CleanUp bool +var ( + ConfigFile string + CleanUp bool +) type Cluster struct { K8sClientSet *kubernetes.Clientset diff --git a/e2e/util/crud.go b/e2e/util/crud.go index 545d48e741..3c9978d412 100644 --- a/e2e/util/crud.go +++ b/e2e/util/crud.go @@ -161,8 +161,8 @@ func AddNamespaceAnnotationForVolSync(client client.Client, namespace string) er func CleanUpWorkloads() error { channel := GetChannelNamespace() + "/" + GetChannelName() subList := &subscriptionv1.SubscriptionList{} - err := Ctx.Hub.CtrlClient.List(context.Background(), subList) - if err != nil { + + if err := Ctx.Hub.CtrlClient.List(context.Background(), subList); err != nil { return err } @@ -171,14 +171,14 @@ func CleanUpWorkloads() error { // delete placement pName := sub.Spec.Placement.PlacementRef.Name pNamespace := sub.Namespace - err = DeletePlacement(pName, pNamespace) - if err != nil { + + if err := DeletePlacement(pName, pNamespace); err != nil { Ctx.Log.Error(err, "error deleting placement") return err } // delete subscription - err = DeleteSubscription(sub.Name, sub.Name) + err := DeleteSubscription(sub.Name, sub.Name) if err != nil { Ctx.Log.Error(err, "error deleting subscription")