Skip to content

Commit

Permalink
Initial iteration for source-controller integration
Browse files Browse the repository at this point in the history
  • Loading branch information
mumoshu committed Nov 29, 2020
1 parent 30ee7ff commit 149416c
Show file tree
Hide file tree
Showing 16 changed files with 665 additions and 505 deletions.
6 changes: 6 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
linters-settings:
gci:
# put imports beginning with prefix after 3rd-party packages;
# only support one prefix
# if not set, use goimports.local-prefixes
local-prefixes: github.com/mumoshu/variant2
42 changes: 37 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,52 @@ build:
go build -o variant ./pkg/cmd

bin/goimports:
GOBIN=$(PWD)/bin go install golang.org/x/tools/cmd/goimports
echo "Installing goimports"
@{ \
set -e ;\
INSTALL_TMP_DIR=$$(mktemp -d) ;\
cd $$INSTALL_TMP_DIR ;\
go mod init tmp ;\
GOBIN=$(PWD)/bin go install golang.org/x/tools/cmd/goimports ;\
rm -rf $$INSTALL_TMP_DIR ;\
}

bin/gofumpt:
echo "Installing gofumpt"
@{ \
set -e ;\
INSTALL_TMP_DIR=$$(mktemp -d) ;\
cd $$INSTALL_TMP_DIR ;\
go mod init tmp ;\
GOBIN=$(PWD)/bin go install mvdan.cc/gofumpt ;\
rm -rf $$INSTALL_TMP_DIR ;\
}

bin/gci:
echo "Installing gci"
@{ \
set -e ;\
INSTALL_TMP_DIR=$$(mktemp -d) ;\
cd $$INSTALL_TMP_DIR ;\
go mod init tmp ;\
GOBIN=$(PWD)/bin go install github.com/daixiang0/gci ;\
rm -rf $$INSTALL_TMP_DIR ;\
}

.PHONY: fmt
fmt: bin/goimports
bin/goimports -w pkg .
fmt: bin/goimports bin/gci bin/gofumpt
gofmt -w -s pkg .
bin/gofumpt -w . || :
bin/gci -w -local github.com/mumoshu/variant2 . || :


.PHONY: test
test: build
go vet ./...
PATH=$(PWD):$(PATH) go test -race -v ./...

bin/golangci-lint:
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.32.0
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.33.0

.PHONY: lint
lint: bin/golangci-lint
Expand All @@ -26,7 +58,7 @@ lint: bin/golangci-lint
--disable gochecknoglobals \
--disable gochecknoinits \
--disable gomnd,funlen,prealloc,gocritic,lll,gocognit \
--disable testpackage,goerr113,exhaustivestruct,wrapcheck
--disable testpackage,goerr113,exhaustivestruct,wrapcheck,paralleltest

.PHONY: smoke
smoke: export GOBIN=$(shell pwd)/tools
Expand Down
36 changes: 17 additions & 19 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ require (
github.com/AlecAivazis/survey/v2 v2.0.5
github.com/PaesslerAG/jsonpath v0.1.1 // indirect
github.com/docker/distribution v2.7.1+incompatible // indirect
github.com/fluxcd/pkg/untar v0.0.5
github.com/fluxcd/source-controller/api v0.2.0
github.com/go-logr/logr v0.1.0
github.com/go-playground/universal-translator v0.17.0 // indirect
github.com/google/go-cmp v0.4.0
github.com/google/go-cmp v0.5.3
github.com/google/go-github/v27 v27.0.6 // indirect
github.com/hashicorp/go-multierror v1.0.0
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/hashicorp/hcl/v2 v2.3.0
github.com/hashicorp/terraform v0.12.18
github.com/hashicorp/hcl/v2 v2.7.0
github.com/hashicorp/terraform v0.14.0-beta2
github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect
github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334 // indirect
github.com/imdario/mergo v0.3.11
Expand All @@ -26,31 +27,28 @@ require (
github.com/rakyll/statik v0.1.7
github.com/rs/xid v1.2.1
github.com/spf13/cobra v0.0.5
github.com/spf13/pflag v1.0.5 // indirect
github.com/summerwind/whitebox-controller v0.7.1
github.com/tidwall/gjson v1.3.5
github.com/twpayne/go-vfs v1.3.6 // indirect
github.com/ulikunitz/xz v0.5.6 // indirect
github.com/urfave/cli v1.22.1 // indirect
github.com/variantdev/dag v0.0.0-20191028002400-bb0b3c785363
github.com/variantdev/mod v0.18.0
github.com/variantdev/vals v0.4.0
github.com/variantdev/vals v0.11.0
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
github.com/zclconf/go-cty v1.2.1
github.com/zclconf/go-cty-yaml v1.0.1
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a
golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4 // indirect
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543
github.com/zclconf/go-cty v1.6.2-0.20201013200640-e5225636c8c2
github.com/zclconf/go-cty-yaml v1.0.2
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9
golang.org/x/tools v0.0.0-20201121010211-780cb80bd7fb // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
gopkg.in/go-playground/validator.v9 v9.31.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c
k8s.io/api v0.18.9 // indirect
k8s.io/apiextensions-apiserver v0.18.9 // indirect
k8s.io/apimachinery v0.18.9
k8s.io/cli-runtime v0.18.9 // indirect
k8s.io/client-go v0.18.9
k8s.io/klog v1.0.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776
k8s.io/api v0.18.12 // indirect
k8s.io/apimachinery v0.18.12
k8s.io/client-go v10.0.0+incompatible
sigs.k8s.io/controller-runtime v0.6.3
)

replace github.com/summerwind/whitebox-controller v0.7.1 => github.com/mumoshu/whitebox-controller v0.5.1-0.20201028130131-ac7a0743254b

replace k8s.io/client-go v10.0.0+incompatible => k8s.io/client-go v0.18.12
Loading

0 comments on commit 149416c

Please sign in to comment.