Skip to content

Commit

Permalink
Updates deppy
Browse files Browse the repository at this point in the history
Signed-off-by: Mikalai Radchuk <mradchuk@redhat.com>
  • Loading branch information
m1kola authored and joelanford committed Jun 6, 2023
1 parent 28f4dcd commit 02c2fe1
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/onsi/ginkgo/v2 v2.8.3
github.com/onsi/gomega v1.27.1
github.com/operator-framework/catalogd v0.2.0
github.com/operator-framework/deppy v0.0.0-20230125110717-dc02e928470f
github.com/operator-framework/deppy v0.0.0-20230602120738-cbf2c66b141b
github.com/operator-framework/operator-registry v1.26.3
github.com/operator-framework/rukpak v0.12.0
go.uber.org/zap v1.24.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ github.com/onsi/gomega v1.27.1 h1:rfztXRbg6nv/5f+Raen9RcGoSecHIFgBBLQK3Wdj754=
github.com/onsi/gomega v1.27.1/go.mod h1:aHX5xOykVYzWOV4WqQy0sy8BQptgukenXpCXfadcIAw=
github.com/operator-framework/catalogd v0.2.0 h1:1uroX6DfHh+/PnEAQMLTpkx67Mwn3ZMTPFXSbZwmYAs=
github.com/operator-framework/catalogd v0.2.0/go.mod h1:RIrm+yaMDa9ZMDIKGH8JL4Eg3zwUHKaJxonTXeK+5k8=
github.com/operator-framework/deppy v0.0.0-20230125110717-dc02e928470f h1:YxUZyQjF2kT2hli9ceBkuK7Mmiln0lV2RV38rzBObBI=
github.com/operator-framework/deppy v0.0.0-20230125110717-dc02e928470f/go.mod h1:JaF7sX6tn7mpXcOehYjSHiKM1Y0z09vEfC6dca4AVuo=
github.com/operator-framework/deppy v0.0.0-20230602120738-cbf2c66b141b h1:m7MhK8IJx9Abb0ULbUw8vXqGMP1S9bodLrKh5d6wk6k=
github.com/operator-framework/deppy v0.0.0-20230602120738-cbf2c66b141b/go.mod h1:9xVfBnKK/p6M/vQlsHqscslUtUYnK2is5D24liQBtoE=
github.com/operator-framework/operator-registry v1.26.3 h1:U+HTGgjAT5RCXU2WkDwa525wcqdo97BsO7WfMhwL5MA=
github.com/operator-framework/operator-registry v1.26.3/go.mod h1:DZcTzhAyZf/NLi2UwBQA1F/qh4FwgYBcgBx2yBz8I+Q=
github.com/operator-framework/rukpak v0.12.0 h1:qzM18RQZdqS00/6GLkEiTZf0pHtQ5bVg/DLzAmho+jQ=
Expand Down
2 changes: 1 addition & 1 deletion internal/resolution/entitysources/catalogdsource.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func NewCatalogdEntitySource(client client.Client) *catalogdEntitySource {
return &catalogdEntitySource{client: client}
}

func (es *catalogdEntitySource) Get(ctx context.Context, id deppy.Identifier) *input.Entity {
func (es *catalogdEntitySource) Get(ctx context.Context, id deppy.Identifier) (*input.Entity, error) {
panic("not implemented")
}

Expand Down
5 changes: 1 addition & 4 deletions internal/resolution/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ func (o *OperatorResolver) Resolve(ctx context.Context) (*solver.Solution, error
}

olmVariableSource := olm.NewOLMVariableSource(operatorList.Items...)
deppySolver, err := solver.NewDeppySolver(o.entitySource, olmVariableSource)
if err != nil {
return nil, err
}
deppySolver := solver.NewDeppySolver(o.entitySource, olmVariableSource)

solution, err := deppySolver.Solve(ctx)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions internal/resolution/resolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ var _ input.EntitySource = &FailEntitySource{}

type FailEntitySource struct{}

func (f FailEntitySource) Get(ctx context.Context, id deppy.Identifier) *input.Entity {
return nil
func (f FailEntitySource) Get(ctx context.Context, id deppy.Identifier) (*input.Entity, error) {
return nil, fmt.Errorf("error calling get in entity source")
}

func (f FailEntitySource) Filter(ctx context.Context, filter input.Predicate) (input.EntityList, error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ var _ input.EntitySource = &PanicEntitySource{}

type PanicEntitySource struct{}

func (p PanicEntitySource) Get(ctx context.Context, id deppy.Identifier) *input.Entity {
return nil
func (p PanicEntitySource) Get(ctx context.Context, id deppy.Identifier) (*input.Entity, error) {
return nil, fmt.Errorf("if you are seeing this it is because the global variable source is calling the entity source - this shouldn't happen")
}

func (p PanicEntitySource) Filter(ctx context.Context, filter input.Predicate) (input.EntityList, error) {
Expand Down
4 changes: 2 additions & 2 deletions internal/resolution/variable_sources/olm/olm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ var _ input.EntitySource = &FailEntitySource{}
type FailEntitySource struct {
}

func (f FailEntitySource) Get(ctx context.Context, id deppy.Identifier) *input.Entity {
return nil
func (f FailEntitySource) Get(ctx context.Context, id deppy.Identifier) (*input.Entity, error) {
return nil, fmt.Errorf("error executing get")
}

func (f FailEntitySource) Filter(ctx context.Context, filter input.Predicate) (input.EntityList, error) {
Expand Down

0 comments on commit 02c2fe1

Please sign in to comment.