-
Notifications
You must be signed in to change notification settings - Fork 374
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
Improve antctl mc subcommand's unit test #4183
Conversation
func SetupKubeconfig(kubeconfig *rest.Config) { | ||
// TODO: generate kubeconfig in Antrea agent for antctl in-Pod access. |
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.
Move this line to avoid to show this as method description.
@@ -112,7 +112,7 @@ func (o *ClusterSetJoinConfig) validateAndComplete() error { | |||
return fmt.Errorf("the ClusterSet ID is required") | |||
} | |||
if o.ClusterID == "" { | |||
return fmt.Errorf("the member ClusterID is required") | |||
return fmt.Errorf("the ClusterID of member cluster is required") |
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.
Keep member's output consistent with leader's output
Codecov Report
@@ Coverage Diff @@
## main #4183 +/- ##
==========================================
+ Coverage 58.35% 62.74% +4.39%
==========================================
Files 374 396 +22
Lines 53893 54457 +564
==========================================
+ Hits 31447 34167 +2720
+ Misses 20069 17780 -2289
- Partials 2377 2510 +133
|
} | ||
defer file.Close() |
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.
Will it cause any issue without your fix?
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 didn't actually execute it to get an error. But according to the codes, the file will be nil when the output format parameter is empty, and it will return invalid argument if file.Close()
is called.
a19e688
to
9368391
Compare
e990e86
to
51ab877
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.
LGTM. A suggestion for documentation.
docs/multicluster/quick-start.md
Outdated
@@ -47,8 +47,9 @@ mode, and all member clusters in a ClusterSet must use the same tunnel type. | |||
## Steps with antctl | |||
|
|||
`antctl` provides a couple of commands to facilitate deployment, configuration, | |||
and troubleshooting of Antrea Multi-cluster. This section describes the steps | |||
to deploy Antrea Multi-cluster and set up the example ClusterSet using `antctl`. | |||
and troubleshooting of Antrea Multi-cluster. Please refer to the [`antctl` installation guide](../antctl.md#installation) |
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 feel better to move "Refer to antctl installation guide..." to the beginning of the next paragraph.
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.
Done
51ab877
to
5807bbc
Compare
docs/multicluster/quick-start.md
Outdated
cluster's API server, and it needs a kubeconfig file for that. Please refer to | ||
the [`antctl` Multi-cluster manual](antctl.md) to learn more about the | ||
kubeconfig file configuration, and the `antctl` Multi-cluster commands. | ||
Please refer to the [`antctl` installation guide](../antctl.md#installation) |
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.
Reading through the sentences, it probably works better to move this one to the end of the paragraph:
Please refer to the
antctl
Multi-cluster manual to learn
more about the kubeconfig file configuration, and theantctl
Multi-cluster commands. For installation ofantctl
, please refer to the installation guide.
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.
You are right, that looks more readable. I will move 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.
Updated, thanks.
5807bbc
to
8bc6b96
Compare
2aa1eb0
to
0dcb935
Compare
/test-multicluster-e2e |
0dcb935
to
c237ba1
Compare
1. Add unit tests for antctl mc codes. 2. Refine some codes. Signed-off-by: Lan Luo <[email protected]>
c237ba1
to
668069b
Compare
/test-multicluster-e2e @jianjuns Could you take a look again? I have verified new antctl with this PR, it works fine. Thanks. |
/skip-all |
1. Add unit tests for antctl mc codes. 2. Refine some codes. Signed-off-by: Lan Luo <[email protected]>
For #4142