Skip to content
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

Bugfix/crds disabled subchart #314

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

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

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.

1 participant