Skip to content

Fix initial bool value to avoid sending update to kubelet every 5 seconds - #81

Merged
squat merged 1 commit into
squat:mainfrom
pmtk:fix-refresh-devices
Jul 10, 2025
Merged

Fix initial bool value to avoid sending update to kubelet every 5 seconds#81
squat merged 1 commit into
squat:mainfrom
pmtk:fix-refresh-devices

Conversation

@pmtk

@pmtk pmtk commented Jul 10, 2025

Copy link
Copy Markdown
Contributor

ListAndWatch() uses return value of refreshDevices() to make a decision regarding sending the updated devices to kubelet.

Boolean default value is false, therefore variable equal is always false and refreshDevices() always returns false. This causes ListAndWatch() to always send updates to kubelets which causes flood of logs:

kubelet I0710 17:43:44.599983  286051 client.go:93] "State pushed for device plugin" resource="device.microshift.io/zigbee" resourceCapacity=1
kubelet I0710 17:43:44.605881  286051 manager.go:322] "Processed device updates for resource" resourceName="device.microshift.io/zigbee" totalCount=1 healthyCount=1
kubelet I0710 17:43:49.601009  286051 client.go:93] "State pushed for device plugin" resource="device.microshift.io/zigbee" resourceCapacity=1
kubelet I0710 17:43:49.605114  286051 manager.go:322] "Processed device updates for resource" resourceName="device.microshift.io/zigbee" totalCount=1 healthyCount=1
kubelet I0710 17:43:54.601267  286051 client.go:93] "State pushed for device plugin" resource="device.microshift.io/zigbee" resourceCapacity=1
kubelet I0710 17:43:54.613636  286051 manager.go:322] "Processed device updates for resource" resourceName="device.microshift.io/zigbee" totalCount=1 healthyCount=1

@pmtk

pmtk commented Jul 10, 2025

Copy link
Copy Markdown
Contributor Author

Hey @squat
First of all - thanks for developing this project :)
We actually included it with MicroShift (as a code import, not a DaemonSet), hence you can see that the domain is different from default one: device.microshift.io.
This log flood is something we discovered during testing.

Thanks
Patryk

@squat squat left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh great catch @pmtk

@duckfullstop duckfullstop left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea why Github included me on this PR, but have a LGTM from me regardless 👍

@squat

squat commented Jul 10, 2025

Copy link
Copy Markdown
Owner

Hehehe sorry @duckfullstop I accidentally mentioned you rather than the author. Thank you for your service

@squat
squat merged commit 0f7fddf into squat:main Jul 10, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants