Skip to content

Tablet UID Pod label strips leading zeros #801

Description

@absolutejam

Issue

Pod label planetscale.com/tablet-uid strips leading zeros.

Root cause

The generated Pod label for UIDs with leading zeros is formatted with strconv.FormatUint(uint64(tabletAlias.Uid), 10)

labels[planetscalev2.TabletUidLabel] = strconv.FormatUint(uint64(tabletAlias.Uid), 10)

Which results in leading zeros being removed, eg. 0790125915 -> 790125915.

While this doesn't affect the functionality of the operator or tablets, it makes it more difficult to correlate data because the UID is no longer correct. My use case is joining in Prometheus labels and I have some custom Steampipe connectors that allow me to query/join across Vitess, Kubernetes and other data-sources and I have to special-case the tablet UID.

I'll be happy to submit a PR shortly with a test case I have (a combination of labels that build the above uid).

Version

Operator: v2.16.0

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