Skip to content

Commit

Permalink
[IPv6] Handle Spec.PodCIDR with IPv6 CIDR (#1151)
Browse files Browse the repository at this point in the history
For IPv6 single stack case, node.Spec.PodCIDR is
configured with IPv6 CIDR. This patch handles the case
and sets nodeConfig.PodIPv6CIDR with parsed CIDR.
  • Loading branch information
mengdie-song authored and wenyingd committed Aug 31, 2020
1 parent 5d42630 commit 89d7b6d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,11 @@ func (i *Initializer) initNodeLocalConfig() error {
klog.Errorf("Failed to parse subnet from CIDR string %s: %v", node.Spec.PodCIDR, err)
return err
}
i.nodeConfig.PodIPv4CIDR = localSubnet
if localSubnet.IP.To4() != nil {
i.nodeConfig.PodIPv4CIDR = localSubnet
} else {
i.nodeConfig.PodIPv6CIDR = localSubnet
}
return nil
}

Expand Down

0 comments on commit 89d7b6d

Please sign in to comment.