Skip to content
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

introduce mapocirepoattr to control OCI artifact upload #396

Merged
merged 3 commits into from
Jun 29, 2023

Conversation

mandelsoft
Copy link
Contributor

What this PR does / why we need it:

When transferring an OCM component version into an OCI registry based OCM repository, by default, an OCI artifact
uploader is used to publish OCI artifacts stored as local blobs to the same OCI registry. Here, the repository hint is
used to calculate an OCI repository name for the uploaded OCI artifact based on the repository path of the OCM repository.

This results in in potentially very long names, Artifactory has problems with this, therefore we need a possibility to abbreviate
those generated names.

This PR provide a new context attribute to control the upload behaviour. It is possible now to abbreviate the repository hing
by a hashed version all but the last name segaments. It is possible to chose between three modes:

  • simple hash (might still be too long)
  • short hash (like for Git, with the first 8 characters of the hash)
  • prefix mapping. use to map hint prefixes to possibly shorter names.

This attribute can be set with the -X options, or the attribute configuration feature for .ocmconfig.
The attribute name/short name is

	ATTR_KEY   = "github.com/mandelsoft/ocm/mapocirepo"
	ATTR_SHORT = "mapocirepo"

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Release Notes:

Copy link
Contributor

@morri-son morri-son left a comment

Choose a reason for hiding this comment

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

tested successfully.

@morri-son morri-son self-requested a review June 29, 2023 13:29
@morri-son morri-son merged commit 953ab7b into open-component-model:main Jun 29, 2023
robertwol pushed a commit that referenced this pull request Sep 25, 2023
* mapocirepoattr to control OCI artifact upload

* Correct Typo

---------

Co-authored-by: Gerald Morrison <67469729+morri-son@users.noreply.github.com>
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