mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-12-02 19:57:42 +08:00
Merge pull request #312 from GLYASAI/RAINBOND-1032
[FIX] slice bounds out of range
This commit is contained in:
commit
86c1ebabee
@ -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