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

typo(rename): v4ClusterCIDR -> clusterCIDR #17763

Merged
merged 1 commit into from
Nov 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 7 additions & 15 deletions pkg/ipam/allocator/podcidr/podcidr.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ const (
v6AllocatorType = "IPv6"
)

var (
log = logging.DefaultLogger.WithField(logfields.LogSubsys, "pod-cidr")
)
var log = logging.DefaultLogger.WithField(logfields.LogSubsys, "pod-cidr")

// ErrAllocatorNotFound is an error that should be used in case the node tries
// to allocate a CIDR for an allocator that does not exist.
Expand All @@ -50,8 +48,7 @@ func (e *ErrAllocatorNotFound) Error() string {
}

// ErrAllocatorFull ...
type ErrAllocatorFull struct {
}
type ErrAllocatorFull struct{}

// Error returns the human-readable error for the ErrAllocatorFull
func (e *ErrAllocatorFull) Error() string {
Expand Down Expand Up @@ -144,9 +141,7 @@ type ciliumNodeK8sOp struct {
op k8sOp
}

var (
updateK8sInterval = 15 * time.Second
)
var updateK8sInterval = 15 * time.Second

// NodesPodCIDRManager will be used to manage podCIDRs for the nodes in the
// cluster.
Expand Down Expand Up @@ -446,9 +441,7 @@ func (n *NodesPodCIDRManager) Resync(context.Context, time.Time) {
// allocate a CIDR for this node.
// Needs n.Mutex to be held.
func (n *NodesPodCIDRManager) allocateNode(node *v2.CiliumNode) (cn *v2.CiliumNode, allocated, updateStatus bool, err error) {
var (
cidrs *nodeCIDRs
)
var cidrs *nodeCIDRs

log = log.WithFields(logrus.Fields{
"node-name": node.Name,
Expand Down Expand Up @@ -582,11 +575,11 @@ func releaseCIDRs(cidrAllocators []CIDRAllocator, cidrsToRelease []*net.IPNet) {
return
}
for _, ipNet := range cidrsToRelease {
for _, v4ClusterCIDR := range cidrAllocators {
if !v4ClusterCIDR.InRange(ipNet) {
for _, clusterCIDR := range cidrAllocators {
if !clusterCIDR.InRange(ipNet) {
continue
}
err := v4ClusterCIDR.Release(ipNet)
err := clusterCIDR.Release(ipNet)
log = log.WithFields(logrus.Fields{
"cidr": ipNet.String(),
})
Expand All @@ -611,7 +604,6 @@ func (n *NodesPodCIDRManager) reuseIPNets(
) (
newNodeCIDRs *nodeCIDRs, allocated bool, err error,
) {

log = log.WithFields(logrus.Fields{
"node-name": nodeName,
})
Expand Down