From 063bbd9c43c7a01f61a844949a4e4a993813a15b Mon Sep 17 00:00:00 2001 From: Jonny Date: Wed, 16 Dec 2020 11:22:54 +0000 Subject: [PATCH] Remove the extra ID variable for v1 specs --- chainlink/resource_chainlink_spec.go | 15 ++------------- docs/resources/spec.md | 2 +- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/chainlink/resource_chainlink_spec.go b/chainlink/resource_chainlink_spec.go index b914be1..811a8af 100644 --- a/chainlink/resource_chainlink_spec.go +++ b/chainlink/resource_chainlink_spec.go @@ -13,11 +13,6 @@ func ResourceChainlinkSpec() *schema.Resource { Update: resourceSpecUpdate, Schema: mergeSchemaWithNodeProperties(map[string]*schema.Schema{ - "spec_id": { - Type: schema.TypeString, - Computed: true, - ForceNew: true, - }, "json": { Type: schema.TypeString, Required: true, @@ -41,9 +36,6 @@ func resourceSpecCreate(d *schema.ResourceData, m interface{}) error { } d.SetId(id) - if err := d.Set("spec_id", id); err != nil { - return err - } return nil } @@ -53,15 +45,12 @@ func resourceSpecRead(d *schema.ResourceData, m interface{}) error { return err } - spec, err := c.ReadSpec(d.Get("spec_id").(string)) - + _, err = c.ReadSpec(d.Id()) if err == client.ErrNotFound { d.SetId("") } else if err != nil { d.SetId("") return err - } else if err := d.Set("spec_id", spec.Data["id"]); err != nil { - return err } return nil } @@ -79,5 +68,5 @@ func resourceSpecDelete(d *schema.ResourceData, m interface{}) error { return err } - return c.DeleteSpec(d.Get("spec_id").(string)) + return c.DeleteSpec(d.Id()) } diff --git a/docs/resources/spec.md b/docs/resources/spec.md index 1119475..895c772 100644 --- a/docs/resources/spec.md +++ b/docs/resources/spec.md @@ -62,4 +62,4 @@ resource "chainlink_spec" "vrf" { ### Read-only -- **spec_id** (String, Read-only) the ID of the job spec +- **id** (String, Read-only) the ID of the job spec