Improve error handling in SetControllerReference calls#172
Merged
chrisguidry merged 1 commit intomainfrom Jun 12, 2025
Merged
Conversation
This commit addresses the error handling gaps identified in issue #161. Changes: - Modified prefectServerDeployment() to return error and handle SetControllerReference failures - Modified prefectServerService() to return error and handle SetControllerReference failures - Added nil scheme checks to prevent panics - Updated all call sites to handle the new error return values - Added comprehensive error handling tests to verify proper error propagation Before this change, SetControllerReference errors were silently ignored with TODO comments, which could lead to resources not being properly owned by their controllers. Now these functions properly validate the scheme and propagate SetControllerReference errors to the caller, enabling proper error handling and status reporting. Test coverage remains at 56.3% with all tests passing. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
bunchesofdonald
approved these changes
Jun 12, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR addresses the error handling gaps identified in issue #161 by implementing proper error handling for
SetControllerReferencecalls in the PrefectServer controller.Problem
The helper functions
prefectServerDeployment()andprefectServerService()were ignoring errors fromSetControllerReferencecalls with TODO comments, which could lead to:Solution
Changes
prefectServerDeployment()now returns(deployment, pvc, job, error)instead of(deployment, pvc, job)prefectServerService()now returns(service, error)instead ofserviceTest Coverage
Testing
The new tests verify that:
Fixes #161
Test plan
🤖 Generated with Claude Code