Skip to content

Commit 777e6ec

Browse files
authored
Bump vendor versions (#286)
Bump vendor versions: * github.com/Azure/go-autorest/autorest v0.11.4 * github.com/Azure/go-autorest/autorest/adal v0.9.2 * github.com/Azure/go-autorest/autorest/azure/auth v0.5.1 * github.com/aws/aws-sdk-go v1.34.13 * gopkg.in/ini.v1 v1.60.2 Co-authored-by: Serge Smertin <[email protected]>
1 parent 1d82b77 commit 777e6ec

File tree

153 files changed

+5721
-9471
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+5721
-9471
lines changed

access/acceptance/secret_test.go

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,20 @@ import (
1010

1111
"github.com/databrickslabs/databricks-terraform/common"
1212
"github.com/databrickslabs/databricks-terraform/internal/acceptance"
13+
"github.com/hashicorp/terraform-plugin-sdk/helper/acctest"
1314
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
1415
"github.com/hashicorp/terraform-plugin-sdk/terraform"
1516
"github.com/stretchr/testify/assert"
1617
)
1718

1819
func TestAccSecretResource(t *testing.T) {
19-
// TODO: refactor for common instance pool & AZ CLI
2020
if _, ok := os.LookupEnv("CLOUD_ENV"); !ok {
2121
t.Skip("Acceptance tests skipped unless env 'CLOUD_ENV' is set")
2222
}
23-
//var secretScope Secre
2423
var secret SecretMetadata
25-
// generate a random name for each tokenInfo test run, to avoid
26-
// collisions from multiple concurrent tests.
27-
// the acctest package includes many helpers such as RandStringFromCharSet
28-
// See https://godoc.org/github.com/hashicorp/terraform-plugin-sdk/helper/acctest
29-
//scope := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum)
30-
scope := "terraform_acc_test_secret"
31-
key := "my_cool_key"
24+
randomName := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum)
25+
scope := fmt.Sprintf("tf-scope-%s", randomName)
26+
key := fmt.Sprintf("tf-key-%s", randomName)
3227
stringValue := "my super secret key"
3328

3429
acceptance.AccTest(t, resource.TestCase{

common/http.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"bytes"
55
"context"
66
"encoding/json"
7+
"errors"
78
"fmt"
89
"io/ioutil"
910
"log"
@@ -413,6 +414,11 @@ func (c *DatabricksClient) genericQuery(method, requestURL string, data interfac
413414
return nil, err
414415
}
415416
resp, err := c.httpClient.Do(r)
417+
// retryablehttp library now returns only wrapped errors
418+
var ae APIError
419+
if errors.As(err, &ae) {
420+
return nil, ae
421+
}
416422
if err != nil {
417423
return nil, err
418424
}

compute/acceptance/cluster_test.go

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,6 @@ func TestAwsAccClusterResource_CreateClusterViaInstancePool(t *testing.T) {
243243
randomStr := acctest.RandStringFromCharSet(5, acctest.CharSetAlphaNum)
244244
instanceProfileRName := "my-tf-test-instance-profile"
245245
instanceProfile := fmt.Sprintf("arn:aws:iam::999999999999:instance-profile/tf-test-%s", randomStr)
246-
var clusterInfo ClusterInfo
247246
awsAttrCluster := map[string]string{
248247
"instance_profile_arn": fmt.Sprintf("${databricks_instance_profile.%s.id}", instanceProfileRName),
249248
}
@@ -273,35 +272,34 @@ func TestAwsAccClusterResource_CreateClusterViaInstancePool(t *testing.T) {
273272
{
274273
Config: clusterNoInstanceProfileConfig,
275274
Check: resource.ComposeTestCheckFunc(
276-
testClusterCheckAndTerminateForFutureTests(randomClusterId, &clusterInfo, t),
275+
testClusterCheckAndTerminateForFutureTests(randomClusterId, t),
277276
),
278277
},
279278
{
280279
Config: clusterWithInstanceProfileConfig,
281280
Check: resource.ComposeTestCheckFunc(
282-
testClusterCheckAndTerminateForFutureTests(randomClusterId, &clusterInfo, t),
281+
testClusterCheckAndTerminateForFutureTests(randomClusterId, t),
283282
),
284283
},
285284
{
286285
Config: clusterNoInstanceProfileConfig,
287286
Check: resource.ComposeTestCheckFunc(
288-
testClusterCheckAndTerminateForFutureTests(randomClusterId, &clusterInfo, t),
287+
testClusterCheckAndTerminateForFutureTests(randomClusterId, t),
289288
),
290289
PlanOnly: true,
291290
ExpectNonEmptyPlan: true,
292291
},
293292
{
294293
Config: clusterNoInstanceProfileConfig,
295294
Check: resource.ComposeTestCheckFunc(
296-
testClusterCheckAndTerminateForFutureTests(randomClusterId, &clusterInfo, t),
295+
testClusterCheckAndTerminateForFutureTests(randomClusterId, t),
297296
),
298297
},
299298
},
300299
})
301300
}
302301

303302
func TestAzureAccClusterResource_CreateClusterViaInstancePool(t *testing.T) {
304-
var clusterInfo ClusterInfo
305303
randomInstancePoolName := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum)
306304
randomInstancePoolInterpolation := fmt.Sprintf("databricks_instance_pool.%s.id", randomInstancePoolName)
307305
randomClusterSuffix := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum)
@@ -320,7 +318,7 @@ func TestAzureAccClusterResource_CreateClusterViaInstancePool(t *testing.T) {
320318
{
321319
Config: defaultAzureInstancePoolClusterTest,
322320
Check: resource.ComposeTestCheckFunc(
323-
testClusterCheckAndTerminateForFutureTests(randomClusterId, &clusterInfo, t),
321+
testClusterCheckAndTerminateForFutureTests(randomClusterId, t),
324322
),
325323
},
326324
},
@@ -331,7 +329,7 @@ func TestAccClusterResource_CreateClusterWithLibraries(t *testing.T) {
331329
if os.Getenv("CLOUD_ENV") == "" {
332330
return
333331
}
334-
randomName := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum)
332+
randomName := fmt.Sprintf("cluster-%s", acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum))
335333
randomClusterID := fmt.Sprintf("databricks_cluster.%s", randomName)
336334
var clusterInfo ClusterInfo
337335

@@ -365,19 +363,15 @@ func TestAccClusterResource_CreateClusterWithLibraries(t *testing.T) {
365363
func testClusterCheckExists(n string, cluster *ClusterInfo, t *testing.T) resource.TestCheckFunc {
366364
return acceptance.ResourceCheck(n, func(client *common.DatabricksClient, id string) error {
367365
clusters := NewClustersAPI(client)
368-
_, err := clusters.Get(id)
366+
c, err := clusters.Get(id)
367+
*cluster = c
369368
return err
370369
})
371370
}
372371

373-
func testClusterCheckAndTerminateForFutureTests(n string, cluster *ClusterInfo, t *testing.T) resource.TestCheckFunc {
372+
func testClusterCheckAndTerminateForFutureTests(n string, t *testing.T) resource.TestCheckFunc {
374373
return acceptance.ResourceCheck(n, func(client *common.DatabricksClient, id string) error {
375-
clusters := NewClustersAPI(client)
376-
_, err := clusters.Get(id)
377-
if err != nil {
378-
return err
379-
}
380-
return clusters.Terminate(id)
374+
return NewClustersAPI(client).Terminate(id)
381375
})
382376
}
383377

docs/changelog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@
1414
* [Migrated all documentation](https://github.com/databrickslabs/terraform-provider-databricks/pull/250) to Terraform Registry format, therefore having a single always-accurate place for end-user guides.
1515
* Internally, codebase [has been split](https://github.com/databrickslabs/terraform-provider-databricks/pull/224) into multiple packages, which should make further contributions simpler.
1616

17+
Updated dependency versions:
18+
19+
* github.com/Azure/go-autorest/autorest v0.11.4
20+
* github.com/Azure/go-autorest/autorest/adal v0.9.2
21+
* github.com/Azure/go-autorest/autorest/azure/auth v0.5.1
22+
* github.com/aws/aws-sdk-go v1.34.13
23+
* gopkg.in/ini.v1 v1.60.2
24+
1725
**Deprecations**
1826
* `library_*` is no longer receiving fixes and will be removed in `0.3`, please rewrite cluster & job resources to use [`library` configuration block](https://github.com/databrickslabs/terraform-provider-databricks/blob/master/docs/resources/cluster.md#library-configuration-block).
1927
* `basic_auth` provider block is no longer receiving fixesand will be removed in `0.3`, please use `username` and `password` options

go.mod

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,24 @@ module github.com/databrickslabs/databricks-terraform
33
go 1.13
44

55
require (
6-
github.com/Azure/go-autorest/autorest v0.11.2
7-
github.com/Azure/go-autorest/autorest/adal v0.9.0
8-
github.com/Azure/go-autorest/autorest/azure/auth v0.5.0
6+
github.com/Azure/go-autorest/autorest v0.11.4
7+
github.com/Azure/go-autorest/autorest/adal v0.9.2
8+
github.com/Azure/go-autorest/autorest/azure/auth v0.5.1
99
github.com/Azure/go-autorest/autorest/azure/cli v0.4.0
10-
github.com/aws/aws-sdk-go v1.33.11
10+
github.com/aws/aws-sdk-go v1.34.13
1111
github.com/fatih/color v1.9.0 // indirect
12-
github.com/go-kit/kit v0.10.0
1312
github.com/google/go-querystring v1.0.0
14-
github.com/hashicorp/go-retryablehttp v0.6.6
13+
github.com/hashicorp/go-retryablehttp v0.6.7
1514
github.com/hashicorp/hcl v1.0.0
1615
github.com/hashicorp/terraform-plugin-sdk v1.15.0
17-
github.com/joho/godotenv v1.3.0
1816
github.com/mattn/go-colorable v0.1.7 // indirect
1917
github.com/mitchellh/go-homedir v1.1.0
2018
github.com/pkg/errors v0.9.1
2119
github.com/r3labs/diff v1.1.0
2220
github.com/sergi/go-diff v1.1.0 // indirect
21+
github.com/smartystreets/goconvey v1.6.4 // indirect
2322
github.com/stretchr/testify v1.6.1
24-
golang.org/x/sys v0.0.0-20200722175500-76b94024e4b6 // indirect
25-
gopkg.in/ini.v1 v1.57.0
26-
gotest.tools v2.2.0+incompatible
23+
go.opencensus.io v0.22.2 // indirect
24+
golang.org/x/sys v0.0.0-20200828194041-157a740278f4 // indirect
25+
gopkg.in/ini.v1 v1.60.2
2726
)

0 commit comments

Comments
 (0)