Skip to content

fix: treat 404 on server delete as success#140

Open
nilsherzig wants to merge 1 commit into
hashicorp:mainfrom
nilsherzig:main
Open

fix: treat 404 on server delete as success#140
nilsherzig wants to merge 1 commit into
hashicorp:mainfrom
nilsherzig:main

Conversation

@nilsherzig

Copy link
Copy Markdown

same as in ServerStateRefreshFunc


Description

What code changed, and why?

Handling of 404 responses when trying to delete an instance the second time around. Simpler Version of #127, might be easier to merge? Similar logic is already used in the project at:

if _, ok := err.(gophercloud.ErrDefault404); ok {

same as in ServerStateRefreshFunc
@nilsherzig nilsherzig requested a review from a team as a code owner October 28, 2025 12:30
@hashicorp-cla-app

hashicorp-cla-app Bot commented Oct 28, 2025

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Copilot AI left a comment

Copy link
Copy Markdown

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 updates the OpenStack builder’s server deletion logic to treat a 404 Not Found response during servers.Delete / servers.ForceDelete as a successful outcome, avoiding failures when cleanup tries to delete the same instance twice (e.g., in volume-based workflows where multiple steps may attempt termination).

Changes:

  • Treat gophercloud.ErrDefault404 from server delete operations as success and return nil.
  • Emit a user-facing message when the server is already deleted.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants