Skip to content

Commit 0c2ee14

Browse files
Merge pull request #4 from wuyingjun-lucky/main
add ci and publish image
2 parents 4415ce4 + 53ca2dc commit 0c2ee14

File tree

250 files changed

+29419
-2272
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

250 files changed

+29419
-2272
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ jobs:
5151
with:
5252
go-version: '1.20'
5353
- name: Compile
54-
run: make eps-probe-plugin
54+
run: make build

Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@
1818
# Use distroless as minimal base image to package the manager binary
1919
# Refer to https://github.com/GoogleContainerTools/distroless for more details
2020
FROM alpine:3.15.0
21-
WORKDIR /
21+
22+
ARG BINARY
23+
24+
#WORKDIR /
2225
#COPY --from=builder /workspace/controller .
23-
COPY controller /controller
26+
#COPY controller /controller
2427

25-
ENTRYPOINT ["/controller"]
28+
COPY ${BINARY} /bin/${BINARY}

Makefile

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,29 @@ REGISTRY_USER_NAME?=""
88
REGISTRY_PASSWORD?=""
99
REGISTRY_SERVER_ADDRESS?=""
1010

11-
TARGETS := eps-probe-plugin \
12-
1311
# Build code.
12+
.PHONY: build
13+
build:
14+
@make build-eps-probe-plugin GOOS=linux GOARCH=amd64
15+
# @make build-eps-probe-plugin GOOS=linux GOARCH=arm64
16+
# @make build-eps-probe-plugin GOOS=darwin GOARCH=amd64
17+
# @make build-eps-probe-plugin GOOS=darwin GOARCH=arm64
1418

15-
.PHONY: $(TARGETS)
16-
$(TARGETS):
17-
@echo "build binaries"
19+
build-eps-probe-plugin:
20+
hack/build.sh eps-probe-plugin ${GOOS} ${GOARCH}
1821

1922
# Build image.
20-
IMAGE_TARGET=$(addprefix image-, $(TARGETS))
21-
.PHONY: $(IMAGE_TARGET)
22-
$(IMAGE_TARGET):
23-
@echo "build images"
23+
.PHONY: image
24+
image: build
25+
@make image-eps-probe-plugin GOOS=linux GOARCH=amd64
2426

25-
images: $(IMAGE_TARGET)
27+
image-eps-probe-plugin:
28+
VERSION=$(VERSION) REGISTRY=$(REGISTRY) hack/docker.sh eps-probe-plugin ${GOOS} ${GOARCH}
2629

27-
# Build and push multi-platform image to DockerHub
28-
# todo
29-
upload-images: images
30+
# TODO Build and push multi-platform image to DockerHub
31+
upload-images: image
3032
@echo "push images to $(REGISTRY)"
33+
docker push ${REGISTRY}/eps-probe-plugin:${VERSION}
3134

3235
.PHONY: lint
3336
lint: golangci-lint

go.mod

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,18 @@ go 1.19
44

55
require (
66
github.com/go-ping/ping v1.1.0
7-
k8s.io/apimachinery v0.28.2
8-
k8s.io/client-go v0.28.1
7+
k8s.io/apimachinery v0.28.3
8+
k8s.io/client-go v0.28.3
99
k8s.io/klog/v2 v2.100.1
10+
k8s.io/kubectl v0.28.3
1011
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2
1112
sigs.k8s.io/controller-runtime v0.16.2
1213
sigs.k8s.io/mcs-api v0.1.0
1314
)
1415

1516
require (
17+
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
18+
github.com/MakeNowJust/heredoc v1.0.0 // indirect
1619
github.com/beorn7/perks v1.0.1 // indirect
1720
github.com/cespare/xxhash/v2 v2.2.0 // indirect
1821
github.com/davecgh/go-spew v1.1.1 // indirect
@@ -32,10 +35,14 @@ require (
3235
github.com/google/gofuzz v1.2.0 // indirect
3336
github.com/google/uuid v1.3.0 // indirect
3437
github.com/imdario/mergo v0.3.12 // indirect
38+
github.com/inconshreveable/mousetrap v1.1.0 // indirect
3539
github.com/josharian/intern v1.0.0 // indirect
3640
github.com/json-iterator/go v1.1.12 // indirect
3741
github.com/mailru/easyjson v0.7.7 // indirect
3842
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
43+
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
44+
github.com/moby/spdystream v0.2.0 // indirect
45+
github.com/moby/term v0.0.0-20221205130635-1aeaba878587 // indirect
3946
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
4047
github.com/modern-go/reflect2 v1.0.2 // indirect
4148
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
@@ -44,26 +51,28 @@ require (
4451
github.com/prometheus/client_model v0.4.0 // indirect
4552
github.com/prometheus/common v0.44.0 // indirect
4653
github.com/prometheus/procfs v0.10.1 // indirect
54+
github.com/russross/blackfriday/v2 v2.1.0 // indirect
55+
github.com/spf13/cobra v1.7.0 // indirect
4756
github.com/spf13/pflag v1.0.5 // indirect
4857
go.uber.org/multierr v1.11.0 // indirect
4958
go.uber.org/zap v1.25.0 // indirect
5059
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
51-
golang.org/x/net v0.13.0 // indirect
60+
golang.org/x/net v0.17.0 // indirect
5261
golang.org/x/oauth2 v0.8.0 // indirect
5362
golang.org/x/sync v0.2.0 // indirect
54-
golang.org/x/sys v0.11.0 // indirect
55-
golang.org/x/term v0.10.0 // indirect
56-
golang.org/x/text v0.11.0 // indirect
63+
golang.org/x/sys v0.13.0 // indirect
64+
golang.org/x/term v0.13.0 // indirect
65+
golang.org/x/text v0.13.0 // indirect
5766
golang.org/x/time v0.3.0 // indirect
5867
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
5968
google.golang.org/appengine v1.6.7 // indirect
6069
google.golang.org/protobuf v1.30.0 // indirect
6170
gopkg.in/inf.v0 v0.9.1 // indirect
6271
gopkg.in/yaml.v2 v2.4.0 // indirect
6372
gopkg.in/yaml.v3 v3.0.1 // indirect
64-
k8s.io/api v0.28.1 // indirect
73+
k8s.io/api v0.28.3 // indirect
6574
k8s.io/apiextensions-apiserver v0.28.0 // indirect
66-
k8s.io/component-base v0.28.1 // indirect
75+
k8s.io/component-base v0.28.3 // indirect
6776
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
6877
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
6978
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect

0 commit comments

Comments
 (0)