Skip to content

Commit

Permalink
ipam: Clarify purpose of (*Node).syncToAPIServer()
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Tarazi <chris@isovalent.com>
  • Loading branch information
christarazi committed Nov 14, 2020
1 parent 623dcd3 commit 379ce1e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions pkg/ipam/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -686,8 +686,16 @@ func (n *Node) MaintainIPPool(ctx context.Context) error {
return err
}

// syncToAPIServer is called to synchronize the node content with the custom
// resource in the apiserver.
// syncToAPIServer synchronizes the contents of the CiliumNode resource
// [(*Node).resource)] with the K8s apiserver. This operation occurs on an
// interval to refresh the CiliumNode resource.
//
// For Azure and ENI IPAM modes, this function serves two purposes: (1) as the
// entry point to initialize the CiliumNode resource and (2) to keep the
// resource up-to-date with K8s.
//
// To initialize, or seed, the CiliumNode resource, the PreAllocate field is
// populated with a default value and then is adjusted as necessary.
func (n *Node) syncToAPIServer() (err error) {
scopedLog := n.logger()
scopedLog.Debug("Refreshing node")
Expand Down

0 comments on commit 379ce1e

Please sign in to comment.