Skip to content

Commit

Permalink
Bump scalr-go
Browse files Browse the repository at this point in the history
  • Loading branch information
vaniakov committed Aug 13, 2021
1 parent d37b571 commit e675515
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 17 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/hashicorp/terraform v0.12.0
github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/scalr/go-scalr v0.0.0-20210813111943-1a7743178357
github.com/scalr/go-scalr v0.0.0-20210813140334-b0bce1821414
)

go 1.13
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,8 @@ github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
github.com/scalr/go-scalr v0.0.0-20210813111943-1a7743178357 h1:SLoJWMqDkRg3tsT7g812F7rFjLdkdB8UtrNM+AAnE4g=
github.com/scalr/go-scalr v0.0.0-20210813111943-1a7743178357/go.mod h1:n2HQ6QxqyTySiSFTOpAL18SjCKtP+xUskMygO0KuuQU=
github.com/scalr/go-scalr v0.0.0-20210813140334-b0bce1821414 h1:F3ecDrzKMrqI701ml5nlCGd4YzHDNEauR0nd632Yrf8=
github.com/scalr/go-scalr v0.0.0-20210813140334-b0bce1821414/go.mod h1:n2HQ6QxqyTySiSFTOpAL18SjCKtP+xUskMygO0KuuQU=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
Expand Down
1 change: 1 addition & 0 deletions scalr/resource_scalr_variable.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ func resourceScalrVariableCreate(d *schema.ResourceData, meta interface{}) error
}

log.Printf("[DEBUG] Create %s variable: %s", category, key)
log.Printf("[DEBUG] Description: %s", *options.Description)
variable, err := scalrClient.Variables.Create(ctx, options)
if err != nil {
return fmt.Errorf("Error creating %s variable %s: %v", category, key, err)
Expand Down
2 changes: 1 addition & 1 deletion scalr/resource_scalr_variable_migrate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func testResourceScalrVariableStateDataDescriptionV2(varID string) map[string]in

func TestResourceScalrVariableStateUpgradeV2(t *testing.T) {
client := testScalrClient(t)
variable, err := client.Variables.Create(context.Background(), scalr.VariableCreateOptions{ID: "var-123"})
variable, _ := client.Variables.Create(context.Background(), scalr.VariableCreateOptions{ID: "var-123"})
expected := testResourceScalrVariableStateDataDescriptionV2(variable.ID)
actual, err := resourceScalrVariableStateUpgradeV2(testResourceScalrVariableStateDataDescriptionV1(variable.ID), client)
assertCorrectState(t, err, actual, expected)
Expand Down
24 changes: 9 additions & 15 deletions scalr/resource_scalr_variable_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func TestAccScalrVariable_basic(t *testing.T) {
resource.TestCheckResourceAttr(
"scalr_variable.test", "sensitive", "false"),
resource.TestCheckResourceAttr(
"scalr_variable.test", "description", "Test variable"),
"scalr_variable.test", "description", "Test on global scope"),
),
},

Expand All @@ -63,7 +63,7 @@ func TestAccScalrVariable_basic(t *testing.T) {
resource.TestCheckResourceAttr(
"scalr_variable.test", "sensitive", "true"),
resource.TestCheckResourceAttr(
"scalr_variable.test", "description", "Test variable"),
"scalr_variable.test", "description", "Test on global scope sensitive"),
),
},
},
Expand All @@ -89,7 +89,7 @@ func TestAccScalrVariable_defaults(t *testing.T) {
resource.TestCheckResourceAttr(
"scalr_variable.test", "final", "false"),
resource.TestCheckResourceAttr(
"scalr_variable.test", "description", "Test variable"),
"scalr_variable.test", "description", "Test on global scope"),
),
},
},
Expand Down Expand Up @@ -159,7 +159,7 @@ func TestAccScalrVariable_update(t *testing.T) {
resource.TestCheckResourceAttr(
"scalr_variable.test", "sensitive", "false"),
resource.TestCheckResourceAttr(
"scalr_variable.test", "description", "Test variable"),
"scalr_variable.test", "description", "Test update"),
),
},

Expand Down Expand Up @@ -330,10 +330,6 @@ func testAccCheckScalrVariableAttributes(
if variable.Sensitive != false {
return fmt.Errorf("Bad sensitive: %t", variable.Sensitive)
}

if variable.Description != "Test variable" {
return fmt.Errorf("Bad description: %s", variable.Description)
}
return nil
}
}
Expand All @@ -360,9 +356,6 @@ func testAccCheckScalrVariableAttributesUpdate(
if variable.Final != true {
return fmt.Errorf("Bad final: %t", variable.Final)
}
if variable.Description != "updated" {
return fmt.Errorf("Bad description: %s", variable.Description)
}

return nil
}
Expand Down Expand Up @@ -395,7 +388,7 @@ resource scalr_variable test {
key = "var_on_global_%d"
value = "test"
category = "shell"
description = "Test variable"
description = "Test on global scope"
}`, rInt)
}

Expand All @@ -406,7 +399,7 @@ resource scalr_variable test {
value = "test"
category = "shell"
sensitive = true
description = "Test variable"
description = "Test on global scope sensitive"
}`, rInt)
}

Expand All @@ -427,7 +420,7 @@ resource scalr_variable test {
value = "test"
category = "shell"
workspace_id = scalr_workspace.test.id
description = "Test variable"
description = "Test update"
}`, rInt, defaultAccount)
}

Expand All @@ -449,7 +442,7 @@ resource scalr_variable test {
category = "terraform"
account_id = "%[2]s"
environment_id = scalr_environment.test.id
description = "Test variable"
description = "Test not terraform variable"
}`, rInt, defaultAccount)
}

Expand Down Expand Up @@ -508,6 +501,7 @@ resource scalr_variable test {
account_id = "%[2]s"
environment_id = scalr_environment.test.id
workspace_id = scalr_workspace.test.id
description = "updated"
}`, rInt, defaultAccount)
}

Expand Down

0 comments on commit e675515

Please sign in to comment.