Skip to content

Commit bf5f5af

Browse files
committed
every test has wildcard mode
1 parent a397f67 commit bf5f5af

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

pkg/server/stream/v3/subscription.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ func newSubscription(emptyRequest bool, initialResourceVersions map[string]strin
3838
}
3939

4040
// By default we set the subscription as a wildcard only if the request was empty
41-
// and in legacy mode. Later on, outside of this constructor, when we actually
42-
// process the request, if the request was non-empty, it may have an
41+
// and in legacy mode. Later on, outside of this constructor, when we actually
42+
// process the request, if the request was non-empty, it may have an
4343
// explicit wildcard subscription, in which case
4444
// we will set the wildcard field on the subscription accordingly.
4545
wildcard := emptyRequest && allowLegacyWildcard

pkg/server/stream/v3/subscription_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,10 @@ func TestSotwSubscriptionsWithDeactivatedLegacyWildcardForTypes(t *testing.T) {
202202
subEndpoint.SetResourceSubscription([]string{})
203203
assert.False(t, subEndpoint.IsWildcard())
204204

205+
// Can still explicitly subscribe to wildcard
206+
subEndpoint.SetResourceSubscription([]string{"*"})
207+
assert.True(t, subEndpoint.IsWildcard())
208+
205209
// Route should still have legacy wildcard enabled
206210
subRoute := NewSotwSubscription([]string{}, opts, routeType)
207211
subRoute.SetResourceSubscription([]string{})
@@ -252,6 +256,10 @@ func TestDeltaSubscriptionsWithDeactivatedLegacyWildcardForTypes(t *testing.T) {
252256
subEndpoint.UpdateResourceSubscriptions(nil, nil)
253257
assert.False(t, subEndpoint.IsWildcard())
254258

259+
// Can still explicitly subscribe to wildcard
260+
subEndpoint.UpdateResourceSubscriptions([]string{"*"}, nil)
261+
assert.True(t, subEndpoint.IsWildcard())
262+
255263
// Route should still have legacy wildcard enabled
256264
subRoute := NewDeltaSubscription([]string{}, []string{}, map[string]string{}, opts, routeType)
257265
subRoute.UpdateResourceSubscriptions(nil, nil)

0 commit comments

Comments
 (0)