Skip to content

Commit f973ff9

Browse files
committed
Update templated files to rev 6fbe9fa (#192)
Automatically created PR based on commit 6fbe9fa9324e71c0e173b376a05157c9c934aea9 in stackabletech/operator-templating repo. Triggered by: Manual run triggered by: adwk67 with message [23.1 release prep: rust-version set to 1.65]
1 parent 00522a5 commit f973ff9

File tree

14 files changed

+85
-2291
lines changed

14 files changed

+85
-2291
lines changed

.github/workflows/build.yml

Lines changed: 47 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
- trying
1010
- "renovate/**"
1111
tags:
12-
- "*"
12+
- '[0-9][0-9].[0-9]+.[0-9]+'
1313
pull_request:
1414

1515
env:
@@ -19,11 +19,11 @@ env:
1919
RUSTFLAGS: "-D warnings"
2020
RUSTDOCFLAGS: "-D warnings"
2121
RUST_LOG: "info"
22-
OPERATOR_NAME: "spark-k8s-operator"
23-
PRODUCT_NAME: "spark-k8s"
2422
DEV_REPO_HELM_URL: https://repo.stackable.tech/repository/helm-dev
2523
TEST_REPO_HELM_URL: https://repo.stackable.tech/repository/helm-test
2624
STABLE_REPO_HELM_URL: https://repo.stackable.tech/repository/helm-stable
25+
# TODO remove before final go-live!
26+
EXP_REPO_HELM_URL: https://repo.stackable.tech/repository/helm-experimental
2727

2828
jobs:
2929
# Identify unused dependencies
@@ -43,7 +43,7 @@ jobs:
4343
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # renovate: tag=v1.0.7
4444
with:
4545
profile: minimal
46-
toolchain: "1.63.0"
46+
toolchain: "1.65.0"
4747
override: true
4848
- uses: Swatinem/rust-cache@6720f05bc48b77f96918929a9019fb2203ff71f8 # tag=v2.0.0
4949
with:
@@ -56,68 +56,49 @@ jobs:
5656
with:
5757
command: udeps
5858

59-
prerelease_job:
60-
name: Returns the pre-release string from the version of the cargo workspace.
61-
runs-on: ubuntu-latest
62-
outputs:
63-
str: ${{ steps.prerelease.outputs.str }}
64-
steps:
65-
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2
66-
with:
67-
submodules: recursive
68-
- uses: actions/setup-python@b55428b1882923874294fa556849718a1d7f2ca5 # tag=v4
69-
- name: Install requirements for version tool
70-
run: pip install -r python/requirements.txt
71-
- id: prerelease
72-
name: Extract the pre-release string. Might be empty.
73-
run: |
74-
PRERELEASE=$(python/cargo_version.py -o | sed "s/^[0-9]\+\.[0-9]\+\.[0-9]\+-\?//g")
75-
echo "::set-output name=str::$PRERELEASE"
76-
7759
# This job evaluates the github environment to determine why this action is running and selects the appropriate
7860
# target repository for published Helm charts based on this.
7961
#
8062
# The following scenarios are identified:
81-
# - pull request:
63+
# - all pull requests land in the test repository:
8264
# condition: github.event_name == "pull_request"
8365
# repository: test
8466
#
85-
# - release (aka a tag was created):
67+
# - all tagged releases land in stable:
8668
# condition: github.event_name == 'create' & github.ref.startswith('refs/tags/')
8769
# repository: stable
8870
#
89-
# - merge of pr to main branch and pre release is nightly:
90-
# condition: github.event_name == 'push' & github.ref == 'refs/heads/main' & needs.prerelease_job.outputs.str == 'nightly'
71+
# - all pushes to main (i.e. PR-merges) land in dev:
72+
# condition: github.event_name == 'push' & github.ref == 'refs/heads/main'
9173
# repository: dev
9274
#
93-
# Any other scenarios will cause the publish step to be skipped, most commonly this is expected to happen for the
75+
# Any other scenarios (e.g. when a branch is created/pushed) will cause the publish step to be skipped, most commonly this is expected to happen for the
9476
# branches that bors uses internally (staging, trying) for which the checks need to run, but we do not want artifacts
9577
# to be published.
96-
select_repo:
97-
name: Select target repository based on action trigger
78+
select_helm_repo:
79+
name: Select target helm repository based on action trigger
9880
runs-on: ubuntu-latest
9981
outputs:
100-
repository: ${{ steps.selectrepo.outputs.repo }}
101-
needs: prerelease_job
82+
helm_repository: ${{ steps.selecthelmrepo.outputs.helm_repo }}
10283
steps:
103-
- id: selectrepo
84+
- id: selecthelmrepo
10485
env:
10586
TRIGGER: ${{ github.event_name }}
10687
GITHUB_REF: ${{ github.ref }}
107-
PRERELEASE: ${{ needs.prerelease_job.outputs.str }}
10888
run: |
10989
if [[ $TRIGGER == "pull_request" ]]; then
110-
echo "exporting test as target repo: ${{ env.TEST_REPO_HELM_URL }}"
111-
echo "::set-output name=repo::${{ env.TEST_REPO_HELM_URL }}"
112-
elif [[ $TRIGGER == "push" && $GITHUB_REF == "refs/heads/main" && $PRERELEASE == 'nightly' ]]; then
113-
echo "exporting dev as target repo: ${{ env.DEV_REPO_HELM_URL }}"
114-
echo "::set-output name=repo::${{ env.DEV_REPO_HELM_URL }}"
90+
echo "exporting test as target helm repo: ${{ env.TEST_REPO_HELM_URL }}"
91+
echo "::set-output name=helm_repo::${{ env.TEST_REPO_HELM_URL }}"
92+
elif [[ $TRIGGER == "push" && $GITHUB_REF == "refs/heads/main" ]]; then
93+
echo "exporting dev as target helm repo: ${{ env.DEV_REPO_HELM_URL }}"
94+
echo "::set-output name=helm_repo::${{ env.DEV_REPO_HELM_URL }}"
11595
elif [[ ( $TRIGGER == "create" || $TRIGGER == "push" ) && $GITHUB_REF == refs/tags/* ]]; then
116-
echo "exporting stable as target repo: ${{ env.STABLE_REPO_HELM_URL }}"
117-
echo "::set-output name=repo::${{ env.STABLE_REPO_HELM_URL }}"
96+
# TODO replace EXP with STABLE repo name
97+
echo "exporting stable as target helm repo: ${{ env.EXP_REPO_HELM_URL }}"
98+
echo "::set-output name=helm_repo::${{ env.EXP_REPO_HELM_URL }}"
11899
else
119100
echo "Unknown trigger and ref combination encountered, skipping publish step: $TRIGGER $GITHUB_REF"
120-
echo "::set-output name=repo::skip"
101+
echo "::set-output name=helm_repo::skip"
121102
fi
122103
123104
run_cargodeny:
@@ -150,7 +131,7 @@ jobs:
150131
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # renovate: tag=v1.0.7
151132
with:
152133
profile: minimal
153-
toolchain: "1.63.0"
134+
toolchain: "1.65.0"
154135
components: rustfmt
155136
override: true
156137
- uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # renovate: tag=v1.0.3
@@ -172,7 +153,7 @@ jobs:
172153
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # renovate: tag=v1.0.7
173154
with:
174155
profile: minimal
175-
toolchain: "1.63.0"
156+
toolchain: "1.65.0"
176157
components: clippy
177158
override: true
178159
- uses: Swatinem/rust-cache@6720f05bc48b77f96918929a9019fb2203ff71f8 # tag=v2.0.0
@@ -206,7 +187,7 @@ jobs:
206187
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # renovate: tag=v1.0.7
207188
with:
208189
profile: minimal
209-
toolchain: "1.63.0"
190+
toolchain: "1.65.0"
210191
components: rustfmt
211192
override: true
212193
- uses: Swatinem/rust-cache@6720f05bc48b77f96918929a9019fb2203ff71f8 # tag=v2.0.0
@@ -219,11 +200,6 @@ jobs:
219200

220201
run_tests:
221202
name: Run Cargo Tests
222-
needs:
223-
- run_cargodeny
224-
- run_clippy
225-
- run_rustfmt
226-
- run_rustdoc
227203
runs-on: ubuntu-latest
228204
steps:
229205
- name: Install protoc
@@ -236,7 +212,7 @@ jobs:
236212
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # renovate: tag=v1.0.7
237213
with:
238214
profile: minimal
239-
toolchain: "1.63.0"
215+
toolchain: "1.65.0"
240216
override: true
241217
- uses: Swatinem/rust-cache@6720f05bc48b77f96918929a9019fb2203ff71f8 # tag=v2.0.0
242218
with:
@@ -272,23 +248,18 @@ jobs:
272248
script: |
273249
core.setFailed('Committed README are not up to date, please make sure to apply them to the templated partials, and re-commit!')
274250
275-
# This job cleans up the CRDs, Helm charts and Kustomize manifests, followed by rebuilding them
251+
# This job cleans up the CRDs and Helm charts, followed by rebuilding them
276252
# It then runs a `git diff` and fails the entire workflow, if any difference is encountered.
277253
#
278254
# Since CRD files are generated during the 'cargo build' process we need to run this once after
279255
# removing the CRD files to ensure that the checked in versions match what the code expects.
280256
#
281257
# The reason for this step is, that developers are expected to check in up-to-date versions of charts
282-
# and manifests, as we'd otherwise have to build these in CI and commit them back to the PR, which
258+
# as we'd otherwise have to build these in CI and commit them back to the PR, which
283259
# creates all kinds of problems.
284-
# Therefor this failsafe simply aborts anything that has not had charts and manifests rebuilt before pushing.
260+
# This failsafe simply aborts anything that has not had charts rebuilt before pushing.
285261
check_charts:
286-
name: Check if committed Helm & Kustomize Charts were up to date
287-
needs:
288-
- run_cargodeny
289-
- run_clippy
290-
- run_rustfmt
291-
- run_rustdoc
262+
name: Check if committed Helm charts are up to date
292263
runs-on: ubuntu-latest
293264
steps:
294265
- name: Install protoc
@@ -307,7 +278,7 @@ jobs:
307278
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # renovate: tag=v1.0.7
308279
with:
309280
profile: minimal
310-
toolchain: "1.63.0"
281+
toolchain: "1.65.0"
311282
override: true
312283
- name: Set up rust-cache
313284
uses: Swatinem/rust-cache@6720f05bc48b77f96918929a9019fb2203ff71f8 # tag=v2.0.0
@@ -324,25 +295,17 @@ jobs:
324295
script: |
325296
core.setFailed('Committed charts were not up to date, please regenerate and re-commit!')
326297
327-
test_charts:
328-
name: Run Chart Tests
329-
needs:
330-
- check_charts
331-
- run_tests
332-
runs-on: ubuntu-latest
333-
steps:
334-
- name: Checkout
335-
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2
336-
with:
337-
submodules: recursive
338-
- name: placeholder
339-
run: echo Tests will go here
340-
341298
tests_passed:
342299
name: All tests passed
343300
needs:
344-
- test_charts
345301
- run_udeps
302+
- run_cargodeny
303+
- run_clippy
304+
- run_rustfmt
305+
- run_rustdoc
306+
- run_tests
307+
- check_charts
308+
- check_readme
346309
runs-on: ubuntu-latest
347310
steps:
348311
- name: log
@@ -352,12 +315,12 @@ jobs:
352315
name: Package Charts, Build Docker Image and publish them
353316
needs:
354317
- tests_passed
355-
- select_repo
318+
- select_helm_repo
356319
runs-on: ubuntu-latest
357320
env:
358321
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
359-
REPO: ${{ needs.select_repo.outputs.repository }}
360-
if: needs.select_repo.outputs.repository != 'skip'
322+
HELM_REPO: ${{ needs.select_helm_repo.outputs.helm_repository }}
323+
if: needs.select_helm_repo.outputs.helm_repository != 'skip'
361324
steps:
362325
- name: Install protoc
363326
run: |
@@ -372,7 +335,7 @@ jobs:
372335
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # renovate: tag=v1.0.7
373336
with:
374337
profile: minimal
375-
toolchain: "1.63.0"
338+
toolchain: "1.65.0"
376339
components: rustfmt
377340
override: true
378341
- name: Install requirements for version tool
@@ -386,22 +349,8 @@ jobs:
386349
if: ${{ github.event_name == 'pull_request' }}
387350
run: python/cargo_version.py -m pr${{ github.event.pull_request.number }}
388351

389-
# Recreate charts with changed version if needed
390-
- name: Clean charts
391-
if: ${{ github.event_name == 'pull_request' }}
392-
run: make chart-clean clean-manifests compile-chart generate-manifests
393-
394-
# Package and publish charts
395-
- name: Package Chart
396-
run: mkdir -p target/helm && helm package --destination target/helm deploy/helm/${{ env.OPERATOR_NAME }}
397-
- name: Build Docker image
398-
if: env.NEXUS_PASSWORD != null # pragma: allowlist secret
399-
run: make docker
400-
- name: Publish Chart
401-
if: env.NEXUS_PASSWORD != null # pragma: allowlist secret
402-
run: >-
403-
/usr/bin/curl
404-
--fail
405-
-u 'github:${{ secrets.NEXUS_PASSWORD }}'
406-
--upload-file "./$(find target/helm/ -name '*.tgz')"
407-
"${{ env.REPO }}/"
352+
# Recreate charts and publish charts and docker image. The "-e" is needed as we want to override the
353+
# default value in the makefile if called from this action, but not otherwise (i.e. when called locally).
354+
# This is needed for the HELM_REPO variable.
355+
- name: Publish Docker image and Helm chart
356+
run: make -e publish

.readme/partials/borrowed/footer.md.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ We develop and test our operators on the following cloud platforms:
2121
* GKE on Google Cloud Platform (GCP)
2222
* [IONOS Cloud Managed Kubernetes](https://cloud.ionos.com/managed/kubernetes)
2323
* K3s
24-
* Kubernetes 1.21-1.24
24+
* Kubernetes 1.21-1.25
2525

2626
We are currently working to support:
2727

.readme/partials/borrowed/links.md.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
{% if no_jenkins_job_badge %}{% else %}[![Build Actions Status](https://ci.stackable.tech/job/{{operator_name}}%2doperator%2dit%2dnightly/badge/icon?subject=Integration%20Tests)](https://ci.stackable.tech/job/{{operator_name}}%2doperator%2dit%2dnightly){% endif %}
2+
{% if no_jenkins_job_badge %}{% else %}![Build Actions Status](https://ci.stackable.tech/buildStatus/icon?job={{operator_name}}%2doperator%2dit%2dnightly&subject=Integration%20Tests){% endif %}
33
[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://GitHub.com/stackabletech/{{operator_name}}-operator/graphs/commit-activity)
44
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-green.svg)](https://docs.stackable.tech/home/stable/contributor/index.html)
55
[![License OSL3.0](https://img.shields.io/badge/license-OSL3.0-green)](./LICENSE)

0 commit comments

Comments
 (0)