kubesess 1.2.5 (new formula)

* kubesess 1.2.5
* better test

Closes #109171.

Signed-off-by: Rui Chen <rui@chenrui.dev>
Signed-off-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com>
Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com>
master
Rami Daghlawi 2022-08-29 20:59:48 +02:00 committed by BrewTestBot
parent a10e902f96
commit e7ccd23242
No known key found for this signature in database
GPG Key ID: 82D7D104050B0F0F
1 changed files with 39 additions and 0 deletions

39
Formula/kubesess.rb Normal file
View File

@ -0,0 +1,39 @@
class Kubesess < Formula
desc "Manage multiple kubernetes cluster at the same time"
homepage "https://rentarami.se/posts/2022-08-05-kube-context-2/"
url "https://github.com/Ramilito/kubesess/archive/refs/tags/1.2.5.tar.gz"
sha256 "1ce69422fc29bde69ac02a209eb7b27a447598c39a3870759aa4c83e553b2e52"
license "MIT"
depends_on "rust" => :build
depends_on "kubernetes-cli" => :test
def install
system "cargo", "install", *std_cargo_args
end
test do
(testpath/".kube/config").write <<~EOS
kind: Config
apiVersion: v1
current-context: docker-desktop
preferences: {}
clusters:
- cluster:
server: https://kubernetes.docker.internal:6443
name: docker-desktop
contexts:
- context:
namespace: monitoring
cluster: docker-desktop
user: docker-desktop
name: docker-desktop
users:
- user:
name: docker-desktop
EOS
output = shell_output("#{bin}/kubesess -v docker-desktop context 2>&1")
assert_match "docker-desktop", output
end
end