Skip to content

docs: Missing docs on ownership annotations#32199

Open
arnavnagzirkar wants to merge 2 commits into
helm:mainfrom
arnavnagzirkar:fix-12869
Open

docs: Missing docs on ownership annotations#32199
arnavnagzirkar wants to merge 2 commits into
helm:mainfrom
arnavnagzirkar:fix-12869

Conversation

@arnavnagzirkar

@arnavnagzirkar arnavnagzirkar commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

The meta.helm.sh/release-name and meta.helm.sh/release-namespace annotations (along with the app.kubernetes.io/managed-by=Helm label) are used by Helm to track ownership of Kubernetes resources.

Root cause

The meta.helm.sh/release-name and meta.helm.sh/release-namespace annotations
(along with the app.kubernetes.io/managed-by=Helm label) are used by Helm to track
ownership of Kubernetes resources. These are defined in pkg/action/validate.go as
helmReleaseNameAnnotation and helmReleaseNamespaceAnnotation. However, neither the
helm install nor helm upgrade command help text explained these annotations or the
--take-ownership flag that lets users adopt pre-existing resources. Users had no
in-tool documentation to discover or understand the ownership mechanism.

What changed

Added a "RESOURCE OWNERSHIP" section to the installDesc constant in
pkg/cmd/install.go (newInstallCmd) and the upgradeDesc constant in
pkg/cmd/upgrade.go (newUpgradeCmd). Each section lists the three ownership
metadata items Helm applies:

  • app.kubernetes.io/managed-by=Helm (label)
  • meta.helm.sh/release-name=<release-name> (annotation)
  • meta.helm.sh/release-namespace=<release-namespace> (annotation)

And explains how the --take-ownership flag allows adopting resources that already
exist in the cluster without this ownership metadata.

Issue

Fixes #12869

Issue: #12869

Diffstat

pkg/cmd/install.go | 15 +++++++++++++++
 pkg/cmd/upgrade.go | 13 +++++++++++++
 2 files changed, 28 insertions(+)

Testing

  • Ran the relevant tests and linter for the changed files while developing.

  • Kept the change minimal and focused on this one issue.

AI assistance

I used GitHub Copilot to help write parts of this change. I've reviewed and tested it myself, I understand what it does, and I'll follow up on any review feedback.

Add a RESOURCE OWNERSHIP section to the helm install and helm upgrade
command descriptions explaining the meta.helm.sh/release-name and
meta.helm.sh/release-namespace annotations (and app.kubernetes.io/managed-by
label) that Helm uses to track resource ownership, and document the
--take-ownership flag for adopting pre-existing resources.

Fixes helm#12869

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Arnav Nagzirkar <113314200+arnavnagzirkar@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 9, 2026 04:34
@pull-request-size pull-request-size Bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jun 9, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds CLI help text explaining Helm’s resource ownership metadata and how --take-ownership affects install/upgrade behavior.

Changes:

  • Documented the label/annotations Helm uses to track resource ownership in helm install help output.
  • Documented upgrade-time ownership checks and the purpose of --take-ownership in helm upgrade help output.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
pkg/cmd/upgrade.go Adds help text describing ownership metadata and --take-ownership during upgrades.
pkg/cmd/install.go Adds help text describing ownership metadata and adopting existing resources with --take-ownership.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/cmd/upgrade.go Outdated
Comment on lines +92 to +93
During an upgrade, if a resource exists in the cluster without these annotations
(or with annotations pointing to a different release), Helm will return an error.
Comment thread pkg/cmd/install.go Outdated
Comment on lines +140 to +141
These are used to track ownership. If a resource already exists in the cluster
without these annotations, Helm will refuse to install and return an error. To
@promptless-for-oss

Copy link
Copy Markdown

Promptless prepared a documentation update related to this change.

Triggered by PR #32199

Added a troubleshooting FAQ entry explaining resource ownership errors and how to resolve them using --take-ownership. This complements the CLI help text changes in this PR by providing users with discoverable documentation when they encounter ownership conflict errors.

Review: docs: add resource ownership troubleshooting FAQ

The refusal condition referred to 'these annotations', but Helm tracks ownership with both the app.kubernetes.io/managed-by label and the meta.helm.sh release-name/release-namespace annotations. checkOwnership also errors when that metadata points to a different release or namespace, not only when it is absent. Reword both help texts to say 'this metadata' and to cover the mismatched release or namespace case.

Signed-off-by: Arnav Nagzirkar <113314200+arnavnagzirkar@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing docs on ownership annotations

3 participants