-
Notifications
You must be signed in to change notification settings - Fork 27
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
Adding support for firmware loading #596
Adding support for firmware loading #596
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: yevgeny-shnaidman The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
✅ Deploy Preview for kubernetes-sigs-kmm ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #596 +/- ##
==========================================
- Coverage 79.27% 78.73% -0.55%
==========================================
Files 49 49
Lines 4849 4937 +88
==========================================
+ Hits 3844 3887 +43
- Misses 829 866 +37
- Partials 176 184 +8
☔ View full report in Codecov by Sentry. |
internal/worker/worker.go
Outdated
if cfg.Modprobe.FirmwarePath != "" { | ||
baseImageDir := pr.fsDir + "/" + cfg.Modprobe.FirmwarePath | ||
w.logger.Info("preparing fimrware for loading", "image directory", baseImageDir, "host mount directory", firmwareMountPath) | ||
if err = cp.Copy(baseImageDir, firmwareMountPath); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What this function does in case baseImageDir
exists is not very clear:
// Merge preserves or overwrites existing files under the dir (default behavior).
https://pkg.go.dev/github.com/otiai10/copy#DirExistsAction
When does it replace and when does it overwrite?
Also, WDYT about using the OnError
option to log copy errors that may occur?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably mean in case there are already directories/files exist at destination, right? I have looked at the copy package code and run a few tests, and i think we are ok: if directory already exists, then new files will be added, files with the same name will be overwritten, files present only at dest will be kept as they are.
Also, added onError function
1) mapping of the host firmware directory into the load/unload pod only in case firmware for the Module is defined 2) during Loading operation, worker pod is copying all firmware files and directories from image onto the mapped host directory 3) during Unloading operation, worker pod is deleting all firmware files, but not directories ( since those can be shared with other modules' firmware files 4) unit tests
455cc54
to
adecbad
Compare
/lgtm |
in case firmware for the Module is defined
directories from image onto the mapped host directory
files, but not directories ( since those can be shared with other
modules' firmware files