Skip to content

Commit 66c7be9

Browse files
dtfranzMikalai Radchuk
authored andcommitted
Deppy version bump, remove remaining entity/entitysource vestigials
Signed-off-by: dtfranz <[email protected]>
1 parent d180207 commit 66c7be9

File tree

12 files changed

+27
-31
lines changed

12 files changed

+27
-31
lines changed

cmd/manager/main.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ func main() {
106106
Client: cl,
107107
Scheme: mgr.GetScheme(),
108108
Resolver: solver.NewDeppySolver(
109-
nil,
110109
controllers.NewVariableSource(cl, catalogClient),
111110
),
112111
}).SetupWithManager(mgr); err != nil {

cmd/resolutioncli/main.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ func run(ctx context.Context, packageName, packageVersion, packageChannel, index
124124
catalogClient := newIndexRefClient(indexRef)
125125

126126
resolver := solver.NewDeppySolver(
127-
nil,
128127
append(
129128
variablesources.NestedVariableSource{newPackageVariableSource(catalogClient, packageName, packageVersion, packageChannel)},
130129
controllers.NewVariableSource(cl, catalogClient)...,

go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ require (
1111
github.com/onsi/gomega v1.27.10
1212
github.com/operator-framework/api v0.17.4-0.20230223191600-0131a6301e42
1313
github.com/operator-framework/catalogd v0.6.0
14-
github.com/operator-framework/deppy v0.0.0-20230629133131-bb7b6ae7b266
14+
github.com/operator-framework/deppy v0.0.1
1515
github.com/operator-framework/operator-registry v1.28.0
1616
github.com/operator-framework/rukpak v0.13.0
1717
github.com/spf13/pflag v1.0.5
@@ -73,6 +73,7 @@ require (
7373
github.com/golang/protobuf v1.5.3 // indirect
7474
github.com/google/cel-go v0.12.6 // indirect
7575
github.com/google/gnostic v0.5.7-v3refs // indirect
76+
github.com/google/go-cmp v0.5.9 // indirect
7677
github.com/google/gofuzz v1.2.0 // indirect
7778
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
7879
github.com/google/uuid v1.3.0 // indirect

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH
542542
github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk=
543543
github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg=
544544
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
545-
github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc=
545+
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
546546
github.com/j-keck/arping v0.0.0-20160618110441-2cf9dc699c56/go.mod h1:ymszkNOg6tORTn+6F6j+Jc8TOr5osrynvN6ivFWZ2GA=
547547
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=
548548
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
@@ -704,8 +704,8 @@ github.com/operator-framework/api v0.17.4-0.20230223191600-0131a6301e42 h1:d/Pnr
704704
github.com/operator-framework/api v0.17.4-0.20230223191600-0131a6301e42/go.mod h1:l/cuwtPxkVUY7fzYgdust2m9tlmb8I4pOvbsUufRb24=
705705
github.com/operator-framework/catalogd v0.6.0 h1:dSZ54MVSHJ8hcoV7OCRxnk3x4O3ramlyPvvz0vsKYdk=
706706
github.com/operator-framework/catalogd v0.6.0/go.mod h1:I0n086a4a+nP1YZy742IrPaWvOlWu0Mj6qA6j4K96Vg=
707-
github.com/operator-framework/deppy v0.0.0-20230629133131-bb7b6ae7b266 h1:SQEUaAoRWNhr2poLH6z/RsEWZG7PppDWHsr5vAvJkJc=
708-
github.com/operator-framework/deppy v0.0.0-20230629133131-bb7b6ae7b266/go.mod h1:6kgHMeS5vQt3gqWGgJIig1yT5uflBUsCc1orP+I3nbk=
707+
github.com/operator-framework/deppy v0.0.1 h1:PLTtaFGwktPhKuKZkfUruTimrWpyaO3tghbsjs0uMjc=
708+
github.com/operator-framework/deppy v0.0.1/go.mod h1:EV6vnxRodSFRn2TFztfxFhMPGh5QufOhn3tpIP1Z8cc=
709709
github.com/operator-framework/operator-registry v1.28.0 h1:vtmd2WgJxkx7vuuOxW4k5Le/oo0SfonSeJVMU3rKIfk=
710710
github.com/operator-framework/operator-registry v1.28.0/go.mod h1:UYw3uaZyHwHgnczLRYmUqMpgRgP2EfkqOsaR+LI+nK8=
711711
github.com/operator-framework/rukpak v0.13.0 h1:QP0P9ybwtkFpfVOMY9z5v4+vRyBdoqAotv8RP/SZ0hw=
@@ -801,7 +801,7 @@ github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkU
801801
github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
802802
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
803803
github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE=
804-
github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA=
804+
github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
805805
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
806806
github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
807807
github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=

internal/resolution/variablesources/bundle_deployment.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ import (
55

66
"github.com/operator-framework/deppy/pkg/deppy"
77
"github.com/operator-framework/deppy/pkg/deppy/input"
8-
catalogclient "github.com/operator-framework/operator-controller/internal/catalogmetadata/client"
98
rukpakv1alpha1 "github.com/operator-framework/rukpak/api/v1alpha1"
109
"sigs.k8s.io/controller-runtime/pkg/client"
10+
11+
catalogclient "github.com/operator-framework/operator-controller/internal/catalogmetadata/client"
1112
)
1213

1314
var _ input.VariableSource = &BundleDeploymentVariableSource{}
@@ -26,7 +27,7 @@ func NewBundleDeploymentVariableSource(cl client.Client, catalog *catalogclient.
2627
}
2728
}
2829

29-
func (o *BundleDeploymentVariableSource) GetVariables(ctx context.Context, _ input.EntitySource) ([]deppy.Variable, error) {
30+
func (o *BundleDeploymentVariableSource) GetVariables(ctx context.Context) ([]deppy.Variable, error) {
3031
variableSources := SliceVariableSource{}
3132
if o.inputVariableSource != nil {
3233
variableSources = append(variableSources, o.inputVariableSource)
@@ -53,5 +54,5 @@ func (o *BundleDeploymentVariableSource) GetVariables(ctx context.Context, _ inp
5354
}
5455
}
5556

56-
return variableSources.GetVariables(ctx, nil)
57+
return variableSources.GetVariables(ctx)
5758
}

internal/resolution/variablesources/bundles_and_dependencies.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ func NewBundlesAndDepsVariableSource(catalog *catalogclient.Client, inputVariabl
2929
}
3030
}
3131

32-
func (b *BundlesAndDepsVariableSource) GetVariables(ctx context.Context, _ input.EntitySource) ([]deppy.Variable, error) {
32+
func (b *BundlesAndDepsVariableSource) GetVariables(ctx context.Context) ([]deppy.Variable, error) {
3333
var variables []deppy.Variable
3434

3535
// extract required package variables
3636
for _, variableSource := range b.variableSources {
37-
inputVariables, err := variableSource.GetVariables(ctx, nil)
37+
inputVariables, err := variableSource.GetVariables(ctx)
3838
if err != nil {
3939
return nil, err
4040
}
@@ -83,7 +83,6 @@ func (b *BundlesAndDepsVariableSource) GetVariables(ctx context.Context, _ input
8383
// create variable
8484
variables = append(variables, olmvariables.NewBundleVariable(id, head, dependencies))
8585
}
86-
8786
}
8887

8988
return variables, nil

internal/resolution/variablesources/composite.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ var _ input.VariableSource = &NestedVariableSource{}
2929

3030
type NestedVariableSource []func(inputVariableSource input.VariableSource) (input.VariableSource, error)
3131

32-
func (s NestedVariableSource) GetVariables(ctx context.Context, _ input.EntitySource) ([]deppy.Variable, error) {
32+
func (s NestedVariableSource) GetVariables(ctx context.Context) ([]deppy.Variable, error) {
3333
if len(s) == 0 {
3434
return nil, errors.New("empty nested variable sources")
3535
}
@@ -43,15 +43,15 @@ func (s NestedVariableSource) GetVariables(ctx context.Context, _ input.EntitySo
4343
}
4444
}
4545

46-
return variableSource.GetVariables(ctx, nil)
46+
return variableSource.GetVariables(ctx)
4747
}
4848

4949
type SliceVariableSource []input.VariableSource
5050

51-
func (s SliceVariableSource) GetVariables(ctx context.Context, _ input.EntitySource) ([]deppy.Variable, error) {
51+
func (s SliceVariableSource) GetVariables(ctx context.Context) ([]deppy.Variable, error) {
5252
var variables []deppy.Variable
5353
for _, variableSource := range s {
54-
inputVariables, err := variableSource.GetVariables(ctx, nil)
54+
inputVariables, err := variableSource.GetVariables(ctx)
5555
if err != nil {
5656
return nil, err
5757
}

internal/resolution/variablesources/composite_test.go

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ func TestNestedVariableSource(t *testing.T) {
5252
} {
5353
t.Run(tt.name, func(t *testing.T) {
5454
ctx := context.Background()
55-
mockEntitySource := input.NewCacheQuerier(map[deppy.Identifier]input.Entity{})
5655

5756
nestedSource := variablesources.NestedVariableSource{}
5857
for i := range tt.varSources {
@@ -70,7 +69,7 @@ func TestNestedVariableSource(t *testing.T) {
7069
})
7170
}
7271

73-
variables, err := nestedSource.GetVariables(ctx, mockEntitySource)
72+
variables, err := nestedSource.GetVariables(ctx)
7473
if tt.wantErr != "" {
7574
assert.EqualError(t, err, tt.wantErr)
7675
} else {
@@ -82,15 +81,14 @@ func TestNestedVariableSource(t *testing.T) {
8281

8382
t.Run("error from a nested constructor", func(t *testing.T) {
8483
ctx := context.Background()
85-
mockEntitySource := input.NewCacheQuerier(map[deppy.Identifier]input.Entity{})
8684

8785
nestedSource := variablesources.NestedVariableSource{
8886
func(inputVariableSource input.VariableSource) (input.VariableSource, error) {
8987
return nil, errors.New("fake error from a constructor")
9088
},
9189
}
9290

93-
variables, err := nestedSource.GetVariables(ctx, mockEntitySource)
91+
variables, err := nestedSource.GetVariables(ctx)
9492
assert.EqualError(t, err, "fake error from a constructor")
9593
assert.Nil(t, variables)
9694
})
@@ -123,10 +121,9 @@ func TestSliceVariableSource(t *testing.T) {
123121
} {
124122
t.Run(tt.name, func(t *testing.T) {
125123
ctx := context.Background()
126-
mockEntitySource := input.NewCacheQuerier(map[deppy.Identifier]input.Entity{})
127124

128125
sliceSource := variablesources.SliceVariableSource(tt.varSources)
129-
variables, err := sliceSource.GetVariables(ctx, mockEntitySource)
126+
variables, err := sliceSource.GetVariables(ctx)
130127
if tt.wantErr != "" {
131128
assert.EqualError(t, err, tt.wantErr)
132129
} else {
@@ -145,7 +142,7 @@ type mockVariableSource struct {
145142
fakeError error
146143
}
147144

148-
func (m *mockVariableSource) GetVariables(ctx context.Context, entitySource input.EntitySource) ([]deppy.Variable, error) {
145+
func (m *mockVariableSource) GetVariables(ctx context.Context) ([]deppy.Variable, error) {
149146
if m.fakeError != nil {
150147
return nil, m.fakeError
151148
}
@@ -154,7 +151,7 @@ func (m *mockVariableSource) GetVariables(ctx context.Context, entitySource inpu
154151
return m.fakeVariables, nil
155152
}
156153

157-
nestedVars, err := m.inputVariableSource.GetVariables(ctx, entitySource)
154+
nestedVars, err := m.inputVariableSource.GetVariables(ctx)
158155
if err != nil {
159156
return nil, err
160157
}

internal/resolution/variablesources/crd_constraints.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ func NewCRDUniquenessConstraintsVariableSource(inputVariableSource input.Variabl
3434
}
3535
}
3636

37-
func (g *CRDUniquenessConstraintsVariableSource) GetVariables(ctx context.Context, _ input.EntitySource) ([]deppy.Variable, error) {
38-
variables, err := g.inputVariableSource.GetVariables(ctx, nil)
37+
func (g *CRDUniquenessConstraintsVariableSource) GetVariables(ctx context.Context) ([]deppy.Variable, error) {
38+
variables, err := g.inputVariableSource.GetVariables(ctx)
3939
if err != nil {
4040
return nil, err
4141
}

internal/resolution/variablesources/installed_package.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type InstalledPackageVariableSource struct {
2121
bundleImage string
2222
}
2323

24-
func (r *InstalledPackageVariableSource) GetVariables(ctx context.Context, _ input.EntitySource) ([]deppy.Variable, error) {
24+
func (r *InstalledPackageVariableSource) GetVariables(ctx context.Context) ([]deppy.Variable, error) {
2525
allBundles, err := r.catalog.Bundles(ctx)
2626
if err != nil {
2727
return nil, err

0 commit comments

Comments
 (0)