Remove unused stuff #2

Closed
allanger wants to merge 0 commits from refs/pull/2/head into main
24 changed files with 281 additions and 1060 deletions

View File

@ -1 +0,0 @@
target

View File

@ -1,26 +0,0 @@
---
kind: pipeline
type: kubernetes
name: Tests
trigger:
event:
- push
steps:
- name: Prepare helm and helmfile
image: ghcr.io/helmfile/helmfile:canary
commands:
- mkdir -p bin
- cp $(which helm) ./bin/helm
- cp $(which helmfile) ./bin/helmfile
- name: Unit tests
image: rust:slim
environment:
CARGO_BUILD_JOBS: 1
commands:
- export PATH=$PWD/bin:$PATH
- helm
- helmfile
- cargo test

View File

@ -1,61 +0,0 @@
---
name: "Version build"
on:
push:
tags:
- "v*.*.*"
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: macos-latest
target: x86_64-apple-darwin
- os: macos-latest
target: aarch64-apple-darwin
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
- uses: actions-rs/cargo@v1
with:
command: build
args: --release --all-features --target=${{ matrix.target }}
- name: Archive build artifacts
uses: actions/upload-artifact@v2
with:
name: build-${{matrix.target}}
path: ${{ github.workspace }}/target/${{ matrix.target }}/release/cdh
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download artifact
uses: actions/download-artifact@v2
- name: Set version variable
run: echo "CDH_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Rename release to avoid name conflict
run: ./scripts/rename_releases.sh
- name: Release
uses: softprops/action-gh-release@v1
with:
files: release/*

View File

@ -1,100 +0,0 @@
---
name: "Stable container"
on:
push:
branches:
- main
jobs:
prepare_base:
name: Prepare the base image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set action link variable
run: echo "LINK=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
- name: Build base
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/${{ github.repository }}-base:latest
labels: |
action_id=${{ github.action }}
action_link=${{ env.LINK }}
actor=${{ github.actor }}
sha=${{ github.sha }}
ref=${{ github.ref }}
build_containers:
name: Build final images
runs-on: ubuntu-latest
needs: prepare_base
strategy:
matrix:
target_image:
- helmfile
- helmfile-secrets
- argo
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set action link variable
run: echo "LINK=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
- name: Build ${{ matrix.target_image }}
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: ./dockerfiles
file: ./dockerfiles/Dockerfile-${{ matrix.target_image }}
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/${{ github.repository }}-${{ matrix.target_image }}:latest
ghcr.io/${{ github.repository }}-${{ matrix.target_image }}:stable
labels: |
action_id=${{ github.action }}
action_link=${{ env.LINK }}
actor=${{ github.actor }}
sha=${{ github.sha }}
ref=${{ github.ref }}

View File

@ -1,106 +0,0 @@
---
name: "Versioned container"
on:
push:
tags:
- "v*.*.*"
jobs:
prepare_base:
name: Prepare the base image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set version variable
run: echo "TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Set action link variable
run: echo "LINK=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
- name: Build base
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/${{ github.repository }}-base:${{ env.TAG }}
labels: |
action_id=${{ github.action }}
action_link=${{ env.LINK }}
actor=${{ github.actor }}
sha=${{ github.sha }}
ref=${{ github.ref }}
build_containers:
name: Build final images
runs-on: ubuntu-latest
needs: prepare_base
strategy:
matrix:
target_image:
- helmfile
- helmfile-secrets
- argo
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set version variable
run: echo "TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Set action link variable
run: echo "LINK=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
- name: Build ${{ matrix.target_image }}
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: ./dockerfiles
file: ./dockerfiles/Dockerfile-${{ matrix.target_image }}
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/${{ github.repository }}-${{ matrix.target_image }}:${{ env.TAG }}
ghcr.io/${{ github.repository }}-${{ matrix.target_image }}:${{ env.TAG }}
labels: |
action_id=${{ github.action }}
action_link=${{ env.LINK }}
actor=${{ github.actor }}
sha=${{ github.sha }}
ref=${{ github.ref }}

View File

@ -1,57 +0,0 @@
---
name: "Tests"
on:
pull_request:
branches:
- main
paths:
- "src/**"
jobs:
cargo_udeps:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
- name: Install cargo-udeps
run: cargo install cargo-udeps --locked
- name: Check dependencies
run: cargo +nightly udeps
cargo_test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: actions-rs/cargo@v1
with:
command: build
args: --release --all-features
- run: cargo test
cargo_clippy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: actions-rs/cargo@v1
with:
command: build
args: --release --all-features
- run: cargo clippy

473
Cargo.lock generated
View File

@ -4,60 +4,18 @@ version = 3
[[package]] [[package]]
name = "aho-corasick" name = "aho-corasick"
version = "1.1.2" version = "0.7.19"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" checksum = "b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e"
dependencies = [ dependencies = [
"memchr", "memchr",
] ]
[[package]] [[package]]
name = "anstream" name = "autocfg"
version = "0.6.4" version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
dependencies = [
"anstyle",
"anstyle-parse",
"anstyle-query",
"anstyle-wincon",
"colorchoice",
"utf8parse",
]
[[package]]
name = "anstyle"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87"
[[package]]
name = "anstyle-parse"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140"
dependencies = [
"utf8parse",
]
[[package]]
name = "anstyle-query"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b"
dependencies = [
"windows-sys",
]
[[package]]
name = "anstyle-wincon"
version = "3.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628"
dependencies = [
"anstyle",
"windows-sys",
]
[[package]] [[package]]
name = "bitflags" name = "bitflags"
@ -65,33 +23,39 @@ version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "bitflags"
version = "2.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07"
[[package]] [[package]]
name = "block-buffer" name = "block-buffer"
version = "0.10.4" version = "0.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e"
dependencies = [ dependencies = [
"generic-array", "generic-array",
] ]
[[package]] [[package]]
name = "bytecount" name = "build_html"
version = "0.6.7" version = "2.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e1e5f035d16fc623ae5f74981db80a439803888314e3a555fd6f04acd51a3205" checksum = "aa8ffb62af7b0911893e2d6126891b2a018e387078fa5d855cb42d0d90d88075"
[[package]]
name = "bytecount"
version = "0.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2c676a478f63e9fa2dd5368a42f28bba0d6c560b775f38583c8bbaa7fcd67c9c"
[[package]]
name = "cc"
version = "1.0.77"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e9f73505338f7d905b19d18738976aae232eb46b8efc15554ffc56deb5d9ebe4"
[[package]] [[package]]
name = "cdh" name = "cdh"
version = "0.1.9" version = "0.1.0"
dependencies = [ dependencies = [
"build_html",
"clap", "clap",
"clap_complete",
"env_logger", "env_logger",
"handlebars", "handlebars",
"log", "log",
@ -99,7 +63,6 @@ dependencies = [
"serde_json", "serde_json",
"serde_yaml", "serde_yaml",
"tabled", "tabled",
"tempfile",
"version-compare", "version-compare",
] ]
@ -111,64 +74,46 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]] [[package]]
name = "clap" name = "clap"
version = "4.4.8" version = "4.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2275f18819641850fa26c89acc84d465c1bf91ce57bc2748b28c420473352f64" checksum = "4ec7a4128863c188deefe750ac1d1dfe66c236909f845af04beed823638dc1b2"
dependencies = [ dependencies = [
"clap_builder", "bitflags",
"clap_derive", "clap_derive",
]
[[package]]
name = "clap_builder"
version = "4.4.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07cdf1b148b25c1e1f7a42225e30a0d99a615cd4637eae7365548dd4529b95bc"
dependencies = [
"anstream",
"anstyle",
"clap_lex", "clap_lex",
"is-terminal",
"once_cell",
"strsim", "strsim",
] "termcolor",
[[package]]
name = "clap_complete"
version = "4.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bffe91f06a11b4b9420f62103854e90867812cd5d01557f853c5ee8e791b12ae"
dependencies = [
"clap",
] ]
[[package]] [[package]]
name = "clap_derive" name = "clap_derive"
version = "4.4.7" version = "4.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" checksum = "684a277d672e91966334af371f1a7b5833f9aa00b07c84e92fbce95e00208ce8"
dependencies = [ dependencies = [
"heck", "heck",
"proc-macro-error",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.39", "syn",
] ]
[[package]] [[package]]
name = "clap_lex" name = "clap_lex"
version = "0.6.0" version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" checksum = "783fe232adfca04f90f56201b26d79682d4cd2625e0bc7290b95123afe558ade"
dependencies = [
[[package]] "os_str_bytes",
name = "colorchoice" ]
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7"
[[package]] [[package]]
name = "cpufeatures" name = "cpufeatures"
version = "0.2.11" version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320"
dependencies = [ dependencies = [
"libc", "libc",
] ]
@ -185,9 +130,9 @@ dependencies = [
[[package]] [[package]]
name = "digest" name = "digest"
version = "0.10.7" version = "0.10.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" checksum = "adfbc57365a37acbd2ebf2b64d7e69bb766e2fea813521ed536f5d0520dcf86c"
dependencies = [ dependencies = [
"block-buffer", "block-buffer",
"crypto-common", "crypto-common",
@ -195,9 +140,9 @@ dependencies = [
[[package]] [[package]]
name = "env_logger" name = "env_logger"
version = "0.10.1" version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "95b3f3e67048839cb0d0781f445682a35113da7121f7c949db0e2be96a4fbece" checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0"
dependencies = [ dependencies = [
"humantime", "humantime",
"is-terminal", "is-terminal",
@ -206,27 +151,26 @@ dependencies = [
"termcolor", "termcolor",
] ]
[[package]]
name = "equivalent"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
[[package]] [[package]]
name = "errno" name = "errno"
version = "0.3.7" version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f258a7194e7f7c2a7837a8913aeab7fd8c383457034fa20ce4dd3dcb813e8eb8" checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1"
dependencies = [ dependencies = [
"errno-dragonfly",
"libc", "libc",
"windows-sys", "winapi",
] ]
[[package]] [[package]]
name = "fastrand" name = "errno-dragonfly"
version = "2.0.1" version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf"
dependencies = [
"cc",
"libc",
]
[[package]] [[package]]
name = "fnv" name = "fnv"
@ -236,9 +180,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
[[package]] [[package]]
name = "generic-array" name = "generic-array"
version = "0.14.7" version = "0.14.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9"
dependencies = [ dependencies = [
"typenum", "typenum",
"version_check", "version_check",
@ -246,9 +190,9 @@ dependencies = [
[[package]] [[package]]
name = "handlebars" name = "handlebars"
version = "4.5.0" version = "4.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "faa67bab9ff362228eb3d00bd024a4965d8231bbb7921167f0cfa66c6626b225" checksum = "433e4ab33f1213cdc25b5fa45c76881240cfe79284cf2b395e8b9e312a30a2fd"
dependencies = [ dependencies = [
"log", "log",
"pest", "pest",
@ -260,21 +204,24 @@ dependencies = [
[[package]] [[package]]
name = "hashbrown" name = "hashbrown"
version = "0.14.2" version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
[[package]] [[package]]
name = "heck" name = "heck"
version = "0.4.1" version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9"
[[package]] [[package]]
name = "hermit-abi" name = "hermit-abi"
version = "0.3.3" version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7"
dependencies = [
"libc",
]
[[package]] [[package]]
name = "humantime" name = "humantime"
@ -284,66 +231,86 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
[[package]] [[package]]
name = "indexmap" name = "indexmap"
version = "2.1.0" version = "1.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e"
dependencies = [ dependencies = [
"equivalent", "autocfg",
"hashbrown", "hashbrown",
] ]
[[package]] [[package]]
name = "is-terminal" name = "io-lifetimes"
version = "0.4.9" version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" checksum = "e394faa0efb47f9f227f1cd89978f854542b318a6f64fa695489c9c993056656"
dependencies = [
"libc",
"windows-sys",
]
[[package]]
name = "is-terminal"
version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "28dfb6c8100ccc63462345b67d1bbc3679177c75ee4bf59bf29c8b1d110b8189"
dependencies = [ dependencies = [
"hermit-abi", "hermit-abi",
"io-lifetimes",
"rustix", "rustix",
"windows-sys", "windows-sys",
] ]
[[package]] [[package]]
name = "itoa" name = "itoa"
version = "1.0.9" version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc"
[[package]] [[package]]
name = "libc" name = "libc"
version = "0.2.150" version = "0.2.137"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89"
[[package]] [[package]]
name = "linux-raw-sys" name = "linux-raw-sys"
version = "0.4.11" version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "969488b55f8ac402214f3f5fd243ebb7206cf82de60d3172994707a4bcc2b829" checksum = "8f9f08d8963a6c613f4b1a78f4f4a4dbfadf8e6545b2d72861731e4858b8b47f"
[[package]] [[package]]
name = "log" name = "log"
version = "0.4.20" version = "0.4.17"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e"
dependencies = [
"cfg-if",
]
[[package]] [[package]]
name = "memchr" name = "memchr"
version = "2.6.4" version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
[[package]] [[package]]
name = "once_cell" name = "once_cell"
version = "1.18.0" version = "1.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860"
[[package]]
name = "os_str_bytes"
version = "6.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3baf96e39c5359d2eb0dd6ccb42c62b91d9678aa68160d261b9e0ccbf9e9dea9"
[[package]] [[package]]
name = "papergrid" name = "papergrid"
version = "0.10.0" version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a2ccbe15f2b6db62f9a9871642746427e297b0ceb85f9a7f1ee5ff47d184d0c8" checksum = "1526bb6aa9f10ec339fb10360f22c57edf81d5678d0278e93bc12a47ffbe4b01"
dependencies = [ dependencies = [
"bytecount", "bytecount",
"fnv", "fnv",
@ -352,20 +319,19 @@ dependencies = [
[[package]] [[package]]
name = "pest" name = "pest"
version = "2.7.5" version = "2.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae9cee2a55a544be8b89dc6848072af97a20f2422603c10865be2a42b580fff5" checksum = "dbc7bc69c062e492337d74d59b120c274fd3d261b6bf6d3207d499b4b379c41a"
dependencies = [ dependencies = [
"memchr",
"thiserror", "thiserror",
"ucd-trie", "ucd-trie",
] ]
[[package]] [[package]]
name = "pest_derive" name = "pest_derive"
version = "2.7.5" version = "2.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "81d78524685f5ef2a3b3bd1cafbc9fcabb036253d9b1463e726a91cd16e2dfc2" checksum = "60b75706b9642ebcb34dab3bc7750f811609a0eb1dd8b88c2d15bf628c1c65b2"
dependencies = [ dependencies = [
"pest", "pest",
"pest_generator", "pest_generator",
@ -373,26 +339,26 @@ dependencies = [
[[package]] [[package]]
name = "pest_generator" name = "pest_generator"
version = "2.7.5" version = "2.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68bd1206e71118b5356dae5ddc61c8b11e28b09ef6a31acbd15ea48a28e0c227" checksum = "f4f9272122f5979a6511a749af9db9bfc810393f63119970d7085fed1c4ea0db"
dependencies = [ dependencies = [
"pest", "pest",
"pest_meta", "pest_meta",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.39", "syn",
] ]
[[package]] [[package]]
name = "pest_meta" name = "pest_meta"
version = "2.7.5" version = "2.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7c747191d4ad9e4a4ab9c8798f1e82a39affe7ef9648390b7e5548d18e099de6" checksum = "4c8717927f9b79515e565a64fe46c38b8cd0427e64c40680b14a7365ab09ac8d"
dependencies = [ dependencies = [
"once_cell", "once_cell",
"pest", "pest",
"sha2", "sha1",
] ]
[[package]] [[package]]
@ -404,7 +370,7 @@ dependencies = [
"proc-macro-error-attr", "proc-macro-error-attr",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 1.0.109", "syn",
"version_check", "version_check",
] ]
@ -421,48 +387,27 @@ dependencies = [
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.69" version = "1.0.47"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725"
dependencies = [ dependencies = [
"unicode-ident", "unicode-ident",
] ]
[[package]] [[package]]
name = "quote" name = "quote"
version = "1.0.33" version = "1.0.21"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
] ]
[[package]]
name = "redox_syscall"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa"
dependencies = [
"bitflags 1.3.2",
]
[[package]] [[package]]
name = "regex" name = "regex"
version = "1.10.2" version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b"
dependencies = [
"aho-corasick",
"memchr",
"regex-automata",
"regex-syntax",
]
[[package]]
name = "regex-automata"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f"
dependencies = [ dependencies = [
"aho-corasick", "aho-corasick",
"memchr", "memchr",
@ -471,18 +416,19 @@ dependencies = [
[[package]] [[package]]
name = "regex-syntax" name = "regex-syntax"
version = "0.8.2" version = "0.6.27"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244"
[[package]] [[package]]
name = "rustix" name = "rustix"
version = "0.38.25" version = "0.36.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc99bc2d4f1fed22595588a013687477aedf3cdcfb26558c559edb67b4d9b22e" checksum = "4feacf7db682c6c329c4ede12649cd36ecab0f3be5b7d74e6a20304725db4549"
dependencies = [ dependencies = [
"bitflags 2.4.1", "bitflags",
"errno", "errno",
"io-lifetimes",
"libc", "libc",
"linux-raw-sys", "linux-raw-sys",
"windows-sys", "windows-sys",
@ -490,35 +436,35 @@ dependencies = [
[[package]] [[package]]
name = "ryu" name = "ryu"
version = "1.0.15" version = "1.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09"
[[package]] [[package]]
name = "serde" name = "serde"
version = "1.0.192" version = "1.0.147"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001" checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965"
dependencies = [ dependencies = [
"serde_derive", "serde_derive",
] ]
[[package]] [[package]]
name = "serde_derive" name = "serde_derive"
version = "1.0.192" version = "1.0.147"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1" checksum = "4f1d362ca8fc9c3e3a7484440752472d68a6caa98f1ab81d99b5dfe517cec852"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.39", "syn",
] ]
[[package]] [[package]]
name = "serde_json" name = "serde_json"
version = "1.0.108" version = "1.0.87"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" checksum = "6ce777b7b150d76b9cf60d28b55f5847135a003f7d7350c6be7a773508ce7d45"
dependencies = [ dependencies = [
"itoa", "itoa",
"ryu", "ryu",
@ -527,9 +473,9 @@ dependencies = [
[[package]] [[package]]
name = "serde_yaml" name = "serde_yaml"
version = "0.9.27" version = "0.9.16"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3cc7a1570e38322cfe4154732e5110f887ea57e22b76f4bfd32b5bdd3368666c" checksum = "92b5b431e8907b50339b51223b97d102db8d987ced36f6e4d03621db9316c834"
dependencies = [ dependencies = [
"indexmap", "indexmap",
"itoa", "itoa",
@ -539,10 +485,10 @@ dependencies = [
] ]
[[package]] [[package]]
name = "sha2" name = "sha1"
version = "0.10.8" version = "0.10.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"cpufeatures", "cpufeatures",
@ -557,20 +503,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
[[package]] [[package]]
name = "syn" name = "syn"
version = "1.0.109" version = "1.0.103"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "syn"
version = "2.0.39"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -579,9 +514,9 @@ dependencies = [
[[package]] [[package]]
name = "tabled" name = "tabled"
version = "0.14.0" version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dfe9c3632da101aba5131ed63f9eed38665f8b3c68703a6bb18124835c1a5d22" checksum = "56c3ee73732ffceaea7b8f6b719ce3bb17f253fa27461ffeaf568ebd0cdb4b85"
dependencies = [ dependencies = [
"papergrid", "papergrid",
"tabled_derive", "tabled_derive",
@ -590,100 +525,81 @@ dependencies = [
[[package]] [[package]]
name = "tabled_derive" name = "tabled_derive"
version = "0.6.0" version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "99f688a08b54f4f02f0a3c382aefdb7884d3d69609f785bd253dc033243e3fe4" checksum = "beca1b4eaceb4f2755df858b88d9b9315b7ccfd1ffd0d7a48a52602301f01a57"
dependencies = [ dependencies = [
"heck", "heck",
"proc-macro-error", "proc-macro-error",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 1.0.109", "syn",
]
[[package]]
name = "tempfile"
version = "3.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5"
dependencies = [
"cfg-if",
"fastrand",
"redox_syscall",
"rustix",
"windows-sys",
] ]
[[package]] [[package]]
name = "termcolor" name = "termcolor"
version = "1.4.0" version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ff1bc3d3f05aff0403e8ac0d92ced918ec05b666a43f83297ccef5bea8a3d449" checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755"
dependencies = [ dependencies = [
"winapi-util", "winapi-util",
] ]
[[package]] [[package]]
name = "thiserror" name = "thiserror"
version = "1.0.50" version = "1.0.37"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e"
dependencies = [ dependencies = [
"thiserror-impl", "thiserror-impl",
] ]
[[package]] [[package]]
name = "thiserror-impl" name = "thiserror-impl"
version = "1.0.50" version = "1.0.37"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.39", "syn",
] ]
[[package]] [[package]]
name = "typenum" name = "typenum"
version = "1.17.0" version = "1.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987"
[[package]] [[package]]
name = "ucd-trie" name = "ucd-trie"
version = "0.1.6" version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81"
[[package]] [[package]]
name = "unicode-ident" name = "unicode-ident"
version = "1.0.12" version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3"
[[package]] [[package]]
name = "unicode-width" name = "unicode-width"
version = "0.1.11" version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b"
[[package]] [[package]]
name = "unsafe-libyaml" name = "unsafe-libyaml"
version = "0.2.9" version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f28467d3e1d3c6586d8f25fa243f544f5800fec42d97032474e17222c2b75cfa" checksum = "bc7ed8ba44ca06be78ea1ad2c3682a43349126c8818054231ee6f4748012aed2"
[[package]]
name = "utf8parse"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a"
[[package]] [[package]]
name = "version-compare" name = "version-compare"
version = "0.1.1" version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "579a42fc0b8e0c63b76519a339be31bed574929511fa53c1a3acae26eb258f29" checksum = "fe88247b92c1df6b6de80ddc290f3976dbdf2f5f5d3fd049a9fb598c6dd5ca73"
[[package]] [[package]]
name = "version_check" name = "version_check"
@ -709,9 +625,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
[[package]] [[package]]
name = "winapi-util" name = "winapi-util"
version = "0.1.6" version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
dependencies = [ dependencies = [
"winapi", "winapi",
] ]
@ -724,18 +640,9 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]] [[package]]
name = "windows-sys" name = "windows-sys"
version = "0.48.0" version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7"
dependencies = [
"windows-targets",
]
[[package]]
name = "windows-targets"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c"
dependencies = [ dependencies = [
"windows_aarch64_gnullvm", "windows_aarch64_gnullvm",
"windows_aarch64_msvc", "windows_aarch64_msvc",
@ -748,42 +655,42 @@ dependencies = [
[[package]] [[package]]
name = "windows_aarch64_gnullvm" name = "windows_aarch64_gnullvm"
version = "0.48.5" version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e"
[[package]] [[package]]
name = "windows_aarch64_msvc" name = "windows_aarch64_msvc"
version = "0.48.5" version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4"
[[package]] [[package]]
name = "windows_i686_gnu" name = "windows_i686_gnu"
version = "0.48.5" version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7"
[[package]] [[package]]
name = "windows_i686_msvc" name = "windows_i686_msvc"
version = "0.48.5" version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246"
[[package]] [[package]]
name = "windows_x86_64_gnu" name = "windows_x86_64_gnu"
version = "0.48.5" version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed"
[[package]] [[package]]
name = "windows_x86_64_gnullvm" name = "windows_x86_64_gnullvm"
version = "0.48.5" version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028"
[[package]] [[package]]
name = "windows_x86_64_msvc" name = "windows_x86_64_msvc"
version = "0.48.5" version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5"

View File

@ -1,7 +1,7 @@
[package] [package]
name = "cdh" name = "cdh"
authors = ["allanger <allanger@zohomail.com>"] authors = ["allanger <allanger@zohomail.com>"]
version = "0.1.9" version = "0.1.0"
description = "Your helm releases are outdated, aren't they? Now you can check" description = "Your helm releases are outdated, aren't they? Now you can check"
edition = "2021" edition = "2021"
@ -13,9 +13,6 @@ env_logger = "0.10.0"
version-compare = "0.1.0" version-compare = "0.1.0"
clap = { version = "4.1.1", features = ["derive", "env"] } clap = { version = "4.1.1", features = ["derive", "env"] }
serde_yaml = "0.9.16" serde_yaml = "0.9.16"
tabled = "0.14.0" tabled = "0.10.0"
build_html = "2.1.0"
handlebars = "4.3.1" handlebars = "4.3.1"
clap_complete = "4.0.6"
[dev-dependencies]
tempfile = "3.4.0"

View File

@ -1,11 +0,0 @@
FROM rust:1.70.0-alpine3.18 as builder
WORKDIR /src
RUN apk update && apk add --no-cache gcc musl-dev
COPY ./ .
RUN rustup default nightly && rustup update
RUN cargo build --release --jobs 2 -Z sparse-registry
FROM alpine:3.18
COPY --from=builder /src/target/release/cdh /bin/cdh
WORKDIR /workdir
ENTRYPOINT ["/bin/cdh"]

View File

@ -1,2 +0,0 @@
build:
cargo build --release

View File

@ -1,35 +1,2 @@
> ! This tool doesn't make sense anymore, since renovate bot can handle the same thing but better
# Check Da Helm # Check Da Helm
> Your helm releases are outdated, aren't they? Now you can check! > Your helm releases are outdated, aren't they? Now you can check!
[![Version build](https://github.com/allanger/check-da-helm/actions/workflows/build-version.yaml/badge.svg)](https://github.com/allanger/check-da-helm/actions/workflows/build-version.yaml)
[![Version container](https://github.com/allanger/check-da-helm/actions/workflows/container-version.yaml/badge.svg)](https://github.com/allanger/check-da-helm/actions/workflows/container-version.yaml)
[![Stable container](https://github.com/allanger/check-da-helm/actions/workflows/container-stable.yaml/badge.svg)](https://github.com/allanger/check-da-helm/actions/workflows/container-stable.yaml)
## What's this?
It's a simple command line tool that lets you check whether your helm releases (currently installed by helmfile or argo) are outdated or not. Why it's created? But the main reason why it's created, is a necessity to check if helm releases that you have installed in your cluster still exist in repos. Once `Bitnami` removed old charts from their main repo and, I believe, everybody needed then some time to understand what happened. So I decided to write this tool. I was checking helmfiles and testing if chart were still in repos. And in case something is broken, I would be notified in the morning. Of course, broken helm charts are something you'll eventually know about, but it just feels better to know about them with this simple cli.
## Install
### Dependencies
Depending on the tool you want to use `cdm` with, you must have either `helmfile` or `argocd` installed. And in any case you need to have `helm`
### Download
Get executable from github releases
Prebuilt binaries exist for **Linux x86_64** and **MacOS arm64** and **x86_64**
Don't forget to add the binary to $PATH
```BASH
$ curl https://raw.githubusercontent.com/allanger/check-da-helm/main/scripts/download_cdh.sh | bash
$ cdm -h
```
### Build from source
1. Build binary
```BASH
$ cargo build --release
```
2. Run `gum help`

View File

@ -1,12 +0,0 @@
ARG BASE_VERSION=latest
FROM ghcr.io/allanger/dumb-downloader as builder
ARG ARGOCD_VERSION=v2.7.6
ENV RUST_LOG=info
RUN mkdir /out
RUN dudo -l "https://github.com/argoproj/argo-cd/releases/download/{{ version }}/argocd-{{ os }}-{{ arch }}" -d /tmp/argocd -p $ARGOCD_VERSION
RUN mv /tmp/argocd /out/argocd && chmod +x /out/argocd
FROM ghcr.io/allanger/check-da-helm-base:${BASE_VERSION}
COPY --from=builder /out/ /usr/bin
RUN apk update --no-cache && apk add --no-cache jq bash
ENTRYPOINT ["cdh"]

View File

@ -1,18 +0,0 @@
ARG BASE_VERSION=latest
FROM ghcr.io/allanger/dumb-downloader as builder
RUN apt-get update -y && apt-get install tar -y
ARG HELM_VERSION=v3.12.1
ARG HELMFILE_VERSION=0.154.0
ENV RUST_LOG=info
RUN dudo -l "https://github.com/helmfile/helmfile/releases/download/v{{ version }}/helmfile_{{ version }}_{{ os }}_{{ arch }}.tar.gz" -d /tmp/helmfile.tar.gz -p $HELMFILE_VERSION
RUN dudo -l "https://get.helm.sh/helm-{{ version }}-{{ os }}-{{ arch }}.tar.gz" -d /tmp/helm.tar.gz -p $HELM_VERSION
RUN tar -xf /tmp/helm.tar.gz -C /tmp && rm -f /tmp/helm.tar.gz
RUN tar -xf /tmp/helmfile.tar.gz -C /tmp && rm -f /tmp/helmfile.tar.gz
RUN mkdir /out && for bin in `find /tmp | grep helm`; do cp $bin /out/; done
RUN chmod +x /out/helm
RUN chmod +x /out/helmfile
FROM ghcr.io/allanger/check-da-helm-base:${BASE_VERSION}
COPY --from=builder /out/ /usr/bin
RUN apk update --no-cache && apk add --no-cache jq bash
ENTRYPOINT ["cdh"]

View File

@ -1,24 +0,0 @@
ARG BASE_VERSION=latest
FROM ghcr.io/allanger/dumb-downloader as builder
RUN apt-get update -y && apt-get install tar -y
ARG HELM_VERSION=v3.12.1
ARG HELMFILE_VERSION=0.154.0
ARG SOPS_VERSION=v3.7.3
ENV RUST_LOG=info
RUN dudo -l "https://github.com/helmfile/helmfile/releases/download/v{{ version }}/helmfile_{{ version }}_{{ os }}_{{ arch }}.tar.gz" -d /tmp/helmfile.tar.gz -p $HELMFILE_VERSION
RUN dudo -l "https://get.helm.sh/helm-{{ version }}-{{ os }}-{{ arch }}.tar.gz" -d /tmp/helm.tar.gz -p $HELM_VERSION
RUN tar -xf /tmp/helm.tar.gz -C /tmp && rm -f /tmp/helm.tar.gz
RUN tar -xf /tmp/helmfile.tar.gz -C /tmp && rm -f /tmp/helmfile.tar.gz
RUN mkdir /out && for bin in `find /tmp | grep helm`; do cp $bin /out/; done
RUN chmod +x /out/helm
RUN chmod +x /out/helmfile
# Download SOPS
RUN dudo -l "https://github.com/mozilla/sops/releases/download/{{ version }}/sops-{{ version }}.{{ os }}.{{ arch }}" -d /out/sops -p $SOPS_VERSION
RUN chmod +x /out/sops
FROM ghcr.io/allanger/check-da-helm-base:${BASE_VERSION}
COPY --from=builder /out/ /usr/bin
RUN apk update --no-cache && apk add --no-cache jq bash age git musl
RUN helm plugin install https://github.com/jkroepke/helm-secrets --version v4.4.2
ENTRYPOINT ["cdh"]

View File

@ -1,18 +0,0 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: sealed-secrets
namespace: argocd
spec:
project: default
source:
chart: argo-cd
repoURL: https://argoproj.github.io/argo-helm
targetRevision: 5.23.3
helm:
releaseName: sealed-secrets
syncPolicy:
automated: {}
destination:
server: "https://kubernetes.default.svc"
namespace: argocd

View File

@ -1,23 +1,14 @@
repositories: repositories:
- name: argo - name: keel
url: https://argoproj.github.io/argo-helm url: https://charts.keel.sh
- name: bitnami
url: registry-1.docker.io/bitnamicharts
oci: true
releases: releases:
- name: argocd # -----------------------------
# -- Keel
# -----------------------------
- name: keel
installed: true installed: true
namespace: argocd namespace: keel-system
createNamespace: true createNamespace: true
chart: argo/argo-cd chart: keel/keel
version: 5.23.3 version: 0.9.11
values:
- server:
extraArgs:
- --insecure
- name: redis
installed: true
chart: bitnami/redis
version: 17.13.1

View File

@ -1,50 +0,0 @@
#!/bin/bash
case "$(uname)" in
"Darwin")
SYSTEM="apple-darwin"
case $(uname -m) in
"arm64")
TARGET="aarch64-$SYSTEM"
;;
"x86_64")
TARGET="x86_64-$SYSTEM"
;;
*)
echo "Unsuported target"
exit 1
;;
esac
;;
"Linux")
SYSTEM="unknown-linux-gnu"
case $(uname -m) in
"x86_64")
TARGET="x86_64-$SYSTEM"
;;
*)
echo "Unsuported target"
exit 1
;;
esac
;;
*)
echo "Signal number $1 is not processed"
exit 1
;;
esac
LATEST_VERSION="v$(curl -s https://raw.githubusercontent.com/allanger/check-da-helm/main/Cargo.toml | awk -F ' = ' '$1 ~ /version/ { gsub(/[\"]/, "", $2); printf("%s",$2); exit}')"
echo "Downloading $LATEST_VERSION"
RELEASE_NAME=cdh-$LATEST_VERSION-$TARGET
RELEASE_URL="https://github.com/allanger/check-da-helm/releases/download/$LATEST_VERSION/$RELEASE_NAME"
echo "Link for downloading: $RELEASE_URL"
curl -LJO $RELEASE_URL
mv $RELEASE_NAME cdh
chmod +x cdh
echo 'Make sure that cdh is in your $PATH'
echo 'Try: '
echo ' $ export PATH=$PATH:$PWD'
echo ' $ cdh -h'

View File

@ -1,15 +0,0 @@
#!/bin/sh
case $(uname -m) in
"arm64"|"aarch64")
PLATFORM="arm64"
;;
"x86_64")
PLATFORM="amd64"
;;
*)
echo "Unsuported target"
exit 1
;;
esac
echo "Downloading $2 from $1"
curl -LJO $1 $2

View File

@ -1,10 +0,0 @@
#!/bin/bash
echo 'renaming cdh to cdh-$VERSION-$SYSTEM format'
mkdir -p release
echo "version - $CDH_VERSION"
for BUILD in build*; do
SYSTEM=$(echo $BUILD | sed -e 's/build-//g')
echo "system - $SYSTEM"
cp $BUILD/cdh release/cdh-$CDH_VERSION-$SYSTEM
done
ls release

View File

@ -15,7 +15,7 @@ impl Connector for Argo {
type ConnectorType = Argo; type ConnectorType = Argo;
fn get_app(&self) -> Result<Vec<types::HelmChart>> { fn get_app(&self) -> Result<Vec<types::HelmChart>> {
let cmd: String = "argocd app list -o json | jq '[.[] | {chart: .spec.source.chart, version: .spec.source.targetRevision, name: .spec.source.helm.releaseName}]'".to_string(); let cmd: String = "argocd app list -o json | jq '[.[] | {chart: .spec.source.chart, version: .spec.source.targetRevision}]'".to_string();
debug!("executing '${}'", cmd); debug!("executing '${}'", cmd);
let output = Command::new("bash") let output = Command::new("bash")
@ -27,7 +27,7 @@ impl Connector for Argo {
match from_str::<Vec<types::HelmChart>>(Borrow::borrow(&helm_stdout)) { match from_str::<Vec<types::HelmChart>>(Borrow::borrow(&helm_stdout)) {
Ok(mut charts) => { Ok(mut charts) => {
charts.iter_mut().for_each(|chart| {chart.chart = Some(format!("{}/{}", chart.chart.clone().unwrap(), chart.chart.clone().unwrap()))}); charts.dedup();
Ok(charts) Ok(charts)
} }
Err(err) => Err(err.into()), Err(err) => Err(err.into()),

View File

@ -8,15 +8,13 @@ use std::{borrow::Borrow, io::Result, process::Command};
pub(crate) struct Helmfile { pub(crate) struct Helmfile {
path: String, path: String,
env: String,
} }
impl Connector for Helmfile { impl Connector for Helmfile {
fn get_app(&self) -> Result<Vec<types::HelmChart>> { fn get_app(&self) -> Result<Vec<types::HelmChart>> {
let cmd: String = format!( let cmd: String = format!(
"helmfile -f {} -e {} list --output json | jq '[.[] | {{chart: .chart, version: .version, name: .name}}]'", "helmfile -f {} list --output json | jq '[.[] | {{chart: .name, version: .version}}]'",
self.path, self.path
self.env
) )
.to_string(); .to_string();
@ -37,7 +35,7 @@ impl Connector for Helmfile {
} }
} }
fn sync_repos(&self) -> Result<()> { fn sync_repos(&self) -> Result<()> {
let cmd: String = format!("helmfile -f {} -e {} repos", self.path, self.env); let cmd: String = format!("helmfile -f {} sync", self.path);
Command::new("bash") Command::new("bash")
.arg("-c") .arg("-c")
.arg(cmd) .arg(cmd)
@ -48,48 +46,8 @@ impl Connector for Helmfile {
type ConnectorType = Helmfile; type ConnectorType = Helmfile;
} }
impl Helmfile { impl Helmfile {
pub(crate) fn init(path: String, env: String) -> Self { pub(crate) fn init(path: String) -> Self {
Self {path, env} Self { path: path }
}
}
#[cfg(test)]
mod tests {
use tempfile::NamedTempFile;
use std::io::Write;
use crate::connectors::{Helmfile, Connector};
use crate::types;
static HELMFILE_EXAMPLE: &str = "repositories:\n
- name: argo\n
url: https://argoproj.github.io/argo-helm\n
releases:\n
- name: argocd\n
installed: true\n
namespace: argocd\n
createNamespace: true\n
chart: argo/argo-cd\n
version: 5.23.3\n
values:\n
- server:\n
extraArgs:\n
- --insecure";
#[test]
fn test_helmfile() {
let mut file = NamedTempFile::new().unwrap();
writeln!(file, "{}", HELMFILE_EXAMPLE.clone()).unwrap();
let path = file.into_temp_path();
let helmfile_app = Helmfile::init(path.to_string_lossy().to_string(), "default".to_string()).get_app().unwrap();
let app = types::HelmChart{
chart: Some("argo/argo-cd".to_string()),
name: Some("argocd".to_string()),
version: Some("5.23.3".to_string()),
};
let apps: Vec<types::HelmChart> = vec![app];
assert_eq!(apps, helmfile_app);
path.close().unwrap();
} }
} }

View File

@ -1,10 +1,10 @@
mod connectors; mod connectors;
mod output;
mod types; mod types;
use clap::{arg, command, Parser, Subcommand, ValueEnum};
use clap::{Parser, ValueEnum};
use connectors::{Argo, Connector, Helm, Helmfile}; use connectors::{Argo, Connector, Helm, Helmfile};
use handlebars::Handlebars;
use log::{debug, error, info, warn}; use log::{debug, error, info, warn};
use output::Output;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use serde_json::from_str; use serde_json::from_str;
use std::{ use std::{
@ -12,7 +12,7 @@ use std::{
io::Result, io::Result,
process::{exit, Command}, process::{exit, Command},
}; };
use types::ExecResult; use tabled::Tabled;
use version_compare::{Cmp, Version}; use version_compare::{Cmp, Version};
use crate::types::{HelmChart, Status}; use crate::types::{HelmChart, Status};
@ -20,51 +20,28 @@ use crate::types::{HelmChart, Status};
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum)] #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum)]
enum Kinds { enum Kinds {
Argo, Argo,
//Helm, Helm,
Helmfile, Helmfile,
} }
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum)]
enum Outputs {
Yaml,
HTML,
}
/// Check you helm releaseas managed by Argo /// Check you helm releaseas managed by Argo
#[derive(Parser)] #[derive(Parser)]
#[clap(author, version, about, long_about = None)] #[clap(author, version, about, long_about = None)]
struct Args { struct Args {
/// How do you install your helm charts /// Type of the
#[clap(long, value_enum)] #[clap(long, value_enum)]
kind: Kinds, kind: Kinds,
/// What kind of output would you like to receive?
#[clap(long, value_enum, default_value = "yaml")]
output: Outputs,
/// Path to the helmfile /// Path to the helmfile
#[clap(short, long, value_parser, default_value = "./")] #[clap(short, long, value_parser, default_value = "./")]
path: String, path: String,
/// Pass an environment to the helmfile
#[arg(long, required = false, default_value = "default")]
helmfile_environment: String,
/// Should execution be failed if you have outdated charts /// Should execution be failed if you have outdated charts
#[clap(short, long, action, default_value_t = false, env = "OUTDATED_FAIL")] #[clap(short, long, action, default_value_t = false, env = "OUTDATED_FAIL")]
outdated_fail: bool, outdated_fail: bool,
/// Set to true if you don't want to sync repositories /// Set to true if you don't want to sync repositories
#[clap(short, long, action, default_value_t = false)] #[clap(short, long, action, default_value_t = false)]
no_sync: bool, no_sync: bool,
/// Set to true if you don't wante to see up-to-date charts in the output
#[clap(long, action, default_value_t = true)]
no_uptodate: bool
} }
#[derive(Debug, Subcommand)]
enum Commands {
#[command(arg_required_else_help = true)]
Generate {
#[arg(value_name = "SHELL", default_missing_value = "zsh")]
shell: clap_complete::shells::Shell,
},
}
/// A struct to write helm repo description to /// A struct to write helm repo description to
#[derive(Serialize, Deserialize, Debug, PartialEq, Eq)] #[derive(Serialize, Deserialize, Debug, PartialEq, Eq)]
struct Repo { struct Repo {
@ -80,20 +57,45 @@ struct LocalCharts {
version: Option<String>, version: Option<String>,
} }
#[derive(Clone, Tabled, Serialize)]
struct ExecResult {
name: String,
latest_version: String,
current_version: String,
status: Status,
}
// Implementation for the ExecResult struct // Implementation for the ExecResult struct
impl ExecResult {
fn new(name: String, latest_version: String, current_version: String, status: Status) -> Self {
Self {
name,
latest_version,
current_version,
status,
}
}
}
fn main() { fn main() {
// Preparations step // Preparations step
env_logger::init(); env_logger::init();
let args = Args::parse(); let args = Args::parse();
let mut result: Vec<ExecResult> = Vec::new(); let mut result: Vec<ExecResult> = Vec::new();
let charts = match args.kind {
Kinds::Argo => Argo::init().get_app(),
Kinds::Helm => Helm::init().get_app(),
Kinds::Helmfile => Helmfile::init(args.path.clone()).get_app(),
}
.unwrap();
if !args.no_sync { if !args.no_sync {
info!("syncing helm repositories"); info!("syncing helm repositories");
let res = match args.kind { let res = match args.kind {
Kinds::Argo => Argo::init().sync_repos(), Kinds::Argo => Argo::init().sync_repos(),
// Kinds::Helm => Helm::init().sync_repos(), Kinds::Helm => Helm::init().sync_repos(),
Kinds::Helmfile => Helmfile::init(args.path.clone(), args.helmfile_environment.clone()).sync_repos(), Kinds::Helmfile => Helmfile::init(args.path).sync_repos(),
}; };
match res { match res {
Ok(_) => info!("helm repos are synced"), Ok(_) => info!("helm repos are synced"),
@ -101,21 +103,13 @@ fn main() {
} }
} }
let charts = match args.kind {
Kinds::Argo => Argo::init().get_app(),
//Kinds::Helm => Helm::init().get_app(),
Kinds::Helmfile => Helmfile::init(args.path.clone(), args.helmfile_environment.clone()).get_app(),
}
.unwrap();
charts.iter().for_each(|a| { charts.iter().for_each(|a| {
debug!("{:?}", a);
check_chart(&mut result, a).unwrap(); check_chart(&mut result, a).unwrap();
}); });
// Parse the helmfile // Parse the helmfile
// Handling the result // Handling the result
match handle_result(&mut result, args.outdated_fail, args.output, args.no_uptodate) { match handle_result(&result, args.outdated_fail) {
Ok(result) => { Ok(result) => {
if result { if result {
exit(1); exit(1);
@ -129,9 +123,9 @@ fn main() {
} }
fn check_chart(result: &mut Vec<ExecResult>, local_chart: &types::HelmChart) -> Result<()> { fn check_chart(result: &mut Vec<ExecResult>, local_chart: &types::HelmChart) -> Result<()> {
if local_chart.chart.is_some() { if local_chart.clone().name.is_some() {
let version = local_chart.version.clone().unwrap(); let version = local_chart.version.clone().unwrap();
let chart = local_chart.chart.clone().unwrap(); let chart = local_chart.name.clone().unwrap();
return match version.is_empty() { return match version.is_empty() {
true => { true => {
warn!( warn!(
@ -143,8 +137,8 @@ fn check_chart(result: &mut Vec<ExecResult>, local_chart: &types::HelmChart) ->
false => { false => {
info!("checking {} - {}", chart, version); info!("checking {} - {}", chart, version);
let cmd = format!( let cmd = format!(
"helm search repo {} --versions --output json", "helm search repo {}/{} --versions --output json",
chart, chart, chart
); );
debug!("executing '${}'", cmd); debug!("executing '${}'", cmd);
let output = Command::new("bash") let output = Command::new("bash")
@ -157,8 +151,6 @@ fn check_chart(result: &mut Vec<ExecResult>, local_chart: &types::HelmChart) ->
// Remove "v" from version definitions // Remove "v" from version definitions
let mut versions: Vec<HelmChart> = from_str(helm_stdout.borrow()).unwrap(); let mut versions: Vec<HelmChart> = from_str(helm_stdout.borrow()).unwrap();
versions.iter_mut().for_each(|f| { versions.iter_mut().for_each(|f| {
f.name = local_chart.name.clone();
f.chart = local_chart.chart.clone();
if f.version.is_some() { if f.version.is_some() {
f.version = Some(f.version.as_ref().unwrap().replace('v', "")); f.version = Some(f.version.as_ref().unwrap().replace('v', ""));
} }
@ -175,10 +167,8 @@ fn check_chart(result: &mut Vec<ExecResult>, local_chart: &types::HelmChart) ->
); );
} }
let remote = Version::from(current_version.as_str()).unwrap(); let remote = Version::from(current_version.as_str()).unwrap();
debug!("{:?}", versions);
let status: Status = if versions.contains(&HelmChart { let status: Status = if versions.contains(&HelmChart {
chart: Some(chart.clone()), name: Some(format!("{}/{}", chart.clone(), chart.clone())),
name: local_chart.name.clone(),
version: Some(version.clone()), version: Some(version.clone()),
}) { }) {
match local.compare(remote.clone()) { match local.compare(remote.clone()) {
@ -192,7 +182,6 @@ fn check_chart(result: &mut Vec<ExecResult>, local_chart: &types::HelmChart) ->
}; };
result.push(ExecResult::new( result.push(ExecResult::new(
local_chart.name.clone().unwrap(),
chart.clone(), chart.clone(),
current_version.clone(), current_version.clone(),
version.clone(), version.clone(),
@ -208,43 +197,57 @@ fn check_chart(result: &mut Vec<ExecResult>, local_chart: &types::HelmChart) ->
} }
/// Handle result /// Handle result
fn handle_result( fn handle_result(result: &Vec<ExecResult>, outdated_fail: bool) -> Result<bool> {
result: &mut Vec<ExecResult>,
outdated_fail: bool,
output_kind: Outputs,
no_uptodate: bool,
) -> Result<bool> {
let mut failed = false; let mut failed = false;
if no_uptodate {
result.retain(|r| r.status != types::Status::Uptodate)
}
for r in result.clone() { for r in result.clone() {
match r.status { match r.status {
Status::Uptodate => info!("{} is up-to-date", r.chart), Status::Uptodate => info!("{} is up-to-date", r.name),
Status::Outdated => { Status::Outdated => {
if outdated_fail { if outdated_fail {
failed = true failed = true
} }
warn!( warn!(
"{} is outdated. Current version is {}, but the latest is {}", "{} is outdated. Current version is {}, but the latest is {}",
r.chart, r.current_version, r.latest_version r.name, r.current_version, r.latest_version
); );
} }
Status::Missing => { Status::Missing => {
failed = true; failed = true;
error!( error!(
"{} is broken. Current version is {}, but it can't be found in the repo", "{} is broken. Current version is {}, but it can't be found in the repo",
r.chart, r.current_version r.name, r.current_version
); );
} }
} }
} }
let template = r#"
<table>
<tr>
<th>Chart Name</th>
<th>Current Version</th>
<th>Latest Version</th>
<th>Status</th>
</tr>
{{#each this as |tr|}}
<tr>
<th>{{tr.name}}</th>
<th>{{tr.current_version}}</th>
<th>{{tr.latest_version}}</th>
<th>{{tr.status}}</th>
</tr>
{{/each}}
</table>
"#;
let mut reg = Handlebars::new();
match output_kind { // TODO: Handle this error
Outputs::Yaml => print!("{}", output::YAML::print(result)?), reg.register_template_string("html_table", template)
Outputs::HTML => print!("{}", output::HTML::print(result)?), .unwrap();
match reg.render("html_table", &result) {
Ok(res) => println!("{}", res),
Err(err) => error!("{}", err),
}; };
Ok(failed) Ok(failed)
} }

View File

@ -1,61 +0,0 @@
use std::io::{Result, Error, ErrorKind};
use handlebars::Handlebars;
use log::error;
use crate::types::ExecResult;
pub(crate) trait Output {
fn print(data: &Vec<ExecResult>) -> Result<String>;
}
pub(crate) struct HTML;
impl Output for HTML {
fn print(data: &Vec<ExecResult>) -> Result<String> {
// To generate htlm output, I have to use templates because I haven't found any other good
// solution
let template = r#"
<table>
<tr>
<th>Chart Name</th>
<th>Current Version</th>
<th>Latest Version</th>
<th>Status</th>
</tr>
{{#each this as |tr|}}
<tr>
<th>{{tr.name}}</th>
<th>{{tr.current_version}}</th>
<th>{{tr.latest_version}}</th>
<th>{{tr.status}}</th>
</tr>
{{/each}}
</table>
"#;
let mut reg = Handlebars::new();
// TODO: Handle this error
reg.register_template_string("html_table", template)
.unwrap();
match reg.render("html_table", &data) {
Ok(res) => Ok(res),
Err(err) => {
error!("{}", err);
return Err(Error::new(ErrorKind::InvalidInput, err.to_string()));
}
}
}
}
pub(crate) struct YAML;
impl Output for YAML {
fn print(data: &Vec<ExecResult>) -> Result<String> {
match serde_yaml::to_string(&data) {
Ok(res) => return Ok(res),
Err(err) => return Err(Error::new(ErrorKind::InvalidData, err.to_string())),
}
}
}

View File

@ -1,14 +1,11 @@
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fmt; use std::fmt;
use tabled::Tabled;
/// Struct for parsing charts info from helmfile /// Struct for parsing charts info from helmfile
#[derive(Serialize, Deserialize, Debug, PartialEq, Eq)] #[derive(Serialize, Deserialize, Debug, PartialEq, Eq)]
pub(crate) struct HelmChart { pub(crate) struct HelmChart {
// #[serde(alias = "name", alias = "chart")] #[serde(alias = "name", alias = "chart")]
pub(crate) name: Option<String>, pub(crate) name: Option<String>,
// #[serde(alias = "name", alias = "chart")]
pub(crate) chart: Option<String>,
pub(crate) version: Option<String>, pub(crate) version: Option<String>,
} }
@ -18,7 +15,7 @@ pub(crate) struct HelmRepo {
pub(crate) url: String, pub(crate) url: String,
} }
#[derive(Clone, Serialize, Deserialize, PartialEq, Eq)] #[derive(Clone, Serialize)]
pub(crate) enum Status { pub(crate) enum Status {
Uptodate, Uptodate,
Outdated, Outdated,
@ -34,30 +31,3 @@ impl fmt::Display for Status {
} }
} }
} }
#[derive(Clone, Tabled, Serialize, Deserialize)]
pub(crate) struct ExecResult {
pub(crate) name: String,
pub(crate) chart: String,
pub(crate) latest_version: String,
pub(crate) current_version: String,
pub(crate) status: Status,
}
impl ExecResult {
pub(crate) fn new(
name: String,
chart: String,
latest_version: String,
current_version: String,
status: Status,
) -> Self {
Self {
name,
chart,
latest_version,
current_version,
status,
}
}
}