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

[Controller] parse kvm support run.xml #6022

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

askyrie
Copy link
Contributor

@askyrie askyrie commented Apr 7, 2024

This PR is for:

  • Server

@askyrie askyrie force-pushed the parse_kvm_support_run_xml branch 7 times, most recently from 2ffb03b to c1ba789 Compare April 10, 2024 03:21
## 可通过此配置将虚拟机名称指定为 domain.name、domain.title、domain.uuid 之一,默认为空
## 当使用此配置指定的字段取不到虚拟机名称或虚拟机名称为空时,则将使用 domain.name 的值作为虚拟机名称
## 例:vm_name_field: title ,指定 domain.title 作为虚拟机的名称
#vm_name_field: ""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

默认的行为是什么?应该不是空,就是空的时候实际生效的是什么?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

domian.metadata.instance.name ?

@@ -292,6 +292,12 @@ controller:
# 忽略网卡正则表达式配置,匹配到会忽略该网卡,默认为 ^(kube-ipvs) ,增加其他的网卡名称需要在此基础上新增
ignore_nic_regex:

## 采集器同步 KVM ,解析虚拟机的 XML 时,默认使用 domian.metadata.instance.name 字段作为虚拟机的名称
## 可通过此配置将虚拟机名称指定为 domain.name、domain.title、domain.uuid 之一,默认为空
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

默认为空改掉。

默认肯定有个行为,比如是 domain.name ?

@@ -27,4 +27,5 @@ type GenesisConfig struct {
MultiNSMode bool `default:"false" yaml:"multi_ns_mode"`
SingleVPCMode bool `default:"false" yaml:"single_vpc_mode"`
IgnoreNICRegex string `default:"^(kube-ipvs)" yaml:"ignore_nic_regex"`
VMNameField string `default:"" yaml:"vm_name_field"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个 config 读取之后应该有一个 validate 的过程。在 validate 中就将 default 值设置上去(发现是空的时候)。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants