devops-works / binenv

One binary to rule them all. Manage all those pesky binaries (kubectl, helm, terraform, ...) easily.
MIT License
373 stars 44 forks source link

add kubeconform #263

Closed axgkl closed 2 hours ago

axgkl commented 2 hours ago

https://github.com/yannh/kubeconform

in use e.g. by flux a lot, e.g https://github.com/fluxcd/flux2-kustomize-helm-example/blob/main/scripts/validate.sh

With this I could get to a working binenv install kubeconform 0.6.7 :

  kubeconform:
    description: >
      Kubeconform is a Kubernetes manifest validation tool. Incorporate it into your CI, or use it locally to validate your Kubernetes configuration!
    url: https://github.com/yannh/kubeconform/
    list:
      type: github-releases
      url: https://api.github.com/repos/yannh/kubeconform/releases
    fetch:
      url: https://github.com/yannh/kubeconform/releases/download/v{{ .Version }}/kubeconform-{{ .OS }}-{{ .Arch }}.tar.gz
    install:
      type: tgz
      binaries:
        - kubeconform

but w/o that version binenv reported "unable to select latest stable version for \"kubeconform\": no stable version available" - not sure what's missing.

leucos commented 2 hours ago

Hey @axgkl

Thanks for the suggestion.

Your snippet works fine for me:

$ cp distributions/distributions.yaml ~/.config/binenv/distributions.yaml
$ binenv update -f kubeconform
updating distributions 100% |███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| (1/1, 27439 it/s)
$ binenv install kubeconform 
2024-09-20T11:04:44+02:00 WRN version for "kubeconform" not specified; using "0.6.7"
fetching kubeconform version 0.6.7 100% |████████████████████████████████████████████████████████████████████████████████████████████████████████████| (6.0/6.0 MB, 1.464 MB/s)        
2024-09-20T11:04:49+02:00 INF "kubeconform" (0.6.7) installed
axgkl commented 2 hours ago

aah, getting it: the hint you give is missing that -f :)

  ~/.config/binenv❯ binenv install kubeconform
2024-09-20T11:09:41+02:00 WRN version for "kubeconform" not specified; using ""
2024-09-20T11:09:41+02:00 ERR unable to install "kubeconform" () error="unable to select latest stable version for \"kubeconform\": 
no stable version available. May be run 'binenv update kubeconform' ?"

May be run 'binenv update kubeconform' ?" => Maybe run 'binenv update -f kubeconform' ?"

leucos commented 2 hours ago

yes, when running binenv update kubeconform you're fetching the cache from binenv's github repo, which did not know anything about kubeconform at the time.

Using binenv update -f kubeconform asks binenv to go fetch the versions directly from the kubeconform repo.

Since then I added your suggestion in the distribution and refreshed the cache, so both should work now.

Thanks a lot Gunther !

axgkl commented 2 hours ago

binenv rocks so f...ng much, should be way more known. merci bien (yet again)

leucos commented 2 hours ago

it is made possible thanks to people like you contributing back ! thanks !