Skip to content

Commit

Permalink
Switch to gomodules
Browse files Browse the repository at this point in the history
  • Loading branch information
sagikazarmark committed Jun 7, 2019
1 parent bcd8abb commit b6aea48
Show file tree
Hide file tree
Showing 1,433 changed files with 321 additions and 519,512 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.go]
indent_style = tab

[{Makefile, *.mk}]
indent_style = tab
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,24 @@
/bin/
/build/
/dist/
/vendor/

# IDE integration
/.vscode/*
!/.vscode/launch.json
!/.vscode/tasks.json
/.idea/*
!/.idea/codeStyles/
!/.idea/copyright/
!/.idea/dataSources.xml
!/.idea/*.iml
!/.idea/externalDependencies.xml
!/.idea/go.imports.xml
!/.idea/modules.xml
!/.idea/runConfigurations/
!/.idea/scopes/
!/.idea/sqldialects.xml

terraform.tfstate
terraform.tfstate.backup
.terraform/
6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/terraform-provider-k8s.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

78 changes: 75 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,68 @@
# A Self-Documenting Makefile: http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html

OS = $(shell uname)

BINARY_NAME = terraform-provider-k8s

# Build variables
BUILD_DIR ?= build
VERSION ?= $(shell git describe --tags --exact-match 2>/dev/null || git symbolic-ref -q --short HEAD)
COMMIT_HASH ?= $(shell git rev-parse --short HEAD 2>/dev/null)
BUILD_DATE ?= $(shell date +%FT%T%z)
LDFLAGS += -X main.version=${VERSION} -X main.commitHash=${COMMIT_HASH} -X main.buildDate=${BUILD_DATE}
export CGO_ENABLED ?= 0
ifeq (${VERBOSE}, 1)
ifeq ($(filter -v,${GOARGS}),)
GOARGS += -v
endif
TEST_FORMAT = short-verbose
endif

# Dependency versions
GOTESTSUM_VERSION = 0.3.4
GOLANGCI_VERSION = 1.16.0
GORELEASER_VERSION = 0.108.0
TERRAFORM_VERSION = 0.11.14

GOLANG_VERSION = 1.12

# Add the ability to override some variables
# Use with care
-include override.mk

.PHONY: clean
clean: ## Clean builds
rm -rf ${BUILD_DIR}/

.PHONY: goversion
goversion:
ifneq (${IGNORE_GOLANG_VERSION_REQ}, 1)
@printf "${GOLANG_VERSION}\n$$(go version | awk '{sub(/^go/, "", $$3);print $$3}')" | sort -t '.' -k 1,1 -k 2,2 -k 3,3 -g | head -1 | grep -q -E "^${GOLANG_VERSION}$$" || (printf "Required Go version is ${GOLANG_VERSION}\nInstalled: `go version`" && exit 1)
endif

.PHONY: build
build: goversion ## Build a binary
ifeq (${VERBOSE}, 1)
go env
endif

go build ${GOARGS} -tags "${GOTAGS}" -ldflags "${LDFLAGS}" -o ${BUILD_DIR}/${BINARY_NAME} .

.PHONY: integration
integration: build bin/terraform ## Execute integration tests
cp build/terraform-provider-k8s examples
bin/terraform init examples
bin/terraform apply -auto-approve examples
bin/terraform destroy -auto-approve examples

bin/terraform: bin/terraform-${TERRAFORM_VERSION}
@ln -sf terraform-${TERRAFORM_VERSION} bin/terraform
bin/terraform-${TERRAFORM_VERSION}:
@mkdir -p bin
curl -sfL https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_darwin_amd64.zip > bin/terraform.zip
unzip -d bin bin/terraform.zip
@mv bin/terraform $@
rm bin/terraform.zip

bin/goreleaser: bin/goreleaser-${GORELEASER_VERSION}
@ln -sf goreleaser-${GORELEASER_VERSION} bin/goreleaser
Expand All @@ -12,6 +75,15 @@ bin/goreleaser-${GORELEASER_VERSION}:
release: bin/goreleaser # Publish a release
bin/goreleaser release

.PHONY: build
build:
go install -v
.PHONY: list
list: ## List all make targets
@${MAKE} -pRrn : -f $(MAKEFILE_LIST) 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | sort

.PHONY: help
.DEFAULT_GOAL := help
help:
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

# Variable outputting/exporting rules
var-%: ; @echo $($*)
varexport-%: ; @echo $*=$($*)
1 change: 1 addition & 0 deletions examples/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
terraform.tfstate
terraform.tfstate.backup
.terraform/
terraform-provider-k8s
4 changes: 2 additions & 2 deletions examples/example.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
data "template_file" "my-configmap" {
template = "${file("manifests/my-configmap.yaml")}"
template = "${file("${path.module}/manifests/my-configmap.yaml")}"

vars {
greeting = "${var.greeting}"
Expand All @@ -11,7 +11,7 @@ resource "k8s_manifest" "my-configmap" {
}

data "template_file" "nginx-deployment" {
template = "${file("manifests/nginx-deployment.yaml")}"
template = "${file("${path.module}/manifests/nginx-deployment.yaml")}"

vars {
replicas = "${var.replicas}"
Expand Down
56 changes: 56 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
module github.com/banzaicloud/terraform-provider-k8s

go 1.12

require (
github.com/agext/levenshtein v1.2.1 // indirect
github.com/apparentlymart/go-cidr v0.0.0-20170616213631-2bd8b58cf427 // indirect
github.com/apparentlymart/go-textseg v0.0.0-20170531203952-b836f5c4d331 // indirect
github.com/armon/go-radix v0.0.0-20170727155443-1fca145dffbc // indirect
github.com/aws/aws-sdk-go v1.12.70 // indirect
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
github.com/bgentry/speakeasy v0.1.0 // indirect
github.com/blang/semver v3.5.1+incompatible // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-ini/ini v1.32.0 // indirect
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect
github.com/golang/protobuf v1.0.0 // indirect
github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce // indirect
github.com/hashicorp/go-cleanhttp v0.0.0-20171218145408-d5fe4b57a186 // indirect
github.com/hashicorp/go-getter v0.0.0-20180123174312-285374cdfad6 // indirect
github.com/hashicorp/go-hclog v0.0.0-20180122232401-5bcb0f17e364 // indirect
github.com/hashicorp/go-multierror v0.0.0-20171204182908-b7773ae21874 // indirect
github.com/hashicorp/go-plugin v0.0.0-20180125190438-e53f54cbf51e // indirect
github.com/hashicorp/go-uuid v0.0.0-20160717022140-64130c7a86d7 // indirect
github.com/hashicorp/go-version v0.0.0-20171129150820-4fe82ae3040f // indirect
github.com/hashicorp/hcl v0.0.0-20171017181929-23c074d0eceb // indirect
github.com/hashicorp/hcl2 v0.0.0-20180202160940-9f91684a1f17 // indirect
github.com/hashicorp/hil v0.0.0-20170627220502-fa9f258a9250 // indirect
github.com/hashicorp/logutils v1.0.0 // indirect
github.com/hashicorp/terraform v0.11.3
github.com/hashicorp/yamux v0.0.0-20171219165022-683f49123a33 // indirect
github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8 // indirect
github.com/kr/pretty v0.1.0 // indirect
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/mattn/go-isatty v0.0.3 // indirect
github.com/mitchellh/cli v0.0.0-20180117155440-518dc677a1e1 // indirect
github.com/mitchellh/copystructure v0.0.0-20170525013902-d23ffcb85de3 // indirect
github.com/mitchellh/go-homedir v0.0.0-20161203194507-b8bc1bf76747 // indirect
github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77 // indirect
github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 // indirect
github.com/mitchellh/hashstructure v0.0.0-20170609045927-2bca23e0e452 // indirect
github.com/mitchellh/mapstructure v0.0.0-20180111000720-b4575eea38cc // indirect
github.com/mitchellh/reflectwalk v0.0.0-20170726202117-63d60e9d0dbc // indirect
github.com/oklog/run v1.0.0 // indirect
github.com/posener/complete v0.0.0-20171104095702-dc2bc5a81acc // indirect
github.com/satori/go.uuid v1.2.0 // indirect
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a // indirect
github.com/stretchr/testify v1.3.0 // indirect
github.com/ulikunitz/xz v0.5.4 // indirect
github.com/zclconf/go-cty v0.0.0-20180106055834-709e4033eeb0 // indirect
golang.org/x/sync v0.0.0-20190423024810-112230192c58 // indirect
google.golang.org/genproto v0.0.0-20180125080656-4eb30f4778ee // indirect
google.golang.org/grpc v1.9.2 // indirect
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
gopkg.in/ini.v1 v1.42.0 // indirect
)
Loading

0 comments on commit b6aea48

Please sign in to comment.