diff --git a/.gitignore b/.gitignore index f56a2b9f..c57f793b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ *.swp *~ vendor -adapter +./adapter diff --git a/Makefile b/Makefile index 7dbfdce7..9fe211b6 100644 --- a/Makefile +++ b/Makefile @@ -25,14 +25,14 @@ endif all: docker-build build: - CGO_ENABLED=0 GOARCH=$(ARCH) go build -a -tags netgo -o /build/adapter github.com/directxman12/k8s-prometheus-adapter/cmd + CGO_ENABLED=0 GOARCH=$(ARCH) go build -a -tags netgo -o /build/adapter github.com/directxman12/k8s-prometheus-adapter/cmd/adapter docker-build: cp deploy/Dockerfile $(TEMP_DIR) cd $(TEMP_DIR) && sed -i "s|BASEIMAGE|$(BASEIMAGE)|g" Dockerfile docker run -it -v $(TEMP_DIR):/build -v $(shell pwd):/go/src/github.com/directxman12/k8s-prometheus-adapter -e GOARCH=$(ARCH) golang:1.8 /bin/bash -c "\ - CGO_ENABLED=0 go build -a -tags netgo -o /build/adapter github.com/directxman12/k8s-prometheus-adapter/cmd" + CGO_ENABLED=0 go build -a -tags netgo -o /build/adapter github.com/directxman12/k8s-prometheus-adapter/cmd/adapter" docker build -t $(REGISTRY)/$(IMAGE)-$(ARCH):$(VERSION) $(TEMP_DIR) sudo rm -r $(TEMP_DIR) diff --git a/cmd/adapter.go b/cmd/adapter/adapter.go similarity index 94% rename from cmd/adapter.go rename to cmd/adapter/adapter.go index 25229e1b..c6b671d0 100644 --- a/cmd/adapter.go +++ b/cmd/adapter/adapter.go @@ -24,7 +24,7 @@ import ( "k8s.io/apimachinery/pkg/util/wait" "k8s.io/apiserver/pkg/util/logs" - "github.com/directxman12/k8s-prometheus-adapter/cmd/app" + "github.com/directxman12/k8s-prometheus-adapter/cmd/adapter/app" ) func main() { diff --git a/cmd/app/start.go b/cmd/adapter/app/start.go similarity index 100% rename from cmd/app/start.go rename to cmd/adapter/app/start.go