-
Notifications
You must be signed in to change notification settings - Fork 64
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
Load balancer rule #25
Conversation
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.
Aside from a few minor comments i have left inline this mostly LGTM.
"frontend_ip_configuration_name": { | ||
Type: schema.TypeString, | ||
Required: true, | ||
}, |
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.
Could we get a NoZeroValues
here?
Type: schema.TypeInt, | ||
Optional: true, | ||
Computed: true, | ||
}, |
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.
Could we get some validation here: validation.IntBetween(4,30)
d.Set("frontend_port", config.LoadBalancingRulePropertiesFormat.FrontendPort) | ||
d.Set("backend_port", config.LoadBalancingRulePropertiesFormat.BackendPort) | ||
|
||
if config.LoadBalancingRulePropertiesFormat.EnableFloatingIP != 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.
Could we break this out into a block? ie:
if properties := config.LoadBalancingRulePropertiesFormat; properties != nil {
d.Set("protocol", properties.Protocol)
...
}
LoadBalancingRulePropertiesFormat: &properties, | ||
} | ||
|
||
return &lbRule, 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.
could we change this to:
return &network.LoadBalancingRule{
Name: utils.String(d.Get("name").(string)),
LoadBalancingRulePropertiesFormat: &properties,
}, nil
ID: &v, | ||
} | ||
|
||
properties.Probe = &pid |
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.
Could we change this to:
properties.Probe = &network.SubResource{
ID: &v,
}
ID: &v, | ||
} | ||
|
||
properties.BackendAddressPool = &beAP |
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.
And here:
properties.FrontendIPConfiguration = &network.SubResource{
ID: rule.ID,
}
Instead of creating a variable and then setting it
Thank you for these updates @thetonymaster, LGTM now 👍 |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
No description provided.