Skip to content
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

Enable control plane firewall pointer arguments and trim spaces #1555

Conversation

llDrLove
Copy link
Contributor

  • Ensure that the enable-control-plane-firewall flag is a optional boolean and only pass the configuration when needed.
  • Ensure that the IPs or CIDRs are trimmed from whitespaces when building the Update or Create request.

@llDrLove llDrLove force-pushed the olove/enable-control-plane-firewall-pointer-arguments branch from 582d3f8 to 0966af0 Compare July 18, 2024 15:14
for _, parm := range parms {
if parm.Init {
keyVal := parm.Key + "=" + parm.Value
for _, param := range params {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -1679,6 +1675,9 @@ func buildClusterCreateRequestFromArgs(c *CmdConfig, r *godo.KubernetesClusterCr
if r.ControlPlaneFirewall == nil {
r.ControlPlaneFirewall = &godo.KubernetesControlPlaneFirewall{}
}
for i := range controlPlaneFirewallAllowedAddresses {
controlPlaneFirewallAllowedAddresses[i] = strings.ReplaceAll(controlPlaneFirewallAllowedAddresses[i], " ", "")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm inclined to prefer strings.TrimSpace() which also handles all sorts of unicode variants.

Similar for the other usage elsewhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I've refactored it to use strings.TrimSpace()

@llDrLove llDrLove requested a review from timoreimann July 18, 2024 17:02
Copy link
Contributor

@timoreimann timoreimann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for the Kubernetes parts.

@llDrLove llDrLove marked this pull request as ready for review July 18, 2024 17:34
Copy link
Member

@andrewsomething andrewsomething left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LGTM!

@andrewsomething andrewsomething merged commit d16c594 into digitalocean:main Jul 22, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants