Skip to content

Commit

Permalink
Avoid effective repository context of component descriptor (run-int-t…
Browse files Browse the repository at this point in the history
…ests)
  • Loading branch information
robertgraeff committed Jun 20, 2024
1 parent f274b51 commit 95eb8dd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
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/gardener/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
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,9 @@ var _ = Describe("SubInstallation", func() {
Expect(subinsts[0].Spec.ComponentDescriptor.Reference.ComponentName).To(Equal("example.com/root"))
Expect(subinsts[0].Spec.ComponentDescriptor.Reference.Version).To(Equal("1.0.0"))

Expect(subinsts[0].Spec.ComponentDescriptor.Reference.RepositoryContext.Object["baseUrl"]).To(Equal("./testdata/registry"))
Expect(subinsts[0].Spec.ComponentDescriptor.Reference.RepositoryContext.Object["type"]).To(Equal("ociRegistry"))
// expecting the same repository context as in the root installation
Expect(subinsts[0].Spec.ComponentDescriptor.Reference.RepositoryContext.Object["baseUrl"]).To(Equal("../testdata/registry"))
Expect(subinsts[0].Spec.ComponentDescriptor.Reference.RepositoryContext.Object["type"]).To(Equal("local"))

Expect(subinsts[0].Spec.Blueprint.Reference.ResourceName).To(Equal("def-1"))

Expand Down
4 changes: 1 addition & 3 deletions pkg/landscaper/registry/components/cdutils/uri.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,11 @@ func (u *URI) Get(cd model.ComponentVersion, repositoryContext *types.Unstructur
func (u *URI) GetComponent(cd model.ComponentVersion, repositoryContext *types.UnstructuredTypedObject,
overwriter componentoverwrites.Overwriter) (model.ComponentVersion, *lsv1alpha1.ComponentDescriptorReference, error) {

cdRepositoryContext := cd.GetRepositoryContext()

var (
ctx = context.Background()
component = cd
cdRef = &lsv1alpha1.ComponentDescriptorReference{
RepositoryContext: cdRepositoryContext,
RepositoryContext: repositoryContext,
ComponentName: cd.GetName(),
Version: cd.GetVersion(),
}
Expand Down

0 comments on commit 95eb8dd

Please sign in to comment.