Skip to content

Commit 520f92e

Browse files
committed
Refactor service annotation detection
1 parent 09d4b02 commit 520f92e

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

cloud/linode/loadbalancers.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,7 @@ func (l *loadbalancers) getNodeBalancerByStatus(ctx context.Context, service *v1
142142
func (l *loadbalancers) cleanupOldNodeBalancer(ctx context.Context, service *v1.Service) error {
143143
// unless there's an annotation, we can never get a past and current NB to differ,
144144
// because they're looked up the same way
145-
// TODO(okokes): just copy pasted from elsewhere, encapsulate it somehow
146-
rawID, _ := getServiceAnnotation(service, annLinodeNodeBalancerID)
147-
id, idErr := strconv.Atoi(rawID)
148-
hasIDAnn := idErr == nil && id != 0
149-
if !hasIDAnn {
145+
if _, ok := getServiceAnnotation(service, annLinodeNodeBalancerID); !ok {
150146
return nil
151147
}
152148

0 commit comments

Comments
 (0)