-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
✨ Enable using setup-envtest without a separate CLI #2810
base: main
Are you sure you want to change the base?
✨ Enable using setup-envtest without a separate CLI #2810
Conversation
Skipping CI for Draft Pull Request. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: tomasaschan The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
a12a6c3
to
b3a4f85
Compare
I will rebase this properly once #2811 merges, since I expect conflicts with that anyway. |
17d784a
to
3650b9b
Compare
3650b9b
to
c8aa9b3
Compare
@sbueringer I think this is ready for an initial review now! I still want to get rid of the dependency on |
I've spent some time now trying to rebuild this without a dependency on While it's certainly possible to build a read/write file system abstraction (on top of @sbueringer What do you think? If you agree with this assessment, I can rebase again to get the latest version bumps of everything, and then this should be ready to go! |
c8aa9b3
to
645331e
Compare
There are two main points of re-implementing vs just moving the code: 1. Error handling in the old code base was based on panicking and recovering, where the recover basically just read out a field from the panic value and determined the correct exit code. In a package, we want more nuanced error handling, especially in order to allow test suites to catch the errors and surface them through their own reporting mechanisms. 2. There was a lot of global state in the old code base, "hidden" in the env.Env type that was used as a receiver for all the methods. This re-implementation tries to make the state more explicit, keeping only dependencies (like the remote client and local store) in the environment, while retaining the same behavior as the previous implementation. Tests have been ported over to their respective workflow sub-packages, and a few new ones have been added to cover cases the old test suite for one reason or another did not. Thus, we can be fairly confident that the new implementation does not break old functionality, even if it is a significant rewrite.
645331e
to
5b1508a
Compare
PR needs rebase. 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-sigs/prow repository. |
@tomasaschan Just a heads up. We'll merge a PR directly after 0.19 which drops the support for GCS. Basically because we wanted to do it anyway, but also to simplify maintenance & refactorings like this PR |
Thanks for the heads up! Have you had time to review these changes, and in particular my last comment about keeping the afero dependency? |
Didn't get around to it yet. Just recently found time to catch up on controller-runtime in general and this is a big PR. But I'll try to look at it soon. Definitely feel free to wait with further rebases until then |
This implements the proposal in #2790.
The implementation is incomplete so far; opening this mostly to show my progress and solicit feedback, as well as to avoid too many conflicts with initiatives like this one.
To do:
use
in the main modulelist
in the main modulecleanup
in the main modulesideload
in the main modulesetup-envtest
module, removing duplicated code etcRemove dependency onafero
go.mod
since I branched off(Optional, possibly in a later PR) Re-implement the arg parsing and help parts of the main module with something a little less home-grown, probably something like https://github.com/spf13/cobra/