Skip to content

Commit 7bb56f3

Browse files
authored
Merge pull request #5 from jsturtevant/fix-param
fix using custom image
2 parents 78511da + bfc5da8 commit 7bb56f3

2 files changed

Lines changed: 39 additions & 3 deletions

File tree

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,11 @@ Released with [krew release bot](https://github.com/rajatjindal/krew-release-bot
3636

3737
- https://krew.sigs.k8s.io/docs/developer-guide/testing-locally/
3838
- https://github.com/rajatjindal/krew-release-bot#testing-the-template-file
39+
40+
## Use as standalone without plugin
41+
42+
You don't have to install this as a plugin via krew. You can also download and invoke the tool directly:
43+
44+
```bash
45+
./kubectl-windows-debug <node-name>
46+
```

kubectl-windows-debug

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,39 @@
11
#!/usr/bin/env bash
22

3+
# default image
34
image="ghcr.io/jsturtevant/windows-debug:v0.1.1"
5+
6+
POSITIONAL=()
7+
while [[ $# -gt 0 ]]
8+
do
9+
key="$1"
10+
11+
case $key in
12+
-h|--help)
13+
echo "Windows node access via kubectl"
14+
echo " "
15+
echo "kubectl windows-debug [options]"
16+
echo " "
17+
echo "options:"
18+
echo "-h, --help Show brief help"
19+
echo "-i, --image use custom image"
20+
exit 0
21+
;;
22+
-i | --image)
23+
image="$2"
24+
shift # past argument
25+
shift # past value
26+
;;
27+
*) # unknown option
28+
POSITIONAL+=("$1")
29+
shift # past argument
30+
;;
31+
esac
32+
done
33+
set -- "${POSITIONAL[@]}" # restore positional parameters
434
nodename="$1"
535

6-
if [[ "$(basename "$0")" == kubectl-* ]]; then # invoked as plugin
7-
echo "Running as plugin"
8-
fi
36+
echo "Running on node '$nodename' with image '$image'"
937

1038
# sometime ns default is empty from this command so default if it is
1139
namespace=$(kubectl config view --minify --output 'jsonpath={..namespace}')

0 commit comments

Comments
 (0)