1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-06-12 22:07:47 +02:00

get k8s pod (#2173)

This commit is contained in:
biubiubiu-ljd
2021-06-02 20:54:02 +08:00
committed by GitHub
parent ca2014bf8e
commit 62112b015f
3 changed files with 4 additions and 3 deletions

View File

@ -191,7 +191,7 @@ func (c *kregistry) GetService(name string, opts ...registry.GetOption) ([]*regi
// loop through items
for _, pod := range pods.Items {
if pod.Status.Phase != podRunning {
if pod.Status.Phase != podRunning || pod.Meta.DeletionTimestamp != "" {
continue
}
// get serialised service from annotation
@ -235,7 +235,7 @@ func (c *kregistry) ListServices(opts ...registry.ListOption) ([]*registry.Servi
svcs := make(map[string]bool)
for _, pod := range pods.Items {
if pod.Status.Phase != podRunning {
if pod.Status.Phase != podRunning || pod.Meta.DeletionTimestamp != "" {
continue
}
for k, v := range pod.Metadata.Annotations {