-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Mateusz Urbanek <[email protected]>
- Loading branch information
0 parents
commit 0e2e624
Showing
42 changed files
with
3,849 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file | ||
# Ignore build and test binaries. | ||
bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
; https://editorconfig.org/ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_size = 2 | ||
indent_style = space | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[boilerplate.go.txt] | ||
insert_final_newline = false | ||
|
||
[{Makefile,go.mod,go.sum,*.go,.gitmodules}] | ||
indent_size = 4 | ||
indent_style = tab | ||
|
||
[*.md] | ||
indent_size = 4 | ||
trim_trailing_whitespace = false | ||
eclint_indent_style = unset | ||
|
||
[Dockerfile] | ||
indent_size = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: linters | ||
|
||
on: | ||
pull_request: | ||
branches: [ "*" ] | ||
push: | ||
branches: | ||
- "main" | ||
|
||
jobs: | ||
golangci-lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: ./go.mod | ||
cache: false | ||
- uses: golangci/golangci-lint-action@v6 | ||
with: | ||
version: latest | ||
skip-cache: true | ||
|
||
commitlint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: wagoid/commitlint-github-action@v6 | ||
with: | ||
configFile: .commitlintrc.mjs | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
hadolint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: hadolint/[email protected] | ||
with: | ||
dockerfile: Dockerfile | ||
recursive: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: tests | ||
|
||
on: | ||
pull_request: | ||
branches: [ "*" ] | ||
push: | ||
branches: | ||
- "main" | ||
|
||
jobs: | ||
unit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: ./go.mod | ||
cache: false | ||
- run: | | ||
make test | ||
e2e: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: ./go.mod | ||
cache: false | ||
- run: | | ||
make \ | ||
IMG=localhost:5005/manager:e2e \ | ||
cluster \ | ||
docker-build docker-push \ | ||
deploy | ||
- run: | | ||
make test-e2e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Binaries for programs and plugins | ||
*.exe | ||
*.exe~ | ||
*.dll | ||
*.so | ||
*.dylib | ||
bin/* | ||
Dockerfile.cross | ||
|
||
# Test binary, built with `go test -c` | ||
*.test | ||
|
||
# Output of the go coverage tool, specifically when used with LiteIDE | ||
*.out | ||
|
||
# Go workspace file | ||
go.work | ||
|
||
# Kubernetes Generated files - skip generated files, except for vendored files | ||
!vendor/**/zz_generated.* | ||
|
||
# editor and IDE paraphernalia | ||
.idea | ||
.vscode | ||
*.swp | ||
*.swo | ||
*~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
run: | ||
timeout: 5m | ||
allow-parallel-runners: true | ||
|
||
issues: | ||
# don't skip warning about doc comments | ||
# don't exclude the default set of lint | ||
exclude-use-default: false | ||
# restore some of the defaults | ||
# (fill in the rest as needed) | ||
exclude-rules: | ||
- path: "internal/*" | ||
linters: | ||
- dupl | ||
- lll | ||
linters: | ||
disable-all: true | ||
enable: | ||
- dupl | ||
- errcheck | ||
- exportloopref | ||
- ginkgolinter | ||
- goconst | ||
- gocyclo | ||
- gofmt | ||
- goimports | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- lll | ||
- misspell | ||
- nakedret | ||
- nolintlint | ||
- prealloc | ||
- revive | ||
- staticcheck | ||
- typecheck | ||
- unconvert | ||
- unparam | ||
- unused | ||
|
||
linters-settings: | ||
revive: | ||
rules: | ||
- name: comment-spacings |
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @anza-labs/core |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Easy crosscomple toolkit | ||
FROM --platform=$BUILDPLATFORM tonistiigi/xx AS xx | ||
|
||
# Build the manager binary | ||
FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.23 AS builder | ||
ARG TARGETOS | ||
ARG TARGETARCH | ||
ARG TARGETPLATFORM | ||
COPY --from=xx / / | ||
|
||
WORKDIR /workspace | ||
# Copy the Go Modules manifests | ||
COPY go.mod go.mod | ||
COPY go.sum go.sum | ||
# cache deps before building and copying source so that we don't need to re-download as much | ||
# and so that source changes don't invalidate our downloaded layer | ||
RUN xx-go mod download | ||
|
||
# Copy the go source | ||
COPY cmd/main.go cmd/main.go | ||
COPY internal/controller/ internal/controller/ | ||
|
||
# Build | ||
ENV CGO_ENABLED=0 | ||
RUN xx-go build -a -o manager cmd/main.go && \ | ||
xx-verify manager | ||
|
||
# Use distroless as minimal base image to package the manager binary | ||
# Refer to https://github.com/GoogleContainerTools/distroless for more details | ||
FROM gcr.io/distroless/static:nonroot | ||
WORKDIR / | ||
COPY --from=builder /workspace/manager . | ||
USER 65532:65532 | ||
|
||
ENTRYPOINT ["/manager"] |
Oops, something went wrong.