You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "SHA-4096 (via GitHub)" <gi...@apache.org> on 2024/05/22 12:51:10 UTC

Re: [PR] feat: implement instance interface [dubbo-kubernetes]

SHA-4096 commented on code in PR #286:
URL: https://github.com/apache/dubbo-kubernetes/pull/286#discussion_r1609895333


##########
pkg/admin/model/instance.go:
##########
@@ -73,3 +78,105 @@ type State struct {
 	Tip   string `json:"tip"`
 	Value string `json:"value"`
 }
+
+type InstanceDetailResp struct {
+	RpcPort         []string `json:"rpcPort"`
+	Ip              []string `json:"ip"`
+	AppName         []string `json:"appName"`
+	WorkloadName    []string `json:"workloadName"`
+	Labels          []string `json:"labels"`
+	CreateTime      []string `json:"createTime"`
+	ReadyTime       []string `json:"readyTime"`
+	RegisterTime    []string `json:"registerTime"`
+	RegisterCluster []string `json:"registerCluster"`
+	DeployCluster   []string `json:"deployCluster"`
+	Node            []string `json:"node"`
+	Image           []string `json:"image"`
+	Probes          struct {
+		StartupProbe struct {
+			Type string `json:"type"`
+			Port int    `json:"port"`
+			Open bool   `json:"open"`
+		} `json:"startupProbe"`
+		ReadinessProbe struct {
+			Type string `json:"type"`
+			Port int    `json:"port"`
+			Open bool   `json:"open"`
+		} `json:"readinessProbe"`
+		LivenessProbe struct {
+			Type string `json:"type"`
+			Port int    `json:"port"`
+			Open bool   `json:"open"`
+		} `json:"livenessProbe"`
+	} `json:"probes"`
+}
+
+func (r *InstanceDetailResp) FromInstanceDetail(id *InstanceDetail) *InstanceDetailResp {
+	r.AppName = id.AppName.Values()
+	r.RpcPort = id.RpcPort.Values()
+	r.Ip = id.Ip.Values()
+	r.WorkloadName = id.WorkloadName.Values()
+	r.Labels = id.Labels.Values()
+	r.CreateTime = id.CreateTime.Values()
+	r.ReadyTime = id.ReadyTime.Values()
+	r.RegisterTime = id.RegisterTime.Values()
+	r.RegisterCluster = id.RegisterClusters.Values()
+	r.DeployCluster = id.DeployCluster.Values()
+	r.Node = id.Node.Values()
+	r.Image = id.Image.Values()
+	return r
+}
+
+type InstanceDetail struct {
+	RpcPort          Set
+	Ip               Set
+	AppName          Set
+	WorkloadName     Set
+	Labels           Set
+	CreateTime       Set
+	ReadyTime        Set
+	RegisterTime     Set
+	RegisterClusters Set
+	DeployCluster    Set
+	Node             Set
+	Image            Set
+}

Review Comment:
   updated in https://github.com/apache/dubbo-kubernetes/pull/286/commits/0bcd68bea622c151299a5828497abf09027eeeef



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org