-
Notifications
You must be signed in to change notification settings - Fork 37
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
Added a function to determine if the attachedcluster was created in the cluster #598
Added a function to determine if the attachedcluster was created in the cluster #598
Conversation
…he cluster Signed-off-by: LiZhenCheng9527 <[email protected]>
✅ Deploy Preview for kurator-dev canceled.
|
e2e/resources/constant.go
Outdated
|
||
const ( | ||
// pollInterval defines the interval time for a poll operation. | ||
pollInterval = 5 * time.Second |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't it too long?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've shortened the pollInterval
between poll operation.
// pollInterval defines the interval time for a poll operation. | ||
pollInterval = 5 * time.Second | ||
// pollTimeout defines the time after which the poll operation times out. | ||
pollTimeout = 420 * time.Second |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is this set
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sets the timeout for getting the attachecluster resource.
You can set it up here:
func WaitAttachedClusterFitWith(client kurator.Interface, namespace, name string, fit func(attachedCluster *clusterv1a1.AttachedCluster) bool) {
gomega.Eventually(func() bool {
attachedClusterPresentOnCluster, err := client.ClusterV1alpha1().AttachedClusters(namespace).Get(context.TODO(), name, metav1.GetOptions{})
if err != nil {
return false
}
return fit(attachedClusterPresentOnCluster)
}, pollTimeout, pollInterval).Should(gomega.Equal(true))
}
It will get the attachedcluster every time poolInterval
until it succeeds or time over pollTimeout
.
Signed-off-by: LiZhenCheng9527 <[email protected]>
f53f6ff
to
88c444d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hzxuzhonghu The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What this PR does / why we need it:
Added a function to determine if the attachedcluster was created in the cluster. Replaces the unstable checking of clusters at fixed intervals.
Which issue(s) this PR fixes:
a part of #436