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
Fix HPA E2E CustomResourceDefinition test #112335
Conversation
@piotrnosek: This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The 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. |
Hi @piotrnosek. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
/kind failing-test |
f001026
to
252f7f8
Compare
/assign liggitt |
/assign mwielgus |
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.
Thanks for all the comments - all should be resolved now.
252f7f8
to
185cb08
Compare
I've just rebased the PR and resolved conflicts - some stuff in autoscaling_utils.go were refactored in another PR (#112252). |
1315f67
to
1897b5c
Compare
@liggitt - many thanks for the comments. I've fixed some of those, but I'm not sure I understand what you mean by some others - can you elaborate on that a bit more? |
b31c5b7
to
4e7a69f
Compare
/retest-required |
1 similar comment
/retest-required |
(drop the spurious files in the repo root in this PR) |
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 pushed a commit up to https://github.com/liggitt/kubernetes/commits/fixcustomcrd on top of this PR's commit with an example of what I'm envisioning, in case that's helpful. The diff against this PR looks messy, but it's actually getting closer to the current state of master
and adding a distinct parallel path for handling custom resources
gvr := schema.GroupVersionResource{Group: crdGroup, Version: crdVersion, Resource: crdNamePlural} | ||
framework.ExpectNoError(e2eresource.DeleteResourceAndWaitForGCWithDynamicClient(rc.clientSet, rc.dynamicClient, rc.scaleClient, true, gvr, kind, rc.nsName, rc.name)) | ||
// Delete CRD kind. | ||
err := rc.apiExtensionClient.ApiextensionsV1().CustomResourceDefinitions().Delete(context.TODO(), crdNamePlural+"."+crdGroup, metav1.DeleteOptions{}) |
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 is deleting the entire CRD (the whole type), not just the custom resource instance ... doesn't that mean any test using this must be serial / cannot run concurrently with other tests using this CRD?
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.
also, this delete request just sets deletionTimestamp on the CRD, it doesn't synchronously wait for the CRD and CR instances to be cleaned up
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.
- True, though we don't have any other tests using this CRD (and I'm not aware of any plans).
- Right.
So maybe it's best to not delete the CRD (the whole type)? I believe it won't hurt us to leave it to just be deleted with the whole cluster deletion?
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 decided to not delete the CRD type. Let me know if you think it's okay or we should have some solution which deletes CRD while still allowing to run concurrently / wait sync.
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.
And regarding this comment:
I noted in the cleanup the bit that will disrupt other concurrent tests using the same CRD
Creating CRD should work fine - we have checks that if CRD already exists, we do not create it.
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 decided to not delete the CRD type. Let me know if you think it's okay or we should have some solution which deletes CRD while still allowing to run concurrently / wait sync.
that's probably ok, at least for now
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.
(the normal way to be non-disruptive is to generate a CRD with a unique name per test)
4e7a69f
to
65ade53
Compare
Many thanks for all the comments and the example commit. I've refactored the code to include your proposed changes. |
This comment was marked as duplicate.
This comment was marked as duplicate.
65ade53
to
1f19920
Compare
1f19920
to
96ff1b1
Compare
/retest-required |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: liggitt, piotrnosek 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 |
The Kubernetes project has merge-blocking tests that are currently too flaky to consistently pass. This bot retests PRs for certain kubernetes repos according to the following rules:
You can:
/retest |
What type of PR is this?
Fix for a failing e2e test
What this PR does / why we need it:
Major fix for running HPA E2E CustomResourceDefinition test. This specifically adds all necessary utilities around creating a CRD, creating an instance and making sure HPA is able to fetch number of Replicas from CRD's status via scale client.
Which issue(s) this PR fixes:
Fixes bug(s) introduced by #111865
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: