fix: deploy csi node daemonset for each wekaclient#2582
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
How to use the Graphite Merge QueueAdd the label main-merge-queue to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has required the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
Claude finished @assafgi's task in 5m 13s —— View job PR Review: deploy CSI node DaemonSet for each WekaClient
The change moves CSI node DaemonSet ownership from a single shared per-CSI-group DaemonSet to one DaemonSet per 🔴 1.
|
Graphite Automations"Add anton/matt/sergey/kristina as reviwers on operator PRs" took an action on this PR • (06/09/26)2 reviewers were added to this PR based on Anton Bykov's automation. |
There was a problem hiding this comment.
Pull request overview
This PR changes CSI node deployment from a single shared DaemonSet (per CSI group) to a per-WekaClient DaemonSet model, and adjusts CSI deployment/cleanup logic accordingly within the operator reconciliation flow.
Changes:
- Add per-client CSI node DaemonSet deploy/undeploy handling in the
WekaClientreconciliation loop and update the node DaemonSet update path to target the per-client DaemonSet name. - Remove CSI node DaemonSet management from the shared
DeployCsiOperationand replace it with cleanup of the legacy shared DaemonSet name. - Update CSI node DaemonSet naming and hashing to incorporate a “client identifier” input.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| internal/controllers/wekaclient/client_reconciler_loop.go | Adds per-client CSI node DaemonSet deploy/undeploy steps and switches update/get paths to per-client naming. |
| internal/controllers/operations/deploy_csi.go | Removes node DaemonSet deploy/undeploy from the shared CSI operation and adds cleanup for the legacy shared DaemonSet. |
| internal/controllers/operations/csi/daemonset.go | Updates CSI node DaemonSet name/hash generation to accept a client identifier and generate per-client names. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| err = c.Create(ctx, daemonSetSpec) | ||
| if err != nil { | ||
| return fmt.Errorf("failed to create CSI node daemonset for client %s: %w", c.wekaClient.Name, err) | ||
| } |
| daemonSetSpec, err := csi.NewCsiNodeDaemonSet(ctx, c.GetCSIGroup(), c.wekaClient, c.wekaClient.Name, c.nodes) | ||
| if err != nil { |
| ctx, logger := instrumentation.CreateLogSpan(ctx, "UndeployCsiNodeDaemonSetForClient") | ||
| defer logger.End() | ||
|
|
||
| nodeDaemonSetName := csi.GetCSINodeDaemonSetNameForClient(c.GetCSIGroup(), c.wekaClient.Name) |
| targetDaemonSet, err := csi.NewCsiNodeDaemonSet(ctx, c.GetCSIGroup(), c.wekaClient, c.wekaClient.Name, c.nodes) | ||
| if err != nil { |
| defer logger.End() | ||
|
|
||
| nodeDaemonSetName := csi.GetCSINodeDaemonSetName(c.GetCSIGroup()) | ||
| nodeDaemonSetName := csi.GetCSINodeDaemonSetNameForClient(c.GetCSIGroup(), c.wekaClient.Name) |
| func GetCSINodeDaemonSetNameForClient(csiGroupName, clientName string) string { | ||
| base := strings.ReplaceAll(csiGroupName, ".", "-") + "-csi-node-" + strings.ReplaceAll(clientName, ".", "-") | ||
| if len(base) > 63 { | ||
| base = base[:63] | ||
| } | ||
| // Ensure name doesn't end with a hyphen | ||
| base = strings.TrimRight(base, "-") | ||
| return base | ||
| } |
| &lifecycle.SimpleStep{ | ||
| Name: "CleanupLegacyCsiNodePods", | ||
| Run: o.cleanupLegacyCsiNodePods, | ||
| Predicates: lifecycle.Predicates{ | ||
| func() bool { return !o.csiNodeDaemonSetExists }, | ||
| }}, | ||
| &lifecycle.SimpleStep{ | ||
| Name: "DeployCsiNodeDaemonSet", | ||
| Run: o.deployCsiNodeDaemonSet, | ||
| Predicates: lifecycle.Predicates{ | ||
| func() bool { return !o.csiNodeDaemonSetExists }, | ||
| }}, | ||
| Name: "CleanupOldSharedCsiNodeDaemonSet", | ||
| Run: o.cleanupOldSharedCsiNodeDaemonSet, | ||
| }, |
d17f806 to
66c4644
Compare
|
Claude finished @assafgi's task in 1m 23s —— View job Re-review (post force-push)The branch was amended at
🔴 1. Non-idempotent
|
66c4644 to
5daf734
Compare
|
Claude finished @assafgi's task in 1m 34s —— View job Re-review (fixes applied) ✅The new push to
✅ 1. Non-idempotent
|

No description provided.