Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/uselagoon/lagoon-linter
Linter for .lagoon.yml
https://github.com/uselagoon/lagoon-linter
Last synced: 2 months ago
JSON representation
Linter for .lagoon.yml
- Host: GitHub
- URL: https://github.com/uselagoon/lagoon-linter
- Owner: uselagoon
- License: apache-2.0
- Created: 2021-10-25T09:25:31.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-08-27T09:02:12.000Z (5 months ago)
- Last Synced: 2024-08-28T04:39:19.472Z (5 months ago)
- Language: Go
- Size: 71.3 KB
- Stars: 0
- Watchers: 1
- Forks: 2
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Lagoon Linter
Lint `.lagoon.yml` for validity.
## Profiles
`lagoon-linter` has the concept of profiles for validating `.lagoon.yml` files.
Different profiles apply different linting checks.| Name | Description |
| --- | --- |
| required | Checks for invalid or restricted content in `.lagoon.yml`. These will fail a Lagoon build. |
| deprecated | Checks for deprecated content in `.lagoon.yml`. These will print a warning in a Lagoon build. |If no profile is specified, the `required` profile will run by default.
## Linters
Currently implemented linters.
| Name | Profile | Description |
| --- | --- | --- |
| RouteAnnotation | required | Validates Lagoon Route / Kubernetes Ingress annotations. See the documentation [here](https://docs.lagoon.sh/using-lagoon-the-basics/lagoon-yml/#restrictions) for details. |
| Cronjobs | required | Validates environment cron jobs. |
| MonitoringURLs | deprecated | Checks for the presence of `monitoring_urls`. |## Usage
Run `lagoon-linter` in the directory containing your `.lagoon.yml`.
See `lagoon-linter --help` for options.### validate-config-map-json
`lagoon-linter validate-config-map-json` allows you to validate a dump of configmaps from an existing kubernetes cluster containing Lagoon environments.
This is helpful when making changes to the linter where you want to check if it will cause build failures on existing Lagoon environments.First get a dump of configmaps:
```
for cluster in abc1 xyz2; do
# assuming kconfig switches kubectl contexts
kconfig myname-$cluster && kubectl get configmap --field-selector metadata.name=lagoon-yaml -Ao json > ~/download/lagoon-yml-audit/amazeeio-$cluster.cm.json;
done
```Then run the linter over them.
It will automatically detect and validate `.lagoon.yml` configmaps only.```
for file in ~/download/lagoon-yml-audit/*.json; do
echo $file; ./lagoon-linter validate-config-map-json --config-map-json $file;
done
```