Remove a useless "_" assignment to appease the linter

(This would become an error rather than a warning once we try to move
this code to another file.)

Also rename an "ok" variable to "exists" since that what it really
means.
This commit is contained in:
Dan Winship 2023-11-27 11:30:53 -05:00
parent 452fcc5fd6
commit 0779042a6f

View File

@ -168,10 +168,10 @@ func (sct *ServiceChangeTracker) newBaseServiceInfo(port *v1.ServicePort, servic
}
// v1.DeprecatedAnnotationTopologyAwareHints has precedence over v1.AnnotationTopologyMode.
var ok bool
info.hintsAnnotation, ok = service.Annotations[v1.DeprecatedAnnotationTopologyAwareHints]
if !ok {
info.hintsAnnotation, _ = service.Annotations[v1.AnnotationTopologyMode]
var exists bool
info.hintsAnnotation, exists = service.Annotations[v1.DeprecatedAnnotationTopologyAwareHints]
if !exists {
info.hintsAnnotation = service.Annotations[v1.AnnotationTopologyMode]
}
loadBalancerSourceRanges := make([]string, len(service.Spec.LoadBalancerSourceRanges))