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

feat: Add ability to specify MTU when creating Network #1262

Merged
merged 5 commits into from
Jul 2, 2024
Merged

feat: Add ability to specify MTU when creating Network #1262

merged 5 commits into from
Jul 2, 2024

Conversation

tasdikrahman
Copy link
Member

What type of PR is this?

/kind feature

What this PR does / why we need it:

User can set GCPCluster.Spec.Network.Mtu for setting the MTU for the network being created. If nothing is passed the MTU will default to 1440 which is the default set here https://cloud.google.com/vpc/docs/mtu

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #1246

Special notes for your reviewer:

Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests

Release note:

feat: Add ability to add GCPCluster.Spec.Network.Mtu 

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jun 14, 2024
@k8s-ci-robot k8s-ci-robot requested review from damdo and dims June 14, 2024 11:20
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 14, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @tasdikrahman. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 14, 2024
Copy link

netlify bot commented Jun 14, 2024

Deploy Preview for kubernetes-sigs-cluster-api-gcp ready!

Name Link
🔨 Latest commit e3a61fc
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-cluster-api-gcp/deploys/6683c59ab88ceb00083e9563
😎 Deploy Preview https://deploy-preview-1262--kubernetes-sigs-cluster-api-gcp.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@cpanato cpanato left a comment

Choose a reason for hiding this comment

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

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 15, 2024
@tasdikrahman
Copy link
Member Author

Thanks for the review @cpanato , let me know if you would like me to add any more changes on this PR before approval. Thank you.

@cpanato
Copy link
Member

cpanato commented Jun 26, 2024

thanks

/approve

/assign @damdo

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cpanato, tasdikrahman

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 26, 2024
Comment on lines 140 to 144
// Mtu: Maximum Transmission Unit (MTU), in bytes, of packets passing through
// this interconnect attachment. Only 1440 and 1500 are allowed. If not
// specified, the value will default to 1440.
// +optional
Mtu int64 `json:"mtu,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

I think we should add openAPI validation for this field only allowing the two values you are mentioning.
Also where are those values coming from? We might want to leave a message mentioning that.

Copy link
Member

Choose a reason for hiding this comment

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

Also we could add a validation step in the validation code (e.g. webooks).
And a couple of unit test checking that is validated correctly.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we should add openAPI validation for this field only allowing the two values you are mentioning.
Also where are those values coming from? We might want to leave a message mentioning that.

Hello there, I fixed the validation code to have the minimum and maximum values present. The values of minimum of 1300 and maximum of 8896 are taken from https://pkg.go.dev/google.golang.org/api/compute/v1#Network

Also we could add a validation step in the validation code (e.g. webooks).
And a couple of unit test checking that is validated correctly.

Will add some unit tests exercising this.

@damdo
Copy link
Member

damdo commented Jun 26, 2024

/hold
For changes to be added

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 26, 2024
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 2, 2024
@damdo
Copy link
Member

damdo commented Jul 2, 2024

Thank you for implementing the requested changes @tasdikrahman
/lgtm
/unhold

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Jul 2, 2024
@k8s-ci-robot k8s-ci-robot merged commit 76feb78 into kubernetes-sigs:main Jul 2, 2024
16 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.1.0 milestone Jul 2, 2024
@tasdikrahman tasdikrahman deleted the feat-add-ability-to-specify-mtu branch July 2, 2024 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support MTU change for VPC
4 participants