-
Notifications
You must be signed in to change notification settings - Fork 7
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
[1.14] ipam: Support for static IP allocation in AWS #569
Conversation
0c522d2
to
fe7b5e8
Compare
e02c448
to
f0dd9b7
Compare
pkg/ipam/node.go
Outdated
func (n *Node) getStaticIPTags() ipamTypes.Tags { | ||
if n.resource.Spec.IPAM.StaticIPTags != nil { | ||
return n.resource.Spec.IPAM.StaticIPTags | ||
} else { |
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.
🔵 Code Quality Violation
code block could be outside the else (...read more)
Sometimes, the else
block of an if
is unnecessary and can be avoided, especially when there is a return
statement inside the if
block will be executed and the function will terminate. Hence, there is no need to explicitly specify the else
clause.
By removing the else
clause, the code becomes more concise and easier to read. It eliminates redundancy and makes the intention of the code clearer.
To avoid such situations, it is a good coding practice to write code with the fewest possible branches. This makes the code easier to understand and minimizes the chance of introducing bugs.
f0dd9b7
to
ea642c1
Compare
pkg/aws/ec2/ec2.go
Outdated
association, err := c.ec2Client.AssociateAddress(ctx, associateAddressInput) | ||
c.metricsAPI.ObserveAPICall("AssociateAddress", deriveStatus(err), sinceStart.Seconds()) | ||
if err != nil { | ||
// TODO some errors can probably be skipped and next EIP can be tried |
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.
Should we summarize the discussion in code comments ?
ea642c1
to
619b740
Compare
No description provided.