diff --git a/go.sum b/go.sum index 10b0201ec2..03867c5b84 100644 --- a/go.sum +++ b/go.sum @@ -140,8 +140,6 @@ github.com/IBM/container-registry-go-sdk v1.1.0 h1:sYyknIod8R4RJZQqAheiduP6wbSTp github.com/IBM/container-registry-go-sdk v1.1.0/go.mod h1:4TwsCnQtVfZ4Vkapy/KPvQBKFc3VOyUZYkwRU4FTPrs= github.com/IBM/continuous-delivery-go-sdk/v2 v2.0.2 h1:yCJJnSLNYkpF7v9n0tw8CpQbSy43E/NbFOopRf1PgoM= github.com/IBM/continuous-delivery-go-sdk/v2 v2.0.2/go.mod h1:2MajFr6C5H2jyj7qtjBxAPnZAjbPiK4CAJNk3fKNnPo= -github.com/IBM/event-notifications-go-admin-sdk v0.10.0 h1:SbEG6Z9lJWQxNYexYmLRzF+seFokOW7bRKBgiyfYsls= -github.com/IBM/event-notifications-go-admin-sdk v0.10.0/go.mod h1:za2mdfBpox6hdsKaYTbE5ooCv2im8BYPq5yuKc7x5Ao= github.com/IBM/event-notifications-go-admin-sdk v0.11.0 h1:X/GhBE6dGRx8s79xYrdmv88ljD/8hSCyh9jMSUPCcCc= github.com/IBM/event-notifications-go-admin-sdk v0.11.0/go.mod h1:za2mdfBpox6hdsKaYTbE5ooCv2im8BYPq5yuKc7x5Ao= github.com/IBM/eventstreams-go-sdk v1.4.0 h1:yS/Ns29sBOe8W2tynQmz9HTKqQZ0ckse4Py5Oy/F2rM= diff --git a/ibm/service/power/resource_ibm_pi_capture.go b/ibm/service/power/resource_ibm_pi_capture.go index 107a432da9..e3e1dea544 100644 --- a/ibm/service/power/resource_ibm_pi_capture.go +++ b/ibm/service/power/resource_ibm_pi_capture.go @@ -8,6 +8,7 @@ import ( "errors" "fmt" "log" + "strings" "time" st "github.com/IBM-Cloud/power-go-client/clients/instance" @@ -196,7 +197,10 @@ func resourceIBMPICaptureCreate(ctx context.Context, d *schema.ResourceData, met imageClient := st.NewIBMPIImageClient(ctx, sess, cloudInstanceID) imagedata, err := imageClient.Get(capturename) if err != nil { - log.Printf("Error on get of ibm pi capture (%s) while applying pi_user_tags: %s", capturename, err) + if strings.Contains(err.Error(), NotFound) { + d.SetId("") + } + return diag.Errorf("Error on get of ibm pi capture (%s) while applying pi_user_tags: %s", capturename, err) } if imagedata.Crn != "" { oldList, newList := d.GetChange(Arg_UserTags)