-
Notifications
You must be signed in to change notification settings - Fork 404
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
Rename yurtctl init/join/reset to yurtadm init/join/reset #819
Conversation
@lonelyCZ: GitHub didn't allow me to assign the following users: your_reviewer. Note that only openyurtio members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. In response to this:
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. |
pkg/yurtadm/cmd/cmd.go
Outdated
"github.com/openyurtio/openyurt/pkg/projectinfo" | ||
"github.com/openyurtio/openyurt/pkg/yurtctl/cmd/join" | ||
"github.com/openyurtio/openyurt/pkg/yurtctl/cmd/reset" | ||
"github.com/openyurtio/openyurt/pkg/yurtctl/cmd/yurtinit" |
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.
please do not import yurtctl/cmd/xxx
, and rename to yurtadm/cmd/xxx
9792232
to
8a3bfdd
Compare
Since some of the functionality in |
@@ -30,7 +30,7 @@ import ( | |||
"k8s.io/klog/v2" | |||
|
|||
"github.com/openyurtio/openyurt/pkg/projectinfo" | |||
kubeutil "github.com/openyurtio/openyurt/pkg/yurtctl/util/kubernetes" | |||
kubeutil "github.com/openyurtio/openyurt/pkg/yurtadm/util/kubernetes" |
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.
It looks strange that yurtctl import package of yurtadm.
Is it possible to move pkg/yurtadm/util/kubernetes
to pkg/util/kubernetes
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.
It can be, but pkg/util/kubernetes
also depend on pkg/yurtadm/kubernetes
.
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.
What do you mean? If we move pkg/yurtadm/util/kubernetes
entirely to pkg/util/kubernetes
, there's no dependence between 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.
There's a lot of subtle dependencies between them. For example, pkg/yurtadm/kubernetes/kubeadm/app/discovery/token
depend on pkg/yurtadm/cmd/join/joindata
. And pkg/yurtadm/kubernetes
and pkg/yurtadm/util/kubernetes
are different files. :(
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.
Well, that's a problem. I find that yurtctl depends on the yurtadm/kubernetes
mostly beacuse of convert/revert and test cmd. And test relies on yurtadm/kubernetes
beacuse it reuses the code of convert. It's a solution that move test into yurtadm and remove convert/revert subcommand(which is under work in pr #748).
For dependence between pkg/yurtadm/kubernetes/kubeadm/app/discovery/token
and pkg/yurtadm/cmd/join/joindata
, can we move the joindata into yurtadm/kubernetes
? It seems that yurtadm/kubernetes
only depends on joindata pkg.
And what do you think @rambohe-ch ?
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.
@Congrool @lonelyCZ The original idea of yurtadm/kubernetes
or yurtctl/kubernetes
is that codes comes from kubernetes project in order to avoid to import k8s.io/kubernetes
. so move joindata
into yurtadm/kubernetes
maybe change the original idea.
how about deprecate yurtctl convert/revert
at first? and now we have no response form writer of #748, so maybe we can post a new pull request to solve this case. @lonelyCZ would you like to take over this case?
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.
Ok.
@@ -29,9 +29,9 @@ import ( | |||
"k8s.io/klog/v2" | |||
|
|||
"github.com/openyurtio/openyurt/pkg/projectinfo" | |||
"github.com/openyurtio/openyurt/pkg/yurtctl/constants" | |||
"github.com/openyurtio/openyurt/pkg/yurtadm/constants" |
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.
For constants
, how about retaining the constants
pkg both in yurtctl
and yurtadm
?
We can extract constants what yurtadm and yurtctl need respectively in pkg/yurtadm/constants
and pkg/yurtctl/constants
.
And each cmd only needs to import the constants pkg under its folder.
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.
Many constants is common, may also need to put the part in pkg/util
.
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 can have a try, I don't find so many common constants. If there're only several common constants used by both yurtctl and yurtadm, the duplication is bearable.
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.
We only use the constants.AnnotationAutonomy
in yurtctl, please move it from pkg/yurtadm/constants
to pkg/yurtctl/constants
and import pkg/yurtctl/constants
instead.
8a3bfdd
to
a70f11d
Compare
9f5883e
to
8b19ad1
Compare
@Congrool PTAL |
@@ -29,9 +29,9 @@ import ( | |||
"k8s.io/klog/v2" | |||
|
|||
"github.com/openyurtio/openyurt/pkg/projectinfo" | |||
"github.com/openyurtio/openyurt/pkg/yurtctl/constants" | |||
"github.com/openyurtio/openyurt/pkg/yurtadm/constants" |
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.
We only use the constants.AnnotationAutonomy
in yurtctl, please move it from pkg/yurtadm/constants
to pkg/yurtctl/constants
and import pkg/yurtctl/constants
instead.
kubeutil "github.com/openyurtio/openyurt/pkg/yurtctl/util/kubernetes" | ||
strutil "github.com/openyurtio/openyurt/pkg/yurtctl/util/strings" | ||
tmplutil "github.com/openyurtio/openyurt/pkg/yurtctl/util/templates" | ||
"github.com/openyurtio/openyurt/pkg/yurtadm/constants" |
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.
We should import pkg/yurtctl/constants
instead of pkg/yurtadm/constants
. Any constants used in this file should be in the pkg/yurtctl/constants
, even there's duplication. In this way, we can decouple yurtctl with yurtadm.
abbe2d2
to
de13611
Compare
Signed-off-by: lonelyCZ <[email protected]>
de13611
to
71f0a48
Compare
/cc @Congrool |
It's not an easy job to entirely decouple yurtadm with yurtctl, more work need to be put on it. In terms of this pr, it looks good. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lonelyCZ, rambohe-ch 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 |
Signed-off-by: lonelyCZ [email protected]
What type of PR is this?
/kind feature
What this PR does / why we need it:
yurtctl init/join/reset are not suitable as name for creating OpenYurt cluster and join nodes.
so rename to yurtadm init/join/reset for conforming to kubeadm init/join/reset so reducing confusion for end users.
Which issue(s) this PR fixes:
Fixes #737
Special notes for your reviewer:
Since it is uncertain whether yurtctl will be retained, in order to reduce the workload, I don't move the dependency for now.
/assign @rambohe-ch @Congrool
Does this PR introduce a user-facing change?
other Note