Skip to content

Conversation

@andrewstucki
Copy link
Contributor

One of the cloud tests picked up an issue with our conversion code:

constructing desired pools: json: Unmarshal(nil *v1.ResourceRequirementsApplyConfiguration)

This is pointing to the second argument in our convertJSON* routines being passed as a nil. This PR adds nil guards/initializations to the target structs where necessary.

Copy link
Contributor

@RafalKorepta RafalKorepta left a comment

Choose a reason for hiding this comment

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

LGTM, It would be good to add regression tests.

Copy link
Contributor

@chrisseto chrisseto left a comment

Choose a reason for hiding this comment

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

Agreed with Rafal, a regression test would be great!

@andrewstucki
Copy link
Contributor Author

Done, just added a resources block to one of the golden file cases in our lifecycle tests. Without the change we get:

        	Error Trace:	/Users/andrewstucki/code/redpanda-operator/operator/internal/lifecycle/v2_test.go:158
        	Error:      	Received unexpected error:
        	            	json: Unmarshal(nil *v1.ResourceRequirementsApplyConfiguration)
        	Test:       	TestV2ResourceClient/compat-test

With it, the tests pass.

@andrewstucki andrewstucki enabled auto-merge (squash) September 16, 2025 14:55
@andrewstucki andrewstucki merged commit ab440ae into main Sep 16, 2025
10 checks passed
@andrewstucki andrewstucki deleted the as/conversion-fixes branch September 16, 2025 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants