Skip to content

Commit

Permalink
Merge pull request #35 from mulesoft-anypoint/dev
Browse files Browse the repository at this point in the history
Release v1.6.0 Prep
  • Loading branch information
soufi authored Feb 6, 2024
2 parents 7e7ba91 + dc91df8 commit 53c092d
Show file tree
Hide file tree
Showing 253 changed files with 22,065 additions and 1,118 deletions.
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ HOSTNAME=anypoint.mulesoft.com
NAMESPACE=automation
NAME=anypoint
BINARY=terraform-provider-${NAME}
VERSION=1.5.6-SNAPSHOT
VERSION=1.6.0-SNAPSHOT
OS_ARCH=darwin_amd64

default: install
Expand All @@ -30,9 +30,9 @@ install: build
mkdir -p ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH}
mv ${BINARY} ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH}

test:
go test -i $(TEST) || exit 1
echo $(TEST) | xargs -t -n4 go test $(TESTARGS) -timeout=30s -parallel=4
test:
go test -i $(TEST) || exit 1
echo $(TEST) | xargs -t -n4 go test $(TESTARGS) -timeout=30s -parallel=4

testacc:
TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m
testacc:
TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m
9 changes: 5 additions & 4 deletions anypoint/data_source_ame.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package anypoint
import (
"context"
"fmt"
"io/ioutil"
"io"
"strconv"
"time"

Expand Down Expand Up @@ -126,11 +126,11 @@ func dataSourceAMERead(ctx context.Context, d *schema.ResourceData, m interface{
}
//Executing Request
res, httpr, err := req.Execute()
defer httpr.Body.Close()
if err != nil {
var details string
if httpr != nil {
b, _ := ioutil.ReadAll(httpr.Body)
if httpr != nil && httpr.StatusCode >= 400 {
defer httpr.Body.Close()
b, _ := io.ReadAll(httpr.Body)
details = string(b)
} else {
details = err.Error()
Expand All @@ -142,6 +142,7 @@ func dataSourceAMERead(ctx context.Context, d *schema.ResourceData, m interface{
})
return diags
}
defer httpr.Body.Close()
//process data
amqinstance := flattenAMEsData(&res)
//save in data source schema
Expand Down
10 changes: 5 additions & 5 deletions anypoint/data_source_amq.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package anypoint
import (
"context"
"fmt"
"io/ioutil"
"io"
"strconv"
"time"

Expand Down Expand Up @@ -145,7 +145,6 @@ func dataSourceAMQRead(ctx context.Context, d *schema.ResourceData, m interface{
envid := d.Get("env_id").(string)
orgid := d.Get("org_id").(string)
authctx := getAMQAuthCtx(ctx, &pco)

//Preparing request
req := pco.amqclient.DefaultApi.GetAMQList(authctx, orgid, envid, regionid)
req, errDiags := parseAMQSearchOpts(req, searchopts)
Expand All @@ -155,11 +154,11 @@ func dataSourceAMQRead(ctx context.Context, d *schema.ResourceData, m interface{
}
//Executing Request
res, httpr, err := req.Execute()
defer httpr.Body.Close()
if err != nil {
var details string
if httpr != nil {
b, _ := ioutil.ReadAll(httpr.Body)
if httpr != nil && httpr.StatusCode >= 400 {
defer httpr.Body.Close()
b, _ := io.ReadAll(httpr.Body)
details = string(b)
} else {
details = err.Error()
Expand All @@ -171,6 +170,7 @@ func dataSourceAMQRead(ctx context.Context, d *schema.ResourceData, m interface{
})
return diags
}
defer httpr.Body.Close()
//process data
amqinstance := flattenAMQsData(&res)
//save in data source schema
Expand Down
Loading

0 comments on commit 53c092d

Please sign in to comment.