diff --git a/CHANGELOG.md b/CHANGELOG.md index bfa5561aba..bd9472dd34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -129,7 +129,8 @@ Adding a new version? You'll need three changes: [#6881](https://github.com/Kong/kubernetes-ingress-controller/pull/6881) - `AddToScheme` is only run in the initialization of scheme of the manager but not called in `scheme.Get` to reduce the CPU usage. - [#7105](https://github.com/Kong/kubernetes-ingress-controller/pull/7105) + [#7105](https://github.com/Kong/kubernetes-ingress-controller/pull/7105) +- Fix mapping `KongConsumer` to respective `KongConsumerGroup` in Konnect ## [3.4.1] diff --git a/internal/dataplane/kongstate/consumer.go b/internal/dataplane/kongstate/consumer.go index af050f584b..2c5f6304a7 100644 --- a/internal/dataplane/kongstate/consumer.go +++ b/internal/dataplane/kongstate/consumer.go @@ -32,8 +32,9 @@ type Consumer struct { // SanitizedCopy returns a shallow copy with sensitive values redacted best-effort. func (c *Consumer) SanitizedCopy(uuidGenerator util.UUIDGenerator) Consumer { return Consumer{ - Consumer: c.Consumer, - Plugins: c.Plugins, + Consumer: c.Consumer, + Plugins: c.Plugins, + ConsumerGroups: c.ConsumerGroups, KeyAuths: func() []*KeyAuth { if c.KeyAuths == nil { return nil diff --git a/internal/dataplane/kongstate/consumer_test.go b/internal/dataplane/kongstate/consumer_test.go index e3c7cd28ee..0cc6a9417d 100644 --- a/internal/dataplane/kongstate/consumer_test.go +++ b/internal/dataplane/kongstate/consumer_test.go @@ -29,6 +29,10 @@ func TestConsumer_SanitizedCopy(t *testing.T) { CreatedAt: int64Ptr(4), Tags: []*string{kong.String("5.1"), kong.String("5.2")}, }, + ConsumerGroups: []kong.ConsumerGroup{ + {ID: kong.String("group-1")}, + {ID: kong.String("group-2")}, + }, Plugins: []kong.Plugin{{ID: kong.String("1")}}, KeyAuths: []*KeyAuth{ { @@ -75,6 +79,10 @@ func TestConsumer_SanitizedCopy(t *testing.T) { CreatedAt: int64Ptr(4), Tags: []*string{kong.String("5.1"), kong.String("5.2")}, }, + ConsumerGroups: []kong.ConsumerGroup{ + {ID: kong.String("group-1")}, + {ID: kong.String("group-2")}, + }, Plugins: []kong.Plugin{{ID: kong.String("1")}}, KeyAuths: []*KeyAuth{ {