Skip to content

Commit

Permalink
Make linting include subcharts and use strict mode (#40)
Browse files Browse the repository at this point in the history
Co-authored-by: Tony Abboud <tabboud@palantir.com>
  • Loading branch information
ashrayjain and Tony Abboud committed May 10, 2024
1 parent 3b4c43d commit 11f1575
Show file tree
Hide file tree
Showing 447 changed files with 44 additions and 70,140 deletions.
6 changes: 2 additions & 4 deletions .github/linters/ct.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ remote: origin
target-branch: develop
debug: true
validate-maintainers: false
helm-lint-extra-args: '--strict'
chart-dirs:
- charts/alpha
- charts/beta
- charts/ga
chart-repos:
- bitnami=https://charts.bitnami.com/bitnami
- grafana=https://grafana.github.io/helm-charts
- prometheus-community=https://prometheus-community.github.io/helm-charts
- vector=https://helm.vector.dev
# Repos get generated at CI time dynamically, see .github/workflows/lint.yaml
14 changes: 4 additions & 10 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,19 @@ jobs:
- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.12.1
version: v3.14.4

- uses: actions/setup-python@v4
with:
python-version: '3.10'
check-latest: true

- name: Set up chart-testing
uses: helm/chart-testing-action@v2.6.0
uses: helm/chart-testing-action@v2.6.1

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --config .github/linters/ct.yaml)
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Add helm repos to ct
run: yq '.repositories[] | (" - " + .name + "=" + .url)' helm-repositories.yaml >> .github/linters/ct.yaml

- name: Run chart-testing (lint)
if: steps.list-changed.outputs.changed == 'true'
run: ct lint --config .github/linters/ct.yaml

18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,15 @@ This repository uses chart specific labels to tag versions of each chart. The la
Each helm chart can be packaged separately and published to a container registry.

```shell
# Build helm dependencies for a single helm-chart product
$ helm dependency build ./charts/<helm-chart-path> --repository-config helm-repositories.yaml

# Package a single helm-chart product
helm package -d ./build ./charts/<helm-chart-name>
$ helm package -d ./build ./charts/<helm-chart-path>

# Publish the packaged helm-chart to a container registry
# NOTE: You must be logged into the helm repository before trying to push
helm push ./build/<packaged-helm-chart> <helm-repository-url>
$ helm push ./build/<packaged-helm-chart> <helm-repository-url>
```

### Example: Using Amazon Elastic Container Registry (ECR)
Expand All @@ -56,7 +59,18 @@ Pre-requisites:
2. `helm`, `aws`, and `apollo-cli` are on the users `$PATH`
3. `apollo-cli` is configured for the correct Apollo hub

From the root of this repository:

```shell
# Build helm dependencies for the vector helm-chart
$ helm dependency build ./charts/beta/vector --repository-config helm-repositories.yaml
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "vector" chart repository
Update Complete. ⎈Happy Helming!
Saving 1 charts
Downloading vector from repo https://helm.vector.dev
Deleting outdated charts

# Package the vector helm-chart
$ helm package -d ./build ./charts/beta/vector
Successfully packaged chart and saved it to: build/vector-0.31.1001.tgz
Expand Down
2 changes: 1 addition & 1 deletion charts/alpha/grafana/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ description: A Grafana chart that can be used with Palantir FedStart
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

version: 7.3.7003
version: 7.3.7004

# Be aware that using helm dependencies has undesirable side affects, where you cannot remove
# subchart config keys by setting them to null. If this type of configuration override is necessary,
Expand Down
2 changes: 1 addition & 1 deletion charts/alpha/grafana/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A Palantir Fedstart compliant helm-chart that configures [Grafana](https://githu

## Configuration

> Refer to the Grafana [README](./charts/grafana/README.md#configuration) for all available upstream configuration options
> Refer to the Grafana [README](https://github.com/grafana/helm-charts/tree/main/charts/grafana#configuration) for all available upstream configuration options
| Parameter | Description | Default |
|----------------------|---------------------------------|-------------|
Expand Down
23 changes: 0 additions & 23 deletions charts/alpha/grafana/charts/grafana/.helmignore

This file was deleted.

33 changes: 0 additions & 33 deletions charts/alpha/grafana/charts/grafana/Chart.yaml

This file was deleted.

Loading

0 comments on commit 11f1575

Please sign in to comment.