Skip to content

Commit 3487a9f

Browse files
Cloud Stack: Fix 404 check (#889)
This is something that probably occurs in Crossplane. On the first read of the cloud stack resource, it doesn't exist so it 404s, but I broke the 404 mechanism in #884
1 parent e35a7f0 commit 3487a9f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/resources/cloud/resource_cloud_stack.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ func ReadStack(ctx context.Context, d *schema.ResourceData, meta interface{}) di
306306
stack, err := getStackFromIDOrSlug(client, d.Id())
307307

308308
if err != nil {
309-
if strings.HasPrefix(err.Error(), "status: 404") {
309+
if strings.Contains(err.Error(), "404") {
310310
log.Printf("[WARN] removing stack %s from state because it no longer exists in grafana", d.Get("name").(string))
311311
d.SetId("")
312312
return nil

0 commit comments

Comments
 (0)