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

Add chart test to manifest #309

Open
skygrammas opened this issue Jun 14, 2023 · 2 comments
Open

Add chart test to manifest #309

skygrammas opened this issue Jun 14, 2023 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@skygrammas
Copy link

Helm supports chart tests, which can help validate that a chart works as expected when installed. Additionally, chart tests can help a chart consumer understand how a chart should behave. These tests are fairly simple jobs and could reduce the deployment of erroneous charts. For example, #306 highlights how chart version 0.22.0 is effectively broken by changes introduced in #291; I believe that a chart test that simply validates Vector's configuration could catch such issues and accelerate less-faulty releases.

I am recommending that a chart test be added to the chart manifest for Vector's Helm charts.

@spencergilbert spencergilbert added enhancement New feature or request good first issue Good for newcomers labels Jun 14, 2023
@skygrammas
Copy link
Author

An example job specification that may be effective is the following:

apiVersion: batch/v1
kind: Job
metadata:
  name: vector-test-installation
spec:
  template:
    metadata:
      annotations:
        "helm.sh/hook": test
    spec:
      containers:
      - name: vector-validate
        image: timberio/vector:{{ .Values.image.tag }}
        command: ['vector']
        args: ['validate --config-yaml /etc/vector/vector.yaml; echo $?']
        {{- if hasKey .Values "env" }}
        env:
        {{- .Values.env | toYaml | nindent 8 }}
        {{- end }}
        volumeMounts:
        - name: config
          mountPath: /etc/vector/vector.yaml
          subPath: vector.yaml
      volumes:
      - name: config
        configMap:
          name: vector-test-configmap
      restartPolicy: Never

@spencergilbert
Copy link
Contributor

I haven't checked recently, but I do remember chart tests causing problems with ArgoCD a couple years back - it would be good to make sure we don't cause unpleasant regressions if we add them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants