mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-11-30 10:48:15 +08:00
27 lines
616 B
Go
27 lines
616 B
Go
package handler
|
|
|
|
import (
|
|
"github.com/goodrain/rainbond/worker/server/pb"
|
|
"strings"
|
|
|
|
"github.com/goodrain/rainbond/worker/client"
|
|
"github.com/goodrain/rainbond/worker/server"
|
|
)
|
|
|
|
// PodAction is an implementation of PodHandler
|
|
type PodAction struct {
|
|
statusCli *client.AppRuntimeSyncClient
|
|
}
|
|
|
|
// PodDetail -
|
|
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()) {
|
|
return nil, server.ErrPodNotFound
|
|
}
|
|
return nil, err
|
|
}
|
|
return pd, nil
|
|
}
|