-
Notifications
You must be signed in to change notification settings - Fork 716
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
Fix resetting service type to default when not specified #8165
Merged
Merged
Changes from 9 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
32fe7f9
Unit test verifying that the external service has the default cluster…
thbkrkr 5b63694
Update NewExternalService with default ClusterIP if type not set
thbkrkr d692c82
Unit test verifying that a services needs to be recreated to go from …
thbkrkr d95f488
Shortcut applyServerSideValues when the service type has changed
thbkrkr 1dbb757
Skip reconciliation if resource is being deleted
thbkrkr 0d3a897
Check being deleted only after deleting
thbkrkr d38519e
Revert explicit check on type to recreate when type changes
thbkrkr 4a9aac0
Update unit tests with default ClusterIP value
thbkrkr ecaf23e
nit: reuse svc and move
thbkrkr 0218fd6
Revert being deleted detection in favor of handling AlreadyExists err…
thbkrkr 79a182d
skip applyServerSideValues if the service type changes from something…
thbkrkr f320dcc
Better message after requeuing for external service reconciliation
thbkrkr c2acb4b
Merge branch 'main' into fix-reset-service-type
thbkrkr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
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.
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.
"Waiting" seems a bit misleading to me. With this change it is up to the caller to detect that the resource has actually not been reconciled, and try again later. By "swallowing"/"hiding" the conflict and returning
nil
here we are assuming that the caller is going to do another attempt, but we can't be sure of that? This makes me feel that it should be up to the caller to decide what to do/log in case of a conflict, by usingapierrors.IsAlreadyExists()
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.
You are right, we can't be 100% sure that the caller will retry. You proposal looks a good idea.
This means we will delete and (try) to create until the deletion is effective.
The only thing that tickles me is that with the current log messages it can be a little confusing.
From LoadBalancer to ClusterIP:
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.
Is it when we requeue immediately, or when we just ignore the error in the driver? Maybe we could add an additional log in that specific case.
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.
It is when we ignore the error and then requeue in the driver (at the caller level), see 0218fd6.