Skip to content

Create ocm download resource command #551

@jakobmoellerdev

Description

@jakobmoellerdev

Description

As a user wanting to make use of resources packaged within OCM, I want to use the ocm download resource command to fetch them and interact with them outside of OCM.

The command downloads a specific resource from a component version located in an OCM-compliant repository (local or remote).

Scope:

  • Selects a component version: You specify a component version (e.g., ghcr.io/org/component:v1) as a positional argument. This reference is resolved using the plugin and credential systems to locate the component in a repository.
  • Identifies the desired resource: You must pass --identity name=example to uniquely identify which resource to download from the component's list of resources.
    • Downloads the resource: If the resource has local access, it's downloaded directly.
    • If it's remote, the appropriate plugin is used along with any needed credentials to download it.
  • Writes the resource to disk:
  • If --output is specified, the file is saved there.
  • If not, it attempts to generate a filename based on the identity and the media type (e.g., adding .tar.gz if applicable).

(Optional) Supports transforming the resource:

If --transformer is specified, the command would ideally use a plugin-based transformation before writing the output (not yet implemented — marked as TODO until we have the transformer contract implemented).

Out of Scope:
--check-verified, --verified, --verify (until we have Signing and Verification implemented in #446)
-c, --constraints, --latest version constraint (we restrict to one component version reference)
-d, --download-handlers, --downloader (replaced by transformer)
-x, --executable (out-scoped due to lack of demand)
--lookup stringArray (replaced by resolver concept)
-O, --outfile string output file or directory
-r, --recursive (no recursion needed for this command)
--repo string (replaced by component reference)
-t, --type stringArray (replaced by identity filter)

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