-
Notifications
You must be signed in to change notification settings - Fork 32
Enable/Disable Auto Enrollment per Hardware #230
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
Enable/Disable Auto Enrollment per Hardware #230
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #230 +/- ##
==========================================
- Coverage 48.18% 48.14% -0.05%
==========================================
Files 101 102 +1
Lines 8596 8622 +26
==========================================
+ Hits 4142 4151 +9
- Misses 4201 4213 +12
- Partials 253 258 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Pull Request Overview
This PR implements the ability for individual Hardware objects to opt out of auto enrollment by restructuring the auto enrollment and discovery configuration. Key changes include:
- Refactoring the configuration into an AutoCapabilities structure with separate Enrollment and Discovery sections.
- Updating functional options, flags, and backend registration to support the new auto enrollment logic.
- Adding corresponding documentation changes and CRD updates to reflect the new configuration fields.
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tink/server/server.go | Refactored auto enrollment/discovery configuration into nested structs. |
| tink/server/internal/grpc/grpc.go | Updated GetAction and doGetAction functions to use the new options struct. |
| tink/server/internal/grpc/enrollment.go | Modified enrollment logic to enforce hardware auto enrollment settings. |
| tink/server/internal/grpc/discovery.go | Adjusted hardware lookup and creation logic to use the new interface. |
| helm/tinkerbell/values.yaml and templates | Updated Helm configuration for auto enrollment/discovery options. |
| docs/technical/AUTO_ENROLLMENT.md & AUTO_DISCOVERY.md | Revised documentation to describe new configuration options. |
| crd/bases/tinkerbell.org_hardware.yaml | Added CRD definitions for the new auto configuration. |
| cmd/tinkerbell/flag/tink_server.go | Registered new flags for auto enrollment/discovery. |
| api/v1alpha1/... | Updated API types and deepcopy functions for the auto configuration. |
Comments suppressed due to low confidence (2)
tink/server/internal/grpc/grpc.go:78
- Changing the opts parameter from a pointer to a value removes the nil check; ensure that every call to doGetAction always provides a fully initialized options struct to avoid potential nil pointer issues.
func (h *Handler) doGetAction(ctx context.Context, req *proto.ActionRequest, opts options) (*proto.ActionResponse, error) {
tink/server/internal/grpc/discovery.go:41
- The explicit check for multiple Hardware objects (via foundMultipleHardware) was removed; verify that handling multiple hardware errors through apierrors.IsNotFound(err) is sufficient for the intended behavior.
if !apierrors.IsNotFound(err) {
This allows individual Hardware objects to opt out of Auto Enrollment creating Workflows. This doesn't affect manual creation of Workflow. Manual creation of Workflows are unaffected by the field. This allows Agents with Hardware.Spec.Auto.EnrollmentEnabled=false to be running and waiting for a Workflow to be created without Auto Enrollment creating a Workflow. This enables Agents to be waiting and run Workflows quickly when one is manually created. Signed-off-by: Jacob Weinstock <[email protected]>
c18130f to
3faa304
Compare
Signed-off-by: Jacob Weinstock <[email protected]>
Description
This allows individual Hardware objects to opt out of Auto Enrollment, creating Workflows. This doesn't affect the manual creation of Workflows. Manual creation of Workflows is unaffected by the field.
This allows Agents with Hardware.Spec.Auto.EnrollmentEnabled=false to be running and waiting for a Workflow to be created without Auto Enrollment creating a Workflow. This enables Agents to be waiting and run Workflows quickly when one is manually created.
This field defaults to
false. This should make it a seamless upgrade.Why is this needed
Fixes: #
How Has This Been Tested?
How are existing users impacted? What migration steps/scripts do we need?
Checklist:
I have: