in integration/scenarios/export_service.go [100:124]
func (e *exportServiceScenario) compareEndpoints(cmEndpoints []*model.Endpoint) bool {
if len(e.expectedSvc.Endpoints) != len(cmEndpoints) {
fmt.Println("Endpoints do not match.")
return false
}
for _, expected := range e.expectedSvc.Endpoints {
match := false
for _, actual := range cmEndpoints {
// Ignore K8S instance attribute for the purpose of this test.
delete(actual.Attributes, controllers.K8sVersionAttr)
if expected.Equals(actual) {
match = true
break
}
}
if !match {
fmt.Println("Endpoints do not match.")
return false
}
}
fmt.Println("Endpoints match.")
return true
}