Skip to content

Commit

Permalink
feat: fix appending repositroy name that is no longer needed (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
Skarlso authored Jul 12, 2023
1 parent 4792a9c commit 89cdaff
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 10 deletions.
5 changes: 1 addition & 4 deletions shared/oci.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ type ComponentModification func(compvers ocm.ComponentVersionAccess) error

// AddComponentVersionToRepository takes a component description and optional resources. Then pushes that component
// into the locally forwarded registry.
func AddComponentVersionToRepository(component Component, repository, scheme string, componentModifications ...ComponentModification) error {
func AddComponentVersionToRepository(component Component, scheme string, componentModifications ...ComponentModification) error {
u, err := url.Parse("https://127.0.0.1:5000")
if err != nil {
return fmt.Errorf("failed to parse base url: %w", err)
Expand All @@ -122,9 +122,6 @@ func AddComponentVersionToRepository(component Component, repository, scheme str
return fmt.Errorf("failed to reparse base url: %w", err)
}

// join up with the repository.
u = u.JoinPath(repository)

baseURL := u.String()
octx := ocm.FromContext(context.Background())

Expand Down
3 changes: 1 addition & 2 deletions shared/steps/setup/add_component_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
// Component contains information about a component to add.
type Component struct {
Component shared.Component
Repository string
Scheme string
ComponentVersionModifications []shared.ComponentModification
}
Expand All @@ -32,7 +31,7 @@ func AddComponentVersions(components ...Component) features.Func {
if c.Scheme != "" {
scheme = c.Scheme
}
if err := shared.AddComponentVersionToRepository(c.Component, c.Repository, scheme, c.ComponentVersionModifications...); err != nil {
if err := shared.AddComponentVersionToRepository(c.Component, scheme, c.ComponentVersionModifications...); err != nil {
t.Fatal(err)
}
}
Expand Down
1 change: 0 additions & 1 deletion test/componentversion/component_version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ func TestComponentVersionApply(t *testing.T) {
Name: "github.com/acme/podinfo",
Version: "v6.0.0",
},
Repository: "ocm-podinfo",
})).
Setup(setup.ApplyTestData(namespace, "testdata", "*")).
Assess("check if resource was created", assess.ResourceWasCreated(assess.Object{
Expand Down
2 changes: 0 additions & 2 deletions test/gitsync/sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ func TestSyncApply(t *testing.T) {
Name: "github.com/acme/podinfo",
Version: "v6.0.0",
},
Repository: "podinfo",
ComponentVersionModifications: []shared.ComponentModification{
shared.BlobResource(shared.Resource{
Name: "deployment",
Expand Down Expand Up @@ -189,7 +188,6 @@ func TestSyncApplyWithPullRequest(t *testing.T) {
Name: "github.com/acme/podinfo",
Version: "v6.0.0",
},
Repository: "podinfo",
ComponentVersionModifications: []shared.ComponentModification{
shared.BlobResource(shared.Resource{
Name: "deployment",
Expand Down
1 change: 0 additions & 1 deletion test/subscription/subscription_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ func TestComponentSubscribeApply(t *testing.T) {
Name: "github.com/acme/podinfo",
Version: "v1.0.0",
},
Repository: "ocm-replication",
})).
Setup(setup.ApplyTestData(namespace, "testdata", "*")).
Assess("check if resource was created",
Expand Down

0 comments on commit 89cdaff

Please sign in to comment.