From 787a6a9f5a45a47420457b1927396ed20822325a Mon Sep 17 00:00:00 2001 From: Piotr Truszkowski Date: Fri, 22 Mar 2024 09:31:29 +0100 Subject: [PATCH] added default state importer for bitbucket_datacenter_integration (#528) * Bump google.golang.org/protobuf from 1.31.0 to 1.33.0 Bumps google.golang.org/protobuf from 1.31.0 to 1.33.0. --- updated-dependencies: - dependency-name: google.golang.org/protobuf dependency-type: indirect ... Signed-off-by: dependabot[bot] * added default state importer for bitbucket_datacenter_integration added test for import bitbucket-datacenter resource --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Plushnikov, Michail --- go.mod | 2 +- go.sum | 4 ++-- spacelift/resource_bitbucket_datacenter_integration.go | 3 +++ spacelift/resource_bitbucket_datacenter_integration_test.go | 6 ++++++ 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 447d1c4e..34f0c96d 100644 --- a/go.mod +++ b/go.mod @@ -60,7 +60,7 @@ require ( google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect google.golang.org/grpc v1.57.1 // indirect - google.golang.org/protobuf v1.31.0 // indirect + google.golang.org/protobuf v1.33.0 // indirect ) replace github.com/shurcooL/graphql => github.com/spacelift-io/graphql v1.2.0 diff --git a/go.sum b/go.sum index 0885da0d..8f7ca808 100644 --- a/go.sum +++ b/go.sum @@ -229,8 +229,8 @@ google.golang.org/grpc v1.57.1 h1:upNTNqv0ES+2ZOOqACwVtS3Il8M12/+Hz41RCPzAjQg= google.golang.org/grpc v1.57.1/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/spacelift/resource_bitbucket_datacenter_integration.go b/spacelift/resource_bitbucket_datacenter_integration.go index 470f9565..5521e9d7 100644 --- a/spacelift/resource_bitbucket_datacenter_integration.go +++ b/spacelift/resource_bitbucket_datacenter_integration.go @@ -23,6 +23,9 @@ func resourceBitbucketDatacenterIntegration() *schema.Resource { ReadContext: resourceBitbucketDatacenterIntegrationRead, UpdateContext: resourceBitbucketDatacenterIntegrationUpdate, DeleteContext: resourceBitbucketDatacenterIntegrationDelete, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, Schema: map[string]*schema.Schema{ bitbucketDatacenterID: { diff --git a/spacelift/resource_bitbucket_datacenter_integration_test.go b/spacelift/resource_bitbucket_datacenter_integration_test.go index 1bb4c5b2..963aa23c 100644 --- a/spacelift/resource_bitbucket_datacenter_integration_test.go +++ b/spacelift/resource_bitbucket_datacenter_integration_test.go @@ -89,6 +89,12 @@ func TestBitbucketDatacenterIntegrationResource(t *testing.T) { Attribute("labels.#", Equals("0")), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"access_token"}, // specified only in the config + }, { Config: configBitbucket("newUserName", host, token, "new descr", `["new label1"]`), Check: Resource(