Skip to content

Commit

Permalink
fix: configmap check
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Tien committed Feb 16, 2025
1 parent f2ead9e commit d5d4fa1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions test/e2e/yurt/hubleader.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/client-go/util/retry"
Expand Down Expand Up @@ -304,12 +305,15 @@ var _ = Describe("Hub leader config owner cleanup", func() {
client.ObjectKey{Name: "leader-hub-" + npName, Namespace: metav1.NamespaceSystem},
&v1.ConfigMap{},
)
if err != nil && client.IgnoreNotFound(err) != nil {
if err != nil {
if errors.IsNotFound(err) {
return nil
}
return err
}
return nil
return fmt.Errorf("leader config map still exists")
},
time.Second*5, time.Millisecond*500).Should(BeNil())
time.Second*30, time.Millisecond*500).Should(BeNil())
})
})

Expand Down

0 comments on commit d5d4fa1

Please sign in to comment.