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
Change .metadata.name to optional for all Patch resources #2126
Conversation
This is a minor breaking change that updates the `.metadata.name` field from required to optional for all Patch resources. This resolves an issue where a nested reference to the ObjectMeta type also required the name field to be set (e.g., for Deployment, StatefulSet, etc.). Instead of requiring the name field in the SDKs, this requirement will be enforced by the provider. This change trades some clarity in the API usage for semantic correctness.
Does the PR have any schema changes?Looking good! No breaking changes found. |
I am not sure this is a breaking change since existing code should still work properly?
Should we roll that into this PR as well? |
It changes types, which affects Go, C#, and Java. I'd consider this a minor break still since the feature is opt-in. |
Does the PR have any schema changes?Looking good! No breaking changes found. |
Does the PR have any schema changes?Looking good! No breaking changes found. |
@@ -1262,6 +1262,12 @@ func (k *kubeProvider) Check(ctx context.Context, req *pulumirpc.CheckRequest) ( | |||
oldInputs := propMapToUnstructured(olds) | |||
newInputs := propMapToUnstructured(news) | |||
|
|||
if k.serverSideApplyMode && strings.HasSuffix(urn.Type().String(), "Patch") { |
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.
Nit: would be good to pull strings.HasSuffix(urn.Type().String(), "Patch")
to a function like isPatchResource()
or something.
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.
Agreed -- I'll follow up on that in a later change.
I think in general compilation breaks are ok as long as replacements etc. arent triggered. As you said, the point is moot here since its in preview. |
Proposed changes
This is a minor breaking change that updates the
.metadata.name
field from required to optional for all Patch resources. This resolves an issue where a nested reference to the ObjectMeta type also required the name field to be set (e.g., for Deployment, StatefulSet, etc.). Instead of requiring the name field in the SDKs, this requirement will be enforced by the provider. This change trades some clarity in the API usage for semantic correctness.Related issues (optional)
Fix #2115