Skip to content

Allow deletion of the ServerClaim when Server does not exist#70

Merged
afritzler merged 1 commit intomainfrom
fix/allow-deleting-serverclaim
Jul 4, 2024
Merged

Allow deletion of the ServerClaim when Server does not exist#70
afritzler merged 1 commit intomainfrom
fix/allow-deleting-serverclaim

Conversation

@hardikdr
Copy link
Copy Markdown
Member

@hardikdr hardikdr commented Jul 4, 2024

Proposed Changes

Allow deletion of the ServerClaim incase Server doesnt exist.

Fixes #

@hardikdr hardikdr marked this pull request as ready for review July 4, 2024 09:05
@github-actions github-actions bot added size/M bug Something isn't working labels Jul 4, 2024
@hardikdr hardikdr force-pushed the fix/allow-deleting-serverclaim branch from 255e7c7 to 15cffec Compare July 4, 2024 09:08

server := &metalv1alpha1.Server{}
if err := r.Client.Get(ctx, client.ObjectKey{Name: claim.Spec.ServerRef.Name}, server); err != nil {
if err := r.Client.Get(ctx, client.ObjectKey{Name: claim.Spec.ServerRef.Name}, server); err != nil && !apierrors.IsNotFound(err) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add here an if statement + logging. Something along the line: log.Info("Server gone")

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, made changes !!

@afritzler afritzler changed the title Allow deletion of the ServerClaim when Server does not exist Allow deletion of the ServerClaim when Server does not exist Jul 4, 2024
@hardikdr hardikdr force-pushed the fix/allow-deleting-serverclaim branch 2 times, most recently from 2528add to 59d08d6 Compare July 4, 2024 09:43
@hardikdr hardikdr force-pushed the fix/allow-deleting-serverclaim branch from 59d08d6 to c248b55 Compare July 4, 2024 09:56
@afritzler afritzler merged commit 875c6ab into main Jul 4, 2024
@afritzler afritzler deleted the fix/allow-deleting-serverclaim branch July 4, 2024 11:16
@hardikdr hardikdr added this to Roadmap Jun 26, 2025
@hardikdr hardikdr moved this to Done in Roadmap Jun 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants