NRI Plugin Refactoring - #751
Conversation
| // Grouped in the order the plugin uses them: how the process behaves, | ||
| // how it attaches to the runtime, then one group per injection step. | ||
| Flags: slices.Concat( | ||
| processFlags(), |
There was a problem hiding this comment.
Too many flags, had to group them like this 😃
9a80e21 to
9b25b68
Compare
9b25b68 to
f7177f0
Compare
Greptile SummaryThe refactor separates NRI runtime integration from injection logic and consolidates health-probe handling.
Reviews (11): Last reviewed commit: "Updated changelog" | Re-trigger Greptile |
f7177f0 to
507bc4f
Compare
8a51f10 to
845df21
Compare
845df21 to
9a47aca
Compare
9a47aca to
d76f79a
Compare
Signed-off-by: Roman Hlushko <rhlushko@nvidia.com>
…rm a plugin pipeline Signed-off-by: Roman Hlushko <rhlushko@nvidia.com>
Signed-off-by: Roman Hlushko <rhlushko@nvidia.com>
Signed-off-by: Roman Hlushko <rhlushko@nvidia.com>
Signed-off-by: Roman Hlushko <rhlushko@nvidia.com>
d76f79a to
a365233
Compare
Signed-off-by: Roman Hlushko <rhlushko@nvidia.com>
Signed-off-by: Roman Hlushko <rhlushko@nvidia.com>
…rm a plugin pipeline Signed-off-by: Roman Hlushko <rhlushko@nvidia.com>
Signed-off-by: Roman Hlushko <rhlushko@nvidia.com>
Signed-off-by: Roman Hlushko <rhlushko@nvidia.com>
Signed-off-by: Roman Hlushko <rhlushko@nvidia.com>
Signed-off-by: Roman Hlushko <rhlushko@nvidia.com>
c5e99a3 to
e5b2a4c
Compare
ArangoGutierrez
left a comment
There was a problem hiding this comment.
Thanks for this. Splitting adjust.go into one file per injection step makes the pipeline much easier to follow, and the step order, the three-arm GPU switch and every fail-open branch come through the move unchanged.
The behaviour moved with the code; what is left to tidy sits around the refactor rather than inside it.
- The shipped binary changes name (nvml-mock-nri to nri-plugin), all fourteen env-var bindings move to the MOKKA_NRI_ prefix, the --plugin-name default becomes mokka-nri-plugin, and pkg/nri/nvmlmock stops being importable, with nothing recorded under [Unreleased]. Anyone configuring the plugin through the environment falls back to defaults after this with no signal. (CHANGELOG.md:8)
Lines 6 to 10 in e5b2a4c
- The DefaultConfig comment says it returns the identity the chart deploys with, but the chart passes --plugin-name=nvml-mock from values.yaml while the default here is mokka-nri-plugin. Rewording it keeps the next reader from trusting the default to match a real deployment. (internal/nri/config.go:27)
|
|
||
| nri: | ||
| enabled: false | ||
| logging: |
There was a problem hiding this comment.
nodeAgent.logging and controlPlane.logging both declare level and format enums in values.schema.json, but nri.logging does not, so --set nri.logging.level=verbose templates cleanly and then the plugin exits 1 on ParseLevel. Copying that schema block under properties.nri keeps a typo failing at template time instead of on every node.
| for _, sim := range a.simulators { | ||
| m[sim.Name()] = sim.Ready() | ||
| ready := sim.Ready() | ||
| if !ready { |
There was a problem hiding this comment.
Deleting these two lines leaves the agent and health suites green, so /readyz would answer 200 for a node whose simulator is not ready. TestReadyz_OneNotReady covered exactly this rule before the move; a case in agent_test.go driving Readiness with one simulator down would put it back.
Signed-off-by: Roman Hlushko <rhlushko@nvidia.com>
# Conflicts: # deployments/nvml-mock/helm/nvml-mock/tests/nri_daemonset_test.yaml
c547033
Signed-off-by: Roman Hlushko <rhlushko@nvidia.com>
Signed-off-by: Roman Hlushko <rhlushko@nvidia.com>
What This PR Does
Refactoring NRI plugin to:
urfave/clias CLI frameworkSince we have three components that behave like servers (Node Agent, Control Plane, NRI), I have promoted the health server logic into its own package reused in all three.
Why
It's stemmed from MEP0003. I'm keeping NRI in line with the recent restructuring and revisiting it's codebase to make sure it's clearly organized.
Checklist
git commit -s)go test -v -race ./...)make lint-fix)Stack created with GitHub Stacks CLI • Give Feedback 💬