Skip to content

Commit

Permalink
fix: map KongConsumer to respective KongConsumerGroup in Konnect
Browse files Browse the repository at this point in the history
  • Loading branch information
programmer04 committed Feb 19, 2025
1 parent 0609891 commit 8210d24
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
5 changes: 3 additions & 2 deletions internal/dataplane/kongstate/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions internal/dataplane/kongstate/consumer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
{
Expand Down Expand Up @@ -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{
{
Expand Down

0 comments on commit 8210d24

Please sign in to comment.