Skip to content
This repository was archived by the owner on Jun 2, 2024. It is now read-only.

Feature/87 sdkv2 #96

Merged
merged 2 commits into from
Feb 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"go.formatTool": "goimports"
"go.formatTool": "goimports",
"go.testTimeout": "120s"
}
31 changes: 26 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,33 @@ module github.com/gessnerfl/terraform-provider-instana
go 1.13

require (
github.com/alecthomas/participle v0.3.0
github.com/golang/mock v1.3.1
github.com/agext/levenshtein v1.2.3 // indirect
github.com/alecthomas/participle v0.7.1
github.com/fatih/color v1.10.0 // indirect
github.com/golang/mock v1.4.4
github.com/golang/protobuf v1.4.3 // indirect
github.com/google/go-cmp v0.5.4 // indirect
github.com/gorilla/mux v1.7.3
github.com/hashicorp/terraform v0.12.18
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.0 // indirect
github.com/hashicorp/go-uuid v1.0.2 // indirect
github.com/hashicorp/hcl/v2 v2.8.2 // indirect
github.com/hashicorp/terraform-plugin-sdk/v2 v2.4.2
github.com/hashicorp/yamux v0.0.0-20200609203250-aecfd211c9ce // indirect
github.com/mitchellh/copystructure v1.1.1 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.4.1 // indirect
github.com/oklog/run v1.1.0 // indirect
github.com/rs/xid v1.2.1
github.com/sirupsen/logrus v1.4.2
github.com/stretchr/testify v1.4.0
github.com/sirupsen/logrus v1.7.0
github.com/stretchr/testify v1.6.1
github.com/zclconf/go-cty v1.7.1 // indirect
golang.org/x/net v0.0.0-20210119194325-5f4716e94777 // indirect
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c // indirect
golang.org/x/text v0.3.5 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20210207032614-bba0dbe2a9ea // indirect
google.golang.org/grpc v1.35.0 // indirect
gopkg.in/resty.v1 v1.12.0
)
669 changes: 421 additions & 248 deletions go.sum

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions instana/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package instana_test

import (
. "github.com/gessnerfl/terraform-provider-instana/instana"
"github.com/hashicorp/terraform/terraform"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

const contentType = "Content-Type"

var testProviders = map[string]terraform.ResourceProvider{
var testProviders = map[string]*schema.Provider{
"instana": Provider(),
}
2 changes: 1 addition & 1 deletion instana/data-source-builtin-event.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"

"github.com/gessnerfl/terraform-provider-instana/instana/restapi"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

//NewBuiltinEventDataSource creates a new DataSource for Builtin Events
Expand Down
4 changes: 2 additions & 2 deletions instana/data-source-builtin-event_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"testing"

"github.com/golang/mock/gomock"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/stretchr/testify/require"

. "github.com/gessnerfl/terraform-provider-instana/instana"
Expand Down
2 changes: 1 addition & 1 deletion instana/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package instana
import (
"github.com/gessnerfl/terraform-provider-instana/instana/restapi"
"github.com/gessnerfl/terraform-provider-instana/utils"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

//SchemaFieldAPIToken the name of the provider configuration option for the api token
Expand Down
2 changes: 1 addition & 1 deletion instana/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

. "github.com/gessnerfl/terraform-provider-instana/instana"
"github.com/gessnerfl/terraform-provider-instana/testutils"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion instana/resource-alerting-channel-common.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package instana

import (
"github.com/gessnerfl/terraform-provider-instana/utils"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

const (
Expand Down
6 changes: 4 additions & 2 deletions instana/resource-alerting-channel-email.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package instana

import (
"context"

"github.com/gessnerfl/terraform-provider-instana/instana/restapi"
"github.com/gessnerfl/terraform-provider-instana/utils"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

const (
Expand Down Expand Up @@ -51,7 +53,7 @@ func (r *alertingChannelEmailResource) StateUpgraders() []schema.StateUpgrader {
return []schema.StateUpgrader{
{
Type: r.alertingChannelEmailSchemaV0().CoreConfigSchema().ImpliedType(),
Upgrade: func(rawState map[string]interface{}, meta interface{}) (map[string]interface{}, error) {
Upgrade: func(ctx context.Context, rawState map[string]interface{}, meta interface{}) (map[string]interface{}, error) {
return rawState, nil
},
Version: 0,
Expand Down
17 changes: 9 additions & 8 deletions instana/resource-alerting-channel-email_test.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
package instana_test

import (
"context"
"fmt"
"net/http"
"strconv"
"strings"
"testing"

"github.com/gorilla/mux"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"

. "github.com/gessnerfl/terraform-provider-instana/instana"
"github.com/gessnerfl/terraform-provider-instana/instana/restapi"
Expand Down Expand Up @@ -64,7 +65,6 @@ func TestCRUDOfAlertingChannelEmailResourceWithMockServer(t *testing.T) {
resourceDefinitionWithoutName0 := strings.ReplaceAll(resourceDefinitionWithoutName, iteratorPlaceholder, "0")
resourceDefinitionWithoutName1 := strings.ReplaceAll(resourceDefinitionWithoutName, iteratorPlaceholder, "1")

hashFunctionEmails := schema.HashSchema(AlertingChannelEmailEmailsSchemaField.Elem.(*schema.Schema))
emailAddress1 := "EMAIL1"
emailAddress2 := "EMAIL2"
resource.UnitTest(t, resource.TestCase{
Expand All @@ -76,8 +76,8 @@ func TestCRUDOfAlertingChannelEmailResourceWithMockServer(t *testing.T) {
resource.TestCheckResourceAttrSet(testAlertingChannelEmailDefinition, "id"),
resource.TestCheckResourceAttr(testAlertingChannelEmailDefinition, AlertingChannelFieldName, "name 0"),
resource.TestCheckResourceAttr(testAlertingChannelEmailDefinition, AlertingChannelFieldFullName, "prefix name 0 suffix"),
resource.TestCheckResourceAttr(testAlertingChannelEmailDefinition, fmt.Sprintf("%s.%d", AlertingChannelEmailFieldEmails, hashFunctionEmails(emailAddress1)), emailAddress1),
resource.TestCheckResourceAttr(testAlertingChannelEmailDefinition, fmt.Sprintf("%s.%d", AlertingChannelEmailFieldEmails, hashFunctionEmails(emailAddress2)), emailAddress2),
resource.TestCheckResourceAttr(testAlertingChannelEmailDefinition, fmt.Sprintf("%s.%d", AlertingChannelEmailFieldEmails, 0), emailAddress1),
resource.TestCheckResourceAttr(testAlertingChannelEmailDefinition, fmt.Sprintf("%s.%d", AlertingChannelEmailFieldEmails, 1), emailAddress2),
),
},
{
Expand All @@ -86,8 +86,8 @@ func TestCRUDOfAlertingChannelEmailResourceWithMockServer(t *testing.T) {
resource.TestCheckResourceAttrSet(testAlertingChannelEmailDefinition, "id"),
resource.TestCheckResourceAttr(testAlertingChannelEmailDefinition, AlertingChannelFieldName, "name 1"),
resource.TestCheckResourceAttr(testAlertingChannelEmailDefinition, AlertingChannelFieldFullName, "prefix name 1 suffix"),
resource.TestCheckResourceAttr(testAlertingChannelEmailDefinition, fmt.Sprintf("%s.%d", AlertingChannelEmailFieldEmails, hashFunctionEmails(emailAddress1)), emailAddress1),
resource.TestCheckResourceAttr(testAlertingChannelEmailDefinition, fmt.Sprintf("%s.%d", AlertingChannelEmailFieldEmails, hashFunctionEmails(emailAddress2)), emailAddress2),
resource.TestCheckResourceAttr(testAlertingChannelEmailDefinition, fmt.Sprintf("%s.%d", AlertingChannelEmailFieldEmails, 0), emailAddress1),
resource.TestCheckResourceAttr(testAlertingChannelEmailDefinition, fmt.Sprintf("%s.%d", AlertingChannelEmailFieldEmails, 1), emailAddress2),
),
},
},
Expand Down Expand Up @@ -131,8 +131,9 @@ func TestShouldReturnStateOfAlertingChannelEmailUnchangedWhenMigratingFromVersio
rawData[AlertingChannelFieldFullName] = fullname
rawData[AlertingChannelEmailFieldEmails] = emails
meta := "dummy"
ctx := context.Background()

result, err := NewAlertingChannelEmailResourceHandle().StateUpgraders()[0].Upgrade(rawData, meta)
result, err := NewAlertingChannelEmailResourceHandle().StateUpgraders()[0].Upgrade(ctx, rawData, meta)

assert.Nil(t, err)
assert.Equal(t, rawData, result)
Expand Down
4 changes: 2 additions & 2 deletions instana/resource-alerting-channel-opsgenie.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (

"github.com/gessnerfl/terraform-provider-instana/instana/restapi"
"github.com/gessnerfl/terraform-provider-instana/utils"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/helper/validation"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions instana/resource-alerting-channel-opsgenie_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"testing"

"github.com/gorilla/mux"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/stretchr/testify/assert"

. "github.com/gessnerfl/terraform-provider-instana/instana"
Expand Down
2 changes: 1 addition & 1 deletion instana/resource-alerting-channel-pagerduty.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package instana
import (
"github.com/gessnerfl/terraform-provider-instana/instana/restapi"
"github.com/gessnerfl/terraform-provider-instana/utils"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion instana/resource-alerting-channel-pagerduty_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"testing"

"github.com/gorilla/mux"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/stretchr/testify/assert"

. "github.com/gessnerfl/terraform-provider-instana/instana"
Expand Down
2 changes: 1 addition & 1 deletion instana/resource-alerting-channel-slack.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package instana
import (
"github.com/gessnerfl/terraform-provider-instana/instana/restapi"
"github.com/gessnerfl/terraform-provider-instana/utils"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion instana/resource-alerting-channel-slack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"testing"

"github.com/gorilla/mux"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/stretchr/testify/assert"

. "github.com/gessnerfl/terraform-provider-instana/instana"
Expand Down
2 changes: 1 addition & 1 deletion instana/resource-alerting-channel-splunk.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package instana
import (
"github.com/gessnerfl/terraform-provider-instana/instana/restapi"
"github.com/gessnerfl/terraform-provider-instana/utils"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion instana/resource-alerting-channel-splunk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"testing"

"github.com/gorilla/mux"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/stretchr/testify/assert"

. "github.com/gessnerfl/terraform-provider-instana/instana"
Expand Down
2 changes: 1 addition & 1 deletion instana/resource-alerting-channel-victorops.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package instana
import (
"github.com/gessnerfl/terraform-provider-instana/instana/restapi"
"github.com/gessnerfl/terraform-provider-instana/utils"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion instana/resource-alerting-channel-victorops_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"testing"

"github.com/gorilla/mux"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/stretchr/testify/assert"

. "github.com/gessnerfl/terraform-provider-instana/instana"
Expand Down
2 changes: 1 addition & 1 deletion instana/resource-alerting-channel-webhook-based.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/gessnerfl/terraform-provider-instana/instana/restapi"
"github.com/gessnerfl/terraform-provider-instana/utils"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion instana/resource-alerting-channel-webhook-based_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"testing"

"github.com/gorilla/mux"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/stretchr/testify/assert"

. "github.com/gessnerfl/terraform-provider-instana/instana"
Expand Down
5 changes: 3 additions & 2 deletions instana/resource-alerting-channel-webhook.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package instana

import (
"context"
"fmt"
"strings"

"github.com/gessnerfl/terraform-provider-instana/instana/restapi"
"github.com/gessnerfl/terraform-provider-instana/utils"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

const (
Expand Down Expand Up @@ -67,7 +68,7 @@ func (r *alertingChannelWebhookResource) StateUpgraders() []schema.StateUpgrader
return []schema.StateUpgrader{
{
Type: r.alertingChannelWebhookSchemaV0().CoreConfigSchema().ImpliedType(),
Upgrade: func(rawState map[string]interface{}, meta interface{}) (map[string]interface{}, error) {
Upgrade: func(ctx context.Context, rawState map[string]interface{}, meta interface{}) (map[string]interface{}, error) {
return rawState, nil
},
Version: 0,
Expand Down
17 changes: 9 additions & 8 deletions instana/resource-alerting-channel-webhook_test.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
package instana_test

import (
"context"
"fmt"
"net/http"
"strconv"
"strings"
"testing"

"github.com/gorilla/mux"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/stretchr/testify/assert"

. "github.com/gessnerfl/terraform-provider-instana/instana"
Expand Down Expand Up @@ -68,7 +69,6 @@ func TestCRUDOfAlertingChannelWebhookResourceWithMockServer(t *testing.T) {
resourceDefinitionWithoutName0 := strings.ReplaceAll(resourceDefinitionWithoutName, iteratorPlaceholder, "0")
resourceDefinitionWithoutName1 := strings.ReplaceAll(resourceDefinitionWithoutName, iteratorPlaceholder, "1")

hashFunctionUrls := schema.HashSchema(AlertingChannelWebhookWebhookURLsSchemaField.Elem.(*schema.Schema))
url1 := "url1"
url2 := "url2"
resource.UnitTest(t, resource.TestCase{
Expand All @@ -80,8 +80,8 @@ func TestCRUDOfAlertingChannelWebhookResourceWithMockServer(t *testing.T) {
resource.TestCheckResourceAttrSet(testAlertingChannelWebhookDefinition, "id"),
resource.TestCheckResourceAttr(testAlertingChannelWebhookDefinition, AlertingChannelFieldName, "name 0"),
resource.TestCheckResourceAttr(testAlertingChannelWebhookDefinition, AlertingChannelFieldFullName, "prefix name 0 suffix"),
resource.TestCheckResourceAttr(testAlertingChannelWebhookDefinition, fmt.Sprintf("%s.%d", AlertingChannelWebhookFieldWebhookURLs, hashFunctionUrls(url1)), url1),
resource.TestCheckResourceAttr(testAlertingChannelWebhookDefinition, fmt.Sprintf("%s.%d", AlertingChannelWebhookFieldWebhookURLs, hashFunctionUrls(url2)), url2),
resource.TestCheckResourceAttr(testAlertingChannelWebhookDefinition, fmt.Sprintf("%s.%d", AlertingChannelWebhookFieldWebhookURLs, 0), url1),
resource.TestCheckResourceAttr(testAlertingChannelWebhookDefinition, fmt.Sprintf("%s.%d", AlertingChannelWebhookFieldWebhookURLs, 1), url2),
resource.TestCheckResourceAttr(testAlertingChannelWebhookDefinition, AlertingChannelWebhookFieldHTTPHeaders+".key1", "value1"),
resource.TestCheckResourceAttr(testAlertingChannelWebhookDefinition, AlertingChannelWebhookFieldHTTPHeaders+".key2", "value2"),
),
Expand All @@ -92,8 +92,8 @@ func TestCRUDOfAlertingChannelWebhookResourceWithMockServer(t *testing.T) {
resource.TestCheckResourceAttrSet(testAlertingChannelWebhookDefinition, "id"),
resource.TestCheckResourceAttr(testAlertingChannelWebhookDefinition, AlertingChannelFieldName, "name 1"),
resource.TestCheckResourceAttr(testAlertingChannelWebhookDefinition, AlertingChannelFieldFullName, "prefix name 1 suffix"),
resource.TestCheckResourceAttr(testAlertingChannelWebhookDefinition, fmt.Sprintf("%s.%d", AlertingChannelWebhookFieldWebhookURLs, hashFunctionUrls(url1)), "url1"),
resource.TestCheckResourceAttr(testAlertingChannelWebhookDefinition, fmt.Sprintf("%s.%d", AlertingChannelWebhookFieldWebhookURLs, hashFunctionUrls(url2)), "url2"),
resource.TestCheckResourceAttr(testAlertingChannelWebhookDefinition, fmt.Sprintf("%s.%d", AlertingChannelWebhookFieldWebhookURLs, 0), "url1"),
resource.TestCheckResourceAttr(testAlertingChannelWebhookDefinition, fmt.Sprintf("%s.%d", AlertingChannelWebhookFieldWebhookURLs, 1), "url2"),
resource.TestCheckResourceAttr(testAlertingChannelWebhookDefinition, AlertingChannelWebhookFieldHTTPHeaders+".key1", "value1"),
resource.TestCheckResourceAttr(testAlertingChannelWebhookDefinition, AlertingChannelWebhookFieldHTTPHeaders+".key2", "value2"),
),
Expand Down Expand Up @@ -140,8 +140,9 @@ func TestShouldReturnStateOfAlertingChannelWebhookUnchangedWhenMigratingFromVers
"key2": "value2",
}
meta := "dummy"
ctx := context.Background()

result, err := NewAlertingChannelWebhookResourceHandle().StateUpgraders()[0].Upgrade(rawData, meta)
result, err := NewAlertingChannelWebhookResourceHandle().StateUpgraders()[0].Upgrade(ctx, rawData, meta)

assert.Nil(t, err)
assert.Equal(t, rawData, result)
Expand Down
Loading