Skip to content

add bundle relatedimage image pullspec validation - #475

Merged
openshift-merge-bot[bot] merged 1 commit into
operator-framework:masterfrom
grokspawn:related-image-format-test
Feb 18, 2026
Merged

add bundle relatedimage image pullspec validation#475
openshift-merge-bot[bot] merged 1 commit into
operator-framework:masterfrom
grokspawn:related-image-format-test

Conversation

@grokspawn

Copy link
Copy Markdown
Contributor

No description provided.

@codecov

codecovBot commented Feb 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.50000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 38.04%. Comparing base (884ff95) to head (0aefd13).
⚠️ Report is 2 commits behind head on master.

Files with missing linesPatch %Lines
pkg/validation/internal/bundle.go87.50%1 Missing and 1 partial ⚠️
Additional details and impacted files
@@ Coverage Diff @@## master #475 +/- ##
==========================================
+ Coverage 37.86% 38.04% +0.17% 
==========================================
Files 57 57 Lines 4563 4579 +16 ==========================================
+ Hits 1728 1742 +14 - Misses 2678 2679 +1 - Partials 157 158 +1 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR adds validation for related image pullspecs in operator bundles to ensure they conform to valid container image reference formats. The validation leverages the github.com/distribution/reference library to parse and validate image references according to Docker distribution standards.

Changes:

  • Added validateRelatedImages function to validate all relatedImages[].image fields in bundle CSVs
  • Added comprehensive unit tests covering valid and invalid image formats
  • Added github.com/distribution/reference dependency for image reference parsing

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

FileDescription
pkg/validation/internal/bundle.goImplements validateRelatedImages function using distribution/reference library to validate image pullspecs; integrates validation into the main validateBundle function
pkg/validation/internal/bundle_test.goAdds comprehensive test coverage for validateRelatedImages including empty images, valid formats (tags/digests), and various invalid formats (spaces, uppercase, special characters)
go.modAdds github.com/distribution/reference v0.6.0 as a new direct dependency and github.com/opencontainers/go-digest v1.0.0 as an indirect dependency
go.sumUpdates checksums for the new dependencies

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

@openshift-ciopenshift-ciBot added the lgtm Indicates that a PR is ready to be merged. label Feb 17, 2026
@acornett21

Copy link
Copy Markdown
Contributor

I've approved this PR, since it works for my use case being called as a dependency as shown in the linked pr. I'll roll this out as soon as this is merged/released. Thanks for working on this.

Signed-off-by: grokspawn <jordan@nimblewidget.com>
@grokspawn
grokspawnforce-pushed the related-image-format-test branch from 2d67dd0 to 0aefd13CompareFebruary 17, 2026 23:20
@openshift-ciopenshift-ciBot removed the lgtm Indicates that a PR is ready to be merged. label Feb 17, 2026
@grokspawn

Copy link
Copy Markdown
ContributorAuthor

Hey @acornett21 could I beg another LGTM? I shifted this to using the container-libs/image/v5/docker/reference, which is just the set of libs common to most of OLM and a wrapper to what we were calling before.

@rashmigottipatirashmigottipati 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.

/lgtm

@openshift-ciopenshift-ciBot added the lgtm Indicates that a PR is ready to be merged. label Feb 17, 2026
@grokspawn

Copy link
Copy Markdown
ContributorAuthor

/approve

@openshift-ci

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: acornett21, grokspawn, rashmigottipati

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ciopenshift-ciBot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 18, 2026
@openshift-merge-bot
openshift-merge-botBot merged commit 63554ab into operator-framework:masterFeb 18, 2026
8 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approvedIndicates a PR has been approved by an approver from all required OWNERS files.lgtmIndicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@grokspawn@acornett21@rashmigottipati