Skip to content

Commit

Permalink
more PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Stuart Auld committed Apr 18, 2018
1 parent 1e82fec commit fba737e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions buildkite/data_source_pipelines_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ resource buildkite_pipeline "test" {
description = "Generated via acceptance tests - please delete if left dangling"
repository = "[email protected]:COzero/terraform-provider-buildkite.git"
step {
steps = [{
type = "script"
name = "Hi!"
command = "echo \"Hello world\""
}
}]
}
data buildkite_pipeline "test" {
Expand Down
2 changes: 1 addition & 1 deletion buildkite/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ func String(v string) *string {
return &v
}

// StringValue returns the value of a string pointer or "" if the pointer is nil
// StringValue deferences a pointer to a string or returns "" if the pointer is nil
func StringValue(v *string) string {
if v != nil {
return *v
Expand Down
10 changes: 5 additions & 5 deletions buildkite/resource_pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ func resourcePipeline() *schema.Resource {
Type: schema.TypeString,
Required: true,
},
"step": &schema.Schema{
Type: schema.TypeSet,
"steps": &schema.Schema{
Type: schema.TypeList,
Required: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
Expand Down Expand Up @@ -188,7 +188,7 @@ func resourcePipelineCreate(d *schema.ResourceData, meta interface{}) error {

updatePipelineFromAPI(d, pipe)

return resourcePipelineRead(d, meta)
return nil
}

func resourcePipelineRead(d *schema.ResourceData, meta interface{}) error {
Expand Down Expand Up @@ -254,7 +254,7 @@ func resourcePipelineUpdate(d *schema.ResourceData, meta interface{}) error {

updatePipelineFromAPI(d, pipe)

return resourcePipelineRead(d, meta)
return nil
}

func resourcePipelineDelete(d *schema.ResourceData, meta interface{}) error {
Expand Down Expand Up @@ -283,7 +283,7 @@ func buildPipelineInput(d *schema.ResourceData) *buildkite.CreatePipeline {
TeamUuids: []string{},
}

steps := d.Get("step").(*schema.Set).List()
steps := d.Get("steps").([]interface{})
input.Steps = make([]buildkite.Step, len(steps))

for i, s := range steps {
Expand Down
4 changes: 2 additions & 2 deletions buildkite/resource_pipeline_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ resource buildkite_pipeline "test" {
description = "Generated via acceptance tests - please delete if left dangling"
repository = "[email protected]:COzero/terraform-provider-buildkite.git"
step {
steps = [{
type = "script"
name = "Hi!"
command = "echo \"Hello world\""
}
}]
}
`, rStr)
}

0 comments on commit fba737e

Please sign in to comment.