Fix up chart linting, add docs and lint script (#146)
This updates the Helm linting system with the following changes: - Import lintconf.yaml with small change to comment distance in order to match existing values.yaml standards - Update Chart.yaml and values.yaml in each chart to pass linting standards - Maintainers added to each chart from OWNERS + CODEOWNERS, the linter requires GitHub usernames so argo-events maintainer names were converted - README updated with documentation around chart standards and testing - A local shell script added for running lint tests locally
This commit is contained in:
parent
30889df476
commit
5f33036890
9 changed files with 112 additions and 13 deletions
|
@ -5,7 +5,7 @@ jobs:
|
||||||
- image: gcr.io/kubernetes-charts-ci/test-image:v3.0.1
|
- image: gcr.io/kubernetes-charts-ci/test-image:v3.0.1
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- run: ct lint --config .circleci/chart-testing.yaml
|
- run: ct lint --config .circleci/chart-testing.yaml --lint-conf .circleci/lintconf.yaml
|
||||||
# Technically this only needs to be run on master, but it's good to have it run on every PR
|
# Technically this only needs to be run on master, but it's good to have it run on every PR
|
||||||
# so that it is regularly tested.
|
# so that it is regularly tested.
|
||||||
publish:
|
publish:
|
||||||
|
|
42
.circleci/lintconf.yaml
Normal file
42
.circleci/lintconf.yaml
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
---
|
||||||
|
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: 1
|
||||||
|
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
|
|
@ -51,6 +51,33 @@ argocd app create guestbook --dest-namespace default --dest-server https://kuber
|
||||||
argocd app sync guestbook
|
argocd app sync guestbook
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## New Application Versions
|
||||||
|
|
||||||
|
When raising application versions ensure you make the following changes:
|
||||||
|
|
||||||
|
- `values.yaml`: Bump all instances of the container image version
|
||||||
|
- `Chart.yaml`: Ensure `appVersion` matches the above container image and bump `version`
|
||||||
|
|
||||||
|
Please ensure chart version changes adhere to semantic versioning standards:
|
||||||
|
|
||||||
|
- Patch: App version patch updates, backwards compatible optional chart features
|
||||||
|
- Minor: New chart functionality (sidecars), major application updates or minor non-backwards compatible changes
|
||||||
|
- Major: Large chart rewrites, major non-backwards compatible or destructive changes
|
||||||
|
|
||||||
|
## Testing Charts
|
||||||
|
|
||||||
|
As part of the Continous Intergration system we run Helm's [Chart Testing](https://github.com/helm/chart-testing) tool.
|
||||||
|
|
||||||
|
The checks for this tool are stricter than the standard Helm requirements, where fields normally considered optional like `maintainer` are required in the standard spec and must be valid GitHub usernames.
|
||||||
|
|
||||||
|
Linting configuration can be found in [lintconf.yaml](.circleci/lintconf.yaml)
|
||||||
|
|
||||||
|
The linting can be invoked manually with the following command:
|
||||||
|
|
||||||
|
```
|
||||||
|
./scripts/lint.sh
|
||||||
|
```
|
||||||
|
|
||||||
## Publishing Changes
|
## Publishing Changes
|
||||||
|
|
||||||
Changes are automatically publish whenever a commit is merged to master. The CI job (see `.circleci/config.yaml`) runs this:
|
Changes are automatically publish whenever a commit is merged to master. The CI job (see `.circleci/config.yaml`) runs this:
|
||||||
|
|
|
@ -2,7 +2,7 @@ apiVersion: v1
|
||||||
appVersion: "1.2.4"
|
appVersion: "1.2.4"
|
||||||
description: A Helm chart for ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes.
|
description: A Helm chart for ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes.
|
||||||
name: argo-cd
|
name: argo-cd
|
||||||
version: 1.0.0
|
version: 1.0.1
|
||||||
home: https://github.com/argoproj/argo-helm
|
home: https://github.com/argoproj/argo-helm
|
||||||
icon: https://raw.githubusercontent.com/argoproj/argo/master/argo.png
|
icon: https://raw.githubusercontent.com/argoproj/argo/master/argo.png
|
||||||
keywords:
|
keywords:
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
description: A Helm chart for Argo-CI
|
description: A Helm chart for Argo-CI
|
||||||
name: argo-ci
|
name: argo-ci
|
||||||
version: 0.1.4
|
version: 0.1.5
|
||||||
icon: https://raw.githubusercontent.com/argoproj/argo/master/argo.png
|
icon: https://raw.githubusercontent.com/argoproj/argo/master/argo.png
|
||||||
|
appVersion: v1.0.0-alpha2
|
||||||
|
home: https://github.com/argoproj/argo-helm
|
||||||
|
maintainers:
|
||||||
|
- name: alexec
|
||||||
|
- name: alexmt
|
||||||
|
- name: jessesuen
|
||||||
|
|
|
@ -9,4 +9,3 @@ argo:
|
||||||
installMinio: true
|
installMinio: true
|
||||||
minioBucketName: argo-artifacts
|
minioBucketName: argo-artifacts
|
||||||
useReleaseAsInstanceID: true
|
useReleaseAsInstanceID: true
|
||||||
|
|
|
@ -1,15 +1,16 @@
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
description: A Helm chart to install Argo-Events in k8s Cluster
|
description: A Helm chart to install Argo-Events in k8s Cluster
|
||||||
name: argo-events
|
name: argo-events
|
||||||
version: 0.5.1
|
version: 0.5.2
|
||||||
keywords:
|
keywords:
|
||||||
- argo-events
|
- argo-events
|
||||||
- sensor-controller
|
- sensor-controller
|
||||||
- gateway-controller
|
- gateway-controller
|
||||||
sources:
|
sources:
|
||||||
- https://github.com/argoproj/argo-events
|
- https://github.com/argoproj/argo-events
|
||||||
maintainers:
|
maintainers:
|
||||||
- name: Vaibhav Page
|
- name: VaibhavPage
|
||||||
- name: Matt Magaldi
|
- name: magaldima
|
||||||
appVersion: 0.10
|
appVersion: 0.10
|
||||||
icon: https://raw.githubusercontent.com/argoproj/argo/master/argo.png
|
icon: https://raw.githubusercontent.com/argoproj/argo/master/argo.png
|
||||||
|
home: https://github.com/argoproj/argo-helm
|
||||||
|
|
|
@ -2,5 +2,11 @@ apiVersion: v1
|
||||||
appVersion: "v2.4.2"
|
appVersion: "v2.4.2"
|
||||||
description: A Helm chart for Argo Workflows
|
description: A Helm chart for Argo Workflows
|
||||||
name: argo
|
name: argo
|
||||||
version: 0.6.2
|
version: 0.6.3
|
||||||
icon: https://raw.githubusercontent.com/argoproj/argo/master/argo.png
|
icon: https://raw.githubusercontent.com/argoproj/argo/master/argo.png
|
||||||
|
home: https://github.com/argoproj/argo-helm
|
||||||
|
maintainers:
|
||||||
|
- name: alexec
|
||||||
|
- name: alexmt
|
||||||
|
- name: jessesuen
|
||||||
|
- name: benjaminws
|
||||||
|
|
18
scripts/lint.sh
Executable file
18
scripts/lint.sh
Executable file
|
@ -0,0 +1,18 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -eux
|
||||||
|
|
||||||
|
SRCROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||||
|
|
||||||
|
for dir in $(find $SRCROOT/charts -mindepth 1 -maxdepth 1 -type d);
|
||||||
|
do
|
||||||
|
name=$(basename $dir)
|
||||||
|
echo "Running Helm linting for $name"
|
||||||
|
docker run \
|
||||||
|
-v "$SRCROOT:/workdir" \
|
||||||
|
gcr.io/kubernetes-charts-ci/test-image:v3.0.1 \
|
||||||
|
ct \
|
||||||
|
lint \
|
||||||
|
--config .circleci/chart-testing.yaml \
|
||||||
|
--lint-conf .circleci/lintconf.yaml \
|
||||||
|
--charts "/workdir/charts/${name}"
|
||||||
|
done
|
Loading…
Reference in a new issue