Skip to content

Commit

Permalink
Renaming DeleteContext func to RemoveResourceFromState (#230)
Browse files Browse the repository at this point in the history
  • Loading branch information
bendbennett committed Apr 13, 2022
1 parent c83c891 commit 5ed4718
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func New() *schema.Provider {
}
}

func DeleteContext(_ context.Context, d *schema.ResourceData, _ interface{}) diag.Diagnostics {
func RemoveResourceFromState(_ context.Context, d *schema.ResourceData, _ interface{}) diag.Diagnostics {
d.SetId("")
return nil
}
2 changes: 1 addition & 1 deletion internal/provider/resource_id.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ exist concurrently.
`,
CreateContext: CreateID,
ReadContext: RepopulateEncodings,
DeleteContext: DeleteContext,
DeleteContext: RemoveResourceFromState,
Importer: &schema.ResourceImporter{
StateContext: ImportID,
},
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/resource_integer.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func resourceInteger() *schema.Resource {
"old and new resources exist concurrently.",
CreateContext: CreateInteger,
ReadContext: schema.NoopContext,
DeleteContext: DeleteContext,
DeleteContext: RemoveResourceFromState,
Importer: &schema.ResourceImporter{
StateContext: ImportInteger,
},
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/resource_password.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func resourcePassword() *schema.Resource {
"This resource *does* use a cryptographic random number generator.",
CreateContext: createStringFunc(true),
ReadContext: readNil,
DeleteContext: DeleteContext,
DeleteContext: RemoveResourceFromState,
Schema: stringSchemaV1(true),
Importer: &schema.ResourceImporter{
StateContext: importStringFunc(true),
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/resource_pet.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func resourcePet() *schema.Resource {
"and new resources exist concurrently.",
CreateContext: CreatePet,
ReadContext: schema.NoopContext,
DeleteContext: DeleteContext,
DeleteContext: RemoveResourceFromState,

Schema: map[string]*schema.Schema{
"keepers": {
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/resource_shuffle.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func resourceShuffle() *schema.Resource {
"given as an argument.",
CreateContext: CreateShuffle,
ReadContext: schema.NoopContext,
DeleteContext: DeleteContext,
DeleteContext: RemoveResourceFromState,

Schema: map[string]*schema.Schema{
"keepers": {
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/resource_string.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func resourceString() *schema.Resource {
"use [random_id](id.html), for sensitive random values please use [random_password](password.html).",
CreateContext: createStringFunc(false),
ReadContext: readNil,
DeleteContext: DeleteContext,
DeleteContext: RemoveResourceFromState,
// MigrateState is deprecated but the implementation is being left in place as per the
// [SDK documentation](https://github.com/hashicorp/terraform-plugin-sdk/blob/main/helper/schema/resource.go#L91).
MigrateState: resourceRandomStringMigrateState,
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/resource_uuid.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func resourceUuid() *schema.Resource {
"UUID-formatted string for use with services needed a unique string identifier.",
CreateContext: CreateUuid,
ReadContext: schema.NoopContext,
DeleteContext: DeleteContext,
DeleteContext: RemoveResourceFromState,
Importer: &schema.ResourceImporter{
StateContext: ImportUuid,
},
Expand Down

0 comments on commit 5ed4718

Please sign in to comment.