-
Notifications
You must be signed in to change notification settings - Fork 0
fix: strip any sub-paths for registries in ocmconfig #424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
olzemal
wants to merge
1
commit into
main
Choose a base branch
from
fix/handle-ocm-repository-with-path
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Preserve
host:portwhen stripping the repo sub-path.cut -d : -f 1changes the registry identity, not just the path. That will break credential matching for registries exposed on an explicit port (for exampledst.zot:443, which is already used elsewhere). This change should strip only the/reposuffix and keep any port intact.Suggested fix
Also applies to: 208-208
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@trevex do you remember why we split on
:. Was it for repo:tag (does the srcRemoteURL have a tag?) or host:port?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@olzemal— looking at howsrcRemoteURLis used elsewhere in the template, it appears the split on:was for host:port, not repo:tag. The tag portion (:specVersion) is appended separately via the constructedcomponent_url:component_url={{workflow.parameters.srcRemoteURL}}/{{workflow.parameters.specRepo}}//{{workflow.parameters.specComponent}}:{{workflow.parameters.specVersion}}So
srcRemoteURLitself is expected to be something likeregistry.example.com,registry.example.com:443, or (after this PR)registry.example.com/my-repo— no tag component.That's exactly why my original comment flagged the concern: the
cut -d : -f 1in the original code, and retained in this PR aftercut -d / -f 1, strips the port (e.g.dst.zot:443→dst.zot). If OCM does need the fullhost:portfor credential matching on non-standard ports, that would be a problem. If OCM only ever matches on the bare hostname, then stripping the port is intentional and correct — worth confirming against the OCM documentation.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly not sure...
It was most likely due to port but might be because of ocm CLI quirkiness, so if it still works with explicit port we should include the port.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.