Skip to content

Add kubeconform verification of helm charts #280

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 25, 2025

Conversation

SgtCoDFish
Copy link
Member

This catches the issue fixed by cert-manager/csi-driver-spiffe#284 - so it's probably a useful thing to have in the Helm module, globally.

@cert-manager-prow cert-manager-prow bot added dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 25, 2025
## Verify that the Helm chart passes a strict check using kubeconform
## @category [shared] Generate/ Verify
verify-helm-kubeconform: $(helm_chart_archive) | $(NEEDS_KUBECONFORM)
$(HELM) template kubeconform-template-do-not-use $< | $(KUBECONFORM) -strict
Copy link
Contributor

Choose a reason for hiding this comment

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

Do not use? 😆

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah that's the [NAME] of the chart:

helm template --help
helm template [NAME] [CHART]

So the rendered output will have the name kubeconform-template-do-not-use in it:

# Source: cert-manager-csi-driver-spiffe/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
  namespace: default
  labels:
    app.kubernetes.io/name: cert-manager-csi-driver-spiffe
    helm.sh/chart: cert-manager-csi-driver-spiffe-v0.0.0
    app.kubernetes.io/instance: kubeconform-template-do-not-use <---------------
    app.kubernetes.io/version: "v0.0.0"
    app.kubernetes.io/managed-by: Helm
  name: cert-manager-csi-driver-spiffe

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm trying to avoid anyone using that output for anything else - probably wouldn't happen, maybe more confusing than helpful?

Copy link
Contributor

Choose a reason for hiding this comment

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

It was a bit confusing, but I understand it better now that you have explained it!

Copy link
Contributor

@erikgb erikgb left a comment

Choose a reason for hiding this comment

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

I don't understand all of this, but I trust you to know what you are doing.

/lgtm
/approve

@cert-manager-prow cert-manager-prow bot added the lgtm Indicates that a PR is ready to be merged. label Apr 25, 2025
@cert-manager-prow
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: erikgb

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@cert-manager-prow cert-manager-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 25, 2025
@cert-manager-prow cert-manager-prow bot merged commit 78a86c2 into cert-manager:main Apr 25, 2025
4 checks passed
@SgtCoDFish SgtCoDFish deleted the kubeconform branch April 25, 2025 19:42
@SgtCoDFish
Copy link
Member Author

I don't understand all of this, but I trust you to know what you are doing.

Haha we'll see if I do 😂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. lgtm Indicates that a PR is ready to be merged. 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.

2 participants