add check of lease length to allow 60s of kube-apiserver communication disruption#26215
add check of lease length to allow 60s of kube-apiserver communication disruption#26215deads2k wants to merge 1 commit intoopenshift:masterfrom
Conversation
test/extended/operators/leases.go
Outdated
| if err := json.Unmarshal([]byte(leaderElection), leaderElectionRecord); err != nil { | ||
| o.Expect(err).NotTo(o.HaveOccurred()) | ||
| } | ||
| if leaderElectionRecord.LeaseDurationSeconds < 90 { |
| @@ -0,0 +1,77 @@ | |||
| package operators | |||
|
|
|||
| import ( | |||
There was a problem hiding this comment.
do we want to start from exclude list so the test will be green?
There was a problem hiding this comment.
do we want to start from exclude list so the test will be green?
given how far off we are, let's close a few and then add the list. Many ought to be easy.
test/extended/operators/leases.go
Outdated
| o.Expect(err).NotTo(o.HaveOccurred()) | ||
| } | ||
| if leaderElectionRecord.LeaseDurationSeconds < 90 { | ||
| shortLeases = append(shortLeases, fmt.Sprintf("configmap/%s used by %q, has too short a lease to span 60s kube-apiserver disruption. Try 99s leaseDuration with 13s retryPeriod and a 17s renewDeadline. Be sure you have the graceful release properly wired.", endpoint.Name, leaderElectionRecord.HolderIdentity)) |
| endpoints, err := kubeClient.CoreV1().Endpoints("").List(ctx, metav1.ListOptions{}) | ||
| o.Expect(err).NotTo(o.HaveOccurred()) | ||
| for _, endpoint := range endpoints.Items { | ||
| leaderElection, ok := endpoint.Annotations[resourcelock.LeaderElectionRecordAnnotationKey] |
There was a problem hiding this comment.
maybe to have this as an function and call it both for cm and endpoints?
test/extended/operators/leases.go
Outdated
| o.Expect(err).NotTo(o.HaveOccurred()) | ||
| for _, lease := range leases.Items { | ||
| if lease.Spec.LeaseDurationSeconds != nil && *lease.Spec.LeaseDurationSeconds < 90 { | ||
| shortLeases = append(shortLeases, fmt.Sprintf("configmap/%s used by %q, has too short a lease to span 60s kube-apiserver disruption. Try 99s leaseDuration with 13s retryPeriod and a 17s renewDeadline. Be sure you have the graceful release properly wired.", lease.Name, lease.Spec.HolderIdentity)) |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deads2k The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@deads2k: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
|
|
||
| shortLeases := []string{} | ||
|
|
||
| configMaps, err := kubeClient.CoreV1().ConfigMaps("").List(ctx, metav1.ListOptions{}) |
There was a problem hiding this comment.
how about using a paginated list instead?
| } | ||
| } | ||
|
|
||
| leases, err := kubeClient.CoordinationV1().Leases("").List(ctx, metav1.ListOptions{}) |
There was a problem hiding this comment.
it looks like kube-apiservers use the lease, we could filter them out
|
@deads2k is this test will run as part of the fips suite? |
|
@deads2k I assume you have to update the values according to the enhancement? |
|
Issues go stale after 90d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle stale |
|
@deads2k dont we want to merge this test? |
|
/remove-lifecycle stale |
|
Issues go stale after 90d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle stale |
|
Stale issues rot after 30d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle rotten |
|
Rotten issues close after 30d of inactivity. Reopen the issue by commenting /close |
|
@openshift-bot: Closed this PR. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
We cannot find them perfectly, but we can find those that are obviously broken.
There will need to be a library-go PR.