Skip to content

Commit

Permalink
migrating dependency management to go.mod, fix shutdown on lease lost
Browse files Browse the repository at this point in the history
```improvement operator
fix for shutdown on lease lost
```
  • Loading branch information
MartinWeindel committed Feb 4, 2020
1 parent f9fb88e commit 42eb43d
Show file tree
Hide file tree
Showing 2,221 changed files with 311,514 additions and 230,604 deletions.
19 changes: 12 additions & 7 deletions .ci/check
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,26 @@ ignore=(
": exported "
)

# Install Golint (linting tool).
go get -u golang.org/x/lint/golint
# Build Golint.
go install -mod=vendor ./vendor/golang.org/x/lint/golint

###############################################################################

join_by() { local IFS="$1"; shift; echo "$*"; }

PACKAGES="$(go list -e ./... | grep -vE '/tmp/|/vendor/|/local/')"
LINT_FOLDERS="$(echo ${PACKAGES} | sed "s|$GITPROVIDER/$PROJECT|.|g")"
PACKAGES="$(go list -mod=vendor -e ./... | grep -vE '/tmp/|/vendor/|/local/')"
PACKAGES_DIRS="$(echo ${PACKAGES} | sed "s|$GITPROVIDER/$PROJECT|.|g")"

# Execute static code checks.
#go vet ${PACKAGES}
go vet -mod=vendor ${PACKAGES}

# go fmt ignores -mod=vendor and performs module lookup (https://github.com/golang/go/issues/27841).
# Also go fmt is just alias for gofmt -l -w and does not support flags that gofmt does.
# That is why gofmt is used.

# Execute automatic code formatting directive.
go fmt ${PACKAGES}
echo "Running gofmt..."
gofmt -l -w -s ${PACKAGES_DIRS}

# Execute lint checks.
hack/lint -vacs ${LINT_FOLDERS}
hack/lint -vacs ${PACKAGES_DIRS}
5 changes: 2 additions & 3 deletions .ci/test
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ source "$SOURCE_PATH/build/setupenv.src"

# Install Ginkgo (test framework) to be able to execute the tests.
echo "Installing Ginkgo..."
go get -u github.com/onsi/gomega
go get -u github.com/onsi/ginkgo/ginkgo
go install -mod=vendor ./vendor/github.com/onsi/ginkgo/ginkgo

###############################################################################

Expand All @@ -40,4 +39,4 @@ if [[ ! -z "$COVERAGE" ]]; then
fi

echo "Running tests..."
ginkgo ${COVER_FLAG} -r cmd pkg plugin
GOFLAGS="-mod=vendor" ginkgo ${COVER_FLAG} -r cmd pkg plugin
34 changes: 25 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,48 @@ EXECUTABLE=dns-controller-manager
PROJECT=github.com/gardener/external-dns-management
VERSION=$(shell cat VERSION)

.PHONY: revendor
revendor:
@GO111MODULE=on go mod vendor
@GO111MODULE=on go mod tidy

.PHONY: build local-build release test alltests

.PHONY: check
check:
@.ci/check

.PHONY: build
build:
GOOS=linux GOARCH=amd64 go build -o $(EXECUTABLE) \
@CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -o $(EXECUTABLE) \
-mod=vendor \
-ldflags "-X main.Version=$(VERSION)-$(shell git rev-parse HEAD)"\
./cmd/dns

build-local: local-build

local-build:
go build -o $(EXECUTABLE) \
.PHONY: build-local
build-local:
@CGO_ENABLED=0 GO111MODULE=on go build -o $(EXECUTABLE) \
-mod=vendor \
-ldflags "-X main.Version=$(VERSION)-$(shell git rev-parse HEAD)"\
./cmd/dns

.PHONY: release
release:
GOOS=linux GOARCH=amd64 go build -o $(EXECUTABLE) \
@CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -o $(EXECUTABLE) \
-a \
-mod=vendor \
-ldflags "-X main.Version=$(VERSION) \
./cmd/dns

.PHONY: test
test:
go test ./pkg/...
GO111MODULE=on go test -mod=vendor ./pkg/...
@echo ----- Skipping long running integration tests, use \'make alltests\' to run all tests -----
test/integration/run.sh $(kindargs) -- -skip Many $(args)

.PHONY: generate
generate:
@./hack/generate-code

alltests:
go test ./pkg/...
GO111MODULE=on go test -mod=vendor ./pkg/...
test/integration/run.sh $(kindargs) -- $(args)
42 changes: 42 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
module github.com/gardener/external-dns-management

go 1.13

require (
github.com/Azure/azure-sdk-for-go v39.0.0+incompatible
github.com/Azure/go-autorest/autorest/azure/auth v0.4.2
github.com/Azure/go-autorest/autorest/to v0.3.0 // indirect
github.com/Masterminds/semver v1.4.2 // indirect
github.com/ahmetb/gen-crd-api-reference-docs v0.1.5
github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20190603021944-12ad9f921c0b
github.com/aws/aws-sdk-go v1.19.41
github.com/emicklei/go-restful v2.9.6+incompatible // indirect
github.com/gardener/controller-manager-library v0.1.1-0.20200204110458-c263b9bb97ad
github.com/go-openapi/swag v0.19.4 // indirect
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef // indirect
github.com/googleapis/gnostic v0.2.0 // indirect
github.com/gophercloud/gophercloud v0.2.0
github.com/gophercloud/utils v0.0.0-20190527093828-25f1b77b8c03
github.com/imdario/mergo v0.3.7 // indirect
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e // indirect
github.com/miekg/dns v1.1.14
github.com/onsi/ginkgo v1.10.1
github.com/onsi/gomega v1.7.0
github.com/prometheus/client_golang v0.9.2
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 // indirect
github.com/prometheus/common v0.2.0 // indirect
github.com/prometheus/procfs v0.0.0-20190328153300-af7bedc223fb // indirect
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
golang.org/x/tools v0.0.0-20190715044752-607ca053a137 // indirect
google.golang.org/api v0.4.0
k8s.io/api v0.16.4
k8s.io/apiextensions-apiserver v0.16.4
k8s.io/apimachinery v0.17.0
k8s.io/client-go v0.16.4
k8s.io/code-generator v0.16.4
k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a
sigs.k8s.io/kind v0.7.0
)

replace gopkg.in/fsnotify.v1 v1.4.7 => github.com/fsnotify/fsnotify v1.4.7
Loading

0 comments on commit 42eb43d

Please sign in to comment.