Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jacobweinstock
Copy link
Member

Description

Some observed errors were noted when toggling allowPXE.

"Operation cannot be fulfilled on the object has been modified; please apply your changes to the latest version and try again"

This updates the code to get the Hardware object again so that the Update will be successful.

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:

  • updated the documentation and/or roadmap (if required)
  • added unit or e2e tests
  • provided instructions on how to upgrade

There were some observed errors with toggling allowPXE.

"Operation cannot be fulfilled on the object has been modified;
please apply your changes to the latest version and try again"

This gets the Hardware object again so that the Update
will be successful.

Signed-off-by: Jacob Weinstock <[email protected]>
Copilot

This comment was marked as outdated.

Use a for loop instead of goto.
goto's are difficult to debug and maintain.
Handle nil spec.interfaces.netboot structs.

Signed-off-by: Jacob Weinstock <[email protected]>
Signed-off-by: Jacob Weinstock <[email protected]>
@jacobweinstock jacobweinstock requested a review from Copilot July 18, 2025 00:56
Copilot

This comment was marked as outdated.

@codecov
Copy link

codecov bot commented Jul 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 48.39%. Comparing base (bb1b86e) to head (b01f44c).
Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #254      +/-   ##
==========================================
+ Coverage   48.08%   48.39%   +0.30%     
==========================================
  Files         102      102              
  Lines        8622     8648      +26     
==========================================
+ Hits         4146     4185      +39     
+ Misses       4217     4208       -9     
+ Partials      259      255       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jacobweinstock jacobweinstock requested a review from Copilot July 18, 2025 01:02
Copilot

This comment was marked as outdated.

Provides a backoff to retrying the Get Hardware
calls to the Kube API server.

Signed-off-by: Jacob Weinstock <[email protected]>
@jacobweinstock jacobweinstock requested a review from Copilot July 18, 2025 02:28
Copilot

This comment was marked as outdated.

Signed-off-by: Jacob Weinstock <[email protected]>
@jacobweinstock jacobweinstock requested a review from Copilot July 18, 2025 02:35
Copilot

This comment was marked as outdated.

@jacobweinstock jacobweinstock requested a review from Copilot July 18, 2025 02:40
Copy link
Contributor

Copilot AI left a 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 adds resilience to toggling the allowPXE field in Hardware objects by implementing a retry mechanism with exponential backoff to handle conflict errors that occur when multiple processes attempt to modify the same Hardware object simultaneously.

  • Implements retry logic with exponential backoff for handling Kubernetes API conflict errors
  • Adds comprehensive test coverage for the retry mechanism and various edge cases
  • Updates existing test calls to include the new backoff configuration parameter

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
tink/controller/internal/workflow/hardware.go Implements retry mechanism with exponential backoff for setAllowPXE function to handle conflict errors
tink/controller/internal/workflow/hardware_test.go Adds comprehensive test suite covering retry mechanisms, conflict scenarios, and edge cases
tink/controller/internal/workflow/reconciler_test.go Updates existing test call to include new backoff configuration parameter

@jacobweinstock jacobweinstock added the ready-to-merge Signal Mergify to merge the PR label Jul 18, 2025
mergify bot added a commit that referenced this pull request Jul 18, 2025
@mergify mergify bot merged commit 863c916 into tinkerbell:main Jul 18, 2025
11 checks passed
@jacobweinstock jacobweinstock deleted the toggle-fix branch August 20, 2025 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Signal Mergify to merge the PR tink-controller

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant