From f7bbfcea3cc609850311f504d8d6b06672658183 Mon Sep 17 00:00:00 2001
From: Daniel Henkel <9447057+dhenkel92@users.noreply.github.com>
Date: Thu, 7 Dec 2023 10:29:06 +0100
Subject: [PATCH] feature: merge evict pod command into debug-pdb (#9)
---
.goreleaser.yaml | 43 --------------
README.md | 66 ++++------------------
cmd/kubectl-debug-pdb/kubectl-debug-pdb.go | 1 +
cmd/kubectl-evict/kubectl-evict.go | 33 -----------
pkg/cmd/evict_pod.go | 2 +-
5 files changed, 14 insertions(+), 131 deletions(-)
delete mode 100644 cmd/kubectl-evict/kubectl-evict.go
diff --git a/.goreleaser.yaml b/.goreleaser.yaml
index 3a1395b..1dd400f 100644
--- a/.goreleaser.yaml
+++ b/.goreleaser.yaml
@@ -27,20 +27,6 @@ builds:
- linux
- windows
- darwin
- - env:
- - CGO_ENABLED=0
- main: ./cmd/kubectl-evict/kubectl-evict.go
- id: kubectl-evict
- binary: kubectl-evict
- goarch:
- - amd64
- - arm
- - arm64
- goos:
- - linux
- - windows
- - darwin
-
archives:
- id: kubectl-debug-pdb
builds:
@@ -58,22 +44,6 @@ archives:
format_overrides:
- goos: windows
format: zip
- - id: kubectl-evict
- builds:
- - kubectl-evict
- format: tar.gz
- # this name template makes the OS and Arch compatible with the results of `uname`.
- name_template: >-
- {{ .Binary }}_
- {{- title .Os }}_
- {{- if eq .Arch "amd64" }}x86_64
- {{- else if eq .Arch "386" }}i386
- {{- else }}{{ .Arch }}{{ end }}
- {{- if .Arm }}v{{ .Arm }}{{ end }}
- # use zip for windows archives
- format_overrides:
- - goos: windows
- format: zip
brews:
- name: kubectl-debug-pdb
ids:
@@ -87,19 +57,6 @@ brews:
branch: main
pull_request:
enabled: true
- - name: kubectl-evict
- ids:
- - kubectl-evict
- folder: Formula
- homepage: "https://github.com/dhenkel92/kubectl-debug-pdb"
- license: "MIT"
- repository:
- owner: dhenkel92
- name: homebrew-tap
- branch: main
- pull_request:
- enabled: true
-
checksum:
name_template: 'checksums.txt'
snapshot:
diff --git a/README.md b/README.md
index 4b56ed7..7f7a9e9 100644
--- a/README.md
+++ b/README.md
@@ -1,10 +1,6 @@
- - - - -
A kubectl plugin to work with pod disruption budgets.
@@ -49,15 +45,12 @@ To get a local copy up and running follow these simple example steps.
You can install the tool via Homebrew and the tap repository can be found [here.](https://github.com/dhenkel92/homebrew-tap)
```
-brew update
-brew install dhenkel92/homebrew-tap/kubectl-debug-pdb
-brew install dhenkel92/homebrew-tap/kubectl-evict
+brew update && brew install dhenkel92/homebrew-tap/kubectl-debug-pdb
```
In order to get a newer version, just upgrade via Homebrew
```
-brew upgrade kubectl-debug-pdb
-brew upgrade kubectl-evict
+brew update && brew upgrade dhenkel92/homebrew-tap/kubectl-debug-pdb
```
### Other distributions
@@ -66,18 +59,17 @@ See the [Releases page](https://github.com/dhenkel92/kubectl-debug-pdb/releases)
## Usage
-### Kubectl pdb
-
```
Utility to work with pod disruption budgets
Usage:
- pdb [command]
+ debug-pdb [command]
Available Commands:
completion Generate the autocompletion script for the specified shell
cover Shows which PDBs are a workload.
create Create a new PDB for a given workload.
+ evict Utility to evict a pod from a node
help Help about any command
pods List pods covered by a given PDB
@@ -92,7 +84,7 @@ Flags:
--cluster string The name of the kubeconfig cluster to use
--context string The name of the kubeconfig context to use
--disable-compression If true, opt-out of response compression for all requests to the server
- -h, --help help for pdb
+ -h, --help help for debug-pdb
--insecure-skip-tls-verify If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure
--kubeconfig string Path to the kubeconfig file to use for CLI requests.
-n, --namespace string If present, the namespace scope for this CLI request
@@ -102,66 +94,32 @@ Flags:
--token string Bearer token for authentication to the API server
--user string The name of the kubeconfig user to use
-Use "pdb [command] --help" for more information about a command.
+Use "debug-pdb [command] --help" for more information about a command.
```
List all pods for a given PDB:
```
-kubectl pdb pods