Skip to content

enhancement: support consumer custom labels in ApisixConsumer #398

@kayx23

Description

@kayx23

Summary

Please triage whether ApisixConsumer should support user-defined consumer labels in addition to the controller-generated labels.

Current behavior

APISIX itself supports consumer labels, but ApisixConsumer does not currently provide a way to define custom labels on the APISIX consumer.

From the current implementation:

  • ApisixConsumer does not expose a field for consumer custom labels
  • the translator sets consumer.Labels = label.GenLabel(ac)
  • label.GenLabel only generates controller metadata labels such as kind, name, namespace, and resource key

As a result, consumer label use cases supported by APISIX cannot currently be expressed through ApisixConsumer.

Use cases affected

  • setting business or tenant labels on a consumer
  • using those labels in workflows that depend on consumer label metadata, such as attach-consumer-label

Code context

  • api/v2/apisixconsumer_types.go
  • internal/adc/translator/apisixconsumer.go
  • internal/controller/label/label.go

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions