-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Fix profile list when there are multi node clusters #9996
Conversation
Hi @daehyeok. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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/test-infra repository. |
Can one of the admins verify this patch? |
pkg/minikube/config/profile.go
Outdated
@@ -242,6 +250,27 @@ func removeDupes(profiles []string) []string { | |||
return result | |||
} | |||
|
|||
// TODO: MachineName is copied from driver to avoid dependency cycle. Remove it or move to other module | |||
// MachineName returns the name of the machine, as seen by the hypervisor given the cluster and node names | |||
func MachineName(cc *ClusterConfig, n *Node) string { |
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.
lets move this a package that everyone can use, and we could refactor all other existances of this function
this could be moved to maybe util package or drivers package
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.
Which package is good for new home of this func?
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.
does it allow to put it in 'drivers" package ?
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.
or can we put it in the machine
package?
so we could call it something like this
machine.NameFromConfig(cc *ClusterConfig, n *Node)
or simply
machine.Name(cc *ClusterConfig, n *Node)
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.
Are you means pkg/minikube/machine
package?
Unfortunately, it also depend on config.
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.
how about we refactor the MachineName func to not depend on clusterConfig or Node ?
so we pass everything we want from it ?
machine.Name(name string, int nodes, controlPlane bool, ...)
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.
Function required following arguments,
Cluster name, Node name, number of node in cluster, is controlPlane or not
machine.Name(clusterName, nodeName string, int nodes, controlPlane bool)
.
Is it okay?
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.
@daehyeok sure that sounds like a good compromise
pkg/minikube/config/profile.go
Outdated
@@ -242,6 +250,27 @@ func removeDupes(profiles []string) []string { | |||
return result | |||
} | |||
|
|||
// TODO: MachineName is copied from driver to avoid dependency cycle. Remove it or move to other module | |||
// MachineName returns the name of the machine, as seen by the hypervisor given the cluster and node names | |||
func MachineName(cc *ClusterConfig, n *Node) string { |
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.
or can we put it in the machine
package?
so we could call it something like this
machine.NameFromConfig(cc *ClusterConfig, n *Node)
or simply
machine.Name(cc *ClusterConfig, n *Node)
Any update here? I wonder if @medyagh 's suggestion will also result in a circular dependency. |
pkg/minikube/config/profile.go
Outdated
@@ -242,6 +250,27 @@ func removeDupes(profiles []string) []string { | |||
return result | |||
} | |||
|
|||
// TODO: MachineName is copied from driver to avoid dependency cycle. Remove it or move to other module | |||
// MachineName returns the name of the machine, as seen by the hypervisor given the cluster and node names | |||
func MachineName(cc *ClusterConfig, n *Node) string { |
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.
how about we refactor the MachineName func to not depend on clusterConfig or Node ?
so we pass everything we want from it ?
machine.Name(name string, int nodes, controlPlane bool, ...)
f2f74c5
to
12315d6
Compare
12315d6
to
97abedc
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 this PR
it looks good just one thing I request to add integation test for it.
we have a TestMultiNode https://github.com/medyagh/minikube/blob/89a8cdc794098f9ba0550fbb5eeb19bc3dd8774d/test/integration/multinode_test.go#L29
lets add a Profile List to that test
and ensure the Profile List Exits Normally
only check for exit code 0
}{
{"FreshStart2Nodes", validateMultiNodeStart},
{"AddNode", validateAddNodeToMultiNode},
{"StopNode", validateStopRunningNode},
{"StartAfterStop", validateStartNodeAfterStop},
{"DeleteNode", validateDeleteNodeFromMultiNode},
{"StopMultiNode", validateStopMultiNodeCluster},
{"RestartMultiNode", validateRestartMultiNodeCluster},
lets add profile list after "FreshStart2Nodes",
97abedc
to
2f059c7
Compare
2f059c7
to
772590c
Compare
Test added case to integration test. |
Can we be sure that we don't show the "Found 0 invalid profiles" when there are no invalid profiles? When everything is ok, it should just show the table. |
772590c
to
9464507
Compare
Oops my bad. I confused master brach also print warn. Please ignore my previous comment. fixed it.
|
9464507
to
362fc47
Compare
Fix prolbem which ListProfiles return subnodes in Mult-Node clusters as a part of inValidPs.
362fc47
to
5ddaf5f
Compare
/ok-to-test |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: daehyeok, medyagh The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Fix problem which ListProfiles return sub-nodes in Mult-Node clusters as
a part of inValidPs.
fixes #9772
before
after