-
Notifications
You must be signed in to change notification settings - Fork 450
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: The gc delete multus ip cr and lsp setting when enable keep vm ip #3378
Conversation
我存在一个疑问,感觉bug原因还需要澄清下: 情况1: networkName: nad-name 结果一致 情况2: networkName: nad-namespace/nad-name 结果一致 |
vm is not define below: vm.Spec.Template.ObjectMeta.Annotations[util.AttachmentNetworkAnnotation] The virt-launcher-pod have multus annotations is auto add by virt-controller-pod. |
@watermelon-brother, if |
I mean that the vm.Spec.Template.ObjectMeta.Annotation key util.AttachmentNetworkAnnotation is not need. |
Oh, I get it. thanks |
跟兵兵沟通后,确认情况如下 所以基于annotation 检查 multus 配置的逻辑,应该保留 |
pkg/controller/gc.go
Outdated
@@ -756,22 +756,11 @@ func (c *Controller) getVMLsps() []string { | |||
vmLsp := ovs.PodNameToPortName(vm.Name, ns.Name, util.OvnProvider) | |||
vmLsps = append(vmLsps, vmLsp) | |||
|
|||
attachNets, err := util.ParsePodNetworkAnnotation(vm.Spec.Template.ObjectMeta.Annotations[util.AttachmentNetworkAnnotation], vm.Namespace) | |||
if err != nil { |
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.
keep this section for util.AttachmentNetworkAnnotation
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.
This logic is not need for kubevirt. If you add this annotation, it is work only you not set vm multus network.
This logic is not need, because if you set vm.Spec.Template.ObjectMeta.Annotation key util.AttachmentNetworkAnnotation, It can override by the kubevirt controller logic. this logic you can see below: https://github.com/kubevirt/kubevirt/blob/main/pkg/virt-controller/services/template.go -> generatePodAnnotations |
hi @watermelon-brother ,那段之前就有的逻辑应该不会产生 bug, 而且大家使用的kubevirt的版本可能不太一样,而且查看所有关于 |
Signed-off-by: wujixin <wujix@yealink.com>
70902f2
to
6f541dd
Compare
OK, I had reserve it in the pr. |
…3378) Signed-off-by: wujixin <wujix@yealink.com> Co-authored-by: wujixin <wujix@yealink.com>
…3378) Signed-off-by: wujixin <wujix@yealink.com> Co-authored-by: wujixin <wujix@yealink.com>
…ubeovn#3378) Signed-off-by: wujixin <wujix@yealink.com> Co-authored-by: wujixin <wujix@yealink.com> Signed-off-by: bobz965 <zhangbingbing2_yewu@cmss.chinamobile.com>
What type of this PR
The vm multus ip cr and lsp setting will be deleted by gc logic when vm define multus networkName as below:
Which issue(s) this PR fixes
The vm ip and mac somethime change when enable keep VM IP.
WHAT
I have remove not need logic in the pr.
HOW
Keep vm ip and mac not change is very important, because it can cause the vm nic not get ip when mac address change.