Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brianpursley/kubectl-confirm
Kubectl Confirm is a plugin for Kubectl that displays information and asked for confirmation before executing a command.
https://github.com/brianpursley/kubectl-confirm
kubectl kubernetes plugin
Last synced: 11 days ago
JSON representation
Kubectl Confirm is a plugin for Kubectl that displays information and asked for confirmation before executing a command.
- Host: GitHub
- URL: https://github.com/brianpursley/kubectl-confirm
- Owner: brianpursley
- License: apache-2.0
- Created: 2022-07-25T21:54:05.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-07-29T13:33:15.000Z (over 2 years ago)
- Last Synced: 2024-11-09T17:41:52.254Z (about 1 month ago)
- Topics: kubectl, kubernetes, plugin
- Language: Go
- Homepage:
- Size: 10.7 KB
- Stars: 25
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-repositories - brianpursley/kubectl-confirm - Kubectl Confirm is a plugin for Kubectl that displays information and asked for confirmation before executing a command. (Go)
README
# Kubectl Confirm Plugin
Kubectl Confirm is a plugin for Kubectl that displays information and asked for confirmation before executing a command.
The following information is displayed:
* Configuration: Context name, Cluster, User, and Namespace
* Dry Run Output (if the executed command supports the `--dry-run` flag)
* Diff Output (if the executed command supports the `--dry-run` and `--output` flags)## Example Output
```
$ kubectl confirm apply -f ~/changed.yaml
========== Config ===========
Context: kind-kind
Cluster: kind-kind
User: kind-kind
Namespace: default========== Dry Run ==========
deployment.apps/foo configured (server dry run)========== Diff =============
diff -u -N /tmp/LIVE-2275701238/apps.v1.Deployment.default.foo /tmp/MERGED-1055657464/apps.v1.Deployment.default.foo
--- /tmp/LIVE-2275701238/apps.v1.Deployment.default.foo 2022-07-28 10:27:25.690604172 -0400
+++ /tmp/MERGED-1055657464/apps.v1.Deployment.default.foo 2022-07-28 10:27:25.694604038 -0400
@@ -6,7 +6,7 @@
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"apps/v1","kind":"Deployment","metadata":{"annotations":{},"name":"foo","namespace":"default"},"spec":{"replicas":1,"revisionHistoryLimit":10,"selector":{"matchLabels":{"app":"foo"}},"template":{"metadata":{"labels":{"app":"foo"}},"spec":{"containers":[{"command":["sh","-c","echo Container bar is running! \u0026\u0026 sleep 9999999"],"image":"busybox:1.30","name":"bar"}]}}}}
creationTimestamp: "2022-07-28T11:43:58Z"
- generation: 1
+ generation: 2
managedFields:
- apiVersion: apps/v1
fieldsType: FieldsV1
@@ -90,7 +90,7 @@
spec:
progressDeadlineSeconds: 600
replicas: 1
- revisionHistoryLimit: 10
+ revisionHistoryLimit: 11
selector:
matchLabels:
app: foo========== Confirm ==========
The following command will be executed:
kubectl apply -f /home/bpursley/changed.yamlEnter 'yes' to continue:
```If you enter `yes` (exactly) then it will proceed:
```
Enter 'yes' to continue: yesdeployment.apps/foo configured
```If you enter anything other than `yes` (exactly), then it will stop:
```
Enter 'yes' to continue: noCommand aborted.
```## Known Limitations
* Command line completion does not work