提交 8b17e607 编写于 作者: T Tiago Ilieve

Add Go modules, remove Go dep

上级 e02f9c6f
......@@ -4,6 +4,7 @@
*.so
# Folders
.cache
_obj
_test
......
......@@ -4,7 +4,6 @@ sudo: required
go:
- 1.x
go_import_path: k8s.io/minikube
install:
- echo "Don't run anything."
......
此差异已折叠。
# Gopkg.toml example
#
# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"
#
# [prune]
# non-go = false
# go-tests = true
# unused-packages = true
[[constraint]]
name = "github.com/blang/semver"
version = "3.5.0"
[[constraint]]
branch = "master"
source = "github.com/machine-drivers/machine"
name = "github.com/docker/machine"
[[constraint]]
branch = "master"
name = "github.com/jimmidyson/go-download"
[[constraint]]
branch = "master"
name = "github.com/johanneswuerbach/nfsexports"
[[constraint]]
name = "github.com/libvirt/libvirt-go"
version = "3.4.0"
[[constraint]]
name = "github.com/moby/hyperkit"
version = "0.20171020.0"
[[constraint]]
name = "github.com/pkg/errors"
version = "0.8.0"
[[constraint]]
branch = "master"
name = "github.com/r2d4/external-storage"
[[constraint]]
name = "github.com/spf13/pflag"
version = "1.0.1"
[[constraint]]
name = "github.com/spf13/viper"
version = "1.0.0"
[[constraint]]
branch = "master"
name = "github.com/zchee/go-vmnet"
[[constraint]]
name = "k8s.io/api"
version = "kubernetes-1.11.2"
[[constraint]]
name = "k8s.io/apimachinery"
version = "kubernetes-1.11.2"
[[constraint]]
name = "k8s.io/client-go"
version = "kubernetes-1.11.2"
[[constraint]]
name = "k8s.io/kubernetes"
version = "1.11.2"
[[override]]
name = "k8s.io/api"
version = "kubernetes-1.11.2"
[[override]]
name = "k8s.io/apimachinery"
version = "kubernetes-1.11.2"
[[override]]
name = "github.com/Azure/go-ansiterm"
revision = "d6e3b3328b783f23731bc4d058875b0371ff8109"
[[override]]
name = "github.com/json-iterator/go"
version = "1.1.3-22-gf2b4162"
[[override]]
branch = "master"
name = "github.com/intel-go/cpuid"
[prune]
go-tests = true
non-go = true
unused-packages = true
[[constraint]]
name = "github.com/google/go-cmp"
version = "0.2.0"
[[constraint]]
name = "golang.org/x/text"
revision = "342b2e1fbaa52c93f31447ad2c6abc048c63e475"
[[constraint]]
name = "github.com/cloudfoundry-attic/jibber_jabber"
branch = "master"
......@@ -26,9 +26,9 @@ INSTALL_SIZE ?= $(shell du out/minikube-windows-amd64.exe | cut -f1)
BUILDROOT_BRANCH ?= 2018.05
REGISTRY?=gcr.io/k8s-minikube
HYPERKIT_BUILD_IMAGE ?= karalabe/xgo-1.10.x
# NOTE: "latest" as of 2018-12-04. kube-cross images aren't updated as often as Kubernetes
BUILD_IMAGE ?= k8s.gcr.io/kube-cross:v1.11.1-1
HYPERKIT_BUILD_IMAGE ?= karalabe/xgo-1.12.x
# NOTE: "latest" as of 2019-05-09. kube-cross images aren't updated as often as Kubernetes
BUILD_IMAGE ?= k8s.gcr.io/kube-cross:v1.12.5-1
ISO_BUILD_IMAGE ?= $(REGISTRY)/buildroot-image
KVM_BUILD_IMAGE ?= $(REGISTRY)/kvm-build-image
......@@ -41,6 +41,7 @@ MINIKUBE_UPLOAD_LOCATION := gs://${MINIKUBE_BUCKET}
KERNEL_VERSION ?= 4.16.14
GO_VERSION ?= $(shell go version | cut -d' ' -f3 | sed -e 's/go//')
export GO111MODULE := on
GOOS ?= $(shell go env GOOS)
GOARCH ?= $(shell go env GOARCH)
......@@ -48,9 +49,6 @@ GOPATH ?= $(shell go env GOPATH)
BUILD_DIR ?= ./out
$(shell mkdir -p $(BUILD_DIR))
ORG := k8s.io
REPOPATH ?= $(ORG)/minikube
# Use system python if it exists, otherwise use Docker.
PYTHON := $(shell command -v python || echo "docker run --rm -it -v $(shell pwd):/minikube -w /minikube python python")
BUILD_OS := $(shell uname -s)
......@@ -80,7 +78,7 @@ SOURCE_PACKAGES = ./cmd/... ./pkg/... ./test/...
# $(call DOCKER, image, command)
define DOCKER
docker run --rm -e IN_DOCKER=1 --user $(shell id -u):$(shell id -g) -w /go/src/$(REPOPATH) -v $(GOPATH):/go --entrypoint /bin/bash $(1) -c '$(2)'
docker run --rm -e GOCACHE=/app/.cache -e IN_DOCKER=1 --user $(shell id -u):$(shell id -g) -w /app -v $(PWD):/app -v $(GOPATH):/go --entrypoint /bin/bash $(1) -c '$(2)'
endef
ifeq ($(BUILD_IN_DOCKER),y)
......@@ -109,17 +107,6 @@ out/minikube-%: pkg/minikube/assets/assets.go
ifeq ($(MINIKUBE_BUILD_IN_DOCKER),y)
$(call DOCKER,$(BUILD_IMAGE),/usr/bin/make $@)
else
ifneq ($(GOPATH)/src/$(REPOPATH),$(CURDIR))
$(warning ******************************************************************************)
$(warning WARNING: You are building minikube outside the expected GOPATH:)
$(warning )
$(warning expected: $(GOPATH)/src/$(REPOPATH) )
$(warning got: $(CURDIR) )
$(warning )
$(warning You will likely encounter unusual build failures. For proper setup, read: )
$(warning https://github.com/kubernetes/minikube/blob/master/docs/contributors/build_guide.md)
$(warning ******************************************************************************)
endif
GOOS="$(firstword $(subst -, ,$*))" GOARCH="$(lastword $(subst -, ,$*))" go build -tags "$(MINIKUBE_BUILD_TAGS)" -ldflags="$(MINIKUBE_LDFLAGS)" -a -o $@ k8s.io/minikube/cmd/minikube
endif
......@@ -167,12 +154,12 @@ iso_in_docker:
--user $(shell id -u):$(shell id -g) --env HOME=/tmp --env IN_DOCKER=1 \
$(ISO_BUILD_IMAGE) /bin/bash
test-iso:
go test -v $(REPOPATH)/test/integration --tags=iso --minikube-args="--iso-url=file://$(shell pwd)/out/buildroot/output/images/rootfs.iso9660"
test-iso: pkg/minikube/assets/assets.go
go test -v ./test/integration --tags=iso --minikube-args="--iso-url=file://$(shell pwd)/out/buildroot/output/images/rootfs.iso9660"
.PHONY: test-pkg
test-pkg/%:
go test -v -test.timeout=60m $(REPOPATH)/$* --tags="$(MINIKUBE_BUILD_TAGS)"
test-pkg/%: pkg/minikube/assets/assets.go
go test -v -test.timeout=60m ./$* --tags="$(MINIKUBE_BUILD_TAGS)"
.PHONY: all
all: cross drivers e2e-cross
......@@ -182,7 +169,7 @@ drivers: out/docker-machine-driver-hyperkit out/docker-machine-driver-kvm2
.PHONY: integration
integration: out/minikube
go test -v -test.timeout=60m $(REPOPATH)/test/integration --tags="$(MINIKUBE_INTEGRATION_BUILD_TAGS)" $(TEST_ARGS)
go test -v -test.timeout=60m ./test/integration --tags="$(MINIKUBE_INTEGRATION_BUILD_TAGS)" $(TEST_ARGS)
.PHONY: integration-none-driver
integration-none-driver: e2e-linux-$(GOARCH) out/minikube-linux-$(GOARCH)
......@@ -190,15 +177,15 @@ integration-none-driver: e2e-linux-$(GOARCH) out/minikube-linux-$(GOARCH)
.PHONY: integration-versioned
integration-versioned: out/minikube
go test -v -test.timeout=60m $(REPOPATH)/test/integration --tags="$(MINIKUBE_INTEGRATION_BUILD_TAGS) versioned" $(TEST_ARGS)
go test -v -test.timeout=60m ./test/integration --tags="$(MINIKUBE_INTEGRATION_BUILD_TAGS) versioned" $(TEST_ARGS)
.PHONY: test
test:
GOPATH=$(GOPATH) ./test.sh
test: pkg/minikube/assets/assets.go
./test.sh
# Regenerates assets.go when template files have been updated
pkg/minikube/assets/assets.go: $(shell find deploy/addons -type f)
which go-bindata || GOBIN=$(GOPATH)/bin go get github.com/jteeuwen/go-bindata/...
which go-bindata || GO111MODULE=off GOBIN=$(GOPATH)/bin go get github.com/jteeuwen/go-bindata/...
PATH="$(PATH):$(GOPATH)/bin" go-bindata -nomemcopy -o pkg/minikube/assets/assets.go -pkg assets deploy/addons/...
.PHONY: cross
......@@ -247,7 +234,7 @@ mdlint:
@$(MARKDOWNLINT) $(MINIKUBE_MARKDOWN_FILES)
out/docs/minikube.md: $(shell find cmd) $(shell find pkg/minikube/constants) pkg/minikube/assets/assets.go
cd $(GOPATH)/src/$(REPOPATH) && go run -ldflags="$(MINIKUBE_LDFLAGS)" hack/gen_help_text.go
go run -ldflags="$(MINIKUBE_LDFLAGS)" hack/help_text/gen_help_text.go
out/minikube_$(DEB_VERSION).deb: out/minikube-linux-amd64
cp -r installers/linux/deb/minikube_deb_template out/minikube_$(DEB_VERSION)
......@@ -373,8 +360,7 @@ $(KVM_BUILD_IMAGE): installers/linux/kvm/Dockerfile
kvm_in_docker:
docker inspect $(KVM_BUILD_IMAGE) || $(MAKE) $(KVM_BUILD_IMAGE)
rm -f out/docker-machine-driver-kvm2
docker run --rm -v $(PWD):/go/src/k8s.io/minikube $(KVM_BUILD_IMAGE) \
/usr/bin/make -C /go/src/k8s.io/minikube out/docker-machine-driver-kvm2
$(call DOCKER,$(KVM_BUILD_IMAGE),/usr/bin/make out/docker-machine-driver-kvm2)
.PHONY: install-kvm
install-kvm: out/docker-machine-driver-kvm2
......
module k8s.io/minikube
go 1.12
require (
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78
github.com/Parallels/docker-machine-parallels v1.3.0
github.com/blang/semver v3.5.0+incompatible
github.com/c4milo/gotoolkit v0.0.0-20170318115440-bcc06269efa9
github.com/cloudfoundry-attic/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21
github.com/cpuguy83/go-md2man v1.0.4
github.com/davecgh/go-spew v0.0.0-20170626231645-782f4967f2dc
github.com/docker/docker v0.0.0-20180917213351-bbe08dc7f0b9
github.com/docker/go-units v0.0.0-20170127094116-9e638d38cf69
github.com/docker/machine v0.16.1
github.com/fsnotify/fsnotify v0.0.0-20160816051541-f12c6236fe7b
github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680
github.com/gogo/protobuf v0.0.0-20170330071051-c0656edd0d9e
github.com/golang/glog v0.0.0-20141105023935-44145f04b68c
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903
github.com/golang/protobuf v1.2.0
github.com/google/btree v1.0.0
github.com/google/go-cmp v0.2.0
github.com/google/go-containerregistry v0.0.0-20190318164241-019cdfc6adf9
github.com/google/go-github/v25 v25.0.2
github.com/google/go-querystring v1.0.0
github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367
github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7
github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce
github.com/hashicorp/go-multierror v0.0.0-20160811015721-8c5f0ad93604
github.com/hashicorp/go-version v1.1.0
github.com/hashicorp/golang-lru v0.0.0-20160207214719-a0d98a5f2880
github.com/hashicorp/hcl v0.0.0-20160711231752-d8c773c4cba1
github.com/hooklift/iso9660 v0.0.0-20170318115843-1cf07e5970d8
github.com/imdario/mergo v0.0.0-20141206190957-6633656539c1
github.com/inconshreveable/mousetrap v1.0.0
github.com/intel-go/cpuid v0.0.0-20181003105527-1a4a6f06a1c6
github.com/jimmidyson/go-download v0.0.0-20161028105827-7f9a90c8c95b
github.com/johanneswuerbach/nfsexports v0.0.0-20181204082207-1aa528dcb345
github.com/json-iterator/go v1.1.5
github.com/kr/fs v0.0.0-20131111012553-2788f0dbd169
github.com/libvirt/libvirt-go v3.4.0+incompatible
github.com/machine-drivers/docker-machine-driver-vmware v0.1.1
github.com/magiconair/properties v0.0.0-20160816085511-61b492c03cf4
github.com/mattn/go-isatty v0.0.4
github.com/mattn/go-runewidth v0.0.0-20161012013512-737072b4e32b
github.com/mitchellh/go-ps v0.0.0-20170309133038-4fdf99ab2936
github.com/mitchellh/mapstructure v0.0.0-20170307201123-53818660ed49
github.com/moby/hyperkit v0.0.0-20171020124204-a12cd7250bcd
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742
github.com/olekukonko/tablewriter v0.0.0-20160923125401-bdcc175572fd
github.com/pborman/uuid v0.0.0-20150603214016-ca53cad383ca
github.com/pelletier/go-buffruneio v0.1.0
github.com/pelletier/go-toml v0.0.0-20160822122712-0049ab3dc4c4
github.com/petar/GoLLRB v0.0.0-20130427215148-53be0d36a84c
github.com/peterbourgon/diskv v2.0.1+incompatible
github.com/pkg/browser v0.0.0-20160118053552-9302be274faa
github.com/pkg/errors v0.8.0
github.com/pkg/profile v0.0.0-20161223203901-3a8809bd8a80
github.com/pkg/sftp v0.0.0-20160930220758-4d0e916071f6
github.com/pmezard/go-difflib v1.0.0
github.com/r2d4/external-storage v0.0.0-20171222174501-8c0e8605dc7b
github.com/russross/blackfriday v0.0.0-20151117072312-300106c228d5
github.com/samalba/dockerclient v0.0.0-20160414174713-91d7393ff859
github.com/shurcooL/sanitized_anchor_name v0.0.0-20151028001915-10ef21a441db
github.com/sirupsen/logrus v0.0.0-20170822132746-89742aefa4b2
github.com/spf13/afero v0.0.0-20160816080757-b28a7effac97
github.com/spf13/cast v0.0.0-20160730092037-e31f36ffc91a
github.com/spf13/cobra v0.0.0-20180228053838-6644d46b81fa
github.com/spf13/jwalterweatherman v0.0.0-20160311093646-33c24e77fb80
github.com/spf13/pflag v1.0.1
github.com/spf13/viper v1.0.0
github.com/xeipuuv/gojsonpointer v0.0.0-20151027082146-e0fe6f683076
github.com/xeipuuv/gojsonreference v0.0.0-20150808065054-e02fc20de94c
github.com/xeipuuv/gojsonschema v0.0.0-20160623135812-c539bca196be
github.com/zchee/go-vmnet v0.0.0-20161021174912-97ebf9174097
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2
golang.org/x/net v0.0.0-20190311183353-d8887717615a
golang.org/x/oauth2 v0.0.0-20190115181402-5dab4167f31c
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a
golang.org/x/text v0.3.2
golang.org/x/time v0.0.0-20161028155119-f51c12702a4d
google.golang.org/appengine v1.4.0
gopkg.in/cheggaaa/pb.v1 v1.0.6
gopkg.in/inf.v0 v0.9.0
gopkg.in/yaml.v2 v2.0.0-20170721113624-670d4cfef054
k8s.io/api v0.0.0-20180712090710-2d6f90ab1293
k8s.io/apimachinery v0.0.0-20180621070125-103fd098999d
k8s.io/apiserver v0.0.0-20180914001516-67c892841170
k8s.io/client-go v0.0.0-20180806134042-1f13a808da65
k8s.io/kube-openapi v0.0.0-20180216212618-50ae88d24ede
k8s.io/kubernetes v1.11.3
)
此差异已折叠。
......@@ -21,7 +21,7 @@ import (
"context"
"fmt"
"github.com/google/go-github/github"
"github.com/google/go-github/v25/github"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"golang.org/x/oauth2"
......
......@@ -21,6 +21,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
pkg-config \
curl \
libvirt-dev \
git \
&& rm -rf /var/lib/apt/lists/*
ARG GO_VERSION
......
......@@ -16,8 +16,6 @@
set -e
REPO_PATH="k8s.io/minikube"
# Check for python on host, and use it if possible, otherwise fall back on python dockerized
if [[ -f $(which python 2>&1) ]]; then
PYTHON="python"
......@@ -31,7 +29,6 @@ COV_TMP_FILE=coverage_tmp.txt
# Run "go test" on packages that have test files. Also create coverage profile
echo "Running go tests..."
cd ${GOPATH}/src/${REPO_PATH}
rm -f out/$COV_FILE || true
echo "mode: count" > out/$COV_FILE
for pkg in $(go list -f '{{ if .TestGoFiles }} {{.ImportPath}} {{end}}' ./cmd/... ./pkg/...); do
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册