Skip to content

fix(rook): fix CSI image extraction and install helm in cron-rook-update workflow - #6116

Open
xavpaice wants to merge 4 commits into
mainfrom
fix-rook-generate-image-extraction
Open

fix(rook): fix CSI image extraction and install helm in cron-rook-update workflow#6116
xavpaice wants to merge 4 commits into
mainfrom
fix-rook-generate-image-extraction

Conversation

@xavpaice

Copy link
Copy Markdown
Member

Fixes the failure in the cron-rook-update workflow run https://github.com/replicatedhq/kURL/actions/runs/32680028352.

Diagnosis

The Create Rook Update step exits with code 1 while generating the Rook add-on. The failing part is in addons/rook/template/generate.sh:

curl -fsSL "${github_content_url}/deploy/examples/operator.yaml" | grep '_IMAGE: ' | ...

This line expects Rook's operator.yaml to contain commented ROOK_CSI_*_IMAGE: lines that list the CSI sidecar images. Newer Rook versions (e.g. v1.20.x) moved those images into a ConfigMap as quoted image references and removed the old commented _IMAGE: lines, so grep '_IMAGE: ' returns no matches and exits 1. With set -euo pipefail, that aborts the whole script.

Fix

  • Change the extraction to pull any quoted image reference from operator.yaml. This matches both the old commented _IMAGE: lines and the new ConfigMap values, so the generated Manifest includes the CSI sidecar images required for air-gap installs.
  • Also add a Helm install step to the update-rook.yaml workflow, matching the update-prometheus.yaml and update-goldpinger.yaml workflows.

Verification

I ran the fixed generate.sh in an Ubuntu 24.04 container (the same runner image). It successfully generated the latest Rook version with a complete Manifest:

image rook-ceph docker.io/rook/ceph:v1.20.6
image cephcsi-ceph-csi-operator quay.io/cephcsi/ceph-csi-operator:v1.0.4
image ceph-ceph quay.io/ceph/ceph:v20.2.4
image sig-storage-csi-provisioner registry.k8s.io/sig-storage/csi-provisioner:v6.2.0
image sig-storage-csi-attacher registry.k8s.io/sig-storage/csi-attacher:v4.12.0
image sig-storage-csi-resizer registry.k8s.io/sig-storage/csi-resizer:v2.1.0
image sig-storage-csi-snapshotter registry.k8s.io/sig-storage/csi-snapshotter:v8.5.0
image sig-storage-csi-node-driver-registrar registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.17.0
image cephcsi-cephcsi quay.io/cephcsi/cephcsi:v3.17.0
image csiaddons-k8s-sidecar quay.io/csiaddons/k8s-sidecar:v0.14.0

I also tested regenerating Rook 1.18.11 with --force to confirm the new extraction still works for the older operator.yaml format.

Rook's upstream operator.yaml no longer contains the commented
ROOK_CSI_*_IMAGE lines that the generate script was grepping for. Starting
with newer versions (e.g. v1.20.x), the CSI sidecar images are stored in a
ConfigMap as quoted image references, so the grep for '_IMAGE: ' returns no
matches and the script exits with code 1.

Update the image extraction to pull any quoted image reference from the
operator.yaml. This handles both the old commented _IMAGE lines and the new
ConfigMap image values, so the generated Manifest includes the CSI sidecar
images needed for air-gap installs.
Matches the pattern used by the prometheus and goldpinger update workflows,
ensuring the cron-rook-update job has a known Helm version available even if
the runner image changes.
@xavpaice
xavpaice requested a review from a team as a code owner August 28, 2026 03:05
@greptile-apps

greptile-apps Bot commented Aug 28, 2026

Copy link
Copy Markdown

Security Review

The workflow executes a mutable, unverified third-party installer script in a job that later uses a repository automation PAT. Pinning the installer source and verifying its integrity would prevent an upstream compromise from becoming arbitrary runner code execution.

Reviews (1): Last reviewed commit: "chore(rook): install helm before running..." | Re-trigger Greptile

Comment thread .github/workflows/update-rook.yaml Outdated
Greptile review: the workflow was piping the upstream get-helm-3 script
directly to bash in a job that later uses an automation PAT. Replace the
pipe-to-bash install with a pinned Helm tarball download and a hardcoded
SHA-256 checksum verification so upstream script compromise cannot lead to
arbitrary runner execution.
@greptile-apps

greptile-apps Bot commented Aug 28, 2026

Copy link
Copy Markdown

Reviews (2): Last reviewed commit: "security(rook): pin Helm version and ver..." | Re-trigger Greptile

Helm v4 is a new major version with potential breaking changes for chart
rendering. Stay on the Helm 3 line with the latest patch (3.21.4) to avoid
introducing unrelated behavior changes while still satisfying the security
review by pinning a verified binary.
@greptile-apps

greptile-apps Bot commented Aug 28, 2026

Copy link
Copy Markdown

Reviews (3): Last reviewed commit: "fixup! security(rook): pin Helm 3.21.4 i..." | Re-trigger Greptile

@kriscoleman kriscoleman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants