Skip to content

Commit

Permalink
ignore update pod nic annotation when is not nil
Browse files Browse the repository at this point in the history
  • Loading branch information
hongzhen-ma committed Jun 10, 2021
1 parent 14c8ad7 commit cb8cc64
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 3 additions & 1 deletion pkg/controller/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,9 @@ func (c *Controller) handleAddPod(key string) error {
pod.Annotations[fmt.Sprintf(util.GatewayAnnotationTemplate, podNet.ProviderName)] = subnet.Spec.Gateway
pod.Annotations[fmt.Sprintf(util.LogicalSwitchAnnotationTemplate, podNet.ProviderName)] = subnet.Name
pod.Annotations[fmt.Sprintf(util.AllocatedAnnotationTemplate, podNet.ProviderName)] = "true"
pod.Annotations[util.PodNicAnnotation] = c.config.PodNicType
if pod.Annotations[util.PodNicAnnotation] == "" {
pod.Annotations[util.PodNicAnnotation] = c.config.PodNicType
}

if err := util.ValidatePodCidr(podNet.Subnet.Spec.CIDRBlock, ipStr); err != nil {
klog.Errorf("validate pod %s/%s failed, %v", namespace, name, err)
Expand Down
1 change: 0 additions & 1 deletion pkg/ovs/ovn-nbctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,6 @@ func (c Client) ListLogicalEntity(entity string, args ...string) ([]string, erro
return result, nil
}


func (c Client) LogicalSwitchExists(logicalSwitch string) (bool, error) {
lss, err := c.ListLogicalSwitch()
if err != nil {
Expand Down

0 comments on commit cb8cc64

Please sign in to comment.