Skip to content

Commit 99a308c

Browse files
committed
Squashed commit of the following:
Update README add release action clean up Makefile update chart and chart template remove golangci action add ci action remove unused config rename module initial merge from cloud-orchestration/control-plane-operator
1 parent 154fae6 commit 99a308c

File tree

211 files changed

+23524
-3
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

211 files changed

+23524
-3
lines changed

.envrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# powered by direnv
2+
[[ -f dev.env ]] && dotenv dev.env
3+
[[ -f secret.env ]] && dotenv secret.env
4+
[[ -f e2e.env ]] && dotenv e2e.env

.github/workflows/ci.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: ci
2+
on:
3+
push:
4+
tags:
5+
- v*
6+
branches:
7+
- master
8+
- main
9+
pull_request:
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-24.04
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Go
20+
uses: actions/setup-go@v5
21+
with:
22+
go-version-file: go.mod
23+
24+
- name: make tidy
25+
run: |
26+
make tidy
27+
git diff --exit-code
28+
29+
- name: make verify
30+
run: make verify
31+
32+
- name: make test
33+
run: make test

.github/workflows/release.yaml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Versioned Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write # we need this to be able to push tags
10+
11+
jobs:
12+
release_tag:
13+
name: Release version
14+
runs-on: ubuntu-24.04
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
with:
19+
ssh-key: ${{ secrets.PUSH_KEY }}
20+
fetch-tags: true
21+
fetch-depth: 0
22+
23+
- name: Read and validate VERSION
24+
id: version
25+
run: |
26+
VERSION=$(cat VERSION)
27+
if [[ ! "$VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-dev)?$ ]]; then
28+
echo "Invalid version format in VERSION file: $VERSION"
29+
exit 1
30+
fi
31+
echo "New version: $VERSION"
32+
echo "version=$VERSION" >> $GITHUB_ENV
33+
34+
- name: Skip release if version is a dev version
35+
if: contains(env.version, '-dev')
36+
run: |
37+
echo "Skipping development version release: ${{ env.version }}"
38+
echo "SKIP=true" >> $GITHUB_ENV
39+
exit 0
40+
41+
- name: Check if VERSION is already tagged
42+
id: check_tag
43+
run: |
44+
if git rev-parse "refs/tags/${{ env.version }}" >/dev/null 2>&1; then
45+
echo "Tag ${{ env.version }} already exists. Skipping release."
46+
echo "SKIP=true" >> $GITHUB_ENV
47+
exit 0
48+
fi
49+
echo "Tag ${{ env.version }} doesn't exists. Proceeding with release."
50+
51+
- name: Create Git tag
52+
if: ${{ env.SKIP != 'true' }}
53+
run: |
54+
AUTHOR_NAME=$(git log -1 --pretty=format:'%an')
55+
AUTHOR_EMAIL=$(git log -1 --pretty=format:'%ae')
56+
echo "Tagging as $AUTHOR_NAME <$AUTHOR_EMAIL>"
57+
58+
echo "AUTHOR_NAME=$AUTHOR_NAME" >> $GITHUB_ENV
59+
echo "AUTHOR_EMAIL=$AUTHOR_EMAIL" >> $GITHUB_ENV
60+
61+
git config user.name "$AUTHOR_NAME"
62+
git config user.email "$AUTHOR_EMAIL"
63+
64+
git tag -a "${{ env.version }}" -m "Release ${{ env.version }}"
65+
git push origin "${{ env.version }}"
66+
67+
- name: Create GitHub release
68+
if: ${{ env.SKIP != 'true' }}
69+
uses: softprops/action-gh-release@v2
70+
with:
71+
tag_name: ${{ env.version }}
72+
name: Release ${{ env.version }}
73+
body: "Automated release for version ${{ env.version }}"
74+
draft: false
75+
prerelease: false
76+
env:
77+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78+
79+
- name: Push dev VERSION
80+
if: ${{ env.SKIP != 'true' }}
81+
run: |
82+
echo "${{ env.version }}-dev" > VERSION
83+
git config user.name "${{ env.AUTHOR_NAME }}"
84+
git config user.email "${{ env.AUTHOR_EMAIL }}"
85+
git add VERSION
86+
git commit -m "Update VERSION to ${{ env.version }}-dev"
87+
git push origin main

.gitignore

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
2+
# Binaries for programs and plugins
3+
*.exe
4+
*.exe~
5+
*.dll
6+
*.so
7+
*.dylib
8+
bin/*
9+
Dockerfile.cross
10+
11+
# Test binary, build with `go test -c`
12+
*.test
13+
14+
# Output of the go coverage tool, specifically when used with LiteIDE
15+
*.out
16+
cover.html
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+
*~
27+
28+
.DS_Store
29+
/test/e2e/logs/
30+
/test/e2e/logs-*
31+
32+
config/samples/*_untracked.yaml
33+
34+
# charts
35+
charts/*/charts/*.tgz
36+
37+
/charts/*/templates-original/
38+
*.orig
39+
40+
.generated
41+
secret.env
42+
43+
test/e2e/testdata/serect.yaml
44+
integration-tests.xml

.golangci.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
run:
2+
timeout: 5m
3+
allow-parallel-runners: true
4+
5+
issues:
6+
# don't skip warning about doc comments
7+
# don't exclude the default set of lint
8+
exclude-use-default: false
9+
# restore some of the defaults
10+
# (fill in the rest as needed)
11+
exclude-rules:
12+
- path: "api/*"
13+
linters:
14+
- lll
15+
- path: "internal/*"
16+
linters:
17+
- dupl
18+
- lll
19+
linters:
20+
enable:
21+
- dupl
22+
- errcheck
23+
- copyloopvar
24+
- goconst
25+
- gocyclo
26+
- gofmt
27+
- goimports
28+
- gosimple
29+
- govet
30+
- ineffassign
31+
- lll
32+
- misspell
33+
- nakedret
34+
- prealloc
35+
- staticcheck
36+
- typecheck
37+
- unconvert
38+
- unused
39+
disable: []

.vscode/launch.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Run operator locally",
9+
"type": "go",
10+
"request": "launch",
11+
"mode": "debug",
12+
"program": "cmd/main.go",
13+
"args": ["start"],
14+
"envFile": "${workspaceFolder}/dev.env"
15+
}
16+
]
17+
}

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"gopls": {
3+
"build.buildFlags": ["-tags=e2e"]
4+
}
5+
}

.vscode/tasks.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "Run make",
6+
"command": "make",
7+
"type": "shell",
8+
"args": [],
9+
"presentation": {
10+
"reveal": "silent"
11+
},
12+
"group": {
13+
"kind": "build",
14+
"isDefault": true
15+
},
16+
"problemMatcher": []
17+
},
18+
{
19+
"label": "Build docker image",
20+
"command": "make docker-build",
21+
"type": "shell",
22+
"group": {
23+
"kind": "build",
24+
"isDefault": false
25+
}
26+
}
27+
]
28+
}

Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Use distroless as minimal base image to package the manager binary
2+
# Refer to https://github.com/GoogleContainerTools/distroless for more details
3+
FROM gcr.io/distroless/static:nonroot
4+
ARG TARGETARCH
5+
WORKDIR /
6+
COPY bin/manager-linux.${TARGETARCH} /manager
7+
USER 65532:65532
8+
9+
ENTRYPOINT ["/manager"]

0 commit comments

Comments
 (0)