[Proposal] Move project-id from bare label to domain-prefixed K8s annotation
#1701
renuka-fernando
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
project-idon API custom resources (RestApi, WebSubAPI) with a domain-prefixed annotationgateway.api-platform.wso2.com/project-idproject-idlabel: fall back to the old label if the annotation is absent, and log a warningMotivation
project-idis non-identifying metadata used solely for analytics. Per Kubernetes conventions, non-selector metadata belongs in annotations, not labels. Labels are for identifying and selecting objects.project-idcan collide with labels set by other tools, operators, or CI/CD systems. Domain-prefixed keys (gateway.api-platform.wso2.com/...) are the Kubernetes best practice for vendor-specific metadata.gateway.api-platform.wso2.com/prefixed annotations from HTTPRoute resources. Alongside existing fields (api-version,context,display-name), the operator will need to supportproject-id(and future fields likeartifact-id) via the same annotation convention when converting HTTPRoute to RestApi CRs.HTTPRouteresources into internal RestApi CRs. Users need to attach project-id to HTTPRoute resources too. On HTTPRoute (a shared, multi-controller resource), a bare non-selector label is misleading and collision-prone -- labels on HTTPRoute are used for Gateway route attachment and selection.Proposal
project-idfrom.metadata.labelsto.metadata.annotationswith the fully qualified keygateway.api-platform.wso2.com/project-idExamples
Before:
After:
HTTPRoute usage (new):
Drawbacks
project-idas a label (via platform-api, CI/CD, or manually) must update their resource manifests.gateway.api-platform.wso2.com/project-idis longer thanproject-id. This is an accepted tradeoff for correctness and collision avoidance.Compatibility
References
Beta Was this translation helpful? Give feedback.
All reactions