daemon: fix kernel argument management and logging errors#144
Merged
almaslennikov merged 1 commit intoMellanox:network-operator-26.1.xfrom Jan 22, 2026
Merged
Conversation
This commit addresses several issues in the sriov-network-config-daemon relating to host configuration management and observability. 1. Fix kargs.sh for read-only root filesystems: The daemon now uses the host's /tmp directory (via chroot) for temporary workspace files. This allows the script to function correctly when the container is deployed with 'readOnlyRootFilesystem: true', which previously caused 'cp' and 'grep' failures. 2. Fix logging serialization bug: Updated NodeReconciler to correctly call the Name() method of the main plugin when logging errors. Previously, passing the function pointer directly caused "json: unsupported type: func() string" errors, masking the actual reconciliation failures. Signed-off-by: Fred Rolland <frolland@nvidia.com>
|
Thanks for your PR,
To skip the vendors CIs, Maintainers can use one of:
|
almaslennikov
approved these changes
Jan 22, 2026
2b8c2ea
into
Mellanox:network-operator-26.1.x
11 of 12 checks passed
Greptile SummaryFixed two critical bugs in the SR-IOV network config daemon: (1) kernel argument management now works with read-only container filesystems by using the host's
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Daemon as sriov-config-daemon
participant Container as Container FS
participant Host as Host FS (chroot)
participant Logger as Error Logger
participant Plugin as VendorPlugin
Note over Daemon,Plugin: Scenario 1: Kernel Args Management (kargs.sh)
Daemon->>Container: Check if container root is read-only
Container-->>Daemon: readOnlyRootFilesystem: true
Daemon->>Host: chroot mktemp (create temp file in host /tmp)
Host-->>Daemon: /tmp/tmp.XXXXXX
Daemon->>Daemon: Map host path to container: /host/tmp/tmp.XXXXXX
Daemon->>Host: cp /etc/default/grub to temp file
Daemon->>Daemon: Modify kernel args in temp file
alt Changes detected
Daemon->>Host: cp temp file back to /etc/default/grub
Daemon->>Host: chroot update-grub
Host-->>Daemon: grub updated
end
Daemon->>Daemon: rm -f temp file (cleanup)
Note over Daemon,Plugin: Scenario 2: Logging Fix (daemon.go)
Daemon->>Plugin: OnNodeStateChange(desiredState)
Plugin-->>Daemon: error occurred
Daemon->>Logger: funcLog.Error(err, mainPluginName: dn.mainPlugin.Name())
Note over Logger: Before: passed dn.mainPlugin.Name (func pointer)<br/>After: passed dn.mainPlugin.Name() (string result)
Logger-->>Daemon: Successfully logged error with plugin name
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit addresses several issues in the sriov-network-config-daemon relating to host configuration management and observability.
Fix kargs.sh for read-only root filesystems: The daemon now uses the host's /tmp directory (via chroot) for temporary workspace files. This allows the script to function correctly when the container is deployed with 'readOnlyRootFilesystem: true', which previously caused 'cp' and 'grep' failures.
Fix logging serialization bug: Updated NodeReconciler to correctly call the Name() method of the main plugin when logging errors. Previously, passing the function pointer directly caused "json: unsupported type: func() string" errors, masking the actual reconciliation failures.