opencurve/curveadm

[Improve] host and hostname

Wine93 opened this issue · 6 comments

Wine93 commented

目前我们主机管理模块中的 hosthostname 的命名容易让用户感到困扰,请帮助我们改进它,以提供更清晰易懂的配置项。特别需要注意的是,你需要兼容之前的配置。如果你有任何疑问或者建议,都可以在此 issue 下留言。

global:
  user: curve
  ssh_port: 22
  private_key_file: /home/curve/.ssh/id_rsa

hosts:
  - host: server-host1
    hostname: 10.0.1.1
  - host: server-host2
    hostname: 10.0.1.2
  - host: server-host3
    hostname: 10.0.1.3

Registration procedure

Step 1. Add a comment when you sign up.The purpose of comments is for us to understand you and determine whether you have the basic ability to complete this issue.

  • If you are a student, please introduce your school, major, programming language, technical fields of interest, what you are good at, and why you chose this issue.
  • If you are already working, please introduce your company, career, work content, technical fields of interest, and why you chose this issue.

Step 2. Use WeChat to add the Curve community assistant "Curve" as a WeChat friend, tell your GitHub ID, and send the Issue link of your choice. The assistant will invite you to communicate with the mentor by WeChat.

Step 3. In order to better complete each development task, the mentor will select the developer who best matches the issue based on everyone's comment on GitHub and communication status by WeChat. If you are not selected, please select another issue.

Tips

  • Before developing, please read the dev guideline( https://ask.opencurve.io/t/topic/201) carefully and communicate with your mentor.
  • Please submit a draft PR before 11.29, and the mentor will review it within 2-5 working days and may guide you to modify the PR based on the actual situation.
  • If you successfully merge into PR before 12.27 and you will receive gifts carefully prepared by the Curve community.

"Yes, 'host' should be changed to 'address,' and 'hostname' should refer to the host name. This way, the description would be clearer. Maybe you can assign it to me to try it out." @Wine93

@mfordjody The issue has assigned by Curve Summer Coding Camp and you can choose other issue.

Hi, I think the best way to fix this issue and improve accordingly is to change the name hostname to host_ip so that it is more descriptive and easier to understand.

Can I please be assigned to this problem? I'm currently enrolled in the open curve summer camp and picked this issue.

你好,我想申请完成这个题目,我将在下面描述的对题目的大概思路
本题目主要是对于curveadm hosts 这个读取主机目录的命令进行修改,在文件中,我发现,读取进入的Hosts以Host []map[string]interface{} mapstructure:"hosts" 的形式进行读取,并最终在db/curveadm结构体中以string的形式进行存储,在使用curveadm hosts ssh <> 时,通过hosts.ParseHosts,GetHost等方式,将字符串解析为HostConfig结构体,并进行使用的方式,来对最开始读入的信息进行使用

我认为主要需要修改的有以下几点:
1.修改hosts文件下的get方法(hc.GetHost()等一些与变量名有关的,从map中读取数据的方法)
2.修改和host/hosts变量有关的报错信息(在internal/errno模块下的error常量)/显示(目前观察到的主要是有关curveadm hosts show和curveadm hosts ls命令有关的文件)

以上是我对这个题目的理解,可能还有很多错误,但是还是希望能再次得到社区的机会,更多的参与到社区的开源活动中,并得到知识和实践上的收获

你好,我想申请完成这个题目,我将在下面描述的对题目的大概思路 本题目主要是对于curveadm hosts 这个读取主机目录的命令进行修改,在文件中,我发现,读取进入的Hosts以Host []map[string]interface{} mapstructure:"hosts" 的形式进行读取,并最终在db/curveadm结构体中以string的形式进行存储,在使用curveadm hosts ssh <> 时,通过hosts.ParseHosts,GetHost等方式,将字符串解析为HostConfig结构体,并进行使用的方式,来对最开始读入的信息进行使用

我认为主要需要修改的有以下几点: 1.修改hosts文件下的get方法(hc.GetHost()等一些与变量名有关的,从map中读取数据的方法) 2.修改和host/hosts变量有关的报错信息(在internal/errno模块下的error常量)/显示(目前观察到的主要是有关curveadm hosts show和curveadm hosts ls命令有关的文件)

以上是我对这个题目的理解,可能还有很多错误,但是还是希望能再次得到社区的机会,更多的参与到社区的开源活动中,并得到知识和实践上的收获

Welcome!