-
Notifications
You must be signed in to change notification settings - Fork 248
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
Update spanner instance edition logic for direct controller #3948
base: master
Are you sure you want to change the base?
Update spanner instance edition logic for direct controller #3948
Conversation
@@ -93,6 +93,12 @@ func SpannerInstanceSpec_ToProto(mapCtx *direct.MapContext, in *krm.SpannerInsta | |||
out.DisplayName = in.DisplayName | |||
out.NodeCount = direct.ValueOf(in.NumNodes) | |||
out.ProcessingUnits = direct.ValueOf(in.ProcessingUnits) | |||
// if edition is unspecified, Spanner API default edition to STANDARD. | |||
// Spanner API bans downgrade edition from STANDARD to unspecifed, | |||
// which cause infinite reconcile loop. |
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.
Good to know.
Is "unspecified" allowed? In other words, does the server give a default value when creating a SpannerInstance without the edition? Is it allowed to downgrade edition to other values?
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.
Unspecicied value is no longer allowed. STANDARD is the new default. Downgrading is technically possible but I plan to block it due to the constrains (from other resources).
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.
/approve
Looks good. One question about whether we should consider to allow unsetting the field.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: yuwenma 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:
Approvers can indicate their approval by writing |
|
I added the logic where we blocked downgrade edition. If users do not specify edition, we default to standard in mapping but won't update the edition (because it is treated as downgrade). Effectively, the field become unmanaged. |
Change description
Tests you have done
make ready-pr
to ensure this PR is ready for review.