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

fix: Make gcpmanagedcluster.network a required field #1259

Closed
wants to merge 1 commit into from
Closed

fix: Make gcpmanagedcluster.network a required field #1259

wants to merge 1 commit into from

Conversation

tasdikrahman
Copy link
Member

What type of PR is this?

This makes the gcpmanagedcluster.network field a required field.

/kind feature

What this PR does / why we need it:

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 #1187

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:

fix: Makes GCPManagedCluster Spec's network field a required field

@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 12, 2024
@k8s-ci-robot
Copy link
Contributor

Welcome @tasdikrahman!

It looks like this is your first PR to kubernetes-sigs/cluster-api-provider-gcp 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/cluster-api-provider-gcp has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@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 12, 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 requested a review from damdo June 12, 2024 11:16
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: tasdikrahman
Once this PR has been reviewed and has the lgtm label, please assign dims for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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 requested a review from dims June 12, 2024 11:16
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jun 12, 2024
Copy link

netlify bot commented Jun 12, 2024

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

Name Link
🔨 Latest commit 9786190
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-cluster-api-gcp/deploys/66698398a443bf00086812fd
😎 Deploy Preview https://deploy-preview-1259--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 12, 2024
@damdo
Copy link
Member

damdo commented Jun 12, 2024

Would this be considered a breaking API change?

@tasdikrahman
Copy link
Member Author

Hey folks.

@damdo @cpanato thanks for the review.

Would this be considered a breaking API change?

I feel so, since we are making it required here in this PR. Let me know if you would like me to change something. Thanks.

But thinking out loud, if the controller would crash when this attribute was not passed, the controller would be implicitly requiring this value from what I can understand.

@damdo
Copy link
Member

damdo commented Jun 14, 2024

@tasdikrahman
#1187 is highlighting that this missing causes a nil pointer exception, which makes the controller crash.
I think the right way of doing this would be to first fix that nil pointer by instead throwing an reconciler error instead of assuming Network is always there. (1)

Then this would alert users that the cluster can't be created because the Network field is missing, and so at least we would give out some informative detail on how they can fix this.

Then yeah by all means, we can set that to not optional, but it would be an API breaking change, which we might want to think through whether we want that to be happening in v1beta1 or that requires a v1beta2.

Would you be able to open a PR to do (1) for now? Thanks!

@tasdikrahman
Copy link
Member Author

@damdo That makes sense, thanks for your comments, I have tried addressing the nil pointer issue here in this PR #1261 to begin with.

@tasdikrahman tasdikrahman closed this by deleting the head repository Jul 5, 2024
@tasdikrahman
Copy link
Member Author

Hello @damdo , I opened up an issue here #1285 to track this change of the Network field being made a required one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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. 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/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nil pointer dereference, on an invalid spec
4 participants