Skip to content

fix: make the container image able to run scans again - #418

Merged
jmeridth merged 1 commit into
mainfrom
fix-container-plugin-manifest
Aug 1, 2026
Merged

jmeridth merged 1 commit into
mainfrom
fix-container-plugin-manifest

Conversation

@jmeridth

@jmeridth jmeridth commented Jul 31, 2026 •

Copy link
Copy Markdown
Member

What/Why

The published container image cannot run scans: it ships pvtr and the github-repo plugin binary but no plugins.json manifest, so since privateer began resolving installed plugins from the manifest, pvtr run exits with requested plugin that is not installed: github-repo before writing any results. The entrypoint discarded all output (> /dev/null 2>&1), so the container exited 0 while producing nothing, which surfaces downstream as revanite-io/osps-baseline-action CI failing with "OSPS scanner produced no log file".

Broken downstream runs (started when the action bumped the image from v0.22.0 to v0.27.0):

Changes:

  • Write plugins.json into /.privateer/bin in the Dockerfile (same manifest .github/scripts/ci.sh already creates for the plugin test)
  • Pass an absolute --binaries-path: filepath.Join(".", "github-repo") cleans to a bare name, which exec resolves via $PATH instead of the binaries directory
  • Capture pvtr output instead of discarding it; on crash (exit code > 1) print it to stderr and propagate the exit code. Exit 0/1 (checks passed/failed) still exit 0, preserving current consumer behavior
  • Add an image-smoke-test CI job that builds the image and runs it exactly the way osps-baseline-action does, asserting a log file is written. The existing plugin test exercises the raw binaries with a hand-built manifest, which is how the broken image shipped unnoticed

Proof it works

Built the image locally (--build-arg PLATFORM=Linux_arm64) and ran it with a mounted config and results directory against this repo:

  • Before the --binaries-path fix, the entrypoint surfaced exec: "github-repo": executable file not found in $PATH (previously hidden by /dev/null)
  • After: scan completes, evaluation_results/pvtr/pvtr.log and pvtr.yaml are written to the host mount, log contents printed, exit 0 (17 Passed, 0 Warnings, 0 Failed)
  • Crash path: config requesting a nonexistent plugin prints requested plugin that is not installed to stderr and the container exits with pvtr's exit code
  • The new image-smoke-test job repeats the happy-path verification in CI on x86_64

Risk + AI role

Low -- touches only the container packaging, entrypoint, and CI; no plugin or evaluation logic. Diagnosed and written with AI assistance, manually verified end to end.

Review focus

  • Whether exit 0 on "some checks failed" (exit 1) is the contract we want for the container going forward
  • The smoke test scans this repo with the workflow's GITHUB_TOKEN; confirm that token's rate limits/permissions are acceptable for every CI run

The image ships pvtr and the github-repo plugin binary but no
plugins.json manifest. Since privateer began resolving installed
plugins from the manifest, 'pvtr run' inside the container exits
with 'requested plugin that is not installed: github-repo' before
writing any results. The entrypoint discarded all output, so the
container appeared to succeed while producing nothing.

- Write plugins.json into /.privateer/bin in the Dockerfile,
  matching the manifest .github/scripts/ci.sh already creates
- Pass an absolute --binaries-path: filepath.Join('.', 'github-repo')
  cleans to a bare name, which exec resolves via PATH instead of the
  binaries directory
- Capture pvtr output instead of discarding it, surface it on stderr
  and propagate the exit code when the run crashes (exit > 1)
- Add a CI smoke test that builds the image and runs it the same way
  osps-baseline-action does, asserting a log file is written; the
  existing plugin test exercises the raw binaries only, which is how
  the broken image shipped unnoticed

Signed-off-by: jmeridth <jmeridth@gmail.com>
@jmeridth jmeridth self-assigned this Jul 31, 2026
@github-actions github-actions Bot added the fix label Jul 31, 2026
@jmeridth
jmeridth marked this pull request as ready for review July 31, 2026 21:37
@jmeridth
jmeridth requested a review from a team as a code owner July 31, 2026 21:37
@jmeridth
jmeridth requested a review from eddie-knight July 31, 2026 22:26
@jmeridth
jmeridth enabled auto-merge (squash) July 31, 2026 22:27
@jmeridth
jmeridth merged commit e8ce517 into main Aug 1, 2026
18 checks passed
@jmeridth
jmeridth deleted the fix-container-plugin-manifest branch August 1, 2026 02:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants