Skip to content

🌱 Fuzz conversion for v1beta1 <-> v1beta2#3119

Open
lentzi90 wants to merge 2 commits intokubernetes-sigs:mainfrom
Nordix:lentzi90/fuzz-conversion-v1beta1-v1beta2
Open

🌱 Fuzz conversion for v1beta1 <-> v1beta2#3119
lentzi90 wants to merge 2 commits intokubernetes-sigs:mainfrom
Nordix:lentzi90/fuzz-conversion-v1beta1-v1beta2

Conversation

@lentzi90
Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

  • Replace the deprecated gofuzz library with randfill, updating all fuzzer
    function signatures and method calls accordingly.
  • Add fuzzy conversion tests for v1beta1 API types

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

Special notes for your reviewer:

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

TODOs:

  • squashed commits
  • if necessary:
    • includes documentation
    • adds unit tests

/hold

@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 Apr 15, 2026
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 15, 2026

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

Name Link
🔨 Latest commit 6d3ec0f
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-sigs-cluster-api-openstack/deploys/69e0c11cd12e5a00089a669d
😎 Deploy Preview https://deploy-preview-3119--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 project configuration.

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 15, 2026
@lentzi90 lentzi90 force-pushed the lentzi90/fuzz-conversion-v1beta1-v1beta2 branch from 8efb07a to a6e0c39 Compare April 15, 2026 07:23
Replace the deprecated gofuzz library with randfill, updating all fuzzer
function signatures and method calls accordingly.

Signed-off-by: Lennart Jern <lennart.jern@est.tech>
@lentzi90 lentzi90 force-pushed the lentzi90/fuzz-conversion-v1beta1-v1beta2 branch from a6e0c39 to daf2a25 Compare April 15, 2026 07:35
Copy link
Copy Markdown
Contributor Author

@lentzi90 lentzi90 left a comment

Choose a reason for hiding this comment

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

/hold cancel
/approve

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Apr 15, 2026
Copy link
Copy Markdown
Contributor

@nikParasyr nikParasyr left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 16, 2026
Comment thread test/helpers/fuzzerfuncs.go Outdated
// * Constrain the output in ways which are validated by the API server
// * Constrain fields that are not preserved during v1beta2 <-> v1beta1 round-trip conversion
// * Add additional test coverage where it is not generated by the default fuzzer.
func InfraV1Beta2FuzzerFuncs() []any {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

similar to the other one, most of the funcs here are identical copies of the ones in InfraV1FuzzerFuncs. Since slices.Concat merges both lists, the duplicates in InfraV1FuzzerFuncs end up as dead code (last registration wins).

Could this just contain the funcs that are actually new (the OpenStackCluster/OpenStackMachine/OpenStackMachineTemplate/FailureDomain OpenStackClusterStatus normalizers)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This made me realize a mistake. The point here was to have different API versions for each function, but now we have the same everywhere. I'll fix this. We will have "duplication" in a way but it will be correct then with v1beta1 for the v1beta1 fuzzing and v1beta2 for the v1beta2 fuzzing

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Now I think this is correct. We have separate fuzzers for v1beta1 and v1beta2, so they are no longer identical and won't overwrite each other.

@bnallapeta
Copy link
Copy Markdown
Contributor

/hold

@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 Apr 16, 2026
@lentzi90
Copy link
Copy Markdown
Contributor Author

Good points @bnallapeta ! I sort of just assumed there would be differences, but in reality a lot of it is still the same. I'll clean it up!

Signed-off-by: Lennart Jern <lennart.jern@est.tech>
@lentzi90 lentzi90 force-pushed the lentzi90/fuzz-conversion-v1beta1-v1beta2 branch from daf2a25 to 6d3ec0f Compare April 16, 2026 10:59
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 16, 2026
@lentzi90
Copy link
Copy Markdown
Contributor Author

lentzi90 commented Apr 17, 2026

/hold
Let's take in #3087 first. I don't want to cause any conflicts

@lentzi90
Copy link
Copy Markdown
Contributor Author

Ok we are good, no conflict 👍
/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 17, 2026
Copy link
Copy Markdown
Contributor

@bnallapeta bnallapeta left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 17, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bnallapeta, lentzi90, nikParasyr

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

The pull request process is described here

Details 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
Copy link
Copy Markdown
Contributor

@lentzi90: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cluster-api-provider-openstack-test 6d3ec0f link unknown /test pull-cluster-api-provider-openstack-test

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Details

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. I understand the commands that are listed here.

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. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

Status: Inbox

Development

Successfully merging this pull request may close these issues.

Add Fuzz tests for v1beta1 <-> v1beta2 conversions

4 participants