Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace kubeval with kubeconform #48

Merged
merged 2 commits into from
Jun 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/diff-preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
env:
dyff_ver: 1.5.4
kubeval_ver: 0.16.1
kubeconform_ver: 0.4.13
steps:
- run: sudo apt-get install -y yamllint
- name: install dyff
Expand All @@ -24,12 +24,12 @@ jobs:
- run: which dyff
- uses: giantswarm/install-binary-action@v1
with:
binary: kubeval
download_url: "https://github.com/instrumenta/kubeval/releases/download/v${version}/kubeval-linux-amd64.tar.gz"
smoke_test: "${binary} --version"
binary: kubeconform
download_url: "https://github.com/yannh/kubeconform/releases/download/v${version}/kubeconform-linux-amd64.tar.gz"
smoke_test: "${binary} -v"
tarball_binary_path: "${binary}"
version: ${{ env.kubeval_ver }}
- run: which kubeval
version: ${{ env.kubeconform_ver }}
- run: which kubeconform
- run: ls -la /opt/hostedtoolcache
- uses: actions/checkout@v3
- name: template all for the new branch
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/validate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ jobs:
needs: pre-commit
runs-on: ubuntu-latest
env:
kubeval_ver: 0.16.1
kubeconform_ver: 0.4.13
steps:
- run: sudo apt-get install -y yamllint
- uses: giantswarm/install-binary-action@v1
with:
binary: kubeval
download_url: "https://github.com/instrumenta/kubeval/releases/download/v${version}/kubeval-linux-amd64.tar.gz"
smoke_test: "${binary} --version"
binary: kubeconform
download_url: "https://github.com/yannh/kubeconform/releases/download/v${version}/kubeconform-linux-amd64.tar.gz"
smoke_test: "${binary} -v"
tarball_binary_path: "${binary}"
version: ${{ env.kubeval_ver }}
version: ${{ env.kubeconform_ver }}
- name: cache validation tools
uses: actions/cache@v3
with:
Expand Down
7 changes: 7 additions & 0 deletions docs/appendices.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,10 @@ For core utilties like `base64`, `sed`, `tr`, etc. GNU compatible versions are a
### Working with YAML files

For `yq` the [github.com/mikefarah/yq](https://github.com/mikefarah/yq/) version is assumed in the code examples.

### Validating yaml files in the repository

You need the following tools installed to use [test-all-ffb](/tools/test-all-ffb) script.

- `yamllint` of [github.com/adrienverge/yamllint](https://github.com/adrienverge/yamllint)
- `kubeconform` of [github.com/yannh/kubeconform](https://github.com/yannh/kubeconform)
4 changes: 2 additions & 2 deletions tools/test-all-ffb
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ test() {
echo "Testing: $mc_name $org_name $wc_name $dir_name"
echo -n "yamllint: "
./tools/fake-flux-build build "$mc_name" "$org_name" "$wc_name" "$dir_name" | yamllint - && echo "OK"
echo "kubeval: "
./tools/fake-flux-build build "$mc_name" "$org_name" "$wc_name" "$dir_name" | kubeval --ignore-missing-schemas
echo "kubeconform: "
./tools/fake-flux-build build "$mc_name" "$org_name" "$wc_name" "$dir_name" | kubeconform -ignore-missing-schemas -output text && echo "OK"
echo ""
else
echo "---"
Expand Down