-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 1b3b838
Showing
35 changed files
with
2,972 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,3 @@ | ||
--- | ||
github: [ricoberger] | ||
custom: ["https://www.paypal.me/ricoberger"] |
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,41 @@ | ||
--- | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "monthly" | ||
reviewers: | ||
- "@kobsio/maintainers" | ||
assignees: | ||
- "ricoberger" | ||
groups: | ||
github-actions: | ||
patterns: | ||
- "*" | ||
|
||
- package-ecosystem: "docker" | ||
directory: "/cmd/kobs" | ||
schedule: | ||
interval: "monthly" | ||
reviewers: | ||
- "@kobsio/maintainers" | ||
assignees: | ||
- "ricoberger" | ||
groups: | ||
docker: | ||
patterns: | ||
- "*" | ||
|
||
- package-ecosystem: "gomod" | ||
directory: "/" | ||
schedule: | ||
interval: "monthly" | ||
reviewers: | ||
- "@kobsio/maintainers" | ||
assignees: | ||
- "ricoberger" | ||
groups: | ||
gomod: | ||
patterns: | ||
- "*" |
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,30 @@ | ||
--- | ||
name-template: "$RESOLVED_VERSION" | ||
tag-template: "$RESOLVED_VERSION" | ||
version-template: "v$MAJOR.$MINOR.$PATCH" | ||
categories: | ||
- title: "Added" | ||
labels: | ||
- "changelog: added" | ||
- title: "Fixed" | ||
labels: | ||
- "changelog: fixed" | ||
- title: "Changed" | ||
labels: | ||
- "changelog: changed" | ||
version-resolver: | ||
minor: | ||
labels: | ||
- "changelog: added" | ||
- "changelog: changed" | ||
patch: | ||
labels: | ||
- "changelog: fixed" | ||
default: patch | ||
category-template: "### $TITLE" | ||
change-template: '- #$NUMBER: $TITLE @$AUTHOR' | ||
template: | | ||
$CHANGES | ||
replacers: | ||
- search: ':warning:' | ||
replace: ':warning: _Breaking change:_ :warning:' |
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,86 @@ | ||
--- | ||
name: Continuous Delivery | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
docker: | ||
name: Docker | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set Docker Tag | ||
id: tag | ||
run: | | ||
if [[ $GITHUB_REF == refs/tags/* ]]; then | ||
echo TAG=${GITHUB_REF:10} >> $GITHUB_ENV | ||
else | ||
echo TAG=main >> $GITHUB_ENV | ||
fi | ||
- name: Setup QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Setup Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
registry: ghcr.io | ||
|
||
- name: Build and Push Docker Image | ||
id: docker_build | ||
uses: docker/build-push-action@v5 | ||
with: | ||
push: true | ||
context: . | ||
file: ./cmd/kobs/Dockerfile | ||
platforms: linux/amd64,linux/arm64/v8 | ||
tags: ghcr.io/${{ github.repository_owner }}/namespacerole-operator:${{ env.TAG }} | ||
|
||
helm: | ||
runs-on: ubuntu-latest | ||
if: github.ref == 'refs/heads/main' | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set Version | ||
id: version | ||
run: | | ||
echo "VERSION=$(yq -r .version ./charts/namespacerole-operator/Chart.yaml)" >> "$GITHUB_OUTPUT" | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
registry: ghcr.io | ||
|
||
- name: Package and Push Helm Chart | ||
run: | | ||
helm package ./charts/namespacerole-operator --version ${{ env.VERSION }} | ||
helm push ./namespacerole-operator-${{ env.VERSION }}.tgz oci://${{ github.repository_owner }}/charts | ||
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,39 @@ | ||
--- | ||
name: Continuous Integration | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
go: | ||
name: Go | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: go.mod | ||
cache: true | ||
cache-dependency-path: go.sum | ||
|
||
- name: Lint | ||
run: | | ||
make lint | ||
- name: Test | ||
run: | | ||
make test | ||
- name: Build | ||
run: | | ||
make build |
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,26 @@ | ||
--- | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
changelog: | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
name: Changelog | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Update Changelog | ||
uses: release-drafter/release-drafter@v6 | ||
with: | ||
config-name: release.yaml | ||
disable-autolabeler: true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,30 @@ | ||
# Binaries for programs and plugins | ||
*.exe | ||
*.exe~ | ||
*.dll | ||
*.so | ||
*.dylib | ||
bin/* | ||
|
||
# Test binary, built with `go test -c` | ||
*.test | ||
|
||
# Output of the go coverage tool, specifically when used with LiteIDE | ||
*.out | ||
*.html | ||
|
||
# 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 | ||
*~ | ||
|
||
# Config | ||
config |
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,40 @@ | ||
--- | ||
run: | ||
timeout: 5m | ||
allow-parallel-runners: true | ||
|
||
issues: | ||
exclude-use-default: false | ||
exclude-rules: | ||
- path: "internal/*" | ||
linters: | ||
- dupl | ||
linters: | ||
disable-all: true | ||
enable: | ||
- dupl | ||
- errcheck | ||
- exportloopref | ||
- ginkgolinter | ||
- goconst | ||
- gocyclo | ||
- gofmt | ||
- goimports | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- misspell | ||
- nakedret | ||
- revive | ||
- staticcheck | ||
- typecheck | ||
- unconvert | ||
- unparam | ||
- unused | ||
|
||
linters-settings: | ||
revive: | ||
rules: | ||
- name: comment-spacings | ||
goimports: | ||
local-prefixes: github.com/kobsio/namespacerole-operator |
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,18 @@ | ||
FROM golang:1.23.3 AS builder | ||
WORKDIR /workspace | ||
|
||
COPY go.mod go.mod | ||
COPY go.sum go.sum | ||
RUN go mod download | ||
|
||
COPY cmd/main.go cmd/main.go | ||
COPY api/ api/ | ||
COPY internal/controller/ internal/controller/ | ||
|
||
RUN CGO_ENABLED=0 go build -a -o manager cmd/main.go | ||
|
||
FROM alpine:3.20.3 | ||
WORKDIR / | ||
COPY --from=builder /workspace/manager . | ||
USER 65532:65532 | ||
ENTRYPOINT ["/manager"] |
Oops, something went wrong.