Skip to content

fix(extraction): bump pinned OpenShell to v0.0.83 for Sandbox v1beta1 support - #794

Merged
aredenba-rh merged 3 commits into
mainfrom
fix/openshell-gateway-sandbox-v1beta1-support
Jul 15, 2026
Merged

aredenba-rh merged 3 commits into
mainfrom
fix/openshell-gateway-sandbox-v1beta1-support

Conversation

@aredenba-rh

Copy link
Copy Markdown
Collaborator

Summary

  • openshell-gateway's Kubernetes compute driver was erroring on every sandbox list/watch call with a raw (non-JSON) 404 page not found in kartograph-stage, breaking Graph Management Assistant session start.
  • Root cause: our pinned OpenShell release (v0.0.62) hardcodes the Kubernetes driver's Sandbox custom resource to agents.x-k8s.io/v1alpha1 with no fallback. The Agent Sandbox CRD installed on the cluster now serves v1beta1, not v1alpha1. NVIDIA/OpenShell#2009 (first released in v0.0.72) added runtime detection of the served Sandbox API version (v1beta1 first, falling back to v1alpha1), and explicitly documents the raw-404 signature we observed as the exact failure mode this was written to handle.
  • This surfaced only after hybrid-platforms-gitops/infrastructure!76 fixed a separate, previously-blocking RBAC issue (openshell-rbac.yaml's Role/RoleBinding couldn't sync because ArgoCD's application controller SA didn't hold the verbs it needed to grant). Once that RBAC sync succeeded, the driver's list/watch calls started reaching the API server, exposing this version mismatch underneath.
  • Bumps OPENSHELL_VERSION in both src/api/Dockerfile (the openshell CLI) and deploy/container/openshell-gateway/Dockerfile (the gateway sidecar) to v0.0.83, the latest published release, keeping CLI/gateway protocol versions in lockstep.
  • Adds test_openshell_version_pin.py: a regression test enforcing both Dockerfiles stay pinned to the same version, and that the version is high enough to include the Sandbox API auto-detection fix.
  • Refreshes a stale comment in scripts/verify-fleet-apps-kartograph.sh that still described openshell-rbac.yaml as expected to be disabled.

Test plan

  • New unit test fails (red) against the old v0.0.62 pin, passes (green) after the bump.
  • Full unit suite passes (uv run pytest tests/unit, 3515 passed).
  • After Konflux builds the kartograph-api and kartograph-openshell-gateway images for this PR/merge, bump the stage image tags in hp-fleet-gitops and confirm via ArgoCD/pod logs that the openshell-gateway sidecar in kartograph-stage successfully detects agents.x-k8s.io/v1beta1 and stops erroring on sandbox list/watch.
  • Confirm Graph Management Assistant "Start session" succeeds end-to-end in stage.

Made with Cursor

@coderabbitai

coderabbitai Bot commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Summary by CodeRabbit

  • Updates
    • Updated the OpenShell CLI and gateway to version 0.0.83.
    • Improved container installation by verifying downloaded artifacts with SHA-256 checksums before install.
  • Deployment Verification
    • Refreshed fleet verification messaging around RBAC so the previous commented guidance is treated as historical, not a live expectation.
  • Tests
    • Added unit coverage to ensure the CLI and gateway pin the same OpenShell version.
    • Added a minimum supported version compatibility check for gateway behavior.

Walkthrough

Both OpenShell Dockerfiles now pin version 0.0.83 and verify downloaded archives with SHA256 checksums before installation. New unit tests require matching Dockerfile pins and a gateway version of at least 0.0.72 for Sandbox API auto-detection. The fleet verification message records the re-enabled openshell-rbac.yaml state and directs current RBAC and CRD checks if synchronization fails. The checksum change addresses CWE-494 exposure from unverified executable downloads.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 10 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (10 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the OpenShell version bump and Sandbox v1beta1 support, matching the main change.
Description check ✅ Passed The description is detailed and directly describes the Dockerfile bump, regression test, and comment update.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Sec-02: Secrets In Log Output ✅ Passed PASS: no log/print calls in changed non-test code interpolate token/password/credential/secret; only hit is a SecretStore resource name. CWE-532 not observed.
No Hardcoded Secrets ✅ Passed No CWE-798/CWE-321 hardcoded secrets or credentialed URLs found in changed files; only version pins, hashes, and public release URLs.
No Weak Cryptography ✅ Passed Touched files only use sha256sum to verify GitHub release checksums; no md5/des/rc4/SHA1-for-security, ECB, custom crypto, or secret comparisons found (CWE-327/CWE-208).
No Injection Vectors ✅ Passed No CWE-89/78/79/502 sinks in modified non-test files; changes are Dockerfile downloads/extraction plus a shell comment update.
No Privileged Containers ✅ Passed No added privileged:true/host* or final-stage root; runtime stays 65532/1001. Build-stage USER 0 is install-only, so no CWE-250/CWE-732 finding.
No Pii Or Sensitive Data In Logs ✅ Passed PASS: The diff has no new slog/logr/zap/fmt.Print paths or raw PII/session/request logging; only build pins, comments, and a test. No CWE-532 exposure.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/openshell-gateway-sandbox-v1beta1-support
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch fix/openshell-gateway-sandbox-v1beta1-support

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
scripts/verify-fleet-apps-kartograph.sh (1)

79-81: 🔒 Security & Privacy | 🔵 Trivial

Do not encode authorization state as a static fact.

This message claims the CRD/controller and ArgoCD RBAC escalation are confirmed “as of 2026-07-15,” but the shown branch only prints text. After permission drift, operators may incorrectly conclude that openshell-rbac.yaml should be active and miss the actual authorization failure. Make the check data-driven, or label this as a dated, non-authoritative note linked to the change record.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/verify-fleet-apps-kartograph.sh` around lines 79 - 81, Update the
status message in the verification script so it does not present CRD/controller
or ArgoCD RBAC authorization as a current confirmed fact based only on static
text. Make the output reflect an actual validation result, or clearly label it
as a dated, non-authoritative note referencing the change record.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@deploy/container/openshell-gateway/Dockerfile`:
- Around line 12-14: Replace the mutable ubi9/ubi-minimal:latest base image with
a digest-pinned UBI image in deploy/container/openshell-gateway/Dockerfile lines
12-14 and src/api/Dockerfile line 42. Preserve the existing UBI 9 minimal base
while pinning it to an immutable digest at both sites.
- Line 14: Pin and verify the downloaded OpenShell archive before extraction in
both deploy/container/openshell-gateway/Dockerfile (lines 14-14) and
src/api/Dockerfile (lines 42-42). Add the release checksum or signature as a
build-time verification input, validate each archive immediately after download,
and only run tar extraction after verification succeeds.

---

Nitpick comments:
In `@scripts/verify-fleet-apps-kartograph.sh`:
- Around line 79-81: Update the status message in the verification script so it
does not present CRD/controller or ArgoCD RBAC authorization as a current
confirmed fact based only on static text. Make the output reflect an actual
validation result, or clearly label it as a dated, non-authoritative note
referencing the change record.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 7073b993-df35-4329-b5db-4fd2b7d4edab

📥 Commits

Reviewing files that changed from the base of the PR and between 44db000 and cfb0bd8.

📒 Files selected for processing (4)
  • deploy/container/openshell-gateway/Dockerfile
  • scripts/verify-fleet-apps-kartograph.sh
  • src/api/Dockerfile
  • src/api/tests/unit/extraction/infrastructure/test_openshell_version_pin.py
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • openshift-hyperfleet/architecture (manual)
  • openshift-hyperfleet/hyperfleet-api (manual)
  • openshift-hyperfleet/hyperfleet-sentinel (manual)
  • openshift-hyperfleet/hyperfleet-adapter (manual)
  • openshift-hyperfleet/hyperfleet-broker (manual)

Comment on lines 12 to +14
FROM registry.access.redhat.com/ubi9/ubi-minimal:latest

ARG OPENSHELL_VERSION=0.0.62
ARG OPENSHELL_VERSION=0.0.83

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== Dockerfile refs ==\n'
rg -n --glob 'deploy/container/openshell-gateway/Dockerfile' --glob 'src/api/Dockerfile' '^(FROM|ARG OPENSHELL_VERSION|COPY|RUN)' deploy/container/openshell-gateway/Dockerfile src/api/Dockerfile || true

printf '\n== Context: deploy/container/openshell-gateway/Dockerfile ==\n'
nl -ba deploy/container/openshell-gateway/Dockerfile | sed -n '1,120p'

printf '\n== Context: src/api/Dockerfile ==\n'
nl -ba src/api/Dockerfile | sed -n '1,120p'

Repository: openshift-hyperfleet/kartograph

Length of output: 1903


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== Relevant diff/stat context ==\n'
git diff --stat -- deploy/container/openshell-gateway/Dockerfile src/api/Dockerfile || true

printf '\n== Changed lines around Dockerfiles ==\n'
git diff --unified=20 -- deploy/container/openshell-gateway/Dockerfile src/api/Dockerfile || true

Repository: openshift-hyperfleet/kartograph

Length of output: 243


Pin mutable UBI bases by digest — ubi9/ubi-minimal:latest is a mutable supply-chain input (CWE-829).

  • deploy/container/openshell-gateway/Dockerfile#L12-L14
  • src/api/Dockerfile#L40-L42

Use a digest-pinned UBI image here instead of latest.

📍 Affects 2 files
  • deploy/container/openshell-gateway/Dockerfile#L12-L14 (this comment)
  • src/api/Dockerfile#L42-L42
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@deploy/container/openshell-gateway/Dockerfile` around lines 12 - 14, Replace
the mutable ubi9/ubi-minimal:latest base image with a digest-pinned UBI image in
deploy/container/openshell-gateway/Dockerfile lines 12-14 and src/api/Dockerfile
line 42. Preserve the existing UBI 9 minimal base while pinning it to an
immutable digest at both sites.

Source: Path instructions

FROM registry.access.redhat.com/ubi9/ubi-minimal:latest

ARG OPENSHELL_VERSION=0.0.62
ARG OPENSHELL_VERSION=0.0.83

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n## Relevant Dockerfiles\n'
for f in deploy/container/openshell-gateway/Dockerfile src/api/Dockerfile; do
  echo "--- $f"
  nl -ba "$f" | sed -n '1,220p'
done

printf '\n## Search for checksum/signature/verification mechanisms\n'
rg -n --hidden --no-ignore-vcs -S \
  'sha256|checksum|cosign|cosign|gpg|pgp|sha512|verify|openssl dgst|artifact|release' \
  deploy/container src api .github 2>/dev/null || true

printf '\n## Search for OpenShell references\n'
rg -n --hidden --no-ignore-vcs -S 'openshell|OPENSHELL_VERSION' . 2>/dev/null || true

Repository: openshift-hyperfleet/kartograph

Length of output: 284


🏁 Script executed:

#!/bin/bash
set -euo pipefail

for f in deploy/container/openshell-gateway/Dockerfile src/api/Dockerfile; do
  echo "===== $f ====="
  nl -ba "$f" | sed -n '1,140p'
done

Repository: openshift-hyperfleet/kartograph

Length of output: 267


🏁 Script executed:

#!/bin/bash
set -euo pipefail

for f in deploy/container/openshell-gateway/Dockerfile src/api/Dockerfile; do
  echo "===== $f ====="
  sed -n '1,180p' "$f"
done

printf '\n===== OpenShell verification search =====\n'
rg -n -S 'sha256|checksum|cosign|gpg|pgp|verify|openssl dgst|openshell|OPENSHELL_VERSION' \
  deploy/container src .github 2>/dev/null || true

Repository: openshift-hyperfleet/kartograph

Length of output: 50388


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '===== deploy/container/openshell-gateway/Dockerfile ====='
grep -n -E '^(ARG OPENSHELL_VERSION|RUN |COPY |ADD |ENV |FROM )' deploy/container/openshell-gateway/Dockerfile | sed -n '1,120p'

echo
echo '===== src/api/Dockerfile ====='
grep -n -E '^(ARG OPENSHELL_VERSION|RUN |COPY |ADD |ENV |FROM )' src/api/Dockerfile | sed -n '1,160p'

echo
echo '===== OpenShell verification markers ====='
grep -RIn -E 'sha256|checksum|cosign|gpg|pgp|verify|openssl dgst|OPENSHELL_VERSION|openshell' deploy/container src/api .github 2>/dev/null | sed -n '1,120p'

Repository: openshift-hyperfleet/kartograph

Length of output: 15914


Add checksum or signature verification for both OpenShell archives (CWE-494). deploy/container/openshell-gateway/Dockerfile and src/api/Dockerfile download and extract release tarballs from GitHub without a pinned digest or signature check; verify the payload before tar xzf.

📍 Affects 2 files
  • deploy/container/openshell-gateway/Dockerfile#L14-L14 (this comment)
  • src/api/Dockerfile#L42-L42
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@deploy/container/openshell-gateway/Dockerfile` at line 14, Pin and verify the
downloaded OpenShell archive before extraction in both
deploy/container/openshell-gateway/Dockerfile (lines 14-14) and
src/api/Dockerfile (lines 42-42). Add the release checksum or signature as a
build-time verification input, validate each archive immediately after download,
and only run tar extraction after verification succeeds.

aredenba-rh and others added 3 commits July 15, 2026 15:59
… support

kartograph-stage's Graph Management Assistant was failing to start
sessions: the openshell-gateway sidecar's Kubernetes compute driver
errored on every sandbox list/watch call with a raw "404 page not
found" (not a structured NotFound Status) once the previously-blocking
RBAC issue (openshell-rbac.yaml, fixed via
hybrid-platforms-gitops/infrastructure!76) was resolved.

Root cause: our pinned OpenShell release (v0.0.62) hardcodes the
Kubernetes driver's Sandbox custom resource to
agents.x-k8s.io/v1alpha1 with no fallback. NVIDIA/OpenShell#2009
(first released in v0.0.72) added runtime detection of the served
Sandbox API version, trying v1beta1 before falling back to v1alpha1 -
required because the Agent Sandbox CRD installed on this cluster
serves v1beta1, not v1alpha1. A raw (non-JSON) 404 is exactly the
signature of probing a group/version the API server's router doesn't
recognize at all, which matches this failure precisely.

Bumps both Dockerfiles that vendor the OpenShell binaries (the CLI in
src/api/Dockerfile and the gateway sidecar in
deploy/container/openshell-gateway/Dockerfile) to v0.0.83, the latest
published release, keeping CLI/gateway protocol versions in lockstep.
Adds a regression test enforcing that invariant plus a minimum-version
floor so this can't silently regress.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…it review

Verifies the downloaded openshell/openshell-gateway release archives
against NVIDIA's published sha256 checksums before extraction, so a
compromised or corrupted CDN response fails the build instead of
silently landing in the image. Build-tested locally with podman for
both Dockerfile stages, including a deliberate checksum mismatch to
confirm the build fails closed.

Also softens a verify-fleet-apps-kartograph.sh comment that stated the
openshell-rbac.yaml RBAC/CRD prerequisites as a live authoritative
fact rather than a dated historical note, per review feedback.

Co-authored-by: Cursor <cursoragent@cursor.com>
@aredenba-rh
aredenba-rh force-pushed the fix/openshell-gateway-sandbox-v1beta1-support branch from cfb0bd8 to c4099c3 Compare July 15, 2026 20:00

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@deploy/container/openshell-gateway/Dockerfile`:
- Around line 16-25: Convert the Dockerfile into a multi-stage build: use a
builder stage for installing gzip/tar, downloading and checksum-verifying the
archive, and extracting openshell-gateway; then use a minimal digest-pinned
runtime stage that copies only /usr/local/bin/openshell-gateway from the
builder. Remove build tooling and temporary artifacts from the final image while
preserving the existing OPENSHELL_VERSION-based download and verification flow.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: a2fa5ada-cb4f-4afb-b880-3fe9fab48e0d

📥 Commits

Reviewing files that changed from the base of the PR and between cfb0bd8 and c4099c3.

📒 Files selected for processing (4)
  • deploy/container/openshell-gateway/Dockerfile
  • scripts/verify-fleet-apps-kartograph.sh
  • src/api/Dockerfile
  • src/api/tests/unit/extraction/infrastructure/test_openshell_version_pin.py
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • openshift-hyperfleet/architecture (manual)
  • openshift-hyperfleet/hyperfleet-api (manual)
  • openshift-hyperfleet/hyperfleet-sentinel (manual)
  • openshift-hyperfleet/hyperfleet-adapter (manual)
  • openshift-hyperfleet/hyperfleet-broker (manual)
🚧 Files skipped from review as they are similar to previous changes (2)
  • scripts/verify-fleet-apps-kartograph.sh
  • src/api/tests/unit/extraction/infrastructure/test_openshell_version_pin.py

Comment on lines 16 to 25
RUN microdnf install -y ca-certificates gzip tar \
&& curl -fsSL -o /tmp/openshell-gateway.tgz \
&& curl -fsSL -o /tmp/openshell-gateway-x86_64-unknown-linux-gnu.tar.gz \
"https://github.com/NVIDIA/OpenShell/releases/download/v${OPENSHELL_VERSION}/openshell-gateway-x86_64-unknown-linux-gnu.tar.gz" \
&& tar xzf /tmp/openshell-gateway.tgz -C /usr/local/bin \
&& curl -fsSL -o /tmp/openshell-gateway-checksums-sha256.txt \
"https://github.com/NVIDIA/OpenShell/releases/download/v${OPENSHELL_VERSION}/openshell-gateway-checksums-sha256.txt" \
&& (cd /tmp && grep " openshell-gateway-x86_64-unknown-linux-gnu.tar.gz$" openshell-gateway-checksums-sha256.txt | sha256sum -c -) \
&& tar xzf /tmp/openshell-gateway-x86_64-unknown-linux-gnu.tar.gz -C /usr/local/bin \
&& chmod 755 /usr/local/bin/openshell-gateway \
&& rm -f /tmp/openshell-gateway.tgz \
&& rm -f /tmp/openshell-gateway-x86_64-unknown-linux-gnu.tar.gz /tmp/openshell-gateway-checksums-sha256.txt \
&& microdnf clean all

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift

Move build tooling into a separate stage (CWE-250/CWE-732).

The gateway image installs gzip and tar directly into its only stage, leaving build-time packages in production. Use a builder stage for download, verification, and extraction, then copy only /usr/local/bin/openshell-gateway into a minimal digest-pinned runtime stage.

As per path instructions, container builds must use multi-stage builds to minimize final image size and attack surface.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@deploy/container/openshell-gateway/Dockerfile` around lines 16 - 25, Convert
the Dockerfile into a multi-stage build: use a builder stage for installing
gzip/tar, downloading and checksum-verifying the archive, and extracting
openshell-gateway; then use a minimal digest-pinned runtime stage that copies
only /usr/local/bin/openshell-gateway from the builder. Remove build tooling and
temporary artifacts from the final image while preserving the existing
OPENSHELL_VERSION-based download and verification flow.

Source: Path instructions

@aredenba-rh
aredenba-rh merged commit 4179e64 into main Jul 15, 2026
11 checks passed
@aredenba-rh
aredenba-rh deleted the fix/openshell-gateway-sandbox-v1beta1-support branch July 15, 2026 20:13
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.

1 participant