Skip to content

Commit

Permalink
Fix linter
Browse files Browse the repository at this point in the history
Signed-off-by: Artiom Diomin <kron82@gmail.com>
  • Loading branch information
kron4eg committed Jul 5, 2019
1 parent d15e519 commit 7e812eb
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
4 changes: 4 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
run:
issues-exit-code: 1
skip-dirs:
- hack
- vendor

linters:
enable-all: true
Expand Down Expand Up @@ -27,3 +30,4 @@ issues:
- "don't use underscores in Go names; func SetDefaults_Features should be SetDefaultsFeatures"
- "don't use underscores in Go names; func SetDefaults_MachineController should be SetDefaultsMachineController"
- "G101: Potential hardcoded credentials"
- "G106: Use of ssh InsecureIgnoreHostKey should be audited"
18 changes: 7 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@

export GOPATH?=$(shell go env GOPATH)
export CGO_ENABLED=0
export TFJSON?=
export KUBERNETES_VERSION=1.14.1
export GOPROXY=https://proxy.golang.org
export GO111MODULE=on

BUILD_DATE=$(shell if hash gdate 2>/dev/null; then gdate --rfc-3339=seconds | sed 's/ /T/'; else date --rfc-3339=seconds | sed 's/ /T/'; fi)
BUILD_IMAGE?=golang:1.12.5
BUILD_IMAGE?=golang:1.12.6
GITCOMMIT=$(shell git log -1 --pretty=format:"%H")
GITTAG=$(shell git describe --tags --always)
GOLDFLAGS?=-s -w -X github.com/kubermatic/kubeone/pkg/cmd.version=$(GITTAG) -X github.com/kubermatic/kubeone/pkg/cmd.commit=$(GITCOMMIT) -X github.com/kubermatic/kubeone/pkg/cmd.date=$(BUILD_DATE)
GOBUILDFLAGS?=-mod readonly

PROVIDER=$(notdir $(wildcard ./terraform/*))
CREATE_TARGETS=$(addsuffix -env,$(PROVIDER))
Expand All @@ -42,27 +42,25 @@ install-via-docker: docker-make-install
make install

install:
go install -ldflags='$(GOLDFLAGS)' -v .
go install $(GOBUILDFLAGS) -ldflags='$(GOLDFLAGS)' -v .

build: dist/kubeone

vendor:
go mod vendor

dist/kubeone: $(shell find . -name '*.go')
go build -mod readonly -ldflags='$(GOLDFLAGS)' -v -o $@ .
go build $(GOBUILDFLAGS) -ldflags='$(GOLDFLAGS)' -v -o $@ .

generate-internal-groups: vendor
./hack/update-codegen.sh

verify-dependencies:
go mod verify



.PHONY: test e2e-test lint verify-licence verify-codegen verify-boilerplate
test:
CGO_ENABLED=1 go test -race ./...
CGO_ENABLED=1 go test $(GOBUILDFLAGS) -race ./...

e2e-test: build lint test
./hack/run-ci-e2e_test.sh
Expand All @@ -80,8 +78,6 @@ verify-codegen: vendor
verify-boilerplate:
./hack/verify-boilerplate.sh



$(CREATE_TARGETS): dist/kubeone
$(eval PROVIDERNAME := $(@:-env=))
cd terraform/$(PROVIDERNAME) && terraform apply --auto-approve
Expand All @@ -91,10 +87,10 @@ $(CREATE_TARGETS): dist/kubeone
until ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $(USER)@$$host exit; do sleep 1; done; \
done
./dist/kubeone config print --full --provider $(PROVIDERNAME) > ./dist/fresh_config.yaml
./dist/kubeone install ./dist/fresh_config.yaml --tfjson tf.json
./dist/kubeone install ./dist/fresh_config.yaml --tfjson tf.json

$(DESTROY_TARGETS): dist/kubeone
$(eval PROVIDERNAME := $(@:-env-cleanup=))
./dist/kubeone config print --full --provider $(PROVIDERNAME) > ./dist/fresh_config.yaml
./dist/kubeone reset ./dist/fresh_config.yaml --tfjson tf.json
./dist/kubeone reset ./dist/fresh_config.yaml --tfjson tf.json
cd terraform/$(PROVIDERNAME) && terraform destroy --auto-approve
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 h1:HuIa8hRrWRSrqYzx1qI49NNxhdi2PrY7gxVSq1JjLDc=
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495 h1:I6A9Ag9FpEKOjcKrRNjQkPHawoXIhKyTGfvvjFAiiAk=
golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
Expand Down Expand Up @@ -149,6 +150,7 @@ golang.org/x/tools v0.0.0-20190703212419-2214986f1668/go.mod h1:jcCCGcm9btYwXyDq
gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485 h1:OB/uP/Puiu5vS5QMRPrXCDWUPb+kt8f1KW8oQzFejQw=
gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0=
gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw=
gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e h1:jRyg0XfpwWlhEV8mDfdNGBeSJM2fuyh9Yjrnd8kF2Ts=
gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ=
google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
Expand Down
2 changes: 1 addition & 1 deletion pkg/installer/installation/reset.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func destroyWorkers(s *state.State) error {
})
if waitErr != nil {
s.Logger.Warn("Unable to connect to the control plane API and destroy worker nodes")
s.Logger.Warn("You can skip destorying worker nodes and destroy them manually using `--destroy-workers=false`")
s.Logger.Warn("You can skip destroying worker nodes and destroy them manually using `--destroy-workers=false`")
return waitErr
}

Expand Down

0 comments on commit 7e812eb

Please sign in to comment.