Skip to content

Conversation

@fenech
Copy link
Contributor

@fenech fenech commented Feb 28, 2023

Prevent disabled subcharts containing CRDs from causing tests to fail.

Add a test chart which initially fails, since it contains a disabled subchart with a CRD.

By explicitly processing the dependencies (a workaround for this Helm issue), the check for CRDs passes.

Extract the existing "chart-0.1.0-v3.with-crd" and add it as a
dependency of this chart.

Installing this chart does not install any CRDs, since the condition
for the chart is false. However, the NotContainCRDs check fails, since
it doesn't take the condition into account.
Process dependencies according to chart values to remove unused
subcharts, so any CRDs they may contain are not taken into account.
@fenech
Copy link
Contributor Author

fenech commented Feb 28, 2023

I created this draft PR with a reproducible test case, but I can also open an issue separately if preferred.

To reproduce the failure on the first commit, I built the chart-verifier image locally using the Makefile, and ran:

podman run --rm -it -e KUBECONFIG=/.kube/config \
  -v "${HOME}/.kube":/.kube:z \
  -v "$PWD/internal/chartverifier/checks/":/charts:z \
  "quay.io/redhat-certification/chart-verifier:be2cebd" \
  verify /charts/chart-0.1.0-v3.with-subchart/testchart/

Running the same command on the last commit passes the "no CRDs" check:

    - check: v1.0/not-contains-crds
      type: Mandatory
      outcome: PASS
      reason: Chart does not contain CRDs

@komish komish closed this Dec 1, 2025
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.

2 participants