Skip to content

Support Component Reference Strings #477

@jakobmoellerdev

Description

@jakobmoellerdev

Description

When we want to get component a component there is the possibility in old OCM to support reference strings. Reference strings are having a lot of cases that are supported in base OCM so we need to limit support to a restricted set of use cases in the beginning!

Thus we should probably adopt something that can only limit parsing to the following:

// Parse parses an input string into a Ref.
// Accepted inputs are of the forms
//
//   - [ctf::][<file path>/[<DefaultPrefix>]/<component id>[:<version>]
//   - [oci::][<registry>/<repository>/[<DefaultPrefix>]/<component id>[:<version>]
//
// Not accepted cases that were valid in old OCM:
//
//   - [type::][<repositorySpecJSON>/[<DefaultPrefix>]/<component id>[:<version>] - arbitrary repository definitions
//   - [oci::][<registry>/<repository>/[<DefaultPrefix>]/<component id>[:<version>][@<digest>] - pinned component versions
//   - <repositoryAlias>//[<DefaultPrefix>]/<component id>[:<version>] - repository aliases for the ocm configuration
//   - localhost[:<port>]/[<DefaultPrefix>]/<component id>[:<version>] - localhost special cases
//
// All non-supported special cases are currently under review of being accepted forms.

Old Reference Parsing code can be checked here: https://github.com/open-component-model/ocm/blob/2ea69c7ecca1e8be7e9d9f94dfdcac6090f1c69d/api/oci/ref_test.go

Done Criteria

  • ...
  • Code has been reviewed by other team members
  • Analysis of existing tests (Unit and Integration)
  • Unit Tests created for new code or existing Unit Tests updated
  • Integration Test Suite updated (includes deletion of existing unnecessary Integration Test and/or creation of new ones if required)
  • Enduser Documentation updated (if applicable)
  • Internal technical Documentation created/updated (if applicable)
  • Successful demonstration in Review

Metadata

Metadata

Labels

area/ipceiImportant Project of Common European Interestkind/tasksmall task, normally part of feature or epic

Type

No fields configured for Task.

Projects

Status
🍺 Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions