-
Notifications
You must be signed in to change notification settings - Fork 127
Embed struct, not pointer in resources #2829
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
Conversation
… commit message that captures the essence of the transformation: refactor: replace App pointer embedding with direct struct embedding
This commit resolves type mismatch errors in test files by converting `compute.ClusterSpec{}` to `&compute.ClusterSpec{}` to match the expected pointer type.
The changes affect multiple test files in the bundle configuration and deployment packages, ensuring consistent type usage for cluster specifications.
This reverts commit 8bd4ddb.
a1add45 to
9fa0be8
Compare
pietern
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, great simplification!
|
|
||
| assert.Nil(t, b.Config.Resources.Volumes["nilVolume"]) | ||
| assert.Nil(t, b.Config.Resources.Volumes["emptyVolume"].CreateVolumeRequestContent) | ||
| // assert.Nil(t, b.Config.Resources.Volumes["emptyVolume"].CreateVolumeRequestContent) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dup?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a dup (second line used to check inner pointer), should have been cleaned up.
| ModelServingEndpoints: map[string]*resources.ModelServingEndpoint{ | ||
| "my_model_serving_endpoint": { | ||
| CreateServingEndpoint: &serving.CreateServingEndpoint{}, | ||
| CreateServingEndpoint: serving.CreateServingEndpoint{}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, with these structs being zero-initialized, the assignment can be removed entirely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. For context, most replacement were made with search-and-replace, so they look odd (AI tools were going back and forth on whether it should be a pointer or a struct, so I stopped using those for this).
I feel like there should be a linter to clean this up, but I could not find one.
Changes
Why
Tests
Existing tests.