Skip to content

Commit 7053ffd

Browse files
committedApr 11, 2018
First Commit
1 parent e61f72f commit 7053ffd

24 files changed

+99
-3050
lines changed
 

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
*~
33
vendor
44
_output
5+
apiserver.local.config/

‎Makefile

+88-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ OUT_DIR?=./_output
55

66
all: build
77
build: vendor
8-
CGO_ENABLED=0 GOARCH=$(ARCH) go build -a -tags netgo -o $(OUT_DIR)/$(ARCH)/sample-adapter github.com/kubernetes-incubator/custom-metrics-apiserver
8+
CGO_ENABLED=0 GOARCH=$(ARCH) go build -a -tags netgo -o $(OUT_DIR)/$(ARCH)/sample-adapter github.com/stevemcquaid/custom-metrics-apiserver
99

1010
vendor: glide.lock
1111
glide install -v
@@ -20,3 +20,90 @@ gofmt:
2020
./hack/gofmt-all.sh
2121

2222
verify: verify-gofmt test
23+
24+
run:
25+
./$(OUT_DIR)/$(ARCH)/sample-adapter
26+
27+
28+
29+
30+
31+
32+
33+
# DIRECTXMAN
34+
35+
36+
# REGISTRY?=directxman12
37+
# IMAGE?=k8s-prometheus-adapter
38+
# TEMP_DIR:=$(shell mktemp -d)
39+
# ARCH?=amd64
40+
# ALL_ARCH=amd64 arm arm64 ppc64le s390x
41+
# ML_PLATFORMS=linux/amd64,linux/arm,linux/arm64,linux/ppc64le,linux/s390x
42+
# OUT_DIR?=./_output
43+
# VENDOR_DOCKERIZED=0
44+
45+
# VERSION?=latest
46+
47+
# ifeq ($(ARCH),amd64)
48+
# BASEIMAGE?=busybox
49+
# endif
50+
# ifeq ($(ARCH),arm)
51+
# BASEIMAGE?=armhf/busybox
52+
# endif
53+
# ifeq ($(ARCH),arm64)
54+
# BASEIMAGE?=aarch64/busybox
55+
# endif
56+
# ifeq ($(ARCH),ppc64le)
57+
# BASEIMAGE?=ppc64le/busybox
58+
# endif
59+
# ifeq ($(ARCH),s390x)
60+
# BASEIMAGE?=s390x/busybox
61+
# endif
62+
63+
# .PHONY: all build docker-build push-% push test verify-gofmt gofmt verify
64+
65+
# all: build
66+
# build: vendor
67+
# CGO_ENABLED=0 GOARCH=$(ARCH) go build -a -tags netgo -o $(OUT_DIR)/$(ARCH)/adapter github.com/directxman12/k8s-prometheus-adapter/cmd/adapter
68+
69+
# docker-build: vendor
70+
# cp deploy/Dockerfile $(TEMP_DIR)
71+
# cd $(TEMP_DIR) && sed -i "s|BASEIMAGE|$(BASEIMAGE)|g" Dockerfile
72+
73+
# 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 "\
74+
# CGO_ENABLED=0 go build -a -tags netgo -o /build/adapter github.com/directxman12/k8s-prometheus-adapter/cmd/adapter"
75+
76+
# docker build -t $(REGISTRY)/$(IMAGE)-$(ARCH):$(VERSION) $(TEMP_DIR)
77+
# rm -rf $(TEMP_DIR)
78+
79+
# push-%:
80+
# $(MAKE) ARCH=$* docker-build
81+
# docker push $(REGISTRY)/$(IMAGE)-$*:$(VERSION)
82+
83+
# push: ./manifest-tool $(addprefix push-,$(ALL_ARCH))
84+
# ./manifest-tool push from-args --platforms $(ML_PLATFORMS) --template $(REGISTRY)/$(IMAGE)-ARCH:$(VERSION) --target $(REGISTRY)/$(IMAGE):$(VERSION)
85+
86+
# ./manifest-tool:
87+
# curl -sSL https://github.com/estesp/manifest-tool/releases/download/v0.5.0/manifest-tool-linux-amd64 > manifest-tool
88+
# chmod +x manifest-tool
89+
90+
# vendor: glide.lock
91+
# ifeq ($(VENDOR_DOCKERIZED),1)
92+
# docker run -it -v $(shell pwd):/go/src/github.com/directxman12/k8s-prometheus-adapter -w /go/src/github.com/directxman12/k8s-prometheus-adapter golang:1.8 /bin/bash -c "\
93+
# curl https://glide.sh/get | sh \
94+
# && glide install -v"
95+
# else
96+
# glide install -v
97+
# endif
98+
99+
# test: vendor
100+
# CGO_ENABLED=0 go test ./pkg/...
101+
102+
# verify-gofmt:
103+
# ./hack/gofmt-all.sh -v
104+
105+
# gofmt:
106+
# ./hack/gofmt-all.sh
107+
108+
# verify: verify-gofmt test
109+

‎glide.lock

-604
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎glide.yaml

+8-19
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
1-
package: github.com/kubernetes-incubator/custom-metrics-apiserver
1+
package: github.com/stevemcquaid/custom-metrics-apiserver
22
import:
33
- package: github.com/emicklei/go-restful
4-
version: 2.2.1 # close to kubernetes Godeps.json
5-
4+
version: 2.2.1
65
- package: github.com/emicklei/go-restful-swagger12
7-
version: 1.0.1 # from kubernetes Godeps.json
8-
6+
version: 1.0.1
97
- package: github.com/go-openapi/spec
10-
version: 1de3e0542de65ad8d75452a595886fdd0befb363 # from kubernetes Godeps.json
11-
8+
version: 1de3e0542de65ad8d75452a595886fdd0befb363
129
- package: github.com/golang/glog
13-
version: 44145f04b68cf362d9c4df2182967c2275eaefed # from kubernetes Godep.json
14-
10+
version: 44145f04b68cf362d9c4df2182967c2275eaefed
1511
- package: github.com/spf13/cobra
16-
version: c439c4fa093711d42e1b01acb1235b52004753c1 # from kubernetes Godeps.json
17-
12+
version: c439c4fa093711d42e1b01acb1235b52004753c1
1813
- package: k8s.io/apimachinery
1914
subpackages:
2015
- pkg/api/errors
@@ -33,8 +28,6 @@ import:
3328
- pkg/util/errors
3429
- pkg/util/wait
3530
- pkg/version
36-
tag: kubernetes-1.10.0-rc.1
37-
3831
- package: k8s.io/apiserver
3932
subpackages:
4033
- pkg/endpoints
@@ -47,8 +40,6 @@ import:
4740
- pkg/server
4841
- pkg/server/options
4942
- pkg/util/logs
50-
tag: kubernetes-1.10.0-rc.1
51-
5243
- package: k8s.io/client-go
5344
subpackages:
5445
- discovery
@@ -60,16 +51,14 @@ import:
6051
- rest
6152
- testing
6253
- tools/clientcmd
63-
tag: kubernetes-1.10.0-rc.1
64-
6554
- package: k8s.io/metrics
6655
subpackages:
6756
- pkg/apis/custom_metrics
6857
- pkg/apis/custom_metrics/install
6958
- pkg/apis/external_metrics
7059
- pkg/apis/external_metrics/install
71-
tag: kubernetes-1.10.0-rc.1
72-
60+
- package: github.com/kubernetes-incubator/custom-metrics-apiserver
61+
version: e61f72fec56ab519d74ebd396cd3fcf31b084558
7362
testImport:
7463
- package: github.com/stretchr/testify
7564
version: ^1.1.4

‎pkg/apiserver/apiserver.go

-112
This file was deleted.

‎pkg/apiserver/cmapis.go

-89
This file was deleted.

‎pkg/apiserver/emapis.go

-89
This file was deleted.

‎pkg/apiserver/installer/apiserver_test.go

-428
This file was deleted.

‎pkg/apiserver/installer/cmhandlers.go

-212
This file was deleted.

‎pkg/apiserver/installer/emhandlers.go

-143
This file was deleted.

‎pkg/apiserver/installer/installer.go

-300
This file was deleted.

‎pkg/apiserver/installer/installer_test.go

-83
This file was deleted.

‎pkg/cmd/server/start.go

-87
This file was deleted.

‎pkg/dynamicmapper/fake_discovery.go

-152
This file was deleted.

‎pkg/dynamicmapper/mapper.go

-114
This file was deleted.

‎pkg/dynamicmapper/mapper_test.go

-94
This file was deleted.

‎pkg/provider/errors.go

-49
This file was deleted.

‎pkg/provider/interfaces.go

-119
This file was deleted.

‎pkg/provider/interfaces_test.go

-70
This file was deleted.

‎pkg/provider/resource_lister.go

-77
This file was deleted.

‎pkg/registry/custom_metrics/reststorage.go

-128
This file was deleted.

‎pkg/registry/external_metrics/reststorage.go

-78
This file was deleted.

‎pkg/sample-cmd/server/start.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import (
3030

3131
"github.com/kubernetes-incubator/custom-metrics-apiserver/pkg/cmd/server"
3232
"github.com/kubernetes-incubator/custom-metrics-apiserver/pkg/dynamicmapper"
33-
"github.com/kubernetes-incubator/custom-metrics-apiserver/pkg/sample-cmd/provider"
33+
"github.com/stevemcquaid/custom-metrics-apiserver/pkg/sample-cmd/provider"
3434
)
3535

3636
// NewCommandStartMaster provides a CLI handler for 'start master' command

‎sample-main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"os"
2222
"runtime"
2323

24-
"github.com/kubernetes-incubator/custom-metrics-apiserver/pkg/sample-cmd/server"
24+
"github.com/stevemcquaid/custom-metrics-apiserver/pkg/sample-cmd/server"
2525
"k8s.io/apimachinery/pkg/util/wait"
2626
"k8s.io/apiserver/pkg/util/logs"
2727
)

0 commit comments

Comments
 (0)
Please sign in to comment.