Skip to content

Commit 7e2c6d3

Browse files
Merge pull request #676 from njhale/fix-startingcsv
fix(subscriptions): respect startingCSV
2 parents 1f31248 + 621bc27 commit 7e2c6d3

File tree

30 files changed

+730
-145
lines changed

30 files changed

+730
-145
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,11 @@ container-mockgen:
150150
docker build -t olm:mockgen -f mockgen.Dockerfile .
151151
docker run --name temp-mockgen olm:mockgen /bin/true
152152
docker cp temp-mockgen:/go/src/github.com/operator-framework/operator-lifecycle-manager/pkg/api/wrappers/wrappersfakes/. ./pkg/api/wrappers/wrappersfakes
153-
docker cp temp-mockgen:/go/src/github.com/operator-framework/operator-lifecycle-manager/pkg/fakes/client-go/listers/. ./pkg/fakes/client-go/listers
154153
docker cp temp-mockgen:/go/src/github.com/operator-framework/operator-lifecycle-manager/pkg/lib/operatorlister/operatorlisterfakes/. ./pkg/lib/operatorlister/operatorlisterfakes
155154
docker cp temp-mockgen:/go/src/github.com/operator-framework/operator-lifecycle-manager/pkg/lib/operatorclient/mock_client.go ./pkg/lib/operatorclient/mock_client.go
156155
docker cp temp-mockgen:/go/src/github.com/operator-framework/operator-lifecycle-manager/pkg/fakes/. ./pkg/fakes/.
156+
docker cp temp-mockgen:/go/src/github.com/operator-framework/operator-lifecycle-manager/pkg/controller/registry/resolver/fakes/fake_registry_client.go ./pkg/controller/registry/resolver/fakes/fake_registry_client.go
157+
docker cp temp-mockgen:/go/src/github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/client/fakes/fake_registry_client.go ./pkg/package-server/client/fakes/fake_registry_client.go
157158
docker rm temp-mockgen
158159

159160
# Must be run in gopath: https://github.com/kubernetes/kubernetes/issues/67566

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ require (
2929
github.com/openshift/api v3.9.1-0.20190129160438-bbc4289c54e0+incompatible
3030
github.com/openshift/client-go v0.0.0-20190128154758-1540772775fa
3131
github.com/openshift/library-go v0.0.0-20190125204812-22b2ba2f485f
32-
github.com/operator-framework/operator-registry v1.0.4
32+
github.com/operator-framework/operator-registry v1.0.5
3333
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
3434
github.com/pkg/errors v0.8.0
3535
github.com/prometheus/client_golang v0.9.1

go.sum

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ github.com/openshift/library-go v0.0.0-20190125204812-22b2ba2f485f/go.mod h1:NBt
166166
github.com/operator-framework/operator-lifecycle-manager v0.0.0-20181023032605-e838f7fb2186/go.mod h1:Ma5ZXd4S1vmMyewWlF7aO8CZiokR7Sd8dhSfkGkNU4U=
167167
github.com/operator-framework/operator-lifecycle-manager v0.0.0-20190105193533-81104ffdc4fb/go.mod h1:XMyE4n2opUK4N6L45YGQkXXi8F9fD7XDYFv/CsS6V5I=
168168
github.com/operator-framework/operator-registry v1.0.1/go.mod h1:1xEdZjjUg2hPEd52LG3YQ0jtwiwEGdm98S1TH5P4RAA=
169-
github.com/operator-framework/operator-registry v1.0.4 h1:/xOuw0AFrnV/zjZQeEGtX/xH/ZoLOrNZqWaYU5bRQwM=
170-
github.com/operator-framework/operator-registry v1.0.4/go.mod h1:hve6YwcjM2nGVlscLtNsp9sIIBkNZo6jlJgzWw7vP9s=
169+
github.com/operator-framework/operator-registry v1.0.5 h1:LKhQvSeA3/PHSThchV6rquS8jy2ocvYRHqqCikkyumE=
170+
github.com/operator-framework/operator-registry v1.0.5/go.mod h1:hve6YwcjM2nGVlscLtNsp9sIIBkNZo6jlJgzWw7vP9s=
171171
github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g=
172172
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
173173
github.com/petar/GoLLRB v0.0.0-20130427215148-53be0d36a84c/go.mod h1:HUpKUBZnpzkdx0kD/+Yfuft+uD3zHGtXF/XJB14TUr4=
@@ -288,7 +288,7 @@ k8s.io/apimachinery v0.0.0-20190118094746-1525e4dadd2d/go.mod h1:ccL7Eh7zubPUSh9
288288
k8s.io/apiserver v0.0.0-20181026151315-13cfe3978170 h1:CqI85nZvPaV+7JFono0nAOGOx2brocqefcOhDPVhHKI=
289289
k8s.io/apiserver v0.0.0-20181026151315-13cfe3978170/go.mod h1:6bqaTSOSJavUIXUtfaR9Os9JtTCm8ZqH2SUl2S60C4w=
290290
k8s.io/client-go v0.0.0-20180718001006-59698c7d9724/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s=
291-
k8s.io/client-go v8.0.0+incompatible h1:2pUaSg2x6iEHr8cia6zmWhoCXG1EDG9TCx9s//Aq7HY=
291+
k8s.io/client-go v8.0.0+incompatible h1:tTI4hRmb1DRMl4fG6Vclfdi6nTM82oIrTT7HfitmxC4=
292292
k8s.io/client-go v8.0.0+incompatible/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s=
293293
k8s.io/code-generator v0.0.0-20181203235156-f8cba74510f3 h1:f/Aa24HPnPEDWia884BCF94E1b29KYjOTVTHcBzvT2Q=
294294
k8s.io/code-generator v0.0.0-20181203235156-f8cba74510f3/go.mod h1:MYiN+ZJZ9HkETbgVZdWw2AsuAi9PZ4V80cwfuf2axe8=

pkg/controller/operators/catalog/operator.go

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -530,12 +530,13 @@ func (o *Operator) syncResolvingNamespace(obj interface{}) error {
530530
// get the set of sources that should be used for resolution and best-effort get their connections working
531531
logger.Debug("resolving sources")
532532
resolverSources := o.ensureResolverSources(logger, namespace)
533+
querier := resolver.NewNamespaceSourceQuerier(resolverSources)
533534

534535
logger.Debug("checking if subscriptions need update")
535536

536537
subs, err := o.lister.OperatorsV1alpha1().SubscriptionLister().Subscriptions(namespace).List(labels.Everything())
537538
if err != nil {
538-
logger.WithError(err).Debug("couldn't list subscriptions")
539+
logger.WithError(err).Debug("couldn't list subscriptions")
539540
return err
540541
}
541542

@@ -557,7 +558,7 @@ func (o *Operator) syncResolvingNamespace(obj interface{}) error {
557558
subscriptionUpdated = subscriptionUpdated || changedIp
558559

559560
// record the current state of the desired corresponding CSV in the status. no-op if we don't know the csv yet.
560-
sub, changedCSV, err := o.ensureSubscriptionCSVState(logger, sub)
561+
sub, changedCSV, err := o.ensureSubscriptionCSVState(logger, sub, querier)
561562
if err != nil {
562563
return err
563564
}
@@ -581,7 +582,7 @@ func (o *Operator) syncResolvingNamespace(obj interface{}) error {
581582
logger.Debug("resolving subscriptions in namespace")
582583

583584
// resolve a set of steps to apply to a cluster, a set of subscriptions to create/update, and any errors
584-
steps, updatedSubs, err := o.resolver.ResolveSteps(namespace, resolver.NewNamespaceSourceQuerier(resolverSources))
585+
steps, updatedSubs, err := o.resolver.ResolveSteps(namespace, querier)
585586
if err != nil {
586587
return err
587588
}
@@ -678,7 +679,7 @@ func (o *Operator) ensureResolverSources(logger *logrus.Entry, namespace string)
678679

679680
func (o *Operator) nothingToUpdate(logger *logrus.Entry, sub *v1alpha1.Subscription) bool {
680681
// Only sync if catalog has been updated since last sync time
681-
if o.sourcesLastUpdate.Before(&sub.Status.LastUpdated) && sub.Status.State != v1alpha1.SubscriptionStateNone {
682+
if o.sourcesLastUpdate.Before(&sub.Status.LastUpdated) && sub.Status.State != v1alpha1.SubscriptionStateUpgradeAvailable {
682683
logger.Debugf("skipping update: no new updates to catalog since last sync at %s", sub.Status.LastUpdated.String())
683684
return true
684685
}
@@ -721,7 +722,7 @@ func (o *Operator) ensureSubscriptionInstallPlanState(logger *logrus.Entry, sub
721722
return updated, true, nil
722723
}
723724

724-
func (o *Operator) ensureSubscriptionCSVState(logger *logrus.Entry, sub *v1alpha1.Subscription) (*v1alpha1.Subscription, bool, error) {
725+
func (o *Operator) ensureSubscriptionCSVState(logger *logrus.Entry, sub *v1alpha1.Subscription, querier resolver.SourceQuerier) (*v1alpha1.Subscription, bool, error) {
725726
if sub.Status.CurrentCSV == "" {
726727
return sub, false, nil
727728
}
@@ -732,11 +733,21 @@ func (o *Operator) ensureSubscriptionCSVState(logger *logrus.Entry, sub *v1alpha
732733
logger.WithError(err).WithField("currentCSV", sub.Status.CurrentCSV).Debug("error fetching csv listed in subscription status")
733734
out.Status.State = v1alpha1.SubscriptionStateUpgradePending
734735
} else {
735-
out.Status.State = v1alpha1.SubscriptionStateAtLatest
736+
// Check if an update is available for the current csv
737+
if err := querier.Queryable(); err != nil {
738+
return nil, false, err
739+
}
740+
bundle, _, _ := querier.FindReplacement(sub.Status.CurrentCSV, sub.Spec.Package, sub.Spec.Channel, resolver.CatalogKey{sub.Spec.CatalogSource, sub.Spec.CatalogSourceNamespace})
741+
if bundle != nil {
742+
out.Status.State = v1alpha1.SubscriptionStateUpgradeAvailable
743+
} else {
744+
out.Status.State = v1alpha1.SubscriptionStateAtLatest
745+
}
746+
736747
out.Status.InstalledCSV = sub.Status.CurrentCSV
737748
}
738749

739-
if sub.Status.State == out.Status.State && sub.Status.InstalledCSV == out.Status.InstalledCSV {
750+
if sub.Status.State == out.Status.State {
740751
// The subscription status represents the cluster state
741752
return sub, false, nil
742753
}

pkg/controller/registry/resolver/evolver.go

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package resolver
22

33
import (
4+
opregistry "github.com/operator-framework/operator-registry/pkg/registry"
45
"github.com/pkg/errors"
56
)
67

@@ -60,7 +61,7 @@ func (e *NamespaceGenerationEvolver) checkForUpdates() error {
6061
continue
6162
}
6263

63-
o, err := NewOperatorFromBundle(bundle, *key)
64+
o, err := NewOperatorFromBundle(bundle, op.SourceInfo().StartingCSV, *key)
6465
if err != nil {
6566
return errors.Wrap(err, "error parsing bundle")
6667
}
@@ -76,14 +77,20 @@ func (e *NamespaceGenerationEvolver) checkForUpdates() error {
7677

7778
func (e *NamespaceGenerationEvolver) addNewOperators(add map[OperatorSourceInfo]struct{}) error {
7879
for s := range add {
79-
bundle, key, err := e.querier.FindPackage(s.Package, s.Channel, s.Catalog)
80-
80+
var bundle *opregistry.Bundle
81+
var key *CatalogKey
82+
var err error
83+
if s.StartingCSV != "" {
84+
bundle, key, err = e.querier.FindBundle(s.Package, s.Channel, s.StartingCSV, s.Catalog)
85+
} else {
86+
bundle, key, err = e.querier.FindLatestBundle(s.Package, s.Channel, s.Catalog)
87+
}
8188
if err != nil {
8289
// TODO: log or collect warnings
8390
return errors.Wrapf(err, "%s not found", s)
8491
}
8592

86-
o, err := NewOperatorFromBundle(bundle, *key)
93+
o, err := NewOperatorFromBundle(bundle, s.StartingCSV, *key)
8794
if err != nil {
8895
return errors.Wrap(err, "error parsing bundle")
8996
}
@@ -109,7 +116,7 @@ func (e *NamespaceGenerationEvolver) queryForRequiredAPIs() error {
109116
// attempt to find a bundle that provides that api
110117
if bundle, key, err := e.querier.FindProvider(*api); err == nil {
111118
// add a bundle that provides the api to the generation
112-
o, err := NewOperatorFromBundle(bundle, *key)
119+
o, err := NewOperatorFromBundle(bundle, "", *key)
113120
if err != nil {
114121
return errors.Wrap(err, "error parsing bundle")
115122
}

pkg/controller/registry/resolver/evolver_test.go

Lines changed: 79 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func TestNamespaceGenerationEvolver(t *testing.T) {
5555
},
5656
}),
5757
gen: NewGenerationFromOperators(
58-
NewFakeOperatorSurface("op1", "pkgA", "c", "", "s", []opregistry.APIKey{{"g", "v", "k", "ks"}}, nil, nil, nil),
58+
NewFakeOperatorSurface("op1", "pkgA", "c", "", "s", "", []opregistry.APIKey{{"g", "v", "k", "ks"}}, nil, nil, nil),
5959
),
6060
},
6161
args: args{
@@ -68,10 +68,67 @@ func TestNamespaceGenerationEvolver(t *testing.T) {
6868
},
6969
},
7070
wantGen: NewGenerationFromOperators(
71-
NewFakeOperatorSurface("op1", "pkgA", "c", "", "s", []opregistry.APIKey{{"g", "v", "k", "ks"}}, nil, nil, nil),
72-
NewFakeOperatorSurface("nothing.v1", "nothing", "channel", "", "catsrc", nil, nil, nil, nil),
71+
NewFakeOperatorSurface("op1", "pkgA", "c", "", "s", "", []opregistry.APIKey{{"g", "v", "k", "ks"}}, nil, nil, nil),
72+
NewFakeOperatorSurface("nothing.v1", "nothing", "channel", "", "catsrc", "", nil, nil, nil, nil),
7373
),
7474
},
75+
{
76+
name: "NoNewRequiredAPIs/StartingCSV",
77+
fields: fields{
78+
querier: NewFakeSourceQuerier(map[CatalogKey][]*opregistry.Bundle{
79+
CatalogKey{"catsrc", "catsrc-namespace"}: {
80+
bundle("csv1", "p", "c", "", EmptyAPISet(), EmptyAPISet(), EmptyAPISet(), EmptyAPISet()),
81+
bundle("nothing.v1", "nothing", "channel", "", EmptyAPISet(), EmptyAPISet(), EmptyAPISet(), EmptyAPISet()),
82+
bundle("nothing.v2", "nothing", "channel", "nothing.v1", EmptyAPISet(), EmptyAPISet(), EmptyAPISet(), EmptyAPISet()),
83+
},
84+
}),
85+
gen: NewGenerationFromOperators(
86+
NewFakeOperatorSurface("op1", "pkgA", "c", "", "s", "", []opregistry.APIKey{{"g", "v", "k", "ks"}}, nil, nil, nil),
87+
),
88+
},
89+
args: args{
90+
add: map[OperatorSourceInfo]struct{}{
91+
OperatorSourceInfo{
92+
Package: "nothing",
93+
Channel: "channel",
94+
StartingCSV: "nothing.v1",
95+
Catalog: CatalogKey{"catsrc", "catsrc-namespace"},
96+
}: {},
97+
},
98+
},
99+
wantGen: NewGenerationFromOperators(
100+
NewFakeOperatorSurface("op1", "pkgA", "c", "", "s", "", []opregistry.APIKey{{"g", "v", "k", "ks"}}, nil, nil, nil),
101+
NewFakeOperatorSurface("nothing.v1", "nothing", "channel", "", "catsrc", "nothing.v1", nil, nil, nil, nil),
102+
),
103+
},
104+
{
105+
name: "NoNewRequiredAPIs/StartingCSV/NotFound",
106+
fields: fields{
107+
querier: NewFakeSourceQuerier(map[CatalogKey][]*opregistry.Bundle{
108+
CatalogKey{"catsrc", "catsrc-namespace"}: {
109+
bundle("csv1", "p", "c", "", EmptyAPISet(), EmptyAPISet(), EmptyAPISet(), EmptyAPISet()),
110+
bundle("nothing.v2", "nothing", "channel", "", EmptyAPISet(), EmptyAPISet(), EmptyAPISet(), EmptyAPISet()),
111+
},
112+
}),
113+
gen: NewGenerationFromOperators(
114+
NewFakeOperatorSurface("op1", "pkgA", "c", "", "s", "", []opregistry.APIKey{{"g", "v", "k", "ks"}}, nil, nil, nil),
115+
),
116+
},
117+
args: args{
118+
add: map[OperatorSourceInfo]struct{}{
119+
OperatorSourceInfo{
120+
Package: "nothing",
121+
Channel: "channel",
122+
StartingCSV: "nothing.v1",
123+
Catalog: CatalogKey{"catsrc", "catsrc-namespace"},
124+
}: {},
125+
},
126+
},
127+
wantGen: NewGenerationFromOperators(
128+
NewFakeOperatorSurface("op1", "pkgA", "c", "", "s", "", []opregistry.APIKey{{"g", "v", "k", "ks"}}, nil, nil, nil),
129+
),
130+
wantErr: fmt.Errorf("{nothing channel nothing.v1 {catsrc catsrc-namespace}} not found: no bundle found"),
131+
},
75132
{
76133
// the incoming subscription requires apis that can't be found
77134
// this should contract back to the original set
@@ -106,7 +163,7 @@ func TestNamespaceGenerationEvolver(t *testing.T) {
106163
},
107164
}),
108165
gen: NewGenerationFromOperators(
109-
NewFakeOperatorSurface("op1", "pkgA", "c", "", "s", []opregistry.APIKey{{"g", "v", "k", "ks"}}, nil, nil, nil),
166+
NewFakeOperatorSurface("op1", "pkgA", "c", "", "s", "", []opregistry.APIKey{{"g", "v", "k", "ks"}}, nil, nil, nil),
110167
),
111168
},
112169
args: args{
@@ -119,7 +176,7 @@ func TestNamespaceGenerationEvolver(t *testing.T) {
119176
},
120177
},
121178
wantGen: NewGenerationFromOperators(
122-
NewFakeOperatorSurface("op1", "pkgA", "c", "", "s", []opregistry.APIKey{{"g", "v", "k", "ks"}}, nil, nil, nil),
179+
NewFakeOperatorSurface("op1", "pkgA", "c", "", "s", "", []opregistry.APIKey{{"g", "v", "k", "ks"}}, nil, nil, nil),
123180
),
124181
},
125182
{
@@ -145,8 +202,8 @@ func TestNamespaceGenerationEvolver(t *testing.T) {
145202
},
146203
},
147204
wantGen: NewGenerationFromOperators(
148-
NewFakeOperatorSurface("depender.v1", "depender", "channel", "", "catsrc", nil, []opregistry.APIKey{{"g", "v", "k", "ks"}}, nil, nil),
149-
NewFakeOperatorSurface("provider.v1", "provider", "channel", "", "catsrc", []opregistry.APIKey{{"g", "v", "k", "ks"}}, nil, nil, nil),
205+
NewFakeOperatorSurface("depender.v1", "depender", "channel", "", "catsrc", "", nil, []opregistry.APIKey{{"g", "v", "k", "ks"}}, nil, nil),
206+
NewFakeOperatorSurface("provider.v1", "provider", "channel", "", "catsrc", "", []opregistry.APIKey{{"g", "v", "k", "ks"}}, nil, nil, nil),
150207
),
151208
},
152209
{
@@ -207,9 +264,9 @@ func TestNamespaceGenerationEvolver(t *testing.T) {
207264
},
208265
},
209266
wantGen: NewGenerationFromOperators(
210-
NewFakeOperatorSurface("depender.v1", "depender", "channel", "", "catsrc", nil, []opregistry.APIKey{{"g", "v", "k", "ks"}}, nil, nil),
211-
NewFakeOperatorSurface("provider.v1", "provider", "channel", "", "catsrc", []opregistry.APIKey{{"g", "v", "k", "ks"}}, []opregistry.APIKey{{"g2", "v2", "k2", "k2s"}}, nil, nil),
212-
NewFakeOperatorSurface("provider2.v1", "provider2", "channel", "", "catsrc", []opregistry.APIKey{{"g2", "v2", "k2", "k2s"}}, nil, nil, nil),
267+
NewFakeOperatorSurface("depender.v1", "depender", "channel", "", "catsrc", "", nil, []opregistry.APIKey{{"g", "v", "k", "ks"}}, nil, nil),
268+
NewFakeOperatorSurface("provider.v1", "provider", "channel", "", "catsrc", "", []opregistry.APIKey{{"g", "v", "k", "ks"}}, []opregistry.APIKey{{"g2", "v2", "k2", "k2s"}}, nil, nil),
269+
NewFakeOperatorSurface("provider2.v1", "provider2", "channel", "", "catsrc", "", []opregistry.APIKey{{"g2", "v2", "k2", "k2s"}}, nil, nil, nil),
213270
),
214271
},
215272
{
@@ -243,9 +300,9 @@ func TestNamespaceGenerationEvolver(t *testing.T) {
243300
},
244301
},
245302
wantGen: NewGenerationFromOperators(
246-
NewFakeOperatorSurface("depender.v1", "depender", "channel", "", "catsrc", nil, []opregistry.APIKey{{"g", "v", "k", "ks"}}, nil, nil),
247-
NewFakeOperatorSurface("provider.v1", "provider", "channel", "", "catsrc", []opregistry.APIKey{{"g", "v", "k", "ks"}}, nil, nil, []opregistry.APIKey{{"g2", "v2", "k2", "k2s"}}),
248-
NewFakeOperatorSurface("provider2.v1", "provider2", "channel", "", "catsrc", nil, nil, []opregistry.APIKey{{"g2", "v2", "k2", "k2s"}}, nil),
303+
NewFakeOperatorSurface("depender.v1", "depender", "channel", "", "catsrc", "", nil, []opregistry.APIKey{{"g", "v", "k", "ks"}}, nil, nil),
304+
NewFakeOperatorSurface("provider.v1", "provider", "channel", "", "catsrc", "", []opregistry.APIKey{{"g", "v", "k", "ks"}}, nil, nil, []opregistry.APIKey{{"g2", "v2", "k2", "k2s"}}),
305+
NewFakeOperatorSurface("provider2.v1", "provider2", "channel", "", "catsrc", "", nil, nil, []opregistry.APIKey{{"g2", "v2", "k2", "k2s"}}, nil),
249306
),
250307
},
251308
{
@@ -265,8 +322,7 @@ func TestNamespaceGenerationEvolver(t *testing.T) {
265322
},
266323
}),
267324
gen: NewGenerationFromOperators(
268-
NewFakeOperatorSurface("original", "o", "c", "", "s",
269-
[]opregistry.APIKey{{"g3", "v3", "k3", "k3s"}}, nil, nil, nil),
325+
NewFakeOperatorSurface("original", "o", "c", "", "s", "", []opregistry.APIKey{{"g3", "v3", "k3", "k3s"}}, nil, nil, nil),
270326
),
271327
},
272328
args: args{
@@ -279,10 +335,10 @@ func TestNamespaceGenerationEvolver(t *testing.T) {
279335
},
280336
},
281337
wantGen: NewGenerationFromOperators(
282-
NewFakeOperatorSurface("original", "o", "c", "", "s", []opregistry.APIKey{{"g3", "v3", "k3", "k3s"}}, nil, nil, nil),
283-
NewFakeOperatorSurface("depender.v1", "depender", "channel", "", "catsrc", nil, []opregistry.APIKey{{"g", "v", "k", "ks"}}, nil, nil),
284-
NewFakeOperatorSurface("provider.v1", "provider", "channel", "", "catsrc", []opregistry.APIKey{{"g", "v", "k", "ks"}}, []opregistry.APIKey{{"g2", "v2", "k2", "k2s"}}, nil, nil),
285-
NewFakeOperatorSurface("provider2.v1", "provider2", "channel", "", "catsrc", []opregistry.APIKey{{"g2", "v2", "k2", "k2s"}}, []opregistry.APIKey{{"g3", "v3", "k3", "k3s"}}, nil, nil),
338+
NewFakeOperatorSurface("original", "o", "c", "", "s", "", []opregistry.APIKey{{"g3", "v3", "k3", "k3s"}}, nil, nil, nil),
339+
NewFakeOperatorSurface("depender.v1", "depender", "channel", "", "catsrc", "", nil, []opregistry.APIKey{{"g", "v", "k", "ks"}}, nil, nil),
340+
NewFakeOperatorSurface("provider.v1", "provider", "channel", "", "catsrc", "", []opregistry.APIKey{{"g", "v", "k", "ks"}}, []opregistry.APIKey{{"g2", "v2", "k2", "k2s"}}, nil, nil),
341+
NewFakeOperatorSurface("provider2.v1", "provider2", "channel", "", "catsrc", "", []opregistry.APIKey{{"g2", "v2", "k2", "k2s"}}, []opregistry.APIKey{{"g3", "v3", "k3", "k3s"}}, nil, nil),
286342
),
287343
},
288344
{
@@ -299,7 +355,7 @@ func TestNamespaceGenerationEvolver(t *testing.T) {
299355
},
300356
}),
301357
gen: NewGenerationFromOperators(
302-
NewFakeOperatorSurface("original", "o", "c", "", "catsrc", nil, nil, nil, nil),
358+
NewFakeOperatorSurface("original", "o", "c", "", "catsrc", "", nil, nil, nil, nil),
303359
),
304360
},
305361
args: args{
@@ -312,9 +368,9 @@ func TestNamespaceGenerationEvolver(t *testing.T) {
312368
},
313369
},
314370
wantGen: NewGenerationFromOperators(
315-
NewFakeOperatorSurface("updated", "o", "c", "original", "catsrc", nil, nil, nil, nil),
316-
NewFakeOperatorSurface("depender.v1", "depender", "channel", "", "catsrc", nil, []opregistry.APIKey{{"g", "v", "k", "ks"}}, nil, nil),
317-
NewFakeOperatorSurface("provider.v1", "provider", "channel", "", "catsrc", []opregistry.APIKey{{"g", "v", "k", "ks"}}, nil, nil, nil),
371+
NewFakeOperatorSurface("updated", "o", "c", "original", "catsrc", "", nil, nil, nil, nil),
372+
NewFakeOperatorSurface("depender.v1", "depender", "channel", "", "catsrc", "", nil, []opregistry.APIKey{{"g", "v", "k", "ks"}}, nil, nil),
373+
NewFakeOperatorSurface("provider.v1", "provider", "channel", "", "catsrc", "", []opregistry.APIKey{{"g", "v", "k", "ks"}}, nil, nil, nil),
318374
),
319375
},
320376
}

0 commit comments

Comments
 (0)