go-kit / go-kit/kit

SD.eureka: register app to instance ignore status

Open
#1,076 0 comments 2 reactions 0 assignees View on GitHub
enhancement help wanted
Dominant language
Go
Stars
27.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

when registrar get instances from eureka server app, it ignore eureka app status.

```go
func convertFargoAppToInstances(app *fargo.Application) []string {
instances := make([]string, len(app.Instances))
for i, inst := range app.Instances {
instances[i] = fmt.Sprintf("%s:%d", inst.IPAddr, inst.Port)
}
return instances
}
```

How can i filter them? (eg: I only want STATUS = 'UP' instance)
```go
func convertFargoAppToInstances(app *fargo.Application) []string {
var instances []string
for _, inst := range app.Instances {
if inst.Status == fargo.UP {
instances = append(instances, fmt.Sprintf("%s:%d", inst.IPAddr, inst.Port))
}
}
return instances
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.