From 8d61a43f1307c4ba0fc9387e96d02f677a179211 Mon Sep 17 00:00:00 2001 From: Miroslav Vadkerti Date: Mon, 20 Oct 2025 23:12:15 +0200 Subject: [PATCH] fix: add missing 404 check for floating IP cleanup in step_create_instance MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes duplicate floating IP deletion error when using multiple provisioners. Both step_create_instance and step_waitfor_instance attempt to clean up the same floating IP, but only step_waitfor_instance had the 404 status check. Fixes #133 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- builder/ibmcloud/vpc/step_create_instance.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builder/ibmcloud/vpc/step_create_instance.go b/builder/ibmcloud/vpc/step_create_instance.go index 25892ea..5071ccc 100644 --- a/builder/ibmcloud/vpc/step_create_instance.go +++ b/builder/ibmcloud/vpc/step_create_instance.go @@ -377,8 +377,8 @@ func (step *stepCreateInstance) Cleanup(state multistep.StateBag) { floatingIPID := state.Get("floating_ip_id").(string) options := vpcService.NewGetFloatingIPOptions(floatingIPID) - floatingIPresponse, _, err := vpcService.GetFloatingIP(options) - if err != nil { + floatingIPresponse, response, err := vpcService.GetFloatingIP(options) + if err != nil && response.StatusCode != 404 { err := fmt.Errorf("[ERROR] Error getting the Floating IP: %s", err) state.Put("error", err) ui.Error(err.Error())