diff --git a/go.mod b/go.mod index af3b34a18..61b8e2986 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/go.sum b/go.sum index 007da7d49..6aaaa7e1d 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/internal/resolution/entitysources/catalogdsource.go b/internal/resolution/entitysources/catalogdsource.go index c74399b96..a172d52da 100644 --- a/internal/resolution/entitysources/catalogdsource.go +++ b/internal/resolution/entitysources/catalogdsource.go @@ -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") } diff --git a/internal/resolution/resolver.go b/internal/resolution/resolver.go index a074e7bf6..d898d9bba 100644 --- a/internal/resolution/resolver.go +++ b/internal/resolution/resolver.go @@ -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 { diff --git a/internal/resolution/resolver_test.go b/internal/resolution/resolver_test.go index 25bbc908a..7a2c91e14 100644 --- a/internal/resolution/resolver_test.go +++ b/internal/resolution/resolver_test.go @@ -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) { diff --git a/internal/resolution/variable_sources/crd_constraints/crd_constraints_test.go b/internal/resolution/variable_sources/crd_constraints/crd_constraints_test.go index 06656c03b..6f5ef0fb9 100644 --- a/internal/resolution/variable_sources/crd_constraints/crd_constraints_test.go +++ b/internal/resolution/variable_sources/crd_constraints/crd_constraints_test.go @@ -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) { diff --git a/internal/resolution/variable_sources/olm/olm_test.go b/internal/resolution/variable_sources/olm/olm_test.go index e3010fb4b..ba8c17a9d 100644 --- a/internal/resolution/variable_sources/olm/olm_test.go +++ b/internal/resolution/variable_sources/olm/olm_test.go @@ -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) {