Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enable Consumer Groups scoped Plugins with Konnect #994

Merged
merged 2 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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) {
if utils.Kong340Version.LTE(b.kongVersion) || b.isKonnect {
b.isConsumerGroupScopedPluginSupported = true
}

Expand Down Expand Up @@ -963,7 +963,7 @@ func (b *stateBuilder) plugins() {
}

func (b *stateBuilder) validatePlugin(p FPlugin) error {
if (b.isConsumerGroupScopedPluginSupported && !b.isKonnect) && *p.Name == ratelimitingAdvancedPluginName {
if b.isConsumerGroupScopedPluginSupported && *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
2 changes: 0 additions & 2 deletions tests/integration/dump_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,6 @@ func Test_Dump_SkipConsumers(t *testing.T) {
}

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

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

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

client, err := getTestClient()
if err != nil {
t.Errorf(err.Error())
Expand Down
2 changes: 1 addition & 1 deletion utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var ErrorConsumerGroupUpgrade = errors.New(
"a rate-limiting-advanced plugin with config.consumer_groups\n" +
"and/or config.enforce_consumer_groups was found. Please use Consumer Groups scoped\n" +
"Plugins when running against Kong Enterprise 3.4.0 and above.\n\n" +
"Check DOC_LINK for more information",
"Check https://docs.konghq.com/gateway/latest/kong-enterprise/consumer-groups/ for more information",
)

var UpgradeMessage = "Please upgrade your configuration to account for 3.0\n" +
Expand Down
Loading