Skip to content

Commit 35f381d

Browse files
Mikalai Radchukm1kola
authored andcommitted
Updates deppy
Signed-off-by: Mikalai Radchuk <[email protected]>
1 parent b982ad0 commit 35f381d

File tree

7 files changed

+11
-14
lines changed

7 files changed

+11
-14
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ require (
77
github.com/onsi/ginkgo/v2 v2.8.3
88
github.com/onsi/gomega v1.27.1
99
github.com/operator-framework/catalogd v0.2.0
10-
github.com/operator-framework/deppy v0.0.0-20230125110717-dc02e928470f
10+
github.com/operator-framework/deppy v0.0.0-20230602120738-cbf2c66b141b
1111
github.com/operator-framework/operator-registry v1.26.3
1212
github.com/operator-framework/rukpak v0.12.0
1313
go.uber.org/zap v1.24.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,8 @@ github.com/onsi/gomega v1.27.1 h1:rfztXRbg6nv/5f+Raen9RcGoSecHIFgBBLQK3Wdj754=
226226
github.com/onsi/gomega v1.27.1/go.mod h1:aHX5xOykVYzWOV4WqQy0sy8BQptgukenXpCXfadcIAw=
227227
github.com/operator-framework/catalogd v0.2.0 h1:1uroX6DfHh+/PnEAQMLTpkx67Mwn3ZMTPFXSbZwmYAs=
228228
github.com/operator-framework/catalogd v0.2.0/go.mod h1:RIrm+yaMDa9ZMDIKGH8JL4Eg3zwUHKaJxonTXeK+5k8=
229-
github.com/operator-framework/deppy v0.0.0-20230125110717-dc02e928470f h1:YxUZyQjF2kT2hli9ceBkuK7Mmiln0lV2RV38rzBObBI=
230-
github.com/operator-framework/deppy v0.0.0-20230125110717-dc02e928470f/go.mod h1:JaF7sX6tn7mpXcOehYjSHiKM1Y0z09vEfC6dca4AVuo=
229+
github.com/operator-framework/deppy v0.0.0-20230602120738-cbf2c66b141b h1:m7MhK8IJx9Abb0ULbUw8vXqGMP1S9bodLrKh5d6wk6k=
230+
github.com/operator-framework/deppy v0.0.0-20230602120738-cbf2c66b141b/go.mod h1:9xVfBnKK/p6M/vQlsHqscslUtUYnK2is5D24liQBtoE=
231231
github.com/operator-framework/operator-registry v1.26.3 h1:U+HTGgjAT5RCXU2WkDwa525wcqdo97BsO7WfMhwL5MA=
232232
github.com/operator-framework/operator-registry v1.26.3/go.mod h1:DZcTzhAyZf/NLi2UwBQA1F/qh4FwgYBcgBx2yBz8I+Q=
233233
github.com/operator-framework/rukpak v0.12.0 h1:qzM18RQZdqS00/6GLkEiTZf0pHtQ5bVg/DLzAmho+jQ=

internal/resolution/entitysources/catalogdsource.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func NewCatalogdEntitySource(client client.Client) *catalogdEntitySource {
2525
return &catalogdEntitySource{client: client}
2626
}
2727

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

internal/resolution/resolver.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,7 @@ func (o *OperatorResolver) Resolve(ctx context.Context) (*solver.Solution, error
3333
}
3434

3535
olmVariableSource := olm.NewOLMVariableSource(operatorList.Items...)
36-
deppySolver, err := solver.NewDeppySolver(o.entitySource, olmVariableSource)
37-
if err != nil {
38-
return nil, err
39-
}
36+
deppySolver := solver.NewDeppySolver(o.entitySource, olmVariableSource)
4037

4138
solution, err := deppySolver.Solve(ctx)
4239
if err != nil {

internal/resolution/resolver_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ var _ input.EntitySource = &FailEntitySource{}
130130

131131
type FailEntitySource struct{}
132132

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

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

internal/resolution/variable_sources/crd_constraints/crd_constraints_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,8 @@ var _ input.EntitySource = &PanicEntitySource{}
276276

277277
type PanicEntitySource struct{}
278278

279-
func (p PanicEntitySource) Get(ctx context.Context, id deppy.Identifier) *input.Entity {
280-
return nil
279+
func (p PanicEntitySource) Get(ctx context.Context, id deppy.Identifier) (*input.Entity, error) {
280+
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")
281281
}
282282

283283
func (p PanicEntitySource) Filter(ctx context.Context, filter input.Predicate) (input.EntityList, error) {

internal/resolution/variable_sources/olm/olm_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ var _ input.EntitySource = &FailEntitySource{}
177177
type FailEntitySource struct {
178178
}
179179

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

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

0 commit comments

Comments
 (0)