Skip to content

fix: add standard labels to CRDs#96

Open
Suhani95 wants to merge 2 commits into
kyverno:mainfrom
Suhani95:fix/crd-standard-labels-clean
Open

fix: add standard labels to CRDs#96
Suhani95 wants to merge 2 commits into
kyverno:mainfrom
Suhani95:fix/crd-standard-labels-clean

Conversation

@Suhani95

@Suhani95 Suhani95 commented Jun 6, 2026

Copy link
Copy Markdown

Explanation

This PR fixes an issue where CRDs generated by the kyverno-api Helm chart were rendered without standard Helm/Kubernetes labels when no custom labels were provided. It adds the default labels used across other Kyverno charts while preserving support for user-defined labels

Related issue

Fixes #71

Proposed Changes

  • Add standard Helm/Kubernetes labels to the kyverno-api.labels helper.

  • Preserve existing .Values.labels support for custom labels.

  • Ensure all generated CRDs receive consistent metadata labels.

Verification

helm template test-release .
helm lint .

Verified that generated CRDs now include standard labels and the chart renders successfully.

Checklist

  • I have read the contributing guidelines.
  • I have read the PR documentation guide and followed the process including adding proof manifests to this PR.
  • This is a bug fix and I have added unit tests that prove my fix is effective.

Further Comments

N/A

Signed-off-by: Suhani <suhani4630@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the kyverno-api Helm chart’s CRD templates so that generated CRDs include a consistent set of standard Helm/Kubernetes labels even when .Values.labels is empty, while still supporting user-provided custom labels.

Changes:

  • Updated the kyverno-api.labels helper to emit standard app.kubernetes.io/* and helm.sh/chart labels by default.
  • Preserved support for user-defined .Values.labels via templating (tpl) so custom labels can still be injected.

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

Comment thread charts/kyverno-api/templates/_helpers.tpl Outdated
@Suhani95 Suhani95 requested a review from Copilot June 8, 2026 08:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

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

Comment thread charts/kyverno-api/templates/_helpers.tpl
Comment thread charts/kyverno-api/templates/_helpers.tpl
Comment thread charts/kyverno-api/templates/_helpers.tpl
Signed-off-by: Suhani <suhani4630@gmail.com>
@Suhani95 Suhani95 force-pushed the fix/crd-standard-labels-clean branch from 1bb88b5 to d316ad4 Compare June 8, 2026 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] helm chart: Add standard labels to resources like other kyverno charts do

2 participants