Skip to content
Merged
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
7 changes: 1 addition & 6 deletions pkg/task/generictaskhandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,12 +253,7 @@ func (th *genericTaskHandler) applySubpackageTask(
return pkgerrors.New("for subpackage tasks, the task list must contain exactly 2 tasks, the source task followed by the subpackage task")
}

var repo configapi.Repository
if err := th.referenceResolver.ResolveReference(ctx, draft.Key().RKey().K8SNS(), draft.Key().RKey().K8SName(), &repo); err != nil {
return pkgerrors.Wrapf(err, "cannot find repository for draft PR %+v", draft.Key())
}

mut, err := th.mapTaskToMutation(obj, &obj.Spec.Tasks[1], repo.Spec.Deployment, nil)
mut, err := th.mapTaskToMutation(obj, &obj.Spec.Tasks[1], false, nil)
Comment thread
liamfallon marked this conversation as resolved.
if err != nil {
return err
}
Expand Down
23 changes: 0 additions & 23 deletions pkg/task/generictaskhandler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -864,29 +864,6 @@ func TestApplySubpackageTask(t *testing.T) {
resources: repository.PackageResources{Contents: map[string]string{}},
expectedError: "task list must contain exactly 2 tasks",
},
{
name: "Error when reference resolver fails",
obj: &porchapi.PackageRevision{
Spec: porchapi.PackageRevisionSpec{
Tasks: []porchapi.Task{
{Type: porchapi.TaskTypeClone, Clone: &porchapi.PackageCloneTaskSpec{}},
{Type: porchapi.TaskTypeClone, Clone: &porchapi.PackageCloneTaskSpec{
SubpackageDir: "subpkg",
Upstream: porchapi.UpstreamPackage{
Type: porchapi.RepositoryTypeGit,
Git: &porchapi.GitPackage{
Repo: "https://github.com/example/repo.git",
Ref: "main",
},
},
}},
},
},
},
resources: repository.PackageResources{Contents: map[string]string{}},
resolveErr: fmt.Errorf("repository not found"),
expectedError: "cannot find repository",
},
{
name: "Error when second task has unsupported type",
obj: &porchapi.PackageRevision{
Expand Down
Loading