Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SD.eureka: register app to instance ignore status #1076

Open
finnZhang0710 opened this issue Apr 8, 2021 · 0 comments
Open

SD.eureka: register app to instance ignore status #1076

finnZhang0710 opened this issue Apr 8, 2021 · 0 comments

Comments

@finnZhang0710
Copy link

finnZhang0710 commented Apr 8, 2021

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

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)

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
}
@finnZhang0710 finnZhang0710 changed the title SD.eurekaregister app to instance ignore status SD.eureka: register app to instance ignore status Apr 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants