Skip to content

Commit

Permalink
feat: disable Consumer Groups scoped Plugins for Konnect
Browse files Browse the repository at this point in the history
  • Loading branch information
GGabriele committed Aug 1, 2023
1 parent 9f68186 commit b2b24d3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions file/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (b *stateBuilder) build() (*utils.KongRawState, *utils.KonnectRawState, err
b.checkRoutePaths = true
}

if utils.Kong340Version.LTE(b.kongVersion) || b.isKonnect {
if utils.Kong340Version.LTE(b.kongVersion) {
b.isConsumerGroupScopedPluginSupported = true
}

Expand Down Expand Up @@ -931,7 +931,7 @@ func (b *stateBuilder) plugins() {
p.ConsumerGroup = utils.GetConsumerGroupReference(cg.ConsumerGroup)
}

if b.isConsumerGroupScopedPluginSupported && *p.Name == ratelimitingAdvancedPluginName {
if (b.isConsumerGroupScopedPluginSupported && !b.isKonnect) && *p.Name == ratelimitingAdvancedPluginName {
// check if deprecated consumer-groups configuration is present in the config
var consumerGroupsFound bool
if groups, ok := p.Config["consumer_groups"]; ok {
Expand Down
3 changes: 3 additions & 0 deletions tests/integration/dump_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@ func Test_Dump_SkipConsumers_35x(t *testing.T) {
}

func Test_Dump_SkipConsumers_Konnect(t *testing.T) {
// TODO: remove skip once Konnect support is enabled.
t.Skip()

tests := []struct {
name string
stateFile string
Expand Down
5 changes: 5 additions & 0 deletions tests/integration/sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3716,6 +3716,8 @@ func Test_Sync_SkipConsumers_34x(t *testing.T) {
// test scope:
// - konnect
func Test_Sync_SkipConsumers_Konnect(t *testing.T) {
// TODO: remove skip once Konnect support is enabled.
t.Skip()
runWhenKonnect(t)
// setup stage
client, err := getTestClient()
Expand Down Expand Up @@ -4542,6 +4544,9 @@ func Test_Sync_ConsumerGroupsScopedPlugins_Post340(t *testing.T) {
}

func Test_Sync_ConsumerGroupsScopedPluginsKonnect(t *testing.T) {
// TODO: remove skip once Konnect support is enabled.
t.Skip()

client, err := getTestClient()
if err != nil {
t.Errorf(err.Error())
Expand Down

0 comments on commit b2b24d3

Please sign in to comment.