Skip to content
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

[BUG] yurtctl convert edgenode command's flag --kubeadm-conf-path doesn't work #281

Closed
qclc opened this issue Apr 27, 2021 · 2 comments
Closed
Assignees
Labels

Comments

@qclc
Copy link
Member

qclc commented Apr 27, 2021

What happened:
The following error occurs when I try to convert a cluster node to Edgenode using yurtctl convert edgenode :

[root@master openyurt]# _output/bin/yurtctl convert edgenode --edge-nodes node73 --kubeadm-conf-path /usr/lib/systemd/system/kubelet.service.d/10-kubeadm.conf --v=5
I0426 16:31:30.353536   28855 edgenode.go:174] the server version is valid
I0426 16:31:30.353627   28855 util.go:122] get nodename err: failed to read file /etc/systemd/system/kubelet.service.d/10-kubeadm.conf, open /etc/systemd/system/kubelet.service.d/10-kubeadm.conf: no such file or directory
F0426 16:31:30.353642   28855 edgenode.go:82] fail to covert the kubernetes node to a yurt node: open /etc/systemd/system/kubelet.service.d/10-kubeadm.conf: no such file or directory

I have specified the value of the --kubeadm-conf-path flag, but according to the log, the default path /etc/systemd/system/kubelet.service.d/10-kubeadm.conf is still used.
What you expected to happen:
When user specify the value of the --kubeadm-conf-path flag, the program can use the path that user specify to find information.

How to reproduce it (as minimally and precisely as possible):
when the kubeadm-conf-path is not /etc/systemd/system/kubelet.service.d/10-kubeadm.conf and in the other path, and if you want to execute yurtctl convert edgenode and specify the --kubeadm-conf-path flag's value, this error will appear. For example:

# if 10-kubeadm.conf is not in the default path
$ cat /etc/systemd/system/kubelet.service.d/10-kubeadm.conf
cat: /etc/systemd/system/kubelet.service.d/10-kubeadm.conf: No such file or directory
# And execute the command, the error will appear
$ _output/bin/yurtctl convert edgenode --edge-nodes node73 --kubeadm-conf-path /usr/lib/systemd/system/kubelet.service.d/10-kubeadm.conf --v=5

Anything else we need to know?:

Environment:

  • OpenYurt version:
yurtctl: projectinfo.Info{GitVersion:"v0.3.0", GitCommit:"b02fb17", BuildDate:"2021-04-26T08:07:11Z", GoVersion:"go1.15.11", Compiler:"gc", Platform:"linux/amd64"}
  • Kubernetes version (use kubectl version):
Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.0", GitCommit:"2bd9643cee5b3b3a5ecbd3af49d09018f0773c77", GitTreeState:"clean", BuildDate:"2019-09-18T14:36:53Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.0", GitCommit:"2bd9643cee5b3b3a5ecbd3af49d09018f0773c77", GitTreeState:"clean", BuildDate:"2019-09-18T14:27:17Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}
  • OS (e.g: cat /etc/os-release):
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
  • Kernel (e.g. uname -a):
Linux master 3.10.0-693.el7.x86_64 #1 SMP Tue Aug 22 21:09:27 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
  • Install tools:
  • Others:
@charleszheng44
Copy link
Member

Thanks for reporting the bug. There is an inconsistent variable assignment in the code. I will fix it.

@stale
Copy link

stale bot commented Dec 30, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Dec 30, 2021
@stale stale bot closed this as completed Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants