Skip to content

fix: Fix image pull policy name parsing#855

Open
Nativu5 wants to merge 1 commit intomasterfrom
bugfix/container_pull
Open

fix: Fix image pull policy name parsing#855
Nativu5 wants to merge 1 commit intomasterfrom
bugfix/container_pull

Conversation

@Nativu5
Copy link
Collaborator

@Nativu5 Nativu5 commented Mar 24, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Image pull policies are now properly validated; invalid policies report errors instead of proceeding silently.
    • Improved image tag detection to more accurately distinguish registry path separators from version tags, preventing misidentification of image versions.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c9fd9a98-e1cf-49c9-9f9e-72c9a9c7cff7

📥 Commits

Reviewing files that changed from the base of the PR and between 40f7532 and a0853c7.

📒 Files selected for processing (1)
  • src/Utilities/CriClient/CriClient.cpp

📝 Walkthrough

Walkthrough

The changes update CriClient.cpp to add validation and canonicalization of pull policies before processing images, implement stricter error handling for invalid policies, and refine image-tag detection logic for improved accuracy in identifying registry/name portions versus tags.

Changes

Cohort / File(s) Summary
Pull Policy Validation
src/Utilities/CriClient/CriClient.cpp
Added internal helper function CanonicalizePullPolicy_ that normalizes pull policy input (trims whitespace, lowercases, converts underscores to hyphens, maps to canonical values). Updated CriClient::PullImage to validate policies and return error for unsupported values. Refined image-tag detection to account for registry path position when distinguishing tags. Minor control-flow restructuring in Never policy branch.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~40 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 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 (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title directly addresses the main change: implementing proper parsing and canonicalization of container image pull policy names with validation logic.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 bugfix/container_pull

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes CRI image pull policy parsing and default-policy selection to avoid silently accepting invalid policies and to better distinguish image tags from registry port separators.

Changes:

  • Add pull policy canonicalization + validation (case/whitespace/_ vs -), and fail fast on invalid values.
  • Improve “versioned tag” detection by ensuring : is treated as a tag separator only when it appears after the last / (so registry:5000/repo doesn’t get misread as tagged).
  • Minor control-flow cleanup in the Never policy branch.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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