Repository navigation
fix(operator): enable GMS snapshot by default - #12685
Conversation
|
🎯 Code Coverage (details) 🔗 Commit SHA: 1b3550b | Docs | Datadog PR Page | Give us feedback! |
213fc34 to
681375a
Compare
afb94f5 to
3a0e204
Compare
WalkthroughThe operator removes the temporary GMSSnapshot feature gate. Checkpoint creation and resolution no longer use that gate. A shared compatibility validator rejects unsupported checkpoint combinations during admission and reconciliation. ChangesCheckpoint and GMS snapshot consolidation
Estimated code review effort: 4 (Complex) | ~45 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (6)
deploy/operator/cmd/main.go (1)
646-650: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd a story comment for this registration block.
Add a one-line comment that states that GMS pod replacement is registered when the
Checkpointgate is enabled.Proposed change
+ // Register GMS pod replacement when checkpoint support is enabled. if runtimeConfig.Gate.Enabled(features.Checkpoint) {As per coding guidelines, “In Go code, put a one-line story comment above every multi-line block of logically connected code.”
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@deploy/operator/cmd/main.go` around lines 646 - 650, Add a one-line story comment immediately above the Checkpoint-gated registration block in the setup flow, stating that GMS pod replacement is registered when the Checkpoint feature gate is enabled; leave the existing controller.SetupGMSPodReplacement behavior unchanged.Source: Coding guidelines
deploy/operator/internal/checkpoint/checkpoint_test.go (1)
463-482: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd
t.Logheadings for the new test steps.
deploy/operator/internal/checkpoint/checkpoint_test.go#L463-L482: Add headings before checkpoint creation and GMS configuration assertions.deploy/operator/internal/checkpoint/checkpoint_test.go#L786-L792: Add a heading before resolving the enabled configuration without a reference or identity.deploy/operator/internal/controller/dynamocheckpoint_controller_test.go#L574-L612: Add headings before fixture preparation, reconciliation, and status and Job assertions.As per coding guidelines, “In Go tests, use
t.Logto explain the test's story, with one heading before each block implementing a test step.”🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@deploy/operator/internal/checkpoint/checkpoint_test.go` around lines 463 - 482, Add t.Log headings for each test-step block: in deploy/operator/internal/checkpoint/checkpoint_test.go:463-482, log before checkpoint creation and before GMS configuration assertions; in deploy/operator/internal/checkpoint/checkpoint_test.go:786-792, log before resolving the enabled configuration without a reference or identity; and in deploy/operator/internal/controller/dynamocheckpoint_controller_test.go:574-612, log before fixture preparation, reconciliation, and status/Job assertions.Source: Coding guidelines
deploy/operator/internal/controller/dynamocomponentdeployment_controller.go (1)
169-176: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueThe
deletedbranch is now unreachable.The new early return at Line 134 handles every object that carries a deletion timestamp.
HandleFinalizercan reportdeleted == trueonly for a deleting object, sodeletedis always false here and Lines 174-176 never run. Drop the unused result to keep the control flow honest.♻️ Proposed simplification
- deleted, err := commonController.HandleFinalizer(ctx, dynamoComponentDeployment, r.Client, r) - if err != nil { + if _, err = commonController.HandleFinalizer(ctx, dynamoComponentDeployment, r.Client, r); err != nil { logs.Error(err, "Failed to handle finalizer") return ctrl.Result{}, err } - if deleted { - return ctrl.Result{}, nil - }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@deploy/operator/internal/controller/dynamocomponentdeployment_controller.go` around lines 169 - 176, Remove the unused deleted result and its unreachable conditional return from the HandleFinalizer call in the reconcile flow; retain the existing error handling and return the normal result after successful finalizer handling.deploy/operator/internal/webhook/validation/dynamocheckpoint_handler_test.go (1)
166-182: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRemove the duplicated table row.
This case builds the same fixture as "unprepared pod wiring aggregates in Kubernetes PodSpec declaration order" at Lines 116-132 and expects the identical six errors. After the
gmsSnapshotexpectation was dropped, the row adds no new behavior. Delete it and keep the earlier row.As per coding guidelines: "Prefer table tests over one-off Go tests and do not duplicate behavior already covered by a table."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@deploy/operator/internal/webhook/validation/dynamocheckpoint_handler_test.go` around lines 166 - 182, Remove the duplicated “preparation failures aggregate” table entry from the validation test cases, keeping the earlier “unprepared pod wiring aggregates in Kubernetes PodSpec declaration order” case and its existing expectations unchanged.Source: Coding guidelines
deploy/operator/internal/webhook/validation/dynamocomponentdeployment_validation_envtest_test.go (1)
454-514: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueThe "without job" case names describe a distinction the rule does not make.
ValidateCheckpointCompatibilitynever readscheckpoint.job, none of these cases setsJob, and no paired "with job" case exists. The suffix therefore misleads a reader about the rule under test in both files.
deploy/operator/internal/webhook/validation/dynamocomponentdeployment_validation_envtest_test.go#L454-L514: drop the "without job" suffix from the four inter-pod GMS case names, for example "v1beta1 checkpoint with inter-pod GMS is rejected on create".deploy/operator/internal/webhook/validation/dynamographdeployment_validation_envtest_test.go#L1182-L1250: drop the same suffix from the four matching case names so both files name the rule identically.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@deploy/operator/internal/webhook/validation/dynamocomponentdeployment_validation_envtest_test.go` around lines 454 - 514, Rename the four inter-pod GMS test cases in deploy/operator/internal/webhook/validation/dynamocomponentdeployment_validation_envtest_test.go lines 454-514 and the four matching cases in deploy/operator/internal/webhook/validation/dynamographdeployment_validation_envtest_test.go lines 1182-1250 to remove the misleading “without job” suffix, while preserving the existing test behavior and expected errors.deploy/operator/internal/controller/dynamographdeployment_controller_test.go (1)
177-187: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert failure
ObservedGenerationsemantics.Assert that
ready.ObservedGeneration == dgd.Generationandstored.Status.ObservedGenerationremains zero. Failure conditions identify the failed generation, but status-levelObservedGenerationadvances only after error-free reconciliation.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@deploy/operator/internal/controller/dynamographdeployment_controller_test.go` around lines 177 - 187, Extend the failure-status assertions in the test around ready and stored.Status to verify ready.ObservedGeneration equals dgd.Generation, while stored.Status.ObservedGeneration remains zero. Keep the existing failure state, reason, and message assertions unchanged.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@deploy/operator/internal/controller/dynamographdeployment_controller.go`:
- Around line 142-150: Stop retrying terminal compatibility failures in both
deploy/operator/internal/controller/dynamographdeployment_controller.go:142-150
and
deploy/operator/internal/controller/dynamocomponentdeployment_controller.go:163-167:
persist the failure condition, return any status-write error, and otherwise
return ctrl.Result{}, nil. In the DCD controller, update Available=False with
the joined compatibility message instead of assigning it to the named err;
update the compatibility tests to expect no reconcile error.
---
Nitpick comments:
In `@deploy/operator/cmd/main.go`:
- Around line 646-650: Add a one-line story comment immediately above the
Checkpoint-gated registration block in the setup flow, stating that GMS pod
replacement is registered when the Checkpoint feature gate is enabled; leave the
existing controller.SetupGMSPodReplacement behavior unchanged.
In `@deploy/operator/internal/checkpoint/checkpoint_test.go`:
- Around line 463-482: Add t.Log headings for each test-step block: in
deploy/operator/internal/checkpoint/checkpoint_test.go:463-482, log before
checkpoint creation and before GMS configuration assertions; in
deploy/operator/internal/checkpoint/checkpoint_test.go:786-792, log before
resolving the enabled configuration without a reference or identity; and in
deploy/operator/internal/controller/dynamocheckpoint_controller_test.go:574-612,
log before fixture preparation, reconciliation, and status/Job assertions.
In `@deploy/operator/internal/controller/dynamocomponentdeployment_controller.go`:
- Around line 169-176: Remove the unused deleted result and its unreachable
conditional return from the HandleFinalizer call in the reconcile flow; retain
the existing error handling and return the normal result after successful
finalizer handling.
In
`@deploy/operator/internal/controller/dynamographdeployment_controller_test.go`:
- Around line 177-187: Extend the failure-status assertions in the test around
ready and stored.Status to verify ready.ObservedGeneration equals
dgd.Generation, while stored.Status.ObservedGeneration remains zero. Keep the
existing failure state, reason, and message assertions unchanged.
In
`@deploy/operator/internal/webhook/validation/dynamocheckpoint_handler_test.go`:
- Around line 166-182: Remove the duplicated “preparation failures aggregate”
table entry from the validation test cases, keeping the earlier “unprepared pod
wiring aggregates in Kubernetes PodSpec declaration order” case and its existing
expectations unchanged.
In
`@deploy/operator/internal/webhook/validation/dynamocomponentdeployment_validation_envtest_test.go`:
- Around line 454-514: Rename the four inter-pod GMS test cases in
deploy/operator/internal/webhook/validation/dynamocomponentdeployment_validation_envtest_test.go
lines 454-514 and the four matching cases in
deploy/operator/internal/webhook/validation/dynamographdeployment_validation_envtest_test.go
lines 1182-1250 to remove the misleading “without job” suffix, while preserving
the existing test behavior and expected errors.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 50de8d55-267a-4019-a093-a2cb9a90ef63
📒 Files selected for processing (27)
deploy/helm/charts/platform/components/operator/templates/deployment.yamldeploy/helm/charts/platform/components/operator/values.yamldeploy/operator/cmd/main.godeploy/operator/config/samples/nvidia.com_v1alpha1_dynamocheckpoint.yamldeploy/operator/internal/checkpoint/checkpoint_test.godeploy/operator/internal/checkpoint/compatibility.godeploy/operator/internal/checkpoint/compatibility_test.godeploy/operator/internal/checkpoint/gms_snapshot_gate.godeploy/operator/internal/checkpoint/resolve.godeploy/operator/internal/checkpoint/resource.godeploy/operator/internal/controller/dgd_checkpoints_reconciler.godeploy/operator/internal/controller/dgd_checkpoints_reconciler_test.godeploy/operator/internal/controller/dgd_gms_resource_claims_reconciler_test.godeploy/operator/internal/controller/dynamocheckpoint_controller.godeploy/operator/internal/controller/dynamocheckpoint_controller_test.godeploy/operator/internal/controller/dynamocomponentdeployment_controller.godeploy/operator/internal/controller/dynamocomponentdeployment_controller_test.godeploy/operator/internal/controller/dynamocomponentdeployment_renderer.godeploy/operator/internal/controller/dynamographdeployment_controller.godeploy/operator/internal/controller/dynamographdeployment_controller_test.godeploy/operator/internal/features/gates.godeploy/operator/internal/features/gates_test.godeploy/operator/internal/webhook/validation/dynamocheckpoint.godeploy/operator/internal/webhook/validation/dynamocheckpoint_handler_test.godeploy/operator/internal/webhook/validation/dynamocomponentdeployment_validation_envtest_test.godeploy/operator/internal/webhook/validation/dynamographdeployment_validation_envtest_test.godeploy/operator/internal/webhook/validation/shared_v1beta1.go
💤 Files with no reviewable changes (10)
- deploy/operator/internal/checkpoint/gms_snapshot_gate.go
- deploy/operator/internal/controller/dynamocomponentdeployment_renderer.go
- deploy/operator/config/samples/nvidia.com_v1alpha1_dynamocheckpoint.yaml
- deploy/helm/charts/platform/components/operator/values.yaml
- deploy/operator/internal/checkpoint/resource.go
- deploy/operator/internal/controller/dynamocheckpoint_controller.go
- deploy/operator/internal/webhook/validation/dynamocheckpoint.go
- deploy/operator/internal/checkpoint/resolve.go
- deploy/operator/internal/features/gates_test.go
- deploy/helm/charts/platform/components/operator/templates/deployment.yaml
|
lgtm, the current guide still says GMS Snapshot is disabled and requires the internal gate removed by this PR. After merge, users will be directed toward nonexistent featureGates.gmsSnapshot configuration. Update snapshot.md to describe ordinary IntraPod support and the remaining InterPod/failover restrictions. |
79d7343 to
e3ff0f5
Compare
|
/ok to test e3ff0f5 |
Signed-off-by: Schwinn Saereesitthipitak <schwinns@nvidia.com>
Signed-off-by: Schwinn Saereesitthipitak <schwinns@nvidia.com>
e3ff0f5 to
2446435
Compare
|
/ok to test 2446435 |
1 similar comment
|
/ok to test 2446435 |
2446435 to
bfb4cee
Compare
|
/ok to test bfb4cee |
1 similar comment
|
/ok to test bfb4cee |
Signed-off-by: Schwinn Saereesitthipitak <schwinns@nvidia.com>
bfb4cee to
1b3550b
Compare
|
/ok to test 1b3550b |
Summary
Implements the second delivery step of #12671.
Where should the reviewer start?
Start with
deploy/operator/internal/checkpoint/compatibility.go, then follow its use from webhook validation into the DGD and DCD reconciliation preflight.Validation
go test -count=1 ./internal/checkpoint ./internal/features ./internal/controller ./internal/webhook/validation ./internal/webhook/setup ./cmdgo vet ./internal/checkpoint ./internal/features ./internal/controller ./internal/webhook/validation ./internal/webhook/setup ./cmdhelm lint deploy/helm/charts/platform/components/operator --set discoveryBackend=kubernetesRelated Issues