Skip to content

fix: handle nil auth when pulling unauthenticated images#197

Merged
porridge merged 1 commit into
masterfrom
fix/nil-auth-panic
Jun 10, 2026
Merged

fix: handle nil auth when pulling unauthenticated images#197
porridge merged 1 commit into
masterfrom
fix/nil-auth-panic

Conversation

@porridge

@porridge porridge commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Fix nil pointer panic in internal/main.go:81 when credential providers are configured but no credentials match the image being pulled (e.g. public images).
  • getAuthsForImage intentionally returns a nil AuthConfig entry for unauthenticated pulls, but the logger call in Run() dereferenced it to extract ServerAddress and Username.
  • Extract pullLogger helper that safely builds a logger for pull attempts, omitting auth fields when auth is nil.

Test plan

  • Observed the panic on an OCP cluster when prefetching docker.io/library/busybox with credential provider integration enabled
  • go build ./internal/ compiles cleanly

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 514ae799-d614-4aa6-8acf-4280073ee032

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/nil-auth-panic

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

When no credentials match an image, getAuthsForImage returns a nil
AuthConfig entry to attempt an unauthenticated pull. The logger call
in Run() dereferenced this nil pointer to extract ServerAddress and
Username fields, causing a panic.

Extract pullLogger helper that safely builds a logger for pull attempts,
omitting auth fields when auth is nil.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@porridge porridge force-pushed the fix/nil-auth-panic branch from e92d209 to 6e037e8 Compare June 9, 2026 11:40
@porridge porridge merged commit fe2d4af into master Jun 10, 2026
5 checks passed
@porridge porridge deleted the fix/nil-auth-panic branch June 10, 2026 09:40
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