Skip to content

Commit

Permalink
Merge pull request #4 from wuyingjun-lucky/main
Browse files Browse the repository at this point in the history
add ci and publish image
  • Loading branch information
wuyingjun-lucky committed Oct 19, 2023
2 parents 4415ce4 + 53ca2dc commit 0c2ee14
Show file tree
Hide file tree
Showing 250 changed files with 29,419 additions and 2,272 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ jobs:
with:
go-version: '1.20'
- name: Compile
run: make eps-probe-plugin
run: make build
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@
# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM alpine:3.15.0
WORKDIR /

ARG BINARY

#WORKDIR /
#COPY --from=builder /workspace/controller .
COPY controller /controller
#COPY controller /controller

ENTRYPOINT ["/controller"]
COPY ${BINARY} /bin/${BINARY}
29 changes: 16 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,29 @@ REGISTRY_USER_NAME?=""
REGISTRY_PASSWORD?=""
REGISTRY_SERVER_ADDRESS?=""

TARGETS := eps-probe-plugin \

# Build code.
.PHONY: build
build:
@make build-eps-probe-plugin GOOS=linux GOARCH=amd64
# @make build-eps-probe-plugin GOOS=linux GOARCH=arm64
# @make build-eps-probe-plugin GOOS=darwin GOARCH=amd64
# @make build-eps-probe-plugin GOOS=darwin GOARCH=arm64

.PHONY: $(TARGETS)
$(TARGETS):
@echo "build binaries"
build-eps-probe-plugin:
hack/build.sh eps-probe-plugin ${GOOS} ${GOARCH}

# Build image.
IMAGE_TARGET=$(addprefix image-, $(TARGETS))
.PHONY: $(IMAGE_TARGET)
$(IMAGE_TARGET):
@echo "build images"
.PHONY: image
image: build
@make image-eps-probe-plugin GOOS=linux GOARCH=amd64

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

# Build and push multi-platform image to DockerHub
# todo
upload-images: images
# TODO Build and push multi-platform image to DockerHub
upload-images: image
@echo "push images to $(REGISTRY)"
docker push ${REGISTRY}/eps-probe-plugin:${VERSION}

.PHONY: lint
lint: golangci-lint
Expand Down
25 changes: 17 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@ go 1.19

require (
github.com/go-ping/ping v1.1.0
k8s.io/apimachinery v0.28.2
k8s.io/client-go v0.28.1
k8s.io/apimachinery v0.28.3
k8s.io/client-go v0.28.3
k8s.io/klog/v2 v2.100.1
k8s.io/kubectl v0.28.3
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2
sigs.k8s.io/controller-runtime v0.16.2
sigs.k8s.io/mcs-api v0.1.0
)

require (
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/MakeNowJust/heredoc v1.0.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
Expand All @@ -32,10 +35,14 @@ require (
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/moby/spdystream v0.2.0 // indirect
github.com/moby/term v0.0.0-20221205130635-1aeaba878587 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
Expand All @@ -44,26 +51,28 @@ require (
github.com/prometheus/client_model v0.4.0 // indirect
github.com/prometheus/common v0.44.0 // indirect
github.com/prometheus/procfs v0.10.1 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/spf13/cobra v1.7.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.25.0 // indirect
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
golang.org/x/net v0.13.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/oauth2 v0.8.0 // indirect
golang.org/x/sync v0.2.0 // indirect
golang.org/x/sys v0.11.0 // indirect
golang.org/x/term v0.10.0 // indirect
golang.org/x/text v0.11.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/term v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.3.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/api v0.28.1 // indirect
k8s.io/api v0.28.3 // indirect
k8s.io/apiextensions-apiserver v0.28.0 // indirect
k8s.io/component-base v0.28.1 // indirect
k8s.io/component-base v0.28.3 // indirect
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
Expand Down
Loading

0 comments on commit 0c2ee14

Please sign in to comment.