File tree Expand file tree Collapse file tree 2 files changed +28
-10
lines changed Expand file tree Collapse file tree 2 files changed +28
-10
lines changed Original file line number Diff line number Diff line change @@ -181,6 +181,11 @@ __kubectl_get_resource()
181
181
__kubectl_parse_get " ${nouns[${#nouns[@]} -1]}"
182
182
}
183
183
184
+ __kubectl_get_resource_pod ()
185
+ {
186
+ __kubectl_parse_get " pod"
187
+ }
188
+
184
189
# $1 is the name of the pod we want to get the list of containers inside
185
190
__kubectl_get_containers ()
186
191
{
@@ -213,13 +218,17 @@ __kubectl_require_pod_and_container()
213
218
__custom_func () {
214
219
case ${last_command} in
215
220
kubectl_get | kubectl_describe | kubectl_delete | kubectl_label | kubectl_stop)
216
- __kubectl_get_resource
221
+ __kubectl_get_resource
222
+ return
223
+ ;;
224
+ kubectl_logs)
225
+ __kubectl_require_pod_and_container
226
+ return
227
+ ;;
228
+ kubectl_exec)
229
+ __kubectl_get_resource_pod
217
230
return
218
231
;;
219
- kubectl_logs)
220
- __kubectl_require_pod_and_container
221
- return
222
- ;;
223
232
* )
224
233
;;
225
234
esac
Original file line number Diff line number Diff line change @@ -47,6 +47,11 @@ __kubectl_get_resource()
47
47
__kubectl_parse_get "${nouns[${#nouns[@]} -1]}"
48
48
}
49
49
50
+ __kubectl_get_resource_pod()
51
+ {
52
+ __kubectl_parse_get "pod"
53
+ }
54
+
50
55
# $1 is the name of the pod we want to get the list of containers inside
51
56
__kubectl_get_containers()
52
57
{
@@ -79,13 +84,17 @@ __kubectl_require_pod_and_container()
79
84
__custom_func() {
80
85
case ${last_command} in
81
86
kubectl_get | kubectl_describe | kubectl_delete | kubectl_label | kubectl_stop)
82
- __kubectl_get_resource
87
+ __kubectl_get_resource
88
+ return
89
+ ;;
90
+ kubectl_logs)
91
+ __kubectl_require_pod_and_container
92
+ return
93
+ ;;
94
+ kubectl_exec)
95
+ __kubectl_get_resource_pod
83
96
return
84
97
;;
85
- kubectl_logs)
86
- __kubectl_require_pod_and_container
87
- return
88
- ;;
89
98
*)
90
99
;;
91
100
esac
You can’t perform that action at this time.
0 commit comments