Closed angelwcrypto closed 2 years ago
Hi @angelwcrypto, the helm-error is not really descriptive. Can you do a "helm template charts/argo-cd -f charts/argo-cd/values.yaml? Does this succeed?
Hello @ckotzbauer thanks for quick response :) Yes it is successful.
The Chart is downloaded from argo/argo-cd without modifications, thank you.
Okay, could you please do the following:
ckotzbauer/kyverno-test-action@v2
(it is released until several weeks, but the README wasn't updated)debug
input to true
. This would stream the helm-output to the action-log.There is no more debug information showing
validate-helm-config:
runs-on: ubuntu-latest
needs:
- validate-kyverno-policies
strategy:
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v1
with:
version: v3.8.1
- uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.2.1
- name: Run chart-testing (lint)
run: ct lint --config ct.yaml
- name: Create kind cluster
uses: helm/kind-action@v1.2.0
# if: steps.list-changed.outputs.changed == 'true'
- name: Run chart-testing (install)
run: ct install --config ct.yaml
- name: Test against Kyverno policies
uses: ckotzbauer/kyverno-test-action@v1
with:
chart-dir: charts/argo-cd
value-files: |
argo-cd/values.yaml
policy-files: |
policies/validate-crd.yaml
debug: true
These are the config I use: ct.yaml
helm-extra-args: --timeout 600s
chart-dirs:
- charts
target-branch: main
policies/validate-crd.yaml
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: require-applicationset
spec:
validationFailureAction: enforce
rules:
- name: require-applicationset
match:
any:
- resources:
kinds:
- CustomResourceDefinition
validate:
message: "ApplicationSet is required in ArgoCD."
pattern:
spec:
kind:
- name: ApplicationSet
Please update the action to v2
as I told you above, the v1
doesn't know the debug
input (as the warning says)
Ok, it seems that the file is not rendered.
The path from value-files is wrong. The paths have to be relative to the repo root.
Thank you @ckotzbauer It works, however I am not sure if it is supposed to have 0 test passes and fails.
That's correct according the helm docs: https://helm.sh/docs/chart_best_practices/custom_resource_definitions/#method-1-let-helm-do-it-for-you
"There is now a special directory called crds that you can create in your chart to hold your CRDs. These CRDs are not templated, but will be installed by default ..."
This action can only execute tests for resources emitted by "helm template".
Hello,
Thank you for creating the actions. Would like to ask for help with this. I tried to use the actions but get the following error. Thanks a lot!
This is my ci config:
This is the folder structure: