Skip to content

Commit 0151dd7

Browse files
Generated commit to update templated files based on rev 56d169e in stackabletech/operator-templating repo. (#54)
Triggered by: Manual run triggered by: NickLarsenNZ with message [Bump rust to 1.75]
1 parent a508a42 commit 0151dd7

File tree

5 files changed

+43
-17
lines changed

5 files changed

+43
-17
lines changed

.github/pull_request_template.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# Author
1313
- [ ] Changes are OpenShift compatible
1414
- [ ] CRD changes approved
15-
- [ ] CRD documentation for all fields, following the [style guide](https://docs.stackable.tech/home/nightly/contributor/style-guide).
15+
- [ ] CRD documentation for all fields, following the [style guide](https://docs.stackable.tech/home/nightly/contributor/docs-style-guide).
1616
- [ ] Helm chart can be installed and deployed operator works
1717
- [ ] Integration tests passed (for non trivial changes)
1818
- [ ] Changes need to be "offline" compatible
@@ -21,8 +21,9 @@
2121
```[tasklist]
2222
# Reviewer
2323
- [ ] Code contains useful comments
24+
- [ ] Code contains useful logging statements
2425
- [ ] (Integration-)Test cases added
25-
- [ ] Documentation added or updated. Follows the [style guide](https://docs.stackable.tech/home/nightly/contributor/style-guide).
26+
- [ ] Documentation added or updated. Follows the [style guide](https://docs.stackable.tech/home/nightly/contributor/docs-style-guide).
2627
- [ ] Changelog updated
2728
- [ ] Cargo.toml only contains references to git tags (not specific commits or branches)
2829
```

.github/workflows/build.yml

+22-8
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ env:
2121
CARGO_TERM_COLOR: always
2222
CARGO_INCREMENTAL: '0'
2323
CARGO_PROFILE_DEV_DEBUG: '0'
24+
RUST_TOOLCHAIN_VERSION: "1.75.0"
2425
RUSTFLAGS: "-D warnings"
2526
RUSTDOCFLAGS: "-D warnings"
2627
RUST_LOG: "info"
@@ -44,7 +45,9 @@ jobs:
4445
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
4546
with:
4647
submodules: recursive
47-
- uses: dtolnay/[email protected]
48+
- uses: dtolnay/rust-toolchain@be73d7920c329f220ce78e0234b8f96b7ae60248
49+
with:
50+
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
4851
- uses: Swatinem/rust-cache@3cf7f8cc28d1b4e7d01e3783be10a97d55d483c8 # v2.7.1
4952
with:
5053
key: udeps
@@ -122,8 +125,9 @@ jobs:
122125
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
123126
with:
124127
submodules: recursive
125-
- uses: dtolnay/rust-toolchain@1.74.0
128+
- uses: dtolnay/rust-toolchain@be73d7920c329f220ce78e0234b8f96b7ae60248
126129
with:
130+
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
127131
components: rustfmt
128132
- run: cargo fmt --all -- --check
129133

@@ -139,8 +143,9 @@ jobs:
139143
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
140144
with:
141145
submodules: recursive
142-
- uses: dtolnay/rust-toolchain@1.74.0
146+
- uses: dtolnay/rust-toolchain@be73d7920c329f220ce78e0234b8f96b7ae60248
143147
with:
148+
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
144149
components: clippy
145150
- uses: Swatinem/rust-cache@3cf7f8cc28d1b4e7d01e3783be10a97d55d483c8 # v2.7.1
146151
with:
@@ -174,8 +179,9 @@ jobs:
174179
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
175180
with:
176181
submodules: recursive
177-
- uses: dtolnay/rust-toolchain@1.74.0
182+
- uses: dtolnay/rust-toolchain@be73d7920c329f220ce78e0234b8f96b7ae60248
178183
with:
184+
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
179185
components: rustfmt
180186
- uses: Swatinem/rust-cache@3cf7f8cc28d1b4e7d01e3783be10a97d55d483c8 # v2.7.1
181187
with:
@@ -195,7 +201,9 @@ jobs:
195201
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
196202
with:
197203
submodules: recursive
198-
- uses: dtolnay/[email protected]
204+
- uses: dtolnay/rust-toolchain@be73d7920c329f220ce78e0234b8f96b7ae60248
205+
with:
206+
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
199207
- uses: Swatinem/rust-cache@3cf7f8cc28d1b4e7d01e3783be10a97d55d483c8 # v2.7.1
200208
with:
201209
key: test
@@ -258,7 +266,9 @@ jobs:
258266
with:
259267
version: v3.13.3
260268
- name: Set up cargo
261-
uses: dtolnay/[email protected]
269+
uses: dtolnay/rust-toolchain@be73d7920c329f220ce78e0234b8f96b7ae60248
270+
with:
271+
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
262272
- uses: Swatinem/rust-cache@3cf7f8cc28d1b4e7d01e3783be10a97d55d483c8 # v2.7.1
263273
with:
264274
key: charts
@@ -318,8 +328,9 @@ jobs:
318328
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
319329
with:
320330
submodules: recursive
321-
- uses: dtolnay/rust-toolchain@1.74.0
331+
- uses: dtolnay/rust-toolchain@be73d7920c329f220ce78e0234b8f96b7ae60248
322332
with:
333+
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
323334
components: rustfmt
324335
# This step checks if the current run was triggered by a push to a pr (or a pr being created).
325336
# If this is the case it changes the version of this project in all Cargo.toml files to include the suffix
@@ -335,7 +346,10 @@ jobs:
335346
# Recreate charts and publish charts and docker image. The "-e" is needed as we want to override the
336347
# default value in the makefile if called from this action, but not otherwise (i.e. when called locally).
337348
# This is needed for the HELM_REPO variable.
338-
- uses: sigstore/cosign-installer@9614fae9e5c5eddabb09f90a270fcb487c9f7149 # tag=v3.3.0
349+
- name: Install cosign
350+
uses: sigstore/cosign-installer@9614fae9e5c5eddabb09f90a270fcb487c9f7149 # tag=v3.3.0
351+
- name: Install syft
352+
uses: anchore/sbom-action/download-syft@24b0d5238516480139aa8bc6f92eeb7b54a9eb0a # tag=v0.15.5
339353
- name: Publish Docker image and Helm chart
340354
run: make -e publish
341355
# Output the name of the published image to the Job output for later use

Makefile

+14-3
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ docker-publish:
4545
fi;\
4646
# This generates a signature and publishes it to the registry, next to the image\
4747
# Uses the keyless signing flow with Github Actions as identity provider\
48-
cosign sign -y ${DOCKER_REPO}/${ORGANIZATION}/${OPERATOR_NAME}:@$$REPO_DIGEST_OF_IMAGE
48+
cosign sign -y "${DOCKER_REPO}/${ORGANIZATION}/${OPERATOR_NAME}@$$REPO_DIGEST_OF_IMAGE"
4949

5050
# Push to Harbor
5151
# We need to use "value" here to prevent the variable from being recursively expanded by make (username contains a dollar sign, since it's a Harbor bot)
@@ -59,7 +59,18 @@ docker-publish:
5959
fi;\
6060
# This generates a signature and publishes it to the registry, next to the image\
6161
# Uses the keyless signing flow with Github Actions as identity provider\
62-
cosign sign -y ${OCI_REGISTRY_HOSTNAME}/${OCI_REGISTRY_PROJECT_IMAGES}/${OPERATOR_NAME}:@$$REPO_DIGEST_OF_IMAGE
62+
cosign sign -y "${OCI_REGISTRY_HOSTNAME}/${OCI_REGISTRY_PROJECT_IMAGES}/${OPERATOR_NAME}@$$REPO_DIGEST_OF_IMAGE";\
63+
# Generate the SBOM for the operator image, this leverages the already generated SBOM for the operator binary by cargo-cyclonedx\
64+
syft scan --output cyclonedx-json=sbom.json --select-catalogers "-cargo-auditable-binary-cataloger" --scope all-layers --source-name "${OPERATOR_NAME}" --source-version "${VERSION}" "${OCI_REGISTRY_HOSTNAME}/${OCI_REGISTRY_PROJECT_IMAGES}/${OPERATOR_NAME}@$$REPO_DIGEST_OF_IMAGE";\
65+
# Determine the PURL for the container image\
66+
PURL="pkg:docker/${OCI_REGISTRY_PROJECT_IMAGES}/${OPERATOR_NAME}@$$REPO_DIGEST_OF_IMAGE?repository_url=${OCI_REGISTRY_HOSTNAME}";\
67+
# Get metadata from the image\
68+
IMAGE_DESCRIPTION=$$(docker inspect --format='{{.Config.Labels.description}}' "${OCI_REGISTRY_HOSTNAME}/${OCI_REGISTRY_PROJECT_IMAGES}/${OPERATOR_NAME}:${VERSION}");\
69+
IMAGE_NAME=$$(docker inspect --format='{{.Config.Labels.name}}' "${OCI_REGISTRY_HOSTNAME}/${OCI_REGISTRY_PROJECT_IMAGES}/${OPERATOR_NAME}:${VERSION}");\
70+
# Merge the SBOM with the metadata for the operator\
71+
jq -s '{"metadata":{"component":{"description":"'"$$IMAGE_NAME. $$IMAGE_DESCRIPTION"'","supplier":{"name":"Stackable GmbH","url":["https://stackable.tech/"]},"author":"Stackable GmbH","purl":"'"$$PURL"'","publisher":"Stackable GmbH"}}} * .[0]' sbom.json > sbom.merged.json;\
72+
# Attest the SBOM to the image\
73+
cosign attest -y --predicate sbom.merged.json --type cyclonedx "${OCI_REGISTRY_HOSTNAME}/${OCI_REGISTRY_PROJECT_IMAGES}/${OPERATOR_NAME}@$$REPO_DIGEST_OF_IMAGE"
6374

6475
# TODO remove if not used/needed
6576
docker: docker-build docker-publish
@@ -85,7 +96,7 @@ helm-publish:
8596
docker login --username '${value OCI_REGISTRY_SDP_CHARTS_USERNAME}' --password '${OCI_REGISTRY_SDP_CHARTS_PASSWORD}' '${OCI_REGISTRY_HOSTNAME}';\
8697
# This generates a signature and publishes it to the registry, next to the chart artifact\
8798
# Uses the keyless signing flow with Github Actions as identity provider\
88-
cosign sign -y ${OCI_REGISTRY_HOSTNAME}/${OCI_REGISTRY_PROJECT_CHARTS}/${HELM_CHART_NAME}:@$$REPO_DIGEST_OF_ARTIFACT
99+
cosign sign -y "${OCI_REGISTRY_HOSTNAME}/${OCI_REGISTRY_PROJECT_CHARTS}/${HELM_CHART_NAME}@$$REPO_DIGEST_OF_ARTIFACT"
89100

90101
helm-package:
91102
mkdir -p target/helm && helm package --destination target/helm deploy/helm/${OPERATOR_NAME}

nix/sources.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
"homepage": "",
1818
"owner": "NixOS",
1919
"repo": "nixpkgs",
20-
"rev": "3f21a22b5aafefa1845dec6f4a378a8f53d8681c",
21-
"sha256": "15y8k3hazg91kscbmn7dy6m0q6zvmhlvvhg97gcl5kw87y0svzxk",
20+
"rev": "5ad9903c16126a7d949101687af0aa589b1d7d3d",
21+
"sha256": "1i0nvgzzadbl29hzs5n4qbc0nnw69nh79b0kq3g7zi1926rczlqn",
2222
"type": "tarball",
23-
"url": "https://github.com/NixOS/nixpkgs/archive/3f21a22b5aafefa1845dec6f4a378a8f53d8681c.tar.gz",
23+
"url": "https://github.com/NixOS/nixpkgs/archive/5ad9903c16126a7d949101687af0aa589b1d7d3d.tar.gz",
2424
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
2525
}
2626
}

rust-toolchain.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[toolchain]
2-
channel = "1.74.0"
2+
channel = "1.75.0"

0 commit comments

Comments
 (0)