Skip to content

Commit

Permalink
feat: node update should trigger metadata update
Browse files Browse the repository at this point in the history
Signed-off-by: Mateusz Urbanek <[email protected]>
  • Loading branch information
shanduur-akamai committed Jan 4, 2024
1 parent 053f6d6 commit 8f0c882
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cloud/linode/annotations.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ const (
annLinodeCloudFirewallID = "service.beta.kubernetes.io/linode-loadbalancer-firewall-id"

annLinodeNodePrivateIP = "node.k8s.linode.com/private-ip"
annLinodeUUID = "node.k8s.linode.com/uuid"
annLinodeUUID = "node.k8s.linode.com/host-uuid"
)
19 changes: 14 additions & 5 deletions cloud/linode/node_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,16 @@ func (s *nodeController) Run(stopCh <-chan struct{}) {
return
}

klog.Infof("NodeController will handle node (%s) metadata", node.Name)
klog.Infof("NodeController will handle newly created node (%s) metadata", node.Name)
s.queue.Add(node)
},
UpdateFunc: func(_, new interface{}) {
node, ok := new.(*v1.Node)
if !ok {
return
}

klog.Infof("NodeController will handle updated node (%s) metadata", node.Name)
s.queue.Add(node)
},
})
Expand All @@ -52,14 +61,14 @@ func (s *nodeController) Run(stopCh <-chan struct{}) {
s.informer.Informer().Run(stopCh)
}

// worker runs a worker thread that dequeues deleted services and processes
// deleting their underlying NodeBalancers.
// worker runs a worker thread that dequeues new or modified nodes and processes
// metadata (host UUID) on each of them.
func (s *nodeController) worker() {
for s.processNextAddition() {
for s.processNext() {
}
}

func (s *nodeController) processNextAddition() bool {
func (s *nodeController) processNext() bool {
key, quit := s.queue.Get()
if quit {
return false
Expand Down

0 comments on commit 8f0c882

Please sign in to comment.