Thanks for your feedback.
You are right about init() calls, but IMO they can be a smell.
The instances where init() is used in the virtctl code base are easily replaced by package variables
that can be assigned to during unit tests. It avoids setters which in my opinion do not provide any
benefits in these cases and which need to be called in init() functions.
I'll make sure to motivate each cleanup properly, in general I'm going to follow our coding conventions [1].
My plan for virtctl now roughly looks like this:
1. Clean up the virtctl codebase and eliminate code smells with a look at our coding conventions.
2. Ensure each virtctl command is properly tested by unit tests.
Remove all e2e tests testing virtctl directly or using virtctl to test API endpoints.
We only want to keep e2e tests for complex functionality like portforwarding or usbredir.
3. Avoid dependency on `tests` in `pkg/virtctl`, in other words move / replace functionality in `tests/clientcmd/virtctl.go`.
I will defer changing the command line semantics for now. We can always do that later if needed.
Any further feedback or opinions are appreciated.
Thanks,
Felix