-
Notifications
You must be signed in to change notification settings - Fork 370
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
Update module from antrea.io/antrea to antrea.io/antrea/v2 #6774
Comments
cc: @antoninbas @tnqn |
That's a real issue, but I think there is a deeper issue that should be addressed at the same time: In my view, there are 2 solutions that are worth considering:
A few characteristics of each approach: Approach 1:
Approach 2:
In both cases, some code reorganization is necessary. I don't have a strong preference at the moment. Approach 1 is pretty straightforward, while I am not as familiar with Approach 2 and what it entails. Probably something worth discussing at the next community meeting. |
@antoninbas Approach 1 seems good because only apis are used by consumers, but in general approach2 seems to be more uniform and maintainable in long run, because we need not maintain separate versions and this makes the code(test code as well) more maintainable. |
After reviewing the 2 solutions above, I have concluded that none of them are really satisfactory:
Therefore, I'd like to suggest the following 2-step approach:
Step 1 does require modifying most Go files in this repo (as well as a few others) to update imports from
Step 2 does also have some caveats:
The advantages of step 2 still exist, but may not be as important as I initially thought / presented. For example, I wrote above:
While this is somewhat true, and fewer dependencies is always better, especially for an "API" module, dependency pruning (introduced in go 1.17) means that not all Antrea dependencies are added to downstream projects. This is the go.mod I get when I create a module that import
These dependencies would presumably stay the same if we were to move Antrea APIs to a separate module. So in practice, the advantages of step 2 would be:
See https://github.com/vmware-tanzu/vm-operator for an example of a project which uses a separate module for APIs (but in the same source repository). |
Describe the bug
The antrea module in go.mod should be updated from antrea.io/antrea/v2 since now we are on v2.x
Additional context
If we try to require this in some other repository then it will generate error because go.mod will not parse until the module is antrea.io/antrea/v2.
The text was updated successfully, but these errors were encountered: