generated from ZEISS/template-go
-
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
1 parent
e619b01
commit fe85852
Showing
67 changed files
with
3,091 additions
and
81 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
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 |
---|---|---|
|
@@ -3,12 +3,15 @@ | |
name: Release | ||
|
||
on: | ||
workflow_call: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
IMAGE_NAME: zeiss/natz-operator | ||
REGISTRY: ghcr.io | ||
|
||
jobs: | ||
test: | ||
|
@@ -17,12 +20,56 @@ jobs: | |
uses: ./.github/workflows/main.yml | ||
|
||
release: | ||
needs: [test] | ||
runs-on: ubuntu-latest | ||
needs: [ test ] | ||
permissions: | ||
packages: write | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: | | ||
git config user.name "$GITHUB_ACTOR" | ||
git config user.email "[email protected]" | ||
- run: | | ||
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: ./go.mod | ||
- run: make release | ||
if: success() | ||
cache-dependency-path: | | ||
go.sum | ||
tools/go.sum | ||
- uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/go/pkg/mod | ||
key: ${{ github.job }}-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ github.job }}-${{ runner.os }}-go- | ||
- id: image-tag | ||
run: | | ||
IMAGE_TAG=${GITHUB_SHA} | ||
[[ ${GITHUB_REF_TYPE} == "tag" ]] && IMAGE_TAG=${GITHUB_REF_NAME} | ||
echo "IMAGE_TAG=${IMAGE_TAG}" >> $GITHUB_OUTPUT | ||
- run: sudo apt-get update && sudo apt install -y libxml2-dev libxslt1-dev liblzma-dev zlib1g-dev | ||
- run: | | ||
IMAGE_TAG=${{ steps.image-tag.outputs.IMAGE_TAG }} make release | ||
env: | ||
KO_DOCKER_REPO: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
DIST_DIR: /tmp/dist | ||
if: success() | ||
- run: | | ||
go run internal/tools/updater/main.go --file helm/charts/natz-operator/Chart.yaml --version ${{ env.RELEASE_VERSION }} | ||
- uses: azure/setup-helm@v4 | ||
with: | ||
version: v3.11.2 | ||
- uses: helm/[email protected] | ||
with: | ||
charts_dir: helm/charts | ||
config: helm/cr.yaml | ||
env: | ||
CR_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
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,9 @@ | ||
FROM gcr.io/distroless/static:nonroot | ||
ARG BINARY | ||
|
||
WORKDIR / | ||
COPY ${BINARY} /main | ||
|
||
USER 65532:65532 | ||
|
||
ENTRYPOINT ["/main"] |
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
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 |
---|---|---|
|
@@ -5,8 +5,8 @@ | |
//go:generate go run -tags generate sigs.k8s.io/controller-tools/cmd/[email protected] object:headerFile="../hack/copyright.go.txt" paths="./..." | ||
//go:generate go run -tags generate sigs.k8s.io/controller-tools/cmd/[email protected] rbac:roleName=manager-role crd webhook output:crd:artifacts:config=../manifests/crd/bases paths="./..." | ||
//go:generate cp ../manifests/crd/bases/natz.zeiss.com_natsaccounts.yaml ../helm/charts/natz-operator/templates/crds/natsaccounts.yaml | ||
//go:generate cp ../manifests/crd/bases/natz.zeiss.com_natsclusters.yaml ../helm/charts/natz-operator/templates/crds/natsoperators.yaml | ||
//go:generate cp ../manifests/crd/bases/natz.zeiss.com_natsstreamingclusters.yaml ../helm/charts/natz-operator/templates/crds/natsusers.yaml | ||
//go:generate cp ../manifests/crd/bases/natz.zeiss.com_natsoperators.yaml ../helm/charts/natz-operator/templates/crds/natsoperators.yaml | ||
//go:generate cp ../manifests/crd/bases/natz.zeiss.com_natsusers.yaml ../helm/charts/natz-operator/templates/crds/natsusers.yaml | ||
|
||
package api | ||
|
||
|
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
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,23 @@ | ||
package controllers | ||
|
||
const ( | ||
NATZ_OPERATOR_FINALIZER = "natz.zeiss.com/natz-operator" | ||
OPERATOR_SEED_KEY = "seed.nk" | ||
OPERATOR_PUBLIC_KEY = "key.pub" | ||
OPERATOR_JWT = "key.jwt" | ||
OPERATOR_CREDS = "user.creds" | ||
OPERATOR_CONFIG_FILE = "auth.conf" | ||
AUTH_CONFIG_TEMPLATE = `operator: %s | ||
system_account: %s | ||
resolver { | ||
type: full | ||
dir: './jwt' | ||
allow_delete: true | ||
interval: "2m" | ||
timeout: "5s" | ||
} | ||
resolver_preload: { | ||
%s: %s, | ||
} | ||
` | ||
) |
Oops, something went wrong.