Skip to content

Commit 387dd93

Browse files
committed
Merge branch 'main' into feat/docker-user
# Conflicts: # template/docker/Dockerfile.j2
2 parents 0aa3e30 + a16c534 commit 387dd93

File tree

10 files changed

+45
-22
lines changed

10 files changed

+45
-22
lines changed
File renamed without changes.

.github/workflows/generate_prs.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,12 @@ jobs:
128128
- name: Set commit message for manual dispatch
129129
if: ${{ github.event_name == 'workflow_dispatch' }}
130130
run: |
131-
echo "REASON=@${{ github.event.sender.login }}: ${{ github.event.inputs.message }}" >> "$GITHUB_ENV"
131+
echo "AUTHOR=@${{ github.event.sender.login }}" >> "$GITHUB_ENV"
132+
echo "REASON=${{ github.event.inputs.message }}" >> "$GITHUB_ENV"
132133
- name: Set commit message for schedule
133134
if: ${{ github.event_name == 'schedule' }}
134135
run: |
136+
echo "AUTHOR=Github Actions"
135137
echo "REASON=Daily run triggered" >> "$GITHUB_ENV"
136138
137139
- name: Overwrite repositories.yaml for ${{ matrix.repository.name }}
@@ -150,7 +152,7 @@ jobs:
150152
if: ${{ !inputs.dry-run }}
151153
run: |
152154
# Funnel via JSON to ensure that values are escaped properly
153-
echo '{}' | jq '{commit_hash: $ENV.GITHUB_SHA, reason: $ENV.REASON, base_dir: $pwd, gh_access_token: $ENV.GH_ACCESS_TOKEN}' --arg pwd "$(pwd)" > vars.json
155+
echo '{}' | jq '{commit_hash: $ENV.GITHUB_SHA, author: $ENV.AUTHOR, reason: $ENV.REASON, base_dir: $pwd, gh_access_token: $ENV.GH_ACCESS_TOKEN}' --arg pwd "$(pwd)" > vars.json
154156
ansible-playbook playbook/playbook.yaml --extra-vars "@vars.json"
155157
env:
156158
GH_ACCESS_TOKEN: ${{ secrets.gh_access_token }}

.pre-commit-config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ repos:
4949
rev: 62dc61a45fc95efe8c800af7a557ab0b9165d63b # 1.7.1
5050
hooks:
5151
- id: actionlint
52+
types: [text]
53+
files: ^(template/)?\.github/workflows/.*\.ya?ml(\.j2)?
5254

5355
- repo: https://github.com/hadolint/hadolint
5456
rev: b3555ba9c2bfd9401e79f2f0da68dd1ae38e10c7 # 2.12.0

playbook/group_vars/all/vars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pr_body: |
2626
>
2727
> | **Trigger-message** |
2828
> | - |
29-
> | {{ reason }} |
29+
> | {{ author }}: {{ reason }} |
3030

3131
> [!TIP]
3232
> Please update the change type as appropriate.

playbook/update_repo.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@
139139

140140
- name: "Operator [{{ operator.name }}] create PR"
141141
command:
142-
argv: [gh, pr, create, --base, main, --title, "{{ pr_title }}", --body, "{{ pr_body }}", --reviewer, "@stackabletech/developers"]
142+
argv: [gh, pr, create, --base, main, --title, "{{ pr_title }}", --body, "{{ pr_body }}", --reviewer, "{{ author }}"]
143143
chdir: "{{ work_dir }}/{{ operator.name }}"
144144

145145
- name: "Operator [{{ operator.name }}] clean"

template/.github/actionlint.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
self-hosted-runner:
3+
# Ubicloud machines we are using
4+
labels:
5+
- ubicloud-standard-8-arm

template/.github/workflows/build.yml.j2

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,18 +88,18 @@ jobs:
8888
TRIGGER: ${{ github.event_name }}
8989
GITHUB_REF: ${{ github.ref }}
9090
run: |
91-
if [[ $TRIGGER == "pull_request" ]]; then
91+
if [[ "$TRIGGER" == "pull_request" ]]; then
9292
echo "exporting test as target helm repo: ${{ env.TEST_REPO_HELM_URL }}"
93-
echo "helm_repo=${{ env.TEST_REPO_HELM_URL }}" >> $GITHUB_OUTPUT
94-
elif [[ ( $TRIGGER == "push" || $TRIGGER == "schedule" || $TRIGGER == "workflow_dispatch" ) && $GITHUB_REF == "refs/heads/main" ]]; then
93+
echo "helm_repo=${{ env.TEST_REPO_HELM_URL }}" >> "$GITHUB_OUTPUT"
94+
elif [[ ( "$TRIGGER" == "push" || "$TRIGGER" == "schedule" || "$TRIGGER" == "workflow_dispatch" ) && "$GITHUB_REF" == "refs/heads/main" ]]; then
9595
echo "exporting dev as target helm repo: ${{ env.DEV_REPO_HELM_URL }}"
96-
echo "helm_repo=${{ env.DEV_REPO_HELM_URL }}" >> $GITHUB_OUTPUT
97-
elif [[ $TRIGGER == "push" && $GITHUB_REF == refs/tags/* ]]; then
96+
echo "helm_repo=${{ env.DEV_REPO_HELM_URL }}" >> "$GITHUB_OUTPUT"
97+
elif [[ "$TRIGGER" == "push" && $GITHUB_REF == refs/tags/* ]]; then
9898
echo "exporting stable as target helm repo: ${{ env.STABLE_REPO_HELM_URL }}"
99-
echo "helm_repo=${{ env.STABLE_REPO_HELM_URL }}" >> $GITHUB_OUTPUT
99+
echo "helm_repo=${{ env.STABLE_REPO_HELM_URL }}" >> "$GITHUB_OUTPUT"
100100
else
101101
echo "Unknown trigger and ref combination encountered, skipping publish step: $TRIGGER $GITHUB_REF"
102-
echo "helm_repo=skip" >> $GITHUB_OUTPUT
102+
echo "helm_repo=skip" >> "$GITHUB_OUTPUT"
103103
fi
104104

105105
run_cargodeny:
@@ -379,7 +379,7 @@ jobs:
379379
- id: printtag
380380
name: Output image name and tag
381381
if: ${{ !github.event.pull_request.head.repo.fork }}
382-
run: echo "IMAGE_TAG=$(make -e print-docker-tag)" >> $GITHUB_OUTPUT
382+
run: echo "IMAGE_TAG=$(make -e print-docker-tag)" >> "$GITHUB_OUTPUT"
383383

384384
create_manifest_list:
385385
name: Build and publish manifest list
@@ -437,4 +437,4 @@ jobs:
437437
ARCH_FOR_PREFLIGHT="$(arch | sed -e 's#x86_64#amd64#' | sed -e 's#aarch64#arm64#')"
438438
./preflight-linux-amd64 check container "$IMAGE_TAG" --platform "${ARCH_FOR_PREFLIGHT}" > preflight.out
439439
- name: "Passed?"
440-
run: '[ "$(cat preflight.out | jq -r .passed)" == true ]'
440+
run: '[ "$(jq -r .passed < preflight.out)" == true ]'

template/.github/workflows/pr_pre-commit.yaml.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
1717
with:
1818
fetch-depth: 0
19+
submodules: recursive
1920
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
2021
with:
2122
python-version: '3.12'
@@ -39,6 +40,7 @@ jobs:
3940
chmod 700 "${LOCATION_BIN}"
4041

4142
echo "$LOCATION_DIR" >> "$GITHUB_PATH"
43+
- uses: cachix/install-nix-action@8887e596b4ee1134dae06b98d573bd674693f47c # v26
4244
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
4345
with:
4446
extra_args: "--from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.event.pull_request.head.sha }}"

template/.pre-commit-config.yaml.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ repos:
6666
- id: regenerate-charts
6767
name: regenerate-charts
6868
language: system
69-
entry: make regenerate-charts
69+
entry: nix-shell --run 'make regenerate-charts'
7070
stages: [commit, merge-commit, manual]
7171
pass_filenames: false
7272

7373
- id: cargo-test
7474
name: cargo-test
7575
language: system
76-
entry: cargo test
76+
entry: nix-shell --run 'cargo test'
7777
stages: [commit, merge-commit, manual]
7878
pass_filenames: false

template/docker/Dockerfile.j2

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
11
# syntax=docker/dockerfile:1.10.0@sha256:865e5dd094beca432e8c0a1d5e1c465db5f998dca4e439981029b3b81fb39ed5
2+
# NOTE: The syntax directive needs to be the first line in a Dockerfile
3+
24
# =============
35
# This file is automatically generated from the templates in stackabletech/operator-templating
46
# DON'T MANUALLY EDIT THIS FILE
57
# =============
6-
# NOTE: The syntax directive needs to be the first line in a Dockerfile
8+
79
# https://docs.docker.com/build/checks/#fail-build-on-check-violations
810
# check=error=true
9-
FROM oci.stackable.tech/sdp/ubi9-rust-builder AS builder
1011

11-
FROM registry.access.redhat.com/ubi9/ubi-minimal AS operator
12+
# We want to automatically use the latest. We also don't tag our images with a version.
13+
# hadolint ignore=DL3007
14+
FROM oci.stackable.tech/sdp/ubi9-rust-builder:latest AS builder
15+
16+
17+
# We want to automatically use the latest.
18+
# hadolint ignore=DL3007
19+
FROM registry.access.redhat.com/ubi9/ubi-minimal:latest AS operator
1220

1321
ARG VERSION
1422
ARG RELEASE="1"
@@ -58,9 +66,13 @@ LABEL io.openshift.tags="ubi9,stackable,sdp,{[ operator.product_string }]"
5866
LABEL io.k8s.description="Deploy and manage {[ operator.pretty_string }] clusters."
5967
LABEL io.k8s.display-name="Stackable Operator for {[ operator.pretty_string }]"
6068

61-
# Update image and install kerberos client libraries
6269
RUN <<EOF
70+
# Update image and install kerberos client libraries
71+
# install_weak_deps in microdnf does not support the literal "False" as dnf does
72+
# https://github.com/rpm-software-management/microdnf/blob/a600c62f29262d71a6259b70dc220df65a2ab9b5/dnf/dnf-main.c#L176-L189
6373
microdnf update
74+
# NOTE (@NickLarsenNZ): Maybe we should consider pinning package versions?
75+
# hadolint ignore=DL3041
6476
microdnf install -y \
6577
krb5-libs \
6678
libkadm5 \
@@ -89,9 +101,9 @@ EOF
89101
COPY LICENSE /licenses/LICENSE
90102
91103
COPY --from=builder /app/* /usr/local/bin/
92-
{[% if operator.include_productconfig is undefined or operator.include_productconfig == true %}]
93-
COPY deploy/config-spec/properties.yaml /etc/stackable/{[ operator.name }]/config-spec/properties.yaml
94-
{[% endif %}]
104+
# {[% if operator.include_productconfig is undefined or operator.include_productconfig == true %}]
105+
COPY deploy/config-spec/properties.yaml /etc/stackable/{[operator.name}]/config-spec/properties.yaml
106+
# {[% endif %}]
95107
96108
USER ${STACKABLE_USER_UID}
97109

0 commit comments

Comments
 (0)