kubernetes-sigs / cluster-api-provider-openstack

Cluster API implementation for OpenStack
https://cluster-api-openstack.sigs.k8s.io/
Apache License 2.0
289 stars 253 forks source link

🐛 Fix multiple panics in restore functions #1989

Closed mdbooth closed 6 months ago

mdbooth commented 6 months ago

Panics in restore functions are a particular problem because previous is unvalidated user-provided input. It should have been generated by a previous conversion, but we have no way to enforce that. We don't need to preserve sensible behaviour given invalid input, but we should not crash.

This PR implements a generic function for fuzzing restore functions, adds v1alpha6 and v1alpha7 tests which calls the fuzzer against all restore functions, and fixes all the discovered panics.

/hold

k8s-ci-robot commented 6 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mdbooth

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: - ~~[OWNERS](https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/OWNERS)~~ [mdbooth] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
netlify[bot] commented 6 months ago

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

Name Link
Latest commit de0dffa5ff0fa07a82b81769e342f8d8a953ce91
Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-cluster-api-openstack/deploys/660bd3d5546e2a0008bad24e
Deploy Preview https://deploy-preview-1989--kubernetes-sigs-cluster-api-openstack.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.

mdbooth commented 6 months ago

/test pull-cluster-api-provider-openstack-e2e-full-test

jichenjc commented 6 months ago

/test pull-cluster-api-provider-openstack-e2e-test

k8s-ci-robot commented 6 months ago

PR needs rebase.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
mdbooth commented 6 months ago

/hold cancel

mdbooth commented 6 months ago

In case it's important later: I manually removed the needs-rebase label. Not sure why the bot didn't do that itself, but it doesn't currently need a rebase.

dulek commented 6 months ago

/lgtm