File tree Expand file tree Collapse file tree 11 files changed +88
-50
lines changed Expand file tree Collapse file tree 11 files changed +88
-50
lines changed Original file line number Diff line number Diff line change
1
+ name : main
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - master
7
+
8
+ jobs :
9
+ build :
10
+ runs-on : ubuntu-latest
11
+ steps :
12
+ - name : Checkout
13
+ uses : actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3
14
+ - name : Setup Go
15
+ uses : actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
16
+ with :
17
+ go-version : 1.20.x
18
+ - name : Restore Go cache
19
+ uses : actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
20
+ with :
21
+ path : ~/go/pkg/mod
22
+ key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
23
+ restore-keys : |
24
+ ${{ runner.os }}-go-
25
+ - name : Tests
26
+ run : make test
27
+ - name : Send go coverage report
28
+ uses : shogo82148/actions-goveralls@31ee804b8576ae49f6dc3caa22591bc5080e7920 # v1.6.0
29
+ with :
30
+ path-to-profile : coverage.out
Original file line number Diff line number Diff line change @@ -47,17 +47,15 @@ jobs:
47
47
fi
48
48
- name : Build container image
49
49
run : |
50
- make docker-build IMG=test/k8soauth2-proxy-controller:latest BUILD_PLATFORMS=linux/amd64 \
51
- BUILD_ARGS="--cache-from=type=local,src=/tmp/.buildx-cache \
52
- --cache-to=type=local,dest=/tmp/.buildx-cache-new,mode=max"
50
+ make docker-build
53
51
- name : Setup Kubernetes
54
52
uses : engineerd/setup-kind@aa272fe2a7309878ffc2a81c56cfe3ef108ae7d0 # v0.5.0
55
53
with :
56
54
version : v0.17.0
57
55
- name : Load test image
58
- run : kind load docker-image test/ k8soauth2-proxy-controller:latest
56
+ run : kind load docker-image k8soauth2-proxy-controller:latest
59
57
- name : Deploy controller
60
- run : make deploy IMG=test/k8soauth2-proxy-controller:latest
58
+ run : make deploy
61
59
- name : Debug failure
62
60
if : failure()
63
61
run : |
Original file line number Diff line number Diff line change 1
- name : Lint and Test Charts
1
+ name : pr-chart
2
2
3
3
on : pull_request
4
4
Original file line number Diff line number Diff line change 1
- name : Release Chart
1
+ name : release-chart
2
2
3
3
on :
4
4
push :
Original file line number Diff line number Diff line change
1
+ name : scan
2
+
3
+ on :
4
+ push :
5
+ branches : [ master ]
6
+ pull_request :
7
+ branches : [ master ]
8
+ schedule :
9
+ - cron : ' 18 10 * * 3'
10
+
11
+ permissions :
12
+ contents : read # for actions/checkout to fetch code
13
+ security-events : write # for codeQL to write security events
14
+
15
+ jobs :
16
+ fossa :
17
+ name : FOSSA
18
+ runs-on : ubuntu-latest
19
+ steps :
20
+ - uses : actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3
21
+ - name : Run FOSSA scan and upload build data
22
+ uses : fossa-contrib/fossa-action@6728dc6fe9a068c648d080c33829ffbe56565023 # v2.0.0
23
+ with :
24
+ # FOSSA Push-Only API Token
25
+ fossa-api-key : 956b9b92c5b16eeca1467cebe104f2c3
26
+ github-token : ${{ github.token }}
27
+
28
+ codeql :
29
+ name : CodeQL
30
+ runs-on : ubuntu-latest
31
+ steps :
32
+ - name : Checkout repository
33
+ uses : actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3
34
+ - name : Initialize CodeQL
35
+ uses : github/codeql-action/init@dc046388f30eacf938aadd32064285f437bd9c04 # codeql-bundle-20221020
36
+ with :
37
+ languages : go
38
+ - name : Autobuild
39
+ uses : github/codeql-action/autobuild@dc046388f30eacf938aadd32064285f437bd9c04 # codeql-bundle-20221020
40
+ - name : Perform CodeQL Analysis
41
+ uses : github/codeql-action/analyze@dc046388f30eacf938aadd32064285f437bd9c04 # codeql-bundle-20221020
Original file line number Diff line number Diff line change 6
6
* .so
7
7
* .dylib
8
8
bin
9
+ manager
9
10
10
11
# Test binary, build with `go test -c`
11
12
* .test
Original file line number Diff line number Diff line change 33
33
dockers :
34
34
- image_templates :
35
35
- ghcr.io/doodlescheduling/{{ .ProjectName }}:v{{ .Version }}-amd64
36
- dockerfile : Dockerfile.release
36
+ dockerfile : Dockerfile
37
37
use : buildx
38
38
ids :
39
39
- manager
@@ -50,7 +50,7 @@ dockers:
50
50
- image_templates :
51
51
- ghcr.io/doodlescheduling/{{ .ProjectName }}:v{{ .Version }}-arm64v8
52
52
goarch : arm64
53
- dockerfile : Dockerfile.release
53
+ dockerfile : Dockerfile
54
54
use : buildx
55
55
ids :
56
56
- manager
Original file line number Diff line number Diff line change 2
2
3
3
### Controller release
4
4
1 . Merge all pr's to master which need to be part of the new release
5
- 2 . Create pr to master with these changes:
6
- 1 . Bump kustomization
7
- 2 . Create CHANGELOG.md entry with release and date
8
- 3 . Merge pr
9
- 4 . Push a tag following semantic versioning prefixed by 'v'. Do not create a github release, this is done automatically.
10
- 5 . Create new branch and add the following changes:
5
+ 2 . Create pr to master and bump the kustomization base
6
+ 3 . Push a tag following semantic versioning prefixed by 'v'. Do not create a github release, this is done automatically.
7
+ 4 . Create a new pr and add the following changes:
11
8
1 . Bump chart version
12
9
2 . Bump charts app version
13
- 6 . Create pr to master and merge
14
10
15
11
### Helm chart change only
16
- 1 . Create branch with changes
17
- 2 . Bump chart version
18
- 3 . Create pr to master and merge
12
+ 1 . Bump the helm chart version in the pr
Original file line number Diff line number Diff line change 1
- # Build the manager binary
2
- FROM golang:1.20 as builder
3
-
4
- WORKDIR /workspace
5
- COPY . .
6
-
7
- # cache deps before building and copying source so that we don't need to re-download as much
8
- # and so that source changes don't invalidate our downloaded layer
9
- RUN go mod download
10
-
11
- # Build
12
- RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager main.go
13
-
14
- # Use distroless as minimal base image to package the manager binary
15
- # Refer to https://github.com/GoogleContainerTools/distroless for more details
16
1
FROM gcr.io/distroless/static:nonroot
17
2
WORKDIR /
18
- COPY --from=builder /workspace/ manager .
19
- USER nonroot:nonroot
3
+ COPY manager manager
4
+ USER 65532:65532
20
5
21
6
# User env is required by opentelemetry-go
22
7
ENV USER=k8soauth2-proxy-controller
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
2
2
# Image URL to use all building/pushing image targets
3
- IMG ?= controller:latest
3
+ IMG ?= k8soauth2-proxy- controller:latest
4
4
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
5
5
ENVTEST_K8S_VERSION = 1.23
6
6
@@ -71,7 +71,7 @@ test: manifests generate fmt vet tidy envtest ## Run tests.
71
71
72
72
.PHONY : build
73
73
build : generate fmt vet tidy # # Build manager binary.
74
- go build -o bin/ manager main.go
74
+ CGO_ENABLED=0 go build -o manager main.go
75
75
76
76
.PHONY : run
77
77
run : manifests generate fmt vet tidy # # Run a controller from your host.
@@ -88,7 +88,7 @@ api-docs: gen-crd-api-reference-docs
88
88
$(GEN_CRD_API_REFERENCE_DOCS ) -api-dir=./api/v1beta1 -config=./hack/api-docs/config.json -template-dir=./hack/api-docs/template -out-file=./docs/api/v1beta1.md
89
89
90
90
.PHONY : docker-build
91
- docker-build :
91
+ docker-build : build
92
92
docker build -t ${IMG} .
93
93
94
94
.PHONY : docker-push
You can’t perform that action at this time.
0 commit comments