Skip to content

Commit 80fb705

Browse files
committed
初步定义模型结构
1 parent adef6fd commit 80fb705

39 files changed

+2888
-0
lines changed

.gitignore

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
config
2+
3+
# Binaries for programs and plugins
4+
*.exe
5+
*.exe~
6+
*.dll
7+
*.so
8+
*.dylib
9+
bin
10+
testbin/*
11+
12+
# Test binary, build with `go test -c`
13+
*.test
14+
15+
# Output of the go coverage tool, specifically when used with LiteIDE
16+
*.out
17+
18+
# Kubernetes Generated files - skip generated files, except for vendored files
19+
20+
!vendor/**/zz_generated.*
21+
22+
# editor and IDE paraphernalia
23+
.idea
24+
*.swp
25+
*.swo
26+
*~

Dockerfile

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Build the manager binary
2+
FROM golang:1.18.7-alpine3.15 as builder
3+
4+
WORKDIR /app
5+
# Copy the Go Modules manifests
6+
COPY go.mod go.mod
7+
COPY go.sum go.sum
8+
# 坑:
9+
# 报错 go mod download: google.golang.org/[email protected]: read tcp 172.17.0.3:60862->14.204.51.154:443: read: connection reset by peer
10+
# The command '/bin/sh -c go mod download' returned a non-zero code: 1
11+
# make: *** [docker-build] 错误 1
12+
ENV GOPROXY=https://goproxy.cn,direct
13+
ENV GO111MODULE=on
14+
# cache deps before building and copying source so that we don't need to re-download as much
15+
# and so that source changes don't invalidate our downloaded layer
16+
RUN go mod download
17+
18+
# Copy the go source
19+
# # 需要把该放入的都copy进去,如果报出 package xxxxx is not in GOROOT => 就是这个问题。
20+
COPY main.go main.go
21+
COPY pkg/ pkg/
22+
# Build
23+
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o myclusterconfigoperator main.go
24+
25+
26+
FROM alpine:3.12
27+
WORKDIR /app
28+
# 需要的文件需要复制过来
29+
COPY --from=builder /app/myclusterconfigoperator .
30+
USER 65532:65532
31+
32+
ENTRYPOINT ["./myclusterconfigoperator"]

go.mod

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
module github.com/myoperator/jobflowoperator
2+
3+
go 1.18
4+
5+
require (
6+
github.com/go-logr/logr v1.2.3
7+
k8s.io/api v0.26.2
8+
k8s.io/apimachinery v0.26.2
9+
k8s.io/client-go v0.26.2
10+
k8s.io/code-generator v0.26.2
11+
k8s.io/klog/v2 v2.90.1
12+
sigs.k8s.io/controller-runtime v0.14.5
13+
)
14+
15+
require (
16+
github.com/beorn7/perks v1.0.1 // indirect
17+
github.com/cespare/xxhash/v2 v2.1.2 // indirect
18+
github.com/davecgh/go-spew v1.1.1 // indirect
19+
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
20+
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
21+
github.com/fsnotify/fsnotify v1.6.0 // indirect
22+
github.com/go-logr/zapr v1.2.3 // indirect
23+
github.com/go-openapi/jsonpointer v0.19.5 // indirect
24+
github.com/go-openapi/jsonreference v0.20.0 // indirect
25+
github.com/go-openapi/swag v0.19.14 // indirect
26+
github.com/gogo/protobuf v1.3.2 // indirect
27+
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
28+
github.com/golang/protobuf v1.5.2 // indirect
29+
github.com/google/gnostic v0.5.7-v3refs // indirect
30+
github.com/google/go-cmp v0.5.9 // indirect
31+
github.com/google/gofuzz v1.1.0 // indirect
32+
github.com/google/uuid v1.1.2 // indirect
33+
github.com/imdario/mergo v0.3.6 // indirect
34+
github.com/josharian/intern v1.0.0 // indirect
35+
github.com/json-iterator/go v1.1.12 // indirect
36+
github.com/mailru/easyjson v0.7.6 // indirect
37+
github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
38+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
39+
github.com/modern-go/reflect2 v1.0.2 // indirect
40+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
41+
github.com/pkg/errors v0.9.1 // indirect
42+
github.com/prometheus/client_golang v1.14.0 // indirect
43+
github.com/prometheus/client_model v0.3.0 // indirect
44+
github.com/prometheus/common v0.37.0 // indirect
45+
github.com/prometheus/procfs v0.8.0 // indirect
46+
github.com/spf13/pflag v1.0.5 // indirect
47+
go.uber.org/atomic v1.7.0 // indirect
48+
go.uber.org/multierr v1.6.0 // indirect
49+
go.uber.org/zap v1.24.0 // indirect
50+
golang.org/x/mod v0.6.0 // indirect
51+
golang.org/x/net v0.7.0 // indirect
52+
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect
53+
golang.org/x/sys v0.5.0 // indirect
54+
golang.org/x/term v0.5.0 // indirect
55+
golang.org/x/text v0.7.0 // indirect
56+
golang.org/x/time v0.3.0 // indirect
57+
golang.org/x/tools v0.2.0 // indirect
58+
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
59+
google.golang.org/appengine v1.6.7 // indirect
60+
google.golang.org/protobuf v1.28.1 // indirect
61+
gopkg.in/inf.v0 v0.9.1 // indirect
62+
gopkg.in/yaml.v2 v2.4.0 // indirect
63+
gopkg.in/yaml.v3 v3.0.1 // indirect
64+
k8s.io/apiextensions-apiserver v0.26.1 // indirect
65+
k8s.io/component-base v0.26.1 // indirect
66+
k8s.io/gengo v0.0.0-20220902162205-c0856e24416d // indirect
67+
k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
68+
k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 // indirect
69+
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
70+
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
71+
sigs.k8s.io/yaml v1.3.0 // indirect
72+
)

0 commit comments

Comments
 (0)