Skip to content

Commit

Permalink
wait: set cluster_name on read to fix import
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur Outhenin-Chalandre <[email protected]>
  • Loading branch information
MrFreezeex committed Jul 1, 2022
1 parent b46b26b commit 5ecb190
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ceph/resource_wait_online.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func resourceWaitOnline() *schema.Resource {
Description: "This dummy resource is waiting to Ceph to be online at creation time for up to 1 hour. " +
"This is useful for example on a boostrap procedure.",
CreateContext: resourceWaitOnlineCreate,
ReadContext: resourceWaitOnlineDummy,
ReadContext: resourceWaitOnlineRead,
DeleteContext: resourceWaitOnlineDummy,
Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(time.Hour),
Expand Down Expand Up @@ -60,6 +60,13 @@ func resourceWaitOnlineCreate(ctx context.Context, d *schema.ResourceData, meta
return diag.FromErr(err)
}

func resourceWaitOnlineRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
if err := d.Set("cluster_name", d.Id()); err != nil {
return diag.Errorf("Unable to set cluster_name: %s", err)
}
return nil
}

func resourceWaitOnlineDummy(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
return nil
}

0 comments on commit 5ecb190

Please sign in to comment.