mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-04 00:24:59 +00:00
fix a client-go bug which could casue kubectl panic (#72952)
* When user try execute command like `kubectl get pod test -o custom-columns=CONTAINER:.spec.containers[-1].name` It will throw a panic about slice index out of bounds. This patch fix it. * add test case Kubernetes-commit: 1e245fad87584a28809f8f5d380b766edfa984ec
This commit is contained in:
committed by
Kubernetes Publisher
parent
837b88074c
commit
4b473f5dc7
@@ -325,6 +325,7 @@ Loop:
|
||||
if i == 1 {
|
||||
params[i].Known = true
|
||||
params[i].Value = params[0].Value + 1
|
||||
params[i].Derived = true
|
||||
} else {
|
||||
params[i].Known = false
|
||||
params[i].Value = 0
|
||||
|
Reference in New Issue
Block a user