-
Notifications
You must be signed in to change notification settings - Fork 63
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
Add loadbalancer preserve annotation #69
Add loadbalancer preserve annotation #69
Conversation
5817d84
to
d51dad4
Compare
d51dad4
to
2919ec5
Compare
f2d4e26
to
a1654c9
Compare
if preserveRaw, ok := service.Annotations[annLinodeLoadBalancerPreserve]; ok { | ||
if preserve, err := strconv.ParseBool(preserveRaw); err == nil && preserve { | ||
return nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing a return err
branch here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was intentional. When talking with @jnschaeffer, we thought it'd be better to interpret an invalid boolean as false
and document it as such. Do you think there is value in throwing an error here instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, that does seem like the correct default behavior.
Note that in this case the docs should indicate that the value is a string, as all annotations are, and will accept the following values: 1, t, T, TRUE, true, True
https://golang.org/pkg/strconv/#ParseBool
Docs could even link to this doc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had this comment as pending for a while. Sorry for the confusion in chat.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a note below the annotation lists describing the accepted string representations for true
, here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks perfect aside from my one comment above!
a1654c9
to
02d51da
Compare
This change adds an annotation that can be used on services of
type: LoadBalancer
to ensure that the underlying NodeBalancer is not deleted when the service is.This is the first of two PRs to enable reusing LoadBalancers.