fix: include Datadog version label on pod workloads - #446
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 04c0c326b5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| {{- if and $datadog $datadog.enabled }} | ||
| {{- $_ := set $managed "tags.datadoghq.com/env" (include "common.env" . | trim) }} | ||
| {{- $_ := set $managed "tags.datadoghq.com/service" $fullname }} | ||
| {{- $_ := set $managed "tags.datadoghq.com/version" $containerImage.image.tag }} |
There was a problem hiding this comment.
Keep valid image tags from invalidating pod labels
When Datadog is enabled, a valid OCI image tag longer than 63 characters—or one beginning or ending with . or _—is copied verbatim into this Kubernetes label. Kubernetes label values have stricter syntax and length limits than image tags, so workloads that deployed successfully before this change will now be rejected by the API server. Validate or transform the label value, or populate DD_VERSION without requiring the image tag to be a Kubernetes label.
Useful? React with 👍 / 👎.
Why: Applications derive
DD_VERSIONfrom thetags.datadoghq.com/versionpod label, but the shared chart never rendered that label. Product API therefore reports Sentry events without a release even though deployments use a release-specific image tag.Use each workload’s resolved container image tag so service, worker, and cron pods expose the same deployed version. Consumer chart patch versions are bumped so the updated common library can be published through each chart.
Validated with
npm test, an explicit service/worker/cron render usingimage.tag=release-sha, scoped Prettier, andgit diff --check.