From dc63d8800ee38ee21ae5437a77c088ca44343ae5 Mon Sep 17 00:00:00 2001 From: Ujjwal Kumar Date: Tue, 2 Dec 2025 18:30:18 +0530 Subject: [PATCH 1/2] added 404 check for get floating ip Signed-off-by: Ujjwal Kumar --- builder/ibmcloud/vpc/step_create_instance.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/ibmcloud/vpc/step_create_instance.go b/builder/ibmcloud/vpc/step_create_instance.go index 25892ea..d3a1f06 100644 --- a/builder/ibmcloud/vpc/step_create_instance.go +++ b/builder/ibmcloud/vpc/step_create_instance.go @@ -378,7 +378,7 @@ func (step *stepCreateInstance) Cleanup(state multistep.StateBag) { options := vpcService.NewGetFloatingIPOptions(floatingIPID) floatingIPresponse, _, err := vpcService.GetFloatingIP(options) - if err != nil { + 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()) From 47227e6477f4ed2b02c94a09d595533a020197d7 Mon Sep 17 00:00:00 2001 From: Ujjwal Kumar Date: Tue, 2 Dec 2025 18:33:23 +0530 Subject: [PATCH 2/2] added 404 check for get floating ip Signed-off-by: Ujjwal Kumar --- builder/ibmcloud/vpc/step_create_instance.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/ibmcloud/vpc/step_create_instance.go b/builder/ibmcloud/vpc/step_create_instance.go index d3a1f06..5071ccc 100644 --- a/builder/ibmcloud/vpc/step_create_instance.go +++ b/builder/ibmcloud/vpc/step_create_instance.go @@ -377,7 +377,7 @@ func (step *stepCreateInstance) Cleanup(state multistep.StateBag) { floatingIPID := state.Get("floating_ip_id").(string) options := vpcService.NewGetFloatingIPOptions(floatingIPID) - floatingIPresponse, _, err := vpcService.GetFloatingIP(options) + 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)