Skip to content

Commit

Permalink
helm: Fixed chart-test CI config.
Browse files Browse the repository at this point in the history
Also added yaml lint config and chart_schema files from:
https://github.com/helm/chart-testing/tree/b060fc83f292a1ef7ea6f9db5a5834eb8a83b152/etc

These files are required by chart-test's "lint" command.
There does not appear to be any documentation about this.

Refer to the following GitHub issue for more information:
helm/chart-testing#138
  • Loading branch information
sfox-equinix authored and k8s-ci-robot committed Jul 27, 2022
1 parent 2db17e7 commit 3e7df37
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/helm-chart-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,17 @@ jobs:
uses: helm/[email protected]

- name: Run chart-testing (lint)
run: ct lint --target-branch ${{ github.event.repository.default_branch }}
run: >
ct lint
--chart-dirs deploy/helm
--target-branch ${{ github.event.repository.default_branch }}
--lint-conf hack/ci/chart-test-lintconf
--chart-yaml-schema hack/ci/chart_schema.yaml
- name: Create kind cluster
uses: helm/[email protected]

- name: Run chart-testing (install)
run: ct install
run: >
ct install
--chart-dirs deploy/helm
43 changes: 43 additions & 0 deletions hack/ci/chart-test-lintconf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
rules:
braces:
min-spaces-inside: 0
max-spaces-inside: 0
min-spaces-inside-empty: -1
max-spaces-inside-empty: -1
brackets:
min-spaces-inside: 0
max-spaces-inside: 0
min-spaces-inside-empty: -1
max-spaces-inside-empty: -1
colons:
max-spaces-before: 0
max-spaces-after: 1
commas:
max-spaces-before: 0
min-spaces-after: 1
max-spaces-after: 1
comments:
require-starting-space: true
min-spaces-from-content: 2
document-end: disable
document-start: disable # No --- to start a file
empty-lines:
max: 2
max-start: 0
max-end: 0
hyphens:
max-spaces-after: 1
indentation:
spaces: consistent
indent-sequences: whatever # - list indentation will handle both indentation and without
check-multi-line-strings: false
key-duplicates: enable
line-length: disable # Lines can be any length
new-line-at-end-of-file: enable
new-lines:
type: unix
trailing-spaces: enable
truthy:
level: warning

20 changes: 20 additions & 0 deletions hack/ci/chart_schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: str()
home: str()
version: str()
appVersion: any(str(), num())
description: str()
keywords: list(str(), required=False)
sources: list(str(), required=False)
maintainers: list(include('maintainer'), required=False)
icon: str(required=False)
engine: str(required=False)
condition: str(required=False)
tags: str(required=False)
deprecated: bool(required=False)
kubeVersion: str(required=False)
annotations: map(str(), str(), required=False)
---
maintainer:
name: str()
email: str(required=False)
url: str(required=False)

0 comments on commit 3e7df37

Please sign in to comment.