Skip to content

Use helmignore for test directories#676

Merged
bschwedler merged 6 commits intomainfrom
ci-helmignore-fixes
Jun 3, 2025
Merged

Use helmignore for test directories#676
bschwedler merged 6 commits intomainfrom
ci-helmignore-fixes

Conversation

@bschwedler
Copy link
Contributor

@bschwedler bschwedler commented May 23, 2025

Both helm unittest and chart-testing now support using .helmignore 🙌🏻

Let's move the test files back into the charts directory so that we no longer have to symlink them.

@bschwedler bschwedler force-pushed the ci-helmignore-fixes branch 3 times, most recently from 91326d1 to ce27039 Compare May 23, 2025 20:15
@bschwedler
Copy link
Contributor Author

bschwedler commented May 23, 2025

One of the installation tests is failing:

Installing chart with values file "charts/rstudio-workbench/ci/basic-ingress-values.yaml"...
Error: INSTALLATION FAILED: 1 error occurred:
	* Ingress.networking.k8s.io "rstudio-workbench-mz6b6a9nzw" is invalid: spec.rules[0].http.paths[0].backend: Required value: port name or number is required

The output of helm template using this values file looks correct to me, with the exception of the vertical whitespace, which I don't think should be an issue
https://kubernetes.io/docs/reference/kubernetes-api/service-resources/ingress-v1/#IngressBackend

---
# Source: rstudio-workbench/templates/ingress.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: release-name-rstudio-workbench
  labels:
    helm.sh/chart: rstudio-workbench-0.9.1
    app.kubernetes.io/name: rstudio-workbench
    app.kubernetes.io/instance: release-name
    app.kubernetes.io/version: "2025.05.0"
    app.kubernetes.io/managed-by: Helm
  annotations:
    kubernetes.io/ingress.class: traefik
spec:
  rules:
    - host: "workbench.rstudio.com"
      http:
        paths:
          -            
            path: /test/
            pathType: Prefix
            backend:
              service:
                name: release-name-rstudio-workbench
                port:
                  number: 80

The output parses correctly with yq

$ yq '.spec.rules[0].http.paths[0].backend.service.port.number' < ingress.yaml
80

@bschwedler
Copy link
Contributor Author

bschwedler commented Jun 3, 2025

The new chart-testing release has resolved the above issue!

Also ignore packaged charts in .gitignore
Both chart-testing and unittest now support .helmignore
This allows us to automatically be kept up-to-date with the latest
version of the action, which in turn gets us the latest version of helm
and chart-testing
Copy link
Contributor

@ianpittwood ianpittwood left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@jforest jforest left a comment

Choose a reason for hiding this comment

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

I love the cleanup! Simpler and easier to understand, thanks for taking this on!

@bschwedler bschwedler merged commit 1f65919 into main Jun 3, 2025
7 checks passed
@bschwedler bschwedler deleted the ci-helmignore-fixes branch June 3, 2025 15:34
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.

3 participants