mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-11-30 18:58:02 +08:00
[FIX] slice bounds out of range
This commit is contained in:
parent
1b9b4d71ad
commit
97fcaeec7b
@ -35,8 +35,8 @@ import (
|
||||
"github.com/gosuri/uitable"
|
||||
"github.com/tidwall/gjson"
|
||||
"github.com/urfave/cli"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
//conf "github.com/goodrain/rainbond/cmd/grctl/option"
|
||||
)
|
||||
|
||||
@ -536,7 +536,9 @@ func getContainerIDAndState(status corev1.ContainerStatus) (cid, s string) {
|
||||
s = "Terminated"
|
||||
containerID = state.Terminated.ContainerID
|
||||
}
|
||||
cid = containerID[9:21]
|
||||
if containerID != "" {
|
||||
cid = containerID[9:21]
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user