Skip to content

feat: configurable preference for relative access creation for uploader#1412

Merged
jakobmoellerdev merged 5 commits into
open-component-model:mainfrom
mandelsoft:relative
Sep 4, 2025
Merged

feat: configurable preference for relative access creation for uploader#1412
jakobmoellerdev merged 5 commits into
open-component-model:mainfrom
mandelsoft:relative

Conversation

@mandelsoft
Copy link
Copy Markdown
Contributor

@mandelsoft mandelsoft commented Apr 9, 2025

What this PR does / why we need it

By default the OCI uploader used to handle the implicit OCI uploads for OCI based OCM repositories
creates an absolute access method.

A new global attribute preferrelativeaccess (bool) can be used now to switch this behavior
to prefer a relative access method.

With the new config object local.oci.uploader.config.ocm.software it is possible to configure
host/port combinations for which the relative access should be preferred. (For example localhost).

type: local.oci.uploader.config.ocm.software
preferRelativeAccess: true
repositories:
- localhost
- other:5000

Which issue(s) this PR fixes

Fixes #1410

@mandelsoft mandelsoft requested a review from a team as a code owner April 9, 2025 11:10
@github-actions github-actions Bot added area/documentation Documentation related kind/feature new feature, enhancement, improvement, extension size/l Large labels Apr 9, 2025
- use relative access methods for OCI upload to
  local OCM repository
- make preference configurable for repos
Copy link
Copy Markdown
Member

@jakobmoellerdev jakobmoellerdev left a comment

Choose a reason for hiding this comment

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

In general, relativeOciAccesses are not nicely specified and theyre already not part of the spec anymore. Nevertheless I recognize the value this gives for local debugging.

For me this PR is acceptable, but only if we mark the type as experimental somehow. I think relativeOciAccesses should be avoided because most tools will only know how to deal with ociArtifact / ociImage. Introducing yet another type that is only resolvable if a context is known is very dangerous.

Comment thread api/config/utils.go Outdated
Comment thread api/oci/internal/repotypes.go Outdated
Comment thread api/ocm/extensions/attrs/preferrelativeattr/attr.go Outdated
Comment thread docs/reference/ocm_configfile.md Outdated
@github-actions
Copy link
Copy Markdown
Contributor

This pull request was marked as stale because it has not had recent activity.

@github-actions github-actions Bot added the lifecycle/stale Nobody worked on this for 6 months (will further age) label Jul 31, 2025
@Skarlso Skarlso removed the lifecycle/stale Nobody worked on this for 6 months (will further age) label Sep 4, 2025
Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
@Skarlso
Copy link
Copy Markdown
Contributor

Skarlso commented Sep 4, 2025

Added an experimental warning.

Skarlso and others added 2 commits September 4, 2025 14:34
Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

On-behalf-of: gergely.brautigam@sap.com
@jakobmoellerdev jakobmoellerdev enabled auto-merge (squash) September 4, 2025 13:05
@jakobmoellerdev jakobmoellerdev merged commit 392cf27 into open-component-model:main Sep 4, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/documentation Documentation related kind/feature new feature, enhancement, improvement, extension size/l Large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

relative accesses: using absolute access types for transferred-by-value artifacts is problematic

3 participants