-
Notifications
You must be signed in to change notification settings - Fork 367
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
Implement the antctl framework #208
Implement the antctl framework #208
Conversation
This comment has been minimized.
This comment has been minimized.
6374811
to
968ecbb
Compare
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 working on this.
Just got time to do a quick scan of the change but not in-depth review yet. I put some questions, but I think it could help review if you could add some comments to explain more the concepts in the code.
build/yamls/base/antctl.yml
Outdated
name: antctl | ||
rules: | ||
- nonResourceURLs: | ||
- /apis/antctl.antrea.io/v1 |
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.
Could we use some generic naming instead of indicating this is for antctl only? Like clusterinfo, or controllerinfo/agentinfo or nodeinfo?
@tnqn: what you think?
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.
Agree, they should be named with what they are, instead of who use them.
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 guys, but could you give me some suggestions for the name?
This endpoint was used for accessing antctl server side and we will add commands not related to info, like support-bundle
.
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 think we could use clusterinfo or now (or controllerinfo and agentinfo if we want to separate controller and agent/node).
Not sure about support-bundle. What API groups K8s uses for logging/metrics, etc.?
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.
Changed to clusterinfo.antrea.tanzu.vmware
.
The metrics
in Kubelet does not have API group, it's a bare endpoint.
066c81f
to
f33dbbe
Compare
build/yamls/base/antctl.yml
Outdated
name: antctl | ||
rules: | ||
- nonResourceURLs: | ||
- /apis/antctl.antrea.io/v1 |
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 think we could use clusterinfo or now (or controllerinfo and agentinfo if we want to separate controller and agent/node).
Not sure about support-bundle. What API groups K8s uses for logging/metrics, etc.?
9587a34
to
b31ecd1
Compare
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.
Sorry for the late review.
One global review comment is that more detailed comments would be useful and sometimes even comments for private functions are useful IMO. A lot of the function comments are just a translation of the function name into a short english sentence at the moment and I don't think that's very useful. For example:
// applyToCommand applies the CommandOption to a cobra.Command with the Client.
func (co *CommandOption) applyToCommand(cmd *cobra.Command, client *Client) {
If you look at K8s source code, most of the time you will see some actually useful information in the function comments (e.g. https://github.com/kubernetes/client-go/blob/master/tools/clientcmd/client_config.go#L541).
Another comment is that it would probably be useful to have some skeleton of documentation to accompany this PR (not detailed, just where can you expect to run the CLI binary for client / controller). We can then improve it over time.
37291fa
to
93bc175
Compare
This comment has been minimized.
This comment has been minimized.
751d804
to
783f8bb
Compare
e641ae0
to
a04f639
Compare
Besides, I see server side code is still under pkg/antctl, do you plan to change it as @jianjuns suggested, or leave it to later improvement, or we want to keep it as is? |
Co-Authored-By: Quan Tian <qtian@vmware.com>
I would like to refactor this in another PR. |
d276077
to
91eb97f
Compare
Signed-off-by: Weiqiang TANG <weiqiangt@vmware.com>
91eb97f
to
cb6da3d
Compare
/test-all |
Hi folks, thanks a lot for reviewing this PR. I have addressed all comments and created issues to track several future works of it. The document for the antctl will also be added in a separate PR(it was picked out from 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.
LGTM
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 adding comments.
I mostly found typos, but also left a few other review comments.
Co-Authored-By: Antonin Bas <antonin.bas@gmail.com>
Co-Authored-By: Antonin Bas <antonin.bas@gmail.com>
Co-Authored-By: Antonin Bas <antonin.bas@gmail.com>
Signed-off-by: Weiqiang TANG <weiqiangt@vmware.com>
/test-all |
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.
LGTM
Again, I believe we should decouple API server from antctl, but we can merge the current implementation, and change later (maybe after commands for runtime info are done). |
Copied. |
Resolves #203.