-
Notifications
You must be signed in to change notification settings - Fork 34
Adding support for Modules with no OOT kmod #1084
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 Modules with no OOT kmod #1084
Conversation
Hi @TomerNewman. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
✅ Deploy Preview for kubernetes-sigs-kmm ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
I would update the PR&commit titles as it is not accurate. Maybe something like "Adding support for Modules with no OOT kmod". |
/ok-to-test |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1084 +/- ##
==========================================
- Coverage 79.09% 75.03% -4.06%
==========================================
Files 51 76 +25
Lines 5109 6927 +1818
==========================================
+ Hits 4041 5198 +1157
- Misses 882 1515 +633
- Partials 186 214 +28 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
bfb5208
to
a586e51
Compare
/approve We can merge once @yevgeny-shnaidman is happy with the change as well. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: TomerNewman, ybettan 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 |
@@ -203,6 +208,9 @@ func (dprh *devicePluginReconcilerHelper) handleDevicePlugin(ctx context.Context | |||
func (dprh *devicePluginReconcilerHelper) garbageCollect(ctx context.Context, | |||
mod *kmmv1beta1.Module, | |||
existingDS []appsv1.DaemonSet) error { | |||
if mod.Spec.ModuleLoader == 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.
lets add a comment here that explains why we don't need to go through garbage collect flow in case module loader does not exists
@@ -182,9 +182,14 @@ func (dprh *devicePluginReconcilerHelper) handleDevicePlugin(ctx context.Context | |||
} | |||
|
|||
logger := log.FromContext(ctx) | |||
ds := getExistingDS(existingDevicePluginDS, mod.Namespace, mod.Name, mod.Spec.ModuleLoader.Container.Version) | |||
version := "" |
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.
WDYT about moving this logic into the getExistingDS function? It will receive the Moduleloader pointer instead of the version itself
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.
@yevgeny-shnaidman I can do but either way I have to do something like
version := ""
if mod.Spec.ModuleLoader != nil {
version = mod.Spec.ModuleLoader.Container.Version
}
for the log line down below in order to not get a nil pointer reference error
logger.Info("creating new device plugin DS", "version", version)
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.
Done
if mod.Spec.ModuleLoader.Container.Modprobe.RawArgs != nil { | ||
modprobeRawArgs := strings.Join(mod.Spec.ModuleLoader.Container.Modprobe.RawArgs.Load, ",") | ||
dprh.metricsAPI.SetKMMModprobeRawArgs(mod.Name, mod.Namespace, modprobeRawArgs) | ||
if mod.Spec.ModuleLoader != 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.
WDYT about moving the "if mod.Spec.ModuleLoader != nil {" above line 259? numModulesWithBuild and numModulesWithSign need to be calculated only in case ModuleLoader is not nil. And, in addition, we want have to change the isModuleBuildAndSignCapable function, since the pointer was verified prior to calling that function
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.
@yevgeny-shnaidman isModuleBuildAndSignCapable returns false, false
whenever ModuleLoader is nil automatically though
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.
Done
@@ -351,10 +361,12 @@ func (dsci *daemonSetCreatorImpl) setDevicePluginAsDesired( | |||
standardLabels := map[string]string{constants.ModuleNameLabel: mod.Name} | |||
nodeSelector := map[string]string{utils.GetKernelModuleReadyNodeLabel(mod.Namespace, mod.Name): ""} | |||
|
|||
if mod.Spec.ModuleLoader.Container.Version != "" { | |||
if mod.Spec.ModuleLoader != nil && mod.Spec.ModuleLoader.Container.Version != "" { |
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.
determining the labels has not become a little bit more complicated. WDYT about moving it to a dedicated function?
4a2fa3e
to
db8b713
Compare
When KMM is used by 3rd party vendor operators, they need an option to configure KMM Module not to load OOT kernel driver, but use the in-tree one, and just run the device-plugin. This commit makes moduleLoader in Module cr a pointer, hence making it an optional field.
db8b713
to
5025177
Compare
/lgtm |
When KMM is used by 3rd party vendor operators, they need an option to configure KMM Module to not load OOT kernel driver, but use the in-tree one, and just run the device-plugin.
This commit makes moduleLoader in Module cr a pointer, and so making it an optional field.
/cc @ybettan @yevgeny-shnaidman