Skip to content

Commit dfc9060

Browse files
chore: Update templated files (20d91e7) (#908)
chore: Generated commit to update templated files since the last template run up to stackabletech/operator-templating@20d91e7 Reference-to: stackabletech/operator-templating@20d91e7 (set defaults to oci)
1 parent f1801c6 commit dfc9060

File tree

5 files changed

+24
-14
lines changed

5 files changed

+24
-14
lines changed

.github/workflows/build.yml

+14-4
Original file line numberDiff line numberDiff line change
@@ -354,13 +354,18 @@ jobs:
354354
cargo set-version --offline --workspace "$PR_VERSION"
355355
- name: Update version if PR against non-main branch
356356
# For PRs to be merged against a release branch, use the version that has already been set in the calling script.
357-
if: ${{ github.event_name == 'pull_request' && startsWith(github.event.pull_request.base.ref, 'release-') }}
357+
# We can't rely on cargo set-version here as we will break semver rules when changing the version to make it
358+
# specific to this PR e.g. 1.2.0 --> 1.2.0-pr678, so set it manually.
359+
if: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/main' }}
358360
env:
359361
PR_NUMBER: ${{ github.event.pull_request.number }}
362+
shell: bash
360363
run: |
364+
set -euo pipefail
365+
361366
MANIFEST_VERSION=$(cargo metadata --format-version 1 --no-deps | jq -r '.packages[0].version')
362367
PR_VERSION="${MANIFEST_VERSION}-pr${PR_NUMBER}"
363-
cargo set-version --offline --workspace "$PR_VERSION"
368+
sed -i "s/version = \"${MANIFEST_VERSION}\"/version = \"${PR_VERSION}\"/" Cargo.toml
364369
365370
# Recreate charts and publish charts and docker image. The "-e" is needed as we want to override the
366371
# default value in the makefile if called from this action, but not otherwise (i.e. when called locally).
@@ -433,13 +438,18 @@ jobs:
433438
cargo set-version --offline --workspace "$PR_VERSION"
434439
- name: Update version if PR against non-main branch
435440
# For PRs to be merged against a release branch, use the version that has already been set in the calling script.
436-
if: ${{ github.event_name == 'pull_request' && startsWith(github.event.pull_request.base.ref, 'release-') }}
441+
# We can't rely on cargo set-version here as we will break semver rules when changing the version to make it
442+
# specific to this PR e.g. 1.2.0 --> 1.2.0-pr678, so set it manually.
443+
if: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/main' }}
437444
env:
438445
PR_NUMBER: ${{ github.event.pull_request.number }}
446+
shell: bash
439447
run: |
448+
set -euo pipefail
449+
440450
MANIFEST_VERSION=$(cargo metadata --format-version 1 --no-deps | jq -r '.packages[0].version')
441451
PR_VERSION="${MANIFEST_VERSION}-pr${PR_NUMBER}"
442-
cargo set-version --offline --workspace "$PR_VERSION"
452+
sed -i "s/version = \"${MANIFEST_VERSION}\"/version = \"${PR_VERSION}\"/" Cargo.toml
443453
- name: Build manifest list
444454
run: |
445455
# Creating manifest list

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ docker-publish:
8989
# Attest the SBOM to the image\
9090
cosign attest -y --predicate sbom.merged.json --type cyclonedx "${OCI_REGISTRY_HOSTNAME}/${OCI_REGISTRY_PROJECT_IMAGES}/${OPERATOR_NAME}@$$REPO_DIGEST_OF_IMAGE"
9191

92-
# This assumes "${DOCKER_REPO}/${ORGANIZATION}/${OPERATOR_NAME}:${VERSION}-amd64 and "${DOCKER_REPO}/${ORGANIZATION}/${OPERATOR_NAME}:${VERSION}-arm64 are build and pushed
92+
# This assumes "${OCI_REGISTRY_HOSTNAME}/${OCI_REGISTRY_PROJECT_IMAGES}/${OPERATOR_NAME}:${VERSION}-amd64 and "${OCI_REGISTRY_HOSTNAME}/${OCI_REGISTRY_PROJECT_IMAGES}/${OPERATOR_NAME}:${VERSION}-arm64 are built and pushed
9393
docker-manifest-list-build:
9494
docker manifest create "${DOCKER_REPO}/${ORGANIZATION}/${OPERATOR_NAME}:${VERSION}" --amend "${DOCKER_REPO}/${ORGANIZATION}/${OPERATOR_NAME}:${VERSION}-amd64" --amend "${DOCKER_REPO}/${ORGANIZATION}/${OPERATOR_NAME}:${VERSION}-arm64"
9595
docker manifest create "${OCI_REGISTRY_HOSTNAME}/${OCI_REGISTRY_PROJECT_IMAGES}/${OPERATOR_NAME}:${VERSION}" --amend "${OCI_REGISTRY_HOSTNAME}/${OCI_REGISTRY_PROJECT_IMAGES}/${OPERATOR_NAME}:${VERSION}-amd64" --amend "${OCI_REGISTRY_HOSTNAME}/${OCI_REGISTRY_PROJECT_IMAGES}/${OPERATOR_NAME}:${VERSION}-arm64"
@@ -119,7 +119,7 @@ docker-manifest-list-publish:
119119
docker: docker-build docker-publish
120120

121121
print-docker-tag:
122-
@echo "${DOCKER_REPO}/${ORGANIZATION}/${OPERATOR_NAME}:${VERSION}"
122+
@echo "${OCI_REGISTRY_HOSTNAME}/${OCI_REGISTRY_PROJECT_IMAGES}/${OPERATOR_NAME}:${VERSION}"
123123

124124
helm-publish:
125125
# Push to Nexus

Tiltfile

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# If tilt_options.json exists read it and load the default_registry value from it
22
settings = read_json('tilt_options.json', default={})
3-
registry = settings.get('default_registry', 'docker.stackable.tech/sandbox')
3+
registry = settings.get('default_registry', 'oci.stackable.tech/sandbox')
44

5-
# Configure default registry either read from config file above, or with default value of "docker.stackable.tech/sandbox"
5+
# Configure default registry either read from config file above, or with default value of "oci.stackable.tech/sandbox"
66
default_registry(registry)
77

88
meta = read_json('nix/meta.json')
@@ -23,8 +23,8 @@ if os.path.exists('result'):
2323
k8s_yaml('result/crds.yaml')
2424

2525
# We need to set the correct image annotation on the operator Deployment to use e.g.
26-
# docker.stackable.tech/sandbox/opa-operator:7y19m3d8clwxlv34v5q2x4p7v536s00g instead of
27-
# docker.stackable.tech/sandbox/opa-operator:0.0.0-dev (which does not exist)
26+
# oci.stackable.tech/sandbox/opa-operator:7y19m3d8clwxlv34v5q2x4p7v536s00g instead of
27+
# oci.stackable.tech/sandbox/opa-operator:0.0.0-dev (which does not exist)
2828
k8s_kind('Deployment', image_json_path='{.spec.template.metadata.annotations.internal\\.stackable\\.tech/image}')
2929

3030
# Exclude stale CRDs from Helm chart, and apply the rest

default.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
};
4141
}
4242
, meta ? pkgs.lib.importJSON ./nix/meta.json
43-
, dockerName ? "docker.stackable.tech/sandbox/${meta.operator.name}"
43+
, dockerName ? "oci.stackable.tech/sandbox/${meta.operator.name}"
4444
, dockerTag ? null
4545
}:
4646
rec {

nix/sources.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)