Skip to content

feat: oci artifact cli#1684

Merged
matthiasbruns merged 60 commits into
open-component-model:mainfrom
matthiasbruns:feat/796_oci_artifact_transform_oci_bindings
Feb 13, 2026
Merged

feat: oci artifact cli#1684
matthiasbruns merged 60 commits into
open-component-model:mainfrom
matthiasbruns:feat/796_oci_artifact_transform_oci_bindings

Conversation

@matthiasbruns

@matthiasbruns matthiasbruns commented Jan 30, 2026

Copy link
Copy Markdown
Contributor

What this PR does / why we need it

This PR ties all the changes related to open-component-model/ocm-project#796 together in the cli package and implement oci transfer with tests.
It also adds two new flags, which were taken from old ocm https://ocm.software/docs/reference/ocm-cli/transfer/componentversions/

  • FlagCopyResources = "copy-resources"

in addition, I've added an integration test, that:

  • creates two oci registries
  • uploads one artifact to the first registry
  • creates a cv pointing to the artifact
  • calls:
transferCMD.SetArgs([]string{
		"transfer",
		"component-version",
		sourceRef,
		targetRef,
		"--config", cfgPath,
		"--copy-resources", // required, otherwise we wouldn't transfer oci artifacts
	})
  • verifies, that the oci artifact is in the 2nd registry

Which issue(s) this PR fixes

Contributes: open-component-model/ocm-project#796

Split PRs:

@github-actions github-actions Bot added kind/feature new feature, enhancement, improvement, extension size/l Large labels Jan 30, 2026
@matthiasbruns matthiasbruns marked this pull request as ready for review January 30, 2026 11:58
@matthiasbruns matthiasbruns requested a review from a team as a code owner January 30, 2026 11:58
Comment thread bindings/go/oci/spec/transformation/v1alpha1/ctf_add_oci_artifact.go Outdated
Comment thread bindings/go/oci/spec/transformation/v1alpha1/ctf_add_oci_artifact.go Outdated
@matthiasbruns matthiasbruns force-pushed the feat/796_oci_artifact_transform_oci_bindings branch 4 times, most recently from 2d37161 to 5c78ef7 Compare February 3, 2026 07:38
@github-actions github-actions Bot added component/github-actions Changes on GitHub Actions or within `.github/` directory area/documentation Documentation related labels Feb 3, 2026
@matthiasbruns matthiasbruns force-pushed the feat/796_oci_artifact_transform_oci_bindings branch 3 times, most recently from d221d85 to cfb7597 Compare February 3, 2026 07:48
Comment thread bindings/go/oci/spec/transformation/v1alpha1/oci_get_oci_artifact.go Outdated
Comment thread bindings/go/oci/transformer/get_oci_artifact.go Outdated
Comment thread bindings/go/oci/transformer/get_oci_artifact.go
Comment thread bindings/go/oci/spec/transformation/v1alpha1/oci_get_oci_artifact.go Outdated
Comment thread bindings/go/oci/transformer/get_oci_artifact_test.go Outdated
Comment thread bindings/go/oci/transformer/get_oci_artifact_test.go
Comment thread bindings/go/oci/transformer/get_oci_artifact_test.go Outdated
Comment thread bindings/go/oci/spec/transformation/v1alpha1/get_oci_artifact.go Outdated
Comment thread bindings/go/oci/transformer/get_oci_artifact.go
@matthiasbruns matthiasbruns force-pushed the feat/796_oci_artifact_transform_oci_bindings branch from 80c8e7f to 4f1169f Compare February 3, 2026 10:45
fabianburth
fabianburth previously approved these changes Feb 3, 2026
@matthiasbruns matthiasbruns force-pushed the feat/796_oci_artifact_transform_oci_bindings branch from 4f1169f to 06cc998 Compare February 3, 2026 10:46
fabianburth
fabianburth previously approved these changes Feb 3, 2026

@jakobmoellerdev jakobmoellerdev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

generally LGTM, nice stuff. just minor questions and clarifications for testing and usage

Comment thread bindings/go/oci/spec/transformation/v1alpha1/get_oci_artifact.go Outdated
Comment thread bindings/go/oci/spec/transformation/v1alpha1/get_oci_artifact.go
Comment thread bindings/go/oci/transformer/get_oci_artifact.go Outdated
Comment thread bindings/go/oci/transformer/get_oci_artifact.go Outdated
Comment thread bindings/go/oci/transformer/get_oci_artifact.go Outdated
Comment thread bindings/go/oci/transformer/get_oci_artifact.go Outdated
@matthiasbruns matthiasbruns force-pushed the feat/796_oci_artifact_transform_oci_bindings branch 2 times, most recently from d099a74 to 1736fee Compare February 3, 2026 15:50
matthiasbruns and others added 16 commits February 13, 2026 14:20
On-behalf-of: SAP <matthias.bruns@sap.com>
Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
Signed-off-by: Matthias Bruns <github@matthiasbruns.com>
Signed-off-by: Fabian Burth <fabian.burth@sap.com>
Signed-off-by: Fabian Burth <fabian.burth@sap.com>
Signed-off-by: Fabian Burth <fabian.burth@sap.com>
Signed-off-by: Fabian Burth <fabian.burth@sap.com>
Signed-off-by: Fabian Burth <fabian.burth@sap.com>
On-behalf-of: SAP <matthias.bruns@sap.com>
Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
On-behalf-of: SAP <matthias.bruns@sap.com>
Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
On-behalf-of: SAP <matthias.bruns@sap.com>
Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
On-behalf-of: SAP <matthias.bruns@sap.com>
Signed-off-by: Matthias Bruns <git@matthiasbruns.com>

# Conflicts:
#	cli/go.mod
#	cli/go.sum
#	cli/integration/go.mod
#	cli/integration/go.sum
On-behalf-of: SAP <matthias.bruns@sap.com>
Signed-off-by: Matthias Bruns <git@matthiasbruns.com>

# Conflicts:
#	cli/go.mod
#	cli/go.sum
#	cli/integration/go.sum
On-behalf-of: SAP <matthias.bruns@sap.com>
Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
On-behalf-of: SAP <matthias.bruns@sap.com>
Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
On-behalf-of: SAP <matthias.bruns@sap.com>
Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
On-behalf-of: SAP <matthias.bruns@sap.com>
Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
@matthiasbruns matthiasbruns force-pushed the feat/796_oci_artifact_transform_oci_bindings branch from 59a2a43 to 6e28caf Compare February 13, 2026 13:22
Comment thread cli/cmd/transfer/component-version/internal/discovery.go
Comment thread cli/cmd/transfer/component-version/internal/discovery.go
@matthiasbruns matthiasbruns merged commit 84c98cf into open-component-model:main Feb 13, 2026
22 checks passed
@matthiasbruns matthiasbruns deleted the feat/796_oci_artifact_transform_oci_bindings branch February 13, 2026 15:18
matthiasbruns added a commit that referenced this pull request Feb 13, 2026
#### What this PR does / why we need it
This PR is the result of a discussion on another PR
#1684 (comment)

We want a reusable `IsLocalBlob` helper that is currently being
rewritten multiple times.

#### Which issue(s) this PR fixes
Contributes:
open-component-model/ocm-project#875

Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
morri-son pushed a commit to morri-son/open-component-model that referenced this pull request Feb 16, 2026
<!-- markdownlint-disable MD041 -->
#### What this PR does / why we need it
This PR ties all the changes related to
open-component-model/ocm-project#796 together
in the cli package and implement oci transfer with tests.
It also adds two new flags, which were taken from old ocm
https://ocm.software/docs/reference/ocm-cli/transfer/componentversions/

- `FlagCopyResources      = "copy-resources"`

in addition, I've added an integration test, that:
- creates two oci registries
- uploads one artifact to the first registry
- creates a cv pointing to the artifact
- calls:

```go
transferCMD.SetArgs([]string{
		"transfer",
		"component-version",
		sourceRef,
		targetRef,
		"--config", cfgPath,
		"--copy-resources", // required, otherwise we wouldn't transfer oci artifacts
	})
```
- verifies, that the oci artifact is in the 2nd registry

#### Which issue(s) this PR fixes
Contributes:
open-component-model/ocm-project#796

Split PRs:
- open-component-model#1730
- open-component-model#1751
- open-component-model#1736
- open-component-model#1727
- open-component-model#1718
- open-component-model#1717

---------

Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
Signed-off-by: Matthias Bruns <github@matthiasbruns.com>
Signed-off-by: Fabian Burth <fabian.burth@sap.com>
Co-authored-by: Fabian Burth <fabian.burth@sap.com>
morri-son pushed a commit to morri-son/open-component-model that referenced this pull request Feb 16, 2026
…ent-model#1772)

#### What this PR does / why we need it
This PR is the result of a discussion on another PR
open-component-model#1684 (comment)

We want a reusable `IsLocalBlob` helper that is currently being
rewritten multiple times.

#### Which issue(s) this PR fixes
Contributes:
open-component-model/ocm-project#875

Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
morri-son pushed a commit to morri-son/open-component-model that referenced this pull request Feb 18, 2026
…l#1751)

<!-- markdownlint-disable MD041 -->
#### What this PR does / why we need it
Required plugin contract update for Resources to be able to upload
resources.
It also implements `repository.ResourceRepository` in
`ResourceRegistry`.
Additionally, the tests used a deprecated blob construction and was
updated to use the new prefered way

old:
`blob.NewDirectReadOnlyBlob`
new:
`inmemory.New`

Part of
open-component-model#1684

This PR aligns the plugin resource contract with the updated
`repository.ResourceRepository`

```go
// Repository defines the interface for storing and retrieving OCM resources
// independently of component versions from a Store Implementation
type Repository interface {
	// GetResourceCredentialConsumerIdentity resolves the identity of the given [descriptor.Resource] to use for credential resolution.
	GetResourceCredentialConsumerIdentity(ctx context.Context, resource *descriptor.Resource) (runtime.Identity, error)
	// UploadResource uploads a [descriptor.Resource] to the repository.
	// Returns the updated resource with repository-specific information.
	// The resource must be referenced in the component descriptor.
	// The credentials map must contain necessary authentication information to access the resource.
	UploadResource(ctx context.Context, res *descriptor.Resource, content blob.ReadOnlyBlob, credentials map[string]string) (*descriptor.Resource, error)
	// DownloadResource downloads and verifies the integrity of a [descriptor.Resource] from the repository.
	DownloadResource(ctx context.Context, res *descriptor.Resource, credentials map[string]string) (blob.ReadOnlyBlob, error)
}
```

#### Which issue(s) this PR fixes
Contributes:
open-component-model/ocm-project#796

---------

Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
Signed-off-by: Matthias Bruns <github@matthiasbruns.com>
Co-authored-by: Fabian Burth <fabian.burth@sap.com>
Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
morri-son pushed a commit to morri-son/open-component-model that referenced this pull request Feb 18, 2026
<!-- markdownlint-disable MD041 -->
#### What this PR does / why we need it
This PR ties all the changes related to
open-component-model/ocm-project#796 together
in the cli package and implement oci transfer with tests.
It also adds two new flags, which were taken from old ocm
https://ocm.software/docs/reference/ocm-cli/transfer/componentversions/

- `FlagCopyResources      = "copy-resources"`

in addition, I've added an integration test, that:
- creates two oci registries
- uploads one artifact to the first registry
- creates a cv pointing to the artifact
- calls:

```go
transferCMD.SetArgs([]string{
		"transfer",
		"component-version",
		sourceRef,
		targetRef,
		"--config", cfgPath,
		"--copy-resources", // required, otherwise we wouldn't transfer oci artifacts
	})
```
- verifies, that the oci artifact is in the 2nd registry

#### Which issue(s) this PR fixes
Contributes:
open-component-model/ocm-project#796

Split PRs:
- open-component-model#1730
- open-component-model#1751
- open-component-model#1736
- open-component-model#1727
- open-component-model#1718
- open-component-model#1717

---------

Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
Signed-off-by: Matthias Bruns <github@matthiasbruns.com>
Signed-off-by: Fabian Burth <fabian.burth@sap.com>
Co-authored-by: Fabian Burth <fabian.burth@sap.com>
Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
morri-son pushed a commit to morri-son/open-component-model that referenced this pull request Feb 18, 2026
…ent-model#1772)

#### What this PR does / why we need it
This PR is the result of a discussion on another PR
open-component-model#1684 (comment)

We want a reusable `IsLocalBlob` helper that is currently being
rewritten multiple times.

#### Which issue(s) this PR fixes
Contributes:
open-component-model/ocm-project#875

Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/documentation Documentation related component/github-actions Changes on GitHub Actions or within `.github/` directory kind/feature new feature, enhancement, improvement, extension size/l Large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants