提交 6b2d1ed1 编写于 作者: L Lucas Käldström

Restructure the whole project, gofmt and improve the makefile

上级 f0ad2626
# Copyright 2016 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
GOOS ?= $(shell go env GOOS)
GOARCH ?= $(shell go env GOARCH)
BUILD_DIR ?= ./out
GOPATH := $(shell pwd)/.gopath
REPOPATH ?= k8s.io/minikube
GO15VENDOREXPERIMENT := 1
export GO15VENDOREXPERIMENT=1
clean:
rm -rf $(GOPATH)
rm -rf $(BUILD_DIR)
gopath: clean
gopath:
rm -rf $(GOPATH)
mkdir -p $(shell dirname $(GOPATH)/src/$(REPOPATH))
ln -s $(shell pwd) $(GOPATH)/src/$(REPOPATH)
......@@ -23,14 +37,14 @@ localkube: localkube-$(GOOS)-$(GOARCH)
cp $(BUILD_DIR)/localkube-$(GOOS)-$(GOARCH) $(BUILD_DIR)/localkube
minikube-$(GOOS)-$(GOARCH): gopath
GOPATH=$(GOPATH) CGO_ENABLED=0 GOARCH=$(GOARCH) GOOS=$(GOOS) go build --installsuffix cgo -a -o $(BUILD_DIR)/minikube-$(GOOS)-$(GOARCH) ./cmd/minikube
CGO_ENABLED=0 GOARCH=$(GOARCH) GOOS=$(GOOS) go build --installsuffix cgo -a -o $(BUILD_DIR)/minikube-$(GOOS)-$(GOARCH) ./cmd/minikube
localkube-$(GOOS)-$(GOARCH): gopath
GOARCH=$(GOARCH) GOOS=$(GOOS) CGO_ENABLED=1 go build -o $(BUILD_DIR)/localkube-$(GOOS)-$(GOARCH) -i ./cmd/localkube
GOARCH=$(GOARCH) GOOS=$(GOOS) go build -o $(BUILD_DIR)/localkube-$(GOOS)-$(GOARCH) ./cmd/localkube
.PHONY: integration
integration: minikube
go test -v ./integration --tags=integration
go test -v ./test/integration --tags=integration
.PHONY: test
test: gopath
......
......@@ -5,7 +5,7 @@ import (
"os"
"os/signal"
"k8s.io/minikube/localkube"
"k8s.io/minikube/pkg/localkube"
)
var (
......
......@@ -22,8 +22,8 @@ import (
"github.com/docker/machine/libmachine"
"github.com/spf13/cobra"
"k8s.io/minikube/cli/cluster"
"k8s.io/minikube/cli/constants"
"k8s.io/minikube/pkg/minikube/cluster"
"k8s.io/minikube/pkg/minikube/constants"
)
// deleteCmd represents the delete command
......
......@@ -22,7 +22,7 @@ import (
"os"
"github.com/spf13/cobra"
"k8s.io/minikube/cli/constants"
"k8s.io/minikube/pkg/minikube/constants"
)
var dirs = [...]string{
......
......@@ -23,7 +23,7 @@ import (
"testing"
"github.com/spf13/cobra"
"k8s.io/minikube/cli/constants"
"k8s.io/minikube/pkg/minikube/constants"
)
func makeTempDir() string {
......
......@@ -24,8 +24,8 @@ import (
"github.com/docker/machine/libmachine"
"github.com/spf13/cobra"
"k8s.io/minikube/cli/cluster"
"k8s.io/minikube/cli/constants"
"k8s.io/minikube/pkg/minikube/cluster"
"k8s.io/minikube/pkg/minikube/constants"
)
// startCmd represents the start command
......
......@@ -23,8 +23,8 @@ import (
"github.com/docker/machine/libmachine"
"github.com/spf13/cobra"
"k8s.io/minikube/cli/cluster"
"k8s.io/minikube/cli/constants"
"k8s.io/minikube/pkg/minikube/cluster"
"k8s.io/minikube/pkg/minikube/constants"
)
// statusCmd represents the status command
......
......@@ -22,8 +22,8 @@ import (
"github.com/docker/machine/libmachine"
"github.com/spf13/cobra"
"k8s.io/minikube/cli/cluster"
"k8s.io/minikube/cli/constants"
"k8s.io/minikube/pkg/minikube/cluster"
"k8s.io/minikube/pkg/minikube/constants"
)
// stopCmd represents the stop command
......
......@@ -17,8 +17,8 @@ limitations under the License.
package main
import (
"k8s.io/minikube/cli/cmd"
"k8s.io/minikube/cli/machine"
"k8s.io/minikube/cmd/minikube/cmd"
"k8s.io/minikube/pkg/minikube/machine"
)
func main() {
......
......@@ -22,7 +22,7 @@ import (
"os"
"time"
kube2sky "k8s.io/minikube/k2s"
"k8s.io/minikube/pkg/localkube/kube2sky"
"github.com/coreos/go-etcd/etcd"
backendetcd "github.com/skynetservices/skydns/backends/etcd"
......
......@@ -17,10 +17,10 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// kube2sky is a bridge between Kubernetes and SkyDNS. It watches the
// kube2sky is a bridge between Kubernetes and SkyDNS. It watches the
// Kubernetes master for changes in Services and manifests them into etcd for
// SkyDNS to serve as DNS records.
package lib
package kube2sky
import (
"encoding/json"
......
......@@ -27,7 +27,7 @@ import (
"github.com/docker/machine/libmachine"
"github.com/docker/machine/libmachine/host"
"github.com/docker/machine/libmachine/state"
"k8s.io/minikube/cli/constants"
"k8s.io/minikube/pkg/minikube/constants"
)
// StartHost starts a host VM.
......
......@@ -23,8 +23,8 @@ import (
"github.com/docker/machine/libmachine/host"
"github.com/docker/machine/libmachine/state"
"k8s.io/minikube/cli/constants"
"k8s.io/minikube/cli/tests"
"k8s.io/minikube/pkg/minikube/constants"
"k8s.io/minikube/pkg/minikube/tests"
)
func TestCreateHost(t *testing.T) {
......
......@@ -25,7 +25,7 @@ import (
"testing"
"github.com/docker/machine/libmachine/drivers/plugin/localbinary"
"k8s.io/minikube/cli/constants"
"k8s.io/minikube/pkg/minikube/constants"
)
func makeTempDir() string {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册