Skip to content
This repository was archived by the owner on Dec 9, 2020. It is now read-only.
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ website/vendor
# Test exclusions
!command/test-fixtures/**/*.tfstate
!command/test-fixtures/**/.terraform/
terraform-provider-ultradns
13 changes: 3 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,10 @@ services:
- docker
language: go
go:
- "1.11.x"

install:
# This script is used by the Travis build to install a cookie for
# go.googlesource.com so rate limits are higher when using `go get` to fetch
# packages that live there.
# See: https://github.com/golang/go/issues/12933
- bash scripts/gogetcookie.sh
- go get github.com/kardianos/govendor
- "1.14.x"

script:
- make test
- make vendor-status
- make vet
- make website-test

Expand All @@ -27,3 +18,5 @@ matrix:
fast_finish: true
allow_failures:
- go: tip
env:
- GOFLAGS=-mod=vendor GO111MODULE=on
19 changes: 8 additions & 11 deletions GNUmakefile
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
TEST?=$$(go list ./... |grep -v 'vendor')
GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor)
WEBSITE_REPO=github.com/hashicorp/terraform-website
PKG_NAME=ultradns

default: build

build: fmtcheck
go install
go build -v

clean:
go clean

test: fmtcheck
go test -i $(TEST) || exit 1
echo $(TEST) | \
xargs -t -n4 go test $(TESTARGS) -timeout=30s -parallel=4
go test -cover -race -timeout=30s -parallel=4 ./...

testacc: fmtcheck
TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m
TF_ACC=1 go test -v -cover -race -timeout=120m ./...

vet:
@echo "go vet ."
@go vet $$(go list ./... | grep -v vendor/) ; if [ $$? -eq 1 ]; then \
@go vet $$(go list ./...) ; if [ $$? -eq 1 ]; then \
echo ""; \
echo "Vet found suspicious constructs. Please check the reported constructs"; \
echo "and fix them if necessary before submitting the code for review."; \
Expand All @@ -34,9 +34,6 @@ fmtcheck:
errcheck:
@sh -c "'$(CURDIR)/scripts/errcheck.sh'"

vendor-status:
@govendor status

test-compile:
@if [ "$(TEST)" = "./..." ]; then \
echo "ERROR: Set TEST to a specific package. For example,"; \
Expand All @@ -59,5 +56,5 @@ ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO)))
endif
@$(MAKE) -C $(GOPATH)/src/$(WEBSITE_REPO) website-provider-test PROVIDER_PATH=$(shell pwd) PROVIDER_NAME=$(PKG_NAME)

.PHONY: build test testacc vet fmt fmtcheck errcheck vendor-status test-compile website website-test
.PHONY: build clean test testacc vet fmt fmtcheck errcheck test-compile website website-test

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Requirements
------------

- [Terraform](https://www.terraform.io/downloads.html) 0.10.x
- [Go](https://golang.org/doc/install) 1.11 (to build the provider plugin)
- [Go](https://golang.org/doc/install) 1.14 (to build the provider plugin)

Building The Provider
---------------------
Expand All @@ -52,7 +52,7 @@ Using the provider
Developing the Provider
---------------------------

If you wish to work on the provider, you'll first need [Go](http://www.golang.org) installed on your machine (version 1.11+ is *required*). You'll also need to correctly setup a [GOPATH](http://golang.org/doc/code.html#GOPATH), as well as adding `$GOPATH/bin` to your `$PATH`.
If you wish to work on the provider, you'll first need [Go](http://www.golang.org) installed on your machine (version 1.14+ is *required*). You'll also need to correctly setup a [GOPATH](http://golang.org/doc/code.html#GOPATH), as well as adding `$GOPATH/bin` to your `$PATH`.

To compile the provider, run `make build`. This will build the provider and put the provider binary in the `$GOPATH/bin` directory.

Expand Down
12 changes: 12 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module github.com/manheim/terraform-provider-ultradns

go 1.14

require (
github.com/Ensighten/udnssdk v1.3.2
github.com/fatih/structs v1.0.0
github.com/hashicorp/terraform-plugin-sdk v1.7.0
github.com/mitchellh/mapstructure v1.1.2
github.com/stretchr/testify v1.5.1 // indirect
google.golang.org/appengine v1.6.5 // indirect
)
308 changes: 308 additions & 0 deletions go.sum

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package main

import (
"github.com/hashicorp/terraform/plugin"
"github.com/terraform-providers/terraform-provider-ultradns/ultradns"
"github.com/hashicorp/terraform-plugin-sdk/plugin"
"github.com/manheim/terraform-provider-ultradns/ultradns"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions ultradns/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"log"

"github.com/Ensighten/udnssdk"
"github.com/hashicorp/terraform/helper/hashcode"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/hashcode"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)

// Conversion helper functions
Expand Down
4 changes: 2 additions & 2 deletions ultradns/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"

"github.com/Ensighten/udnssdk"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/terraform"
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/terraform"
)

func testAccRdpoolCheckDestroy(s *terraform.State) error {
Expand Down
4 changes: 2 additions & 2 deletions ultradns/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package ultradns

import (
"github.com/Ensighten/udnssdk"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/terraform"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/terraform"
)

// Provider returns a terraform.ResourceProvider.
Expand Down
4 changes: 2 additions & 2 deletions ultradns/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"os"
"testing"

"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/terraform"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/terraform"
)

var testAccProviders map[string]terraform.ResourceProvider
Expand Down
6 changes: 3 additions & 3 deletions ultradns/resource_ultradns_dirpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (

"github.com/Ensighten/udnssdk"
"github.com/fatih/structs"
"github.com/hashicorp/terraform/helper/hashcode"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/hashcode"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/mitchellh/mapstructure"
)

Expand Down Expand Up @@ -584,7 +584,7 @@ func hashIPInfoIPs(v interface{}) int {
buf.WriteString(fmt.Sprintf("%s-", m["start"].(string)))
buf.WriteString(fmt.Sprintf("%s-", m["end"].(string)))
buf.WriteString(fmt.Sprintf("%s-", m["cidr"].(string)))
buf.WriteString(fmt.Sprintf("%s", m["address"].(string)))
buf.WriteString(m["address"].(string))

h := hashcode.String(buf.String())
log.Printf("[DEBUG] hashIPInfoIPs(): %v -> %v", buf.String(), h)
Expand Down
4 changes: 2 additions & 2 deletions ultradns/resource_ultradns_dirpool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"testing"

"github.com/Ensighten/udnssdk"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/terraform"
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/terraform"
)

func TestAccUltradnsDirpool(t *testing.T) {
Expand Down
7 changes: 1 addition & 6 deletions ultradns/resource_ultradns_probe_http.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"

"github.com/Ensighten/udnssdk"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)

func resourceUltradnsProbeHTTP() *schema.Resource {
Expand Down Expand Up @@ -54,11 +54,6 @@ func resourceUltradnsProbeHTTP() *schema.Resource {
Optional: true,
Elem: schemaHTTPProbe(),
},
// Computed
"id": {
Type: schema.TypeString,
Computed: true,
},
},
}
}
Expand Down
2 changes: 1 addition & 1 deletion ultradns/resource_ultradns_probe_http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"

"github.com/Ensighten/udnssdk"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
)

func TestAccUltradnsProbeHTTP(t *testing.T) {
Expand Down
7 changes: 1 addition & 6 deletions ultradns/resource_ultradns_probe_ping.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"

"github.com/Ensighten/udnssdk"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)

func resourceUltradnsProbePing() *schema.Resource {
Expand Down Expand Up @@ -53,11 +53,6 @@ func resourceUltradnsProbePing() *schema.Resource {
Optional: true,
Elem: schemaPingProbe(),
},
// Computed
"id": {
Type: schema.TypeString,
Computed: true,
},
},
}
}
Expand Down
2 changes: 1 addition & 1 deletion ultradns/resource_ultradns_probe_ping_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"

"github.com/Ensighten/udnssdk"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
)

func TestAccUltradnsProbePing(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions ultradns/resource_ultradns_rdpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"strings"

"github.com/Ensighten/udnssdk"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/helper/validation"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
)

func resourceUltradnsRdpool() *schema.Resource {
Expand Down
2 changes: 1 addition & 1 deletion ultradns/resource_ultradns_rdpool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"

"github.com/Ensighten/udnssdk"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
)

func TestAccUltradnsRdpool(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion ultradns/resource_ultradns_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strings"

"github.com/Ensighten/udnssdk"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)

func newRRSetResource(d *schema.ResourceData) (rRSetResource, error) {
Expand Down
4 changes: 2 additions & 2 deletions ultradns/resource_ultradns_record_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"testing"

"github.com/Ensighten/udnssdk"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/terraform"
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/terraform"
)

func TestAccUltradnsRecord(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion ultradns/resource_ultradns_tcpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strings"

"github.com/Ensighten/udnssdk"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)

func resourceUltradnsTcpool() *schema.Resource {
Expand Down
2 changes: 1 addition & 1 deletion ultradns/resource_ultradns_tcpool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"

"github.com/Ensighten/udnssdk"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
)

func TestAccUltradnsTcpool(t *testing.T) {
Expand Down
Loading