[FIX] nil pointer dereference

This commit is contained in:
GLYASAI 2019-08-23 15:55:40 +08:00
parent cebec7babc
commit 1220934aca
7 changed files with 128 additions and 125 deletions

View File

@ -1,10 +1,9 @@
package handler
import (
"encoding/json"
"github.com/goodrain/rainbond/worker/server/pb"
"strings"
"github.com/goodrain/rainbond/api/model"
"github.com/goodrain/rainbond/worker/client"
"github.com/goodrain/rainbond/worker/server"
)
@ -15,7 +14,7 @@ type PodAction struct {
}
// PodDetail -
func (p *PodAction) PodDetail(serviceID, podName string) (*model.PodDetail, error) {
func (p *PodAction) PodDetail(serviceID, podName string) (*pb.PodDetail, error) {
pd, err := p.statusCli.GetPodDetail(serviceID, podName)
if err != nil {
if strings.Contains(err.Error(), server.ErrPodNotFound.Error()) {
@ -23,14 +22,5 @@ func (p *PodAction) PodDetail(serviceID, podName string) (*model.PodDetail, erro
}
return nil, err
}
b, err := json.Marshal(pd)
if err != nil {
return nil, err
}
var podDetail model.PodDetail
if err := json.Unmarshal(b, &podDetail); err != nil {
return nil, err
}
podDetail.Status.Type = pd.Status.Type.String()
return &podDetail, nil
return pd, nil
}

View File

@ -1,13 +1,13 @@
package handler
import (
"github.com/goodrain/rainbond/api/model"
"github.com/goodrain/rainbond/worker/client"
"github.com/goodrain/rainbond/worker/server/pb"
)
// PodHandler defines handler methods about k8s pods.
type PodHandler interface {
PodDetail(serviceID, podName string) (*model.PodDetail, error)
PodDetail(serviceID, podName string) (*pb.PodDetail, error)
}
// NewPodHandler creates a new PodHandler.

View File

@ -14,7 +14,8 @@ type PodDetail struct {
// PodStatus -
type PodStatus struct {
Type string `json:"type,omitempty"`
Type int `json:"type,omitempty"`
TypeStr string `json:"type_str,omitempty"`
Reason string `json:"reason,omitempty"`
Message string `json:"message,omitempty"`
Advice string `json:"advice,omitempty"`
@ -22,12 +23,12 @@ type PodStatus struct {
// PodContainer -
type PodContainer struct {
Image string `json:"image,omitempty"`
State string `json:"state,omitempty"`
Reason string `json:"reason,omitempty"`
Started string `json:"started,omitempty"`
LimitMemory string `json:"limit_memory,omitempty"`
LimitCPU string `json:"limit_cpu,omitempty"`
Image string `json:"image,omitempty"`
State string `json:"state,omitempty"`
Reason string `json:"reason,omitempty"`
Started string `json:"started,omitempty"`
LimitMemory string `json:"limit_memory,omitempty"`
LimitCPU string `json:"limit_cpu,omitempty"`
}
// PodEvent -

View File

@ -1185,6 +1185,7 @@ type PodStatus struct {
Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"`
Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
Advice string `protobuf:"bytes,4,opt,name=advice,proto3" json:"advice,omitempty"`
TypeStr string `protobuf:"bytes,5,opt,name=type_str,json=typeStr,proto3" json:"type_str,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
@ -1243,6 +1244,13 @@ func (m *PodStatus) GetAdvice() string {
return ""
}
func (m *PodStatus) GetTypeStr() string {
if m != nil {
return m.TypeStr
}
return ""
}
type PodContainer struct {
Image string `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"`
State string `protobuf:"bytes,2,opt,name=state,proto3" json:"state,omitempty"`
@ -1471,108 +1479,109 @@ func init() {
func init() { proto.RegisterFile("app_runtime_server.proto", fileDescriptor_f94cf1a886c479d6) }
var fileDescriptor_f94cf1a886c479d6 = []byte{
// 1602 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x58, 0x4b, 0x73, 0x1b, 0x45,
0x10, 0xb6, 0xde, 0x52, 0xcb, 0x92, 0xe5, 0x49, 0x9c, 0x6c, 0x94, 0x84, 0x24, 0x4b, 0x92, 0x72,
0x15, 0x29, 0x13, 0x0c, 0xa9, 0x38, 0x8f, 0x0a, 0xa5, 0x48, 0xc2, 0x51, 0x61, 0x2b, 0xae, 0xb5,
0x5c, 0x1c, 0x55, 0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01, 0x98, 0x78, 0x6e, 0x68, 0xda, 0x2e, 0xf7, 0x03, 0xad, 0x42, 0xfe,
0xde, 0x59, 0xf2, 0x77, 0xa7, 0x9b, 0x60, 0xe4, 0x31, 0x65, 0x48, 0xed, 0x03, 0xd8, 0x58, 0x58,
0x5e, 0x71, 0x60, 0x1f, 0x67, 0x0f, 0xac, 0xbe, 0xdb, 0x40, 0x13, 0x09, 0x2b, 0x7b, 0x7e, 0x27,
0x50, 0x4b, 0xe4, 0xec, 0x1e, 0x34, 0x13, 0x43, 0xd2, 0x69, 0xa9, 0xb2, 0x91, 0x48, 0xc9, 0xf5,
0x3b, 0xb0, 0xee, 0x70, 0xc7, 0xf3, 0x67, 0xe3, 0xa9, 0xed, 0xd8, 0x21, 0xd9, 0x28, 0x18, 0x75,
0x29, 0x3b, 0x40, 0x91, 0xfe, 0x47, 0x19, 0xa0, 0x27, 0xc3, 0xec, 0xbe, 0xf1, 0xd8, 0x0d, 0xa8,
0xa1, 0xba, 0x40, 0x98, 0x93, 0x58, 0x67, 0x2a, 0x60, 0x3a, 0xac, 0x63, 0xbc, 0xf8, 0x9b, 0x68,
0xca, 0x03, 0x1e, 0xaa, 0x63, 0x9a, 0x93, 0xb1, 0x8f, 0x40, 0x9d, 0x8b, 0xc3, 0xdd, 0x70, 0xfe,
0xa4, 0x50, 0x42, 0x69, 0x10, 0x9a, 0x7e, 0x38, 0xc6, 0x0a, 0xa2, 0xce, 0xaa, 0x46, 0x92, 0x91,
0xed, 0x70, 0xf6, 0x00, 0x8a, 0x02, 0x33, 0xac, 0x44, 0x11, 0xd7, 0xe8, 0x46, 0x24, 0xdb, 0xdb,
0xc1, 0xd4, 0x92, 0x81, 0x26, 0x14, 0xdb, 0x83, 0xaa, 0xca, 0x20, 0x3c, 0x42, 0x64, 0xdc, 0x58,
0x60, 0xc4, 0x45, 0x45, 0xb2, 0x12, 0x34, 0x7b, 0x06, 0x35, 0xee, 0x5a, 0xc2, 0xb3, 0xdd, 0x30,
0x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, 0xf9, 0xa4, 0x32, 0x6a, 0x99, 0xdf,
0xfb, 0xda, 0xb6, 0x6b, 0xb8, 0x2c, 0x7f, 0x42, 0x90, 0x92, 0x95, 0x4f, 0xa2, 0x54, 0xf2, 0xde,
0xd7, 0x72, 0x49, 0xc9, 0xca, 0x37, 0x8d, 0xa9, 0xe6, 0x7d, 0xfa, 0x77, 0x94, 0x7c, 0x41, 0x29,
0x90, 0x5e, 0x1b, 0x4a, 0x81, 0x85, 0x52, 0xdf, 0x8e, 0x93, 0x5e, 0x4a, 0xf4, 0xb5, 0xd3, 0x32,
0xfd, 0x5a, 0xf9, 0xfc, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x1b, 0x81, 0x6a, 0x6b, 0x76, 0x11,
0x00, 0x00,
// 1619 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x58, 0xcd, 0x6e, 0x1b, 0x47,
0x12, 0x16, 0xff, 0xc9, 0xa2, 0x48, 0x51, 0x6d, 0xcb, 0xa6, 0x69, 0x7b, 0x6d, 0xcf, 0xda, 0x86,
0x80, 0x35, 0xb4, 0x5e, 0xed, 0x1a, 0x96, 0x7f, 0xe0, 0x05, 0x4d, 0x32, 0x32, 0x11, 0x89, 0x16,
0x46, 0x12, 0x72, 0x24, 0x46, 0x9c, 0xb6, 0x32, 0x31, 0x67, 0xa6, 0x33, 0x3f, 0x0a, 0x78, 0x4c,
0x0e, 0x79, 0x81, 0x5c, 0x73, 0xc9, 0xe3, 0xe4, 0x12, 0xe4, 0x4d, 0x72, 0xc9, 0x03, 0x04, 0x55,
0xdd, 0x3d, 0x33, 0xfc, 0x31, 0x1c, 0x25, 0x01, 0x72, 0x9b, 0xae, 0xfe, 0xbe, 0xaa, 0xae, 0xea,
0xea, 0xaa, 0x22, 0xa1, 0x6d, 0x09, 0x31, 0x0e, 0x62, 0x2f, 0x72, 0x5c, 0x3e, 0x0e,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3,
0x14, 0x48, 0x9f, 0x0d, 0xa5, 0xc0, 0x42, 0x17, 0xe8, 0xe8, 0xa4, 0x97, 0x12, 0x63, 0xed, 0xac,
0x4c, 0xff, 0xba, 0xfc, 0xf7, 0xb7, 0x00, 0x00, 0x00, 0xff, 0xff, 0xda, 0x28, 0x09, 0xde, 0x91,
0x11, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.

View File

@ -159,6 +159,7 @@ message PodStatus {
string reason = 2;
string message = 3;
string advice = 4;
string type_str = 5;
}
message PodContainer {

View File

@ -4,12 +4,12 @@ import (
"context"
"errors"
"fmt"
"github.com/goodrain/rainbond/worker/util"
"sort"
"time"
"github.com/Sirupsen/logrus"
"github.com/goodrain/rainbond/worker/server/pb"
"github.com/goodrain/rainbond/worker/util"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
@ -42,6 +42,7 @@ func (r *RuntimeServer) GetPodDetail(ctx context.Context, req *pb.GetPodDetailRe
podDetail.StartTime = pod.Status.StartTime.Time.Format(time.RFC3339)
podDetail.InitContainers = make([]*pb.PodContainer, len(pod.Spec.InitContainers))
podDetail.Containers = make([]*pb.PodContainer, len(pod.Spec.Containers))
podDetail.Status = &pb.PodStatus{}
podDetail.Events = []*pb.PodEvent{}
if pod.Spec.NodeName != "" {

View File

@ -45,4 +45,5 @@ func DescribePodStatus(pod *corev1.Pod, podStatus *pb.PodStatus) {
}
// TODO: advice
}
podStatus.TypeStr = podStatus.Type.String()
}