Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new Kubernetes DaemonSet primitive to the operator-component-framework, following the established patterns of existing workload primitives (e.g., deployment) and providing an end-to-end example plus documentation.
Changes:
- Introduces
pkg/primitives/daemonset/with builder, resource wrapper, status handlers, mutator (with selectors/editors), flavors, and tests. - Adds a new shared editor
pkg/mutation/editors/DaemonSetSpecEditorwith unit tests. - Adds an
examples/daemonset-primitive/runnable example anddocs/primitives/daemonset.mddocumentation.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/primitives/daemonset/resource.go | Workload resource wrapper delegating lifecycle hooks to generic workload resource. |
| pkg/primitives/daemonset/builder.go | Fluent builder wiring defaults (applicator, handlers) and mutation/flavor/extractor registration. |
| pkg/primitives/daemonset/handlers.go | Default converge/grace/suspend handlers for DaemonSet lifecycle/health. |
| pkg/primitives/daemonset/flavors.go | Field-application “flavors” to preserve selected live fields (labels/annotations/template metadata). |
| pkg/primitives/daemonset/mutator.go | Planned mutation engine for DaemonSet (metadata/spec/podspec/containers + presence ops + snapshots). |
| pkg/primitives/daemonset/builder_test.go | Builder API/validation/handler wiring tests. |
| pkg/primitives/daemonset/handlers_test.go | Unit tests for default status/suspension handlers. |
| pkg/primitives/daemonset/flavors_test.go | Unit tests for flavors and flavor ordering/error propagation. |
| pkg/primitives/daemonset/mutator_test.go | Extensive mutator behavior tests (ordering, presence ops, snapshots, nil-safety). |
| pkg/mutation/editors/daemonsetspec.go | Adds typed editor for appsv1.DaemonSetSpec. |
| pkg/mutation/editors/daemonsetspec_test.go | Unit tests for the new DaemonSetSpec editor. |
| examples/daemonset-primitive/app/owner.go | Re-exports shared example CRD types for the new example. |
| examples/daemonset-primitive/app/controller.go | Example controller wiring a component with the DaemonSet primitive. |
| examples/daemonset-primitive/features/mutations.go | Example feature-gated mutations using the DaemonSet mutator APIs. |
| examples/daemonset-primitive/features/flavors.go | Example flavors wiring for preserving labels/annotations. |
| examples/daemonset-primitive/resources/daemonset.go | Example DaemonSet resource factory composing builder + features + flavors + extraction. |
| examples/daemonset-primitive/main.go | Runnable fake-client reconciliation sequence demonstrating the primitive. |
| examples/daemonset-primitive/README.md | Example documentation and run instructions. |
| docs/primitives/daemonset.md | Public documentation for the new primitive (API, ordering, editors, suspension, status). |
Claude Review Cycle 1 CompleteAddressed:
Intentionally ignored:
<!-- claude-review-cycle --> |
Claude Review Cycle 1 CompleteAddressed:
Intentionally ignored:
|
Claude Review Cycle 2 CompleteAddressed:
Intentionally ignored:
<!-- claude-review-cycle --> |
c0099c7 to
2638488
Compare
|
approved |
Claude Review Cycle 1 CompleteAddressed:
Intentionally ignored:
<!-- claude-review-cycle --> |
Claude Review Cycle 2 CompleteAddressed:
Intentionally ignored:
|
Claude Review Cycle 1 CompleteAddressed:
Intentionally ignored:
|
Align the daemonset DefaultFieldApplicator doc comment with the deployment primitive to explicitly mention that the Status subresource is preserved, matching the actual implementation behavior. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Claude Review Cycle 3 CompleteAddressed:
Intentionally ignored:
<!-- claude-review-cycle --> |
Claude Review Cycle 4 CompleteAddressed: Intentionally ignored:
<!-- claude-review-cycle --> |
Claude Review Cycle 5 CompleteAddressed:
Intentionally ignored: <!-- claude-review-cycle --> |
Implements the
daemonsetKubernetes resource primitive following the pattern established by the existingConfigMapandDeploymentprimitives.Summary
daemonsetprimitive package underpkg/primitives/daemonset/DaemonSetSpecEditorto sharedpkg/mutation/editors/packagedocs/primitives.mdwith daemonset primitive documentationChecklist
docs/primitives.md,pkg/mutation/editors/daemonsetspec.go