Skip to content

Commit 7f7925f

Browse files
authored
🌱 preparing tech-preview release (#3)
Signed-off-by: batistein <[email protected]>
1 parent 1973b76 commit 7f7925f

File tree

4,548 files changed

+1605955
-110
lines changed

Some content is hidden

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

4,548 files changed

+1605955
-110
lines changed

.builder-image-version.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.0.0
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: 'Bug report'
3+
about: Tell us about a problem you are experiencing.
4+
5+
---
6+
7+
/kind bug
8+
9+
**What steps did you take and what happened:**
10+
[A clear and concise description of what the bug is.]
11+
12+
13+
**What did you expect to happen:**
14+
15+
16+
**Anything else you would like to add:**
17+
[Miscellaneous information that will assist in solving the issue.]
18+
19+
20+
**Environment:**
21+
22+
- cluster-stack-operator version:
23+
- Kubernetes version: (use `kubectl version`)
24+
- OS (e.g. from `/etc/os-release`):
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: 'Feature request'
3+
about: Suggest an idea for this project.
4+
5+
---
6+
7+
/kind feature
8+
9+
**Describe the solution you'd like**
10+
[A clear and concise description of what you want to happen.]
11+
12+
13+
**Anything else you would like to add:**
14+
[Miscellaneous information that will assist in solving the issue.]
15+
16+
17+
**Environment:**
18+
19+
- cluster-stack-operator version:
20+
- Kubernetes version: (use `kubectl version`)
21+
- OS (e.g. from `/etc/os-release`):
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: "Metadata"
2+
description: "Generate Image Metadata"
3+
inputs:
4+
metadata_flavor:
5+
description: "metadata_flavor"
6+
required: true
7+
metadata_tags:
8+
description: "metadata_tags"
9+
required: true
10+
outputs:
11+
tags:
12+
description: "generated image tags"
13+
value: ${{ steps.meta.outputs.tags }}
14+
labels:
15+
description: "generated image labels"
16+
value: ${{ steps.meta.outputs.labels }}
17+
version:
18+
description: "generated image version"
19+
value: ${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
20+
runs:
21+
using: "composite"
22+
steps:
23+
- name: Docker manager metadata
24+
id: meta
25+
uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175 # v4.6.0
26+
with:
27+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
28+
flavor: ${{ inputs.metadata_flavor }}
29+
tags: ${{ inputs.metadata_tags }}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: "Setup Go"
2+
description: "Setup Go"
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Install go
7+
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
8+
with:
9+
go-version-file: "go.mod"
10+
cache: true
11+
cache-dependency-path: go.sum
12+
- id: go-cache-paths
13+
shell: bash
14+
run: |
15+
echo "::set-output name=go-build::$(go env GOCACHE)"
16+
echo "::set-output name=go-mod::$(go env GOMODCACHE)"
17+
- name: Go Mod Cache
18+
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
19+
with:
20+
path: ${{ steps.go-cache-paths.outputs.go-mod }}
21+
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
22+
restore-keys: |
23+
${{ runner.os }}-go-mod-
24+
- name: Go Build Cache
25+
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
26+
with:
27+
path: ${{ steps.go-cache-paths.outputs.go-build }}
28+
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
29+
restore-keys: |
30+
${{ runner.os }}-go-build-

.github/labeler.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
area/code:
3+
- "controllers/**/*"
4+
- "pkg/**/*"
5+
area/api:
6+
- "api/**/*"
7+
- "config/crd/**/*"
8+
area/github:
9+
- ".github/**/*"
10+
area/hack:
11+
- "hack/**/*"
12+
- "Makefile"
13+
area/test:
14+
- "test/**/*"
15+
area/templates:
16+
- "templates/**/*"

.github/labels.yaml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
# Area
3+
- name: area/code
4+
color: "72ccf3"
5+
description: >-
6+
Changes made in the code directory
7+
- name: area/api
8+
color: "72ccf3"
9+
description: >-
10+
Changes made in the api directory
11+
- name: area/github
12+
color: "72ccf3"
13+
description: >-
14+
Changes made in the github directory
15+
- name: area/hack
16+
color: "72ccf3"
17+
description: >-
18+
Changes made in the hack directory
19+
- name: area/test
20+
color: "72ccf3"
21+
description: >-
22+
Changes made in the test directory
23+
- name: area/templates
24+
color: "72ccf3"
25+
description: >-
26+
Changes made in the templates directory
27+
# Update
28+
- name: update/container
29+
color: "ffc300"
30+
- name: update/github-action
31+
color: "ffc300"
32+
- name: update/helm
33+
color: "ffc300"
34+
- name: update/go
35+
color: "ffc300"
36+
# Semantic Type
37+
- name: type/patch
38+
color: "FFEC19"
39+
- name: type/minor
40+
color: "FF9800"
41+
- name: type/major
42+
color: "F6412D"
43+
# Size
44+
- name: size/XS
45+
color: "009900"
46+
description: >-
47+
Denotes a PR that changes 0-20 lines, ignoring generated files.
48+
- name: size/S
49+
color: "77bb00"
50+
description: >-
51+
Denotes a PR that changes 20-50 lines, ignoring generated files.
52+
- name: size/M
53+
color: "eebb00"
54+
description: >-
55+
Denotes a PR that changes 50-200 lines, ignoring generated files.
56+
- name: size/L
57+
color: "ee9900"
58+
description: >-
59+
Denotes a PR that changes 200-800 lines, ignoring generated files.
60+
- name: size/XL
61+
color: "ee5500"
62+
description: >-
63+
Denotes a PR that changes 800-2000 lines, ignoring generated files.
64+
- name: size/XXL
65+
color: "ee0000"
66+
description: >-
67+
Denotes a PR that changes 2000+ lines, ignoring generated files.
68+
# Uncategorized
69+
- name: bug
70+
color: "ee0701"
71+
- name: do-not-merge
72+
color: "ee0701"
73+
- name: docs
74+
color: "F4D1B7"
75+
- name: enhancement
76+
color: "84b6eb"
77+
- name: link-checker
78+
color: "7B55D7"
79+
- name: question
80+
color: "cc317c"

.github/pull_request_template.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!-- If this is your first PR, welcome! Please make sure you read the [contributing guidelines](../CONTRIBUTING.md#contributing-a-patch). -->
2+
<!-- please add an icon to the title of this PR and delete this line and similar ones -->
3+
<!-- the icon will be either ⚠️ (:warning:, major or breaking changes), ✨ (:sparkles:, feature additions), 🐛 (:bug:, patches and bugfixes), 📖 (:book:, documentation or proposals), or 🌱 (:seedling:, minor or other) -->
4+
5+
**What this PR does / why we need it**:
6+
7+
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
8+
Fixes #
9+
10+
**Special notes for your reviewer**:
11+
12+
_Please confirm that if this PR changes any image versions, then that's the sole change this PR makes._
13+
14+
**TODOs**:
15+
16+
- [ ] squash commits
17+
- [ ] include documentation
18+
- [ ] add unit tests
19+

.github/workflows/build.yml

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
name: Build cso Image
2+
# yamllint disable rule:line-length
3+
on: # yamllint disable-line rule:truthy
4+
push:
5+
branches:
6+
- main
7+
# If the cache was cleaned we should re-build the cache with the latest commit
8+
workflow_run:
9+
workflows:
10+
- "CSO Image Cache Cleaner"
11+
branches:
12+
- main
13+
types:
14+
- completed
15+
workflow_dispatch:
16+
env:
17+
REGISTRY: ghcr.io/sovereigncloudstack
18+
metadata_flavor: latest=true
19+
metadata_tags: type=sha,prefix=sha-,format=short
20+
permissions:
21+
contents: read
22+
packages: write
23+
# Required to generate OIDC tokens for `sigstore/cosign-installer` authentication
24+
id-token: write
25+
jobs:
26+
manager-image:
27+
name: Build and push manager image
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout code
31+
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
32+
with:
33+
fetch-depth: 0
34+
- uses: ./.github/actions/setup-go
35+
- name: Set up QEMU
36+
uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v2
37+
- name: Set up Docker Buildx
38+
uses: docker/setup-buildx-action@ecf95283f03858871ff00b787d79c419715afc34 # v2
39+
40+
- name: Generate metadata cso
41+
id: metacso
42+
uses: ./.github/actions/metadata
43+
env:
44+
IMAGE_NAME: cso-staging
45+
with:
46+
metadata_flavor: ${{ env.metadata_flavor }}
47+
metadata_tags: ${{ env.metadata_tags }}
48+
49+
- name: Login to ghcr.io for CI
50+
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0
51+
with:
52+
registry: ghcr.io
53+
username: ${{ github.actor }}
54+
password: ${{ secrets.GITHUB_TOKEN }}
55+
56+
- name: Install Cosign
57+
uses: sigstore/cosign-installer@dd6b2e2b610a11fd73dd187a43d57cc1394e35f9 # v3.0.5
58+
59+
- name: Setup Env
60+
run: |
61+
DOCKER_BUILD_LDFLAGS="$(hack/version.sh)"
62+
echo 'DOCKER_BUILD_LDFLAGS<<EOF' >> $GITHUB_ENV
63+
echo $DOCKER_BUILD_LDFLAGS >> $GITHUB_ENV
64+
echo 'EOF' >> $GITHUB_ENV
65+
66+
# Load Golang cache build from GitHub
67+
- name: Load cso Golang cache build from GitHub
68+
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
69+
id: cache
70+
with:
71+
path: /tmp/.cache/cso
72+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}-cso-${{ github.sha }}
73+
restore-keys: |
74+
${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}-cso-
75+
${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}-
76+
${{ runner.os }}-go-
77+
78+
- name: Create cso cache directory
79+
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
80+
shell: bash
81+
run: |
82+
mkdir -p /tmp/.cache/cso
83+
84+
# Import GitHub's cache build to docker cache
85+
- name: Copy cso Golang cache to docker cache
86+
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 # v4.1.1
87+
with:
88+
provenance: false
89+
context: /tmp/.cache/cso
90+
file: ./images/cache/Dockerfile
91+
push: false
92+
platforms: linux/amd64
93+
target: import-cache
94+
95+
- name: Build and push cso image
96+
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 # v4
97+
id: docker_build_release_cso
98+
with:
99+
provenance: false
100+
context: .
101+
file: ./images/cso/Dockerfile
102+
push: true
103+
build-args: |
104+
LDFLAGS=${{ env.DOCKER_BUILD_LDFLAGS }}
105+
tags: ${{ steps.metacso.outputs.tags }}
106+
labels: ${{ steps.metacso.outputs.labels }}
107+
platforms: linux/amd64
108+
109+
- name: Sign Container Images
110+
env:
111+
COSIGN_EXPERIMENTAL: "true"
112+
run: |
113+
cosign sign --yes ghcr.io/sovereigncloudstack/cso-staging@${{ steps.docker_build_release_cso.outputs.digest }}
114+
115+
- name: Image Releases digests cso
116+
shell: bash
117+
run: |
118+
mkdir -p image-digest/
119+
echo "ghcr.io/sovereigncloudstack/cso-staging:{{ steps.metacso.outputs.tags }}@${{ steps.docker_build_release_cso.outputs.digest }}" >> image-digest/cso.txt
120+
121+
# Upload artifact digests
122+
- name: Upload artifact digests
123+
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
124+
with:
125+
name: image-digest
126+
path: image-digest
127+
retention-days: 90
128+
129+
# Store docker's golang's cache build locally only on the main branch
130+
- name: Store cso Golang cache build locally
131+
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
132+
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 # v4.1.1
133+
with:
134+
provenance: false
135+
context: .
136+
file: ./images/cache/Dockerfile
137+
push: false
138+
outputs: type=local,dest=/tmp/docker-cache-cso
139+
platforms: linux/amd64
140+
target: export-cache
141+
142+
# Store docker's golang's cache build locally only on the main branch
143+
- name: Store cso Golang cache in GitHub cache path
144+
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
145+
shell: bash
146+
run: |
147+
mkdir -p /tmp/.cache/cso/
148+
if [ -f /tmp/docker-cache-cso/tmp/go-build-cache.tar.gz ]; then
149+
cp /tmp/docker-cache-cso/tmp/go-build-cache.tar.gz /tmp/.cache/cso/
150+
fi
151+
if [ -f /tmp/docker-cache-cso/tmp/go-pkg-cache.tar.gz ]; then
152+
cp /tmp/docker-cache-cso/tmp/go-pkg-cache.tar.gz /tmp/.cache/cso/
153+
fi
154+
155+
- name: Image Digests Output
156+
shell: bash
157+
run: |
158+
cd image-digest/
159+
find -type f | sort | xargs -d '\n' cat

0 commit comments

Comments
 (0)