Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 0 additions & 32 deletions pkg/components/components_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ var (
LOCALCNUDIEREPOPATH_VALID = "./testdata/localcnudierepos/valid-components"
LOCALOCMREPOPATH_VALID = "./testdata/localocmrepos/valid-components"

LOCALCNUDIEREPOPATH_WITHOUT_REPOCTX = "./testdata/localcnudierepos/components-without-repoctx"
LOCALOCMREPOPATH_WITHOUT_REPOCTX = "./testdata/localocmrepos/components-without-repoctx"

LOCALCNUDIEREPOPATH_WITH_INVALID_ACCESS_TYPE = "./testdata/localcnudierepos/components-with-invalid-access-type"
LOCALOCMREPOPATH_WITH_INVALID_ACCESS_TYPE = "./testdata/localocmrepos/components-with-invalid-access-type"

Expand Down Expand Up @@ -67,17 +64,6 @@ var (
"componentName": "example.com/referenced-landscaper-component",
"version": "1.0.0"
}
`

withoutRepoctxComponentReference = `
{
"repositoryContext": {
"type": "local",
"filePath": "./"
},
"componentName": "example.com/landscaper-component-without-repository-context",
"version": "1.0.0"
}
`

withInvalidAccessTypeComponentReference = `
Expand Down Expand Up @@ -290,24 +276,6 @@ var _ = Describe("facade implementation compatibility tests", func() {
Entry("with ocm and v3 descriptors", model.Factory(ocmfactory), LOCALOCMREPOPATH_VALID),
)

// This is due to compatibility
// Theoretically, a component descriptor (and consequently a component version) does not have to have a repository
// context (as per ocm spec)
DescribeTable("error when component descriptor has no repository context", func(factory model.Factory, registryRootPath string) {
cdref := &v1alpha1.ComponentDescriptorReference{}
MustBeSuccessful(runtime.DefaultYAMLEncoding.Unmarshal([]byte(withoutRepoctxComponentReference), cdref))

registryAccess := Must(factory.NewRegistryAccess(ctx, &model.RegistryAccessOptions{
LocalRegistryConfig: &config.LocalRegistryConfiguration{RootPath: registryRootPath},
}))
compvers, err := registryAccess.GetComponentVersion(ctx, cdref)
Expect(err).To(HaveOccurred())
Expect(compvers).To(BeNil())
},
Entry("with ocm and v2 descriptors", model.Factory(ocmfactory), LOCALCNUDIEREPOPATH_WITHOUT_REPOCTX),
Entry("with ocm and v3 descriptors", model.Factory(ocmfactory), LOCALOCMREPOPATH_WITHOUT_REPOCTX),
)

DescribeTable("error when component descriptor has invalid access type", func(factory model.Factory, registryRootPath string) {
cdref := &v1alpha1.ComponentDescriptorReference{}
MustBeSuccessful(runtime.DefaultYAMLEncoding.Unmarshal([]byte(withInvalidAccessTypeComponentReference), cdref))
Expand Down
6 changes: 0 additions & 6 deletions pkg/components/model/componentversion_refs.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package model

import (
"context"
"errors"
"fmt"

"github.com/openmcp-project/landscaper/controller-utils/pkg/logging"
Expand Down Expand Up @@ -75,11 +74,6 @@ func getTransitiveComponentReferencesRecursively(ctx context.Context,
}
cds[cid] = cd

cdRepositoryContext := cd.GetRepositoryContext()
if cdRepositoryContext == nil {
return errors.New("component descriptor must at least contain one repository context with a base url")
}

cdComponentReferences := cd.GetComponentReferences()

for _, compRef := range cdComponentReferences {
Expand Down
6 changes: 0 additions & 6 deletions pkg/components/ocmlib/registryaccess.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@ func (r *RegistryAccess) NewComponentVersion(cv ocm.ComponentVersionAccess) (mod
// Get ocm-lib Component Descriptor
cd := cv.GetDescriptor()

// TODO: Remove this check
// this is only included for compatibility reasons as the legacy ocm spec mandated component descriptors to have a
// repository context
if len(cd.RepositoryContexts) == 0 {
return nil, fmt.Errorf("repository context is required")
}
data, err := compdesc.Encode(cd, compdesc.SchemaVersion(v2.SchemaVersion))
if err != nil {
return nil, err
Expand Down

This file was deleted.

This file was deleted.