Skip to content

CLOUD-727: Bump the k8s-ecosystem group across 1 directory with 5 updates #6681

CLOUD-727: Bump the k8s-ecosystem group across 1 directory with 5 updates

CLOUD-727: Bump the k8s-ecosystem group across 1 directory with 5 updates #6681

Workflow file for this run

name: reviewdog
on: [pull_request]
jobs:
golangci-lint:
name: runner / suggester / golangci-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version: '1.26'
- name: golangci-lint
uses: golangci/golangci-lint-action@82606bf257cbaff209d206a39f5134f0cfbfd2ee # v9
with:
version: latest
only-new-issues: true
args: --timeout 5m
gofmt:
name: runner / suggester / gofmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- run: gofmt -w -s $(find . -not -path "*/vendor/*" -name "*.go")
- uses: reviewdog/action-suggester@aa38384ceb608d00f84b4690cacc83a5aba307ff # v1
with:
tool_name: gofmt
shfmt:
name: runner / suggester / shfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version: '1.26'
- run: go install mvdan.cc/sh/v3/cmd/shfmt@latest
- run: $(go env GOPATH)/bin/shfmt -f . | grep -v 'vendor' | xargs $(go env GOPATH)/bin/shfmt -bn -ci -s -w
- name: suggester / shfmt
uses: reviewdog/action-suggester@aa38384ceb608d00f84b4690cacc83a5aba307ff # v1
with:
tool_name: shfmt
shellcheck:
if: github.event_name == 'pull_request'
name: runner / shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: reviewdog/action-shellcheck@4c07458293ac342d477251099501a718ae5ef86e # v1
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-check
shellcheck_flags: -x -e SC2155
exclude: "./vendor/*"
misspell:
name: runner / misspell
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: reviewdog/action-misspell@d6429416b12b09b4e2768307d53bef58d172e962 # v1
with:
github_token: ${{ secrets.github_token }}
locale: "US"
reporter: github-pr-check
exclude: "./vendor/*"
alex:
name: runner / alex
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: reviewdog/action-alex@b6673b547eeb6d430c87ef02dc3524bdf34e324d # v1
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review
level: info
manifests:
name: runner / manifests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version: '1.26'
- name: check on release branch
if: ${{ contains(github.base_ref, 'release-') && ! startsWith(github.head_ref, 'after-release-') }}
run: |
make generate manifests VERSION="$(cat pkg/version/version.txt)" IMAGE_TAG_BASE="percona/percona-xtradb-cluster-operator"
git diff --exit-code
- name: check on non release branches
if: ${{ ! contains(github.base_ref, 'release-') || startsWith(github.head_ref, 'after-release-') }}
run: |
make generate manifests VERSION=main
git diff --exit-code
e2e-release-versions-images:
name: e2e-tests release_versions image availability
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
- name: Check if e2e-tests/release_versions changed
id: changed
run: |
git fetch origin ${{ github.base_ref }}
if git diff --name-only origin/${{ github.base_ref }}...HEAD -- e2e-tests/release_versions | grep -q .; then
echo "changed=true" >> "$GITHUB_OUTPUT"
else
echo "changed=false" >> "$GITHUB_OUTPUT"
fi
- name: Verify release_versions images exist (docker manifest inspect)
if: steps.changed.outputs.changed == 'true'
run: |
set -e
# All IMAGE_*=value lines, exclude operator image (percona/percona-xtradb-cluster-operator)
images=$(grep -E '^IMAGE_[^=]+=' e2e-tests/release_versions | cut -d= -f2 | grep -v '^$' | grep -v 'percona/percona-xtradb-cluster-operator' | sort -u)
if [ -z "$images" ]; then
echo "No non-operator images found in e2e-tests/release_versions"
exit 0
fi
failed=""
for img in $images; do
echo "Checking image $img"
if ! docker manifest inspect "$img"; then
echo "::error::Image not found or inaccessible: $img"
failed="${failed} ${img}"
fi
done
if [ -n "$failed" ]; then
echo "::error::The following images failed docker manifest inspect:$failed"
exit 1
fi
echo "All images are available."
deploy-images-in-release-versions:
name: runner / deploy images in release_versions
runs-on: ubuntu-latest
# Only relevant for release branches, where deploy manifests pin released images.
if: ${{ contains(github.base_ref, 'release-') }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Verify each deploy/*.yaml image matches its e2e-tests/release_versions entry
shell: bash
run: |
set -euo pipefail
# Return the value of an IMAGE_* variable from release_versions.
rv() { grep -E "^$1=" e2e-tests/release_versions | head -n1 | cut -d= -f2-; }
# Map a PerconaXtraDBCluster .spec.<component> to its release_versions variable.
# PXC and backup use the 8.4 (default) versions.
declare -A COMPONENT_VAR=(
[pxc]=IMAGE_PXC84
[haproxy]=IMAGE_HAPROXY
[proxysql]=IMAGE_PROXY
[logcollector]=IMAGE_LOGCOLLECTOR
[backup]=IMAGE_BACKUP84
[pmm]=IMAGE_PMM3_CLIENT
)
failed=0
# Compare a single image to the expected release_versions variable.
check_value() {
local where=$1 actual=$2 var=$3 expected
expected=$(rv "$var")
if [ -z "$expected" ]; then
echo "::error::$var is not defined in e2e-tests/release_versions"; failed=1; return
fi
if [ "$actual" != "$expected" ]; then
echo "::error::$where image '$actual' does not match $var='$expected' from e2e-tests/release_versions"; failed=1; return
fi
echo "OK: $where = $actual (matches $var)"
}
# PerconaXtraDBCluster manifests: verify EVERY image-bearing component under .spec.
# Any component without a mapping fails the check, so newly added images can't slip through.
for file in deploy/cr.yaml deploy/cr-minimal.yaml; do
while IFS= read -r comp; do
[ -z "$comp" ] && continue
image=$(yq ".spec.${comp}.image" "$file")
var=${COMPONENT_VAR[$comp]:-}
if [ -z "$var" ]; then
echo "::error file=$file::No release_versions mapping for component '$comp' (update this check)"; failed=1
else
check_value "$file[$comp]" "$image" "$var"
fi
done < <(yq '.spec | to_entries | .[] | select(.value | has("image")) | .key' "$file")
done
# Operator Deployment manifests: the operator container image must match IMAGE_OPERATOR.
for file in deploy/operator.yaml deploy/bundle.yaml; do
image=$(yq '.spec.template.spec.containers[]? | select(.name == "percona-xtradb-cluster-operator") | .image' "$file" | head -n1)
if [ -z "$image" ]; then
echo "::error file=$file::Could not find the operator container image"; failed=1
else
check_value "$file[operator]" "$image" IMAGE_OPERATOR
fi
done
if [ "$failed" -ne 0 ]; then
echo "::error::deploy manifest images are out of sync with e2e-tests/release_versions"
exit 1
fi
echo "All deploy images match their release_versions entries."