This repository was archived by the owner on Jun 11, 2025. It is now read-only.
fix: cleans up service binding dns records, when synced without#363
Merged
Conversation
Reviewer's Guide by SourceryThis pull request addresses the cleanup of service binding DNS records when synced without certain conditions. It modifies the behavior of service binding updates, improves DNS query handling, and adjusts logging configuration. File-Level Changes
Tips
|
There was a problem hiding this comment.
Hey @nxtcoder17 - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.
| } | ||
|
|
||
| if svcb.Spec.ServiceIP == nil { | ||
| if svcb.Spec.ServiceIP == nil || svcb.Spec.Hostname == "" { |
There was a problem hiding this comment.
suggestion: Consider adding a comment explaining the rationale for deleting the service binding.
It would be helpful to clarify why we're deleting the service binding when either ServiceIP or Hostname is empty. This would improve code maintainability and make the intention clearer for future developers.
// Delete service binding if ServiceIP or Hostname is empty, as these are required fields
if svcb.Spec.ServiceIP == nil || svcb.Spec.Hostname == "" {
if err := d.serviceBindingRepo.DeleteOne(ctx, filter); err != nil {
if !errors.Is(err, repos.ErrNoDocuments) {
return err
}
}
return nil
}
if _, err := d.serviceBindingRepo.Upsert(ctx, filter, &entities.ServiceBinding{
ServiceBinding: *svcb,
AccountName: ctx.AccountName,
ClusterName: opts.ClusterName,
a9a65e8 to
f11f65d
Compare
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Resolves kloudlite/kloudlite#284
Summary by Sourcery
Fix the cleanup of DNS records for service bindings when the hostname is missing or the service IP is nil, and enhance logging in the DNS resolver for better debugging.
Bug Fixes:
Enhancements: