-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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 spring cloud sdk to 2022-01-01-preview #15597
update spring cloud sdk to 2022-01-01-preview #15597
Conversation
a173749
to
d498dbb
Compare
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.
hi @ms-henglu
I've taken a look through here and spotted a number of issues:
- What's the bug?
- What's being fixed on March 7th? When will this reach all regions?
- This shouldn't be using a combined create/update method - this intentionally makes use of
HasChanges
to enable migration from the deprecated to the new field - This appears to introduce a number of breaking changes?
Would you be able to take a look?
Thanks!
Read: resourceSpringCloudActiveDeploymentRead, | ||
Update: resourceSpringCloudActiveDeploymentUpdate, | ||
Update: resourceSpringCloudActiveDeploymentCreateUpdate, |
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.
this should be using a combined Create and Update - can we revert this?
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.
Sorry I didn't get it. Can you elaborate on that?
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 think he meant "should not" as in revert combining create & update
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.
Got it, thanks!
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.
@katbyte , but the logic in Create and Update are almost the same, is it really necessary to revert combining create & update?
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.
yes these need to be separate - as the Create can assume all properties are set but the Update should only change properties if it's changed (e.g. using HasChanges)
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.
@tombuildsstuff , Got it. I've updated this PR, please take another look, thanks!
existing.Properties.DeploymentSettings.CPU = utils.Int32(int32(d.Get("cpu").(int))) | ||
|
||
// "cpu" within "quota" that takes precedence of deprecated "cpu" should be ignored in this situation where users explicitly update the deprecated "cpu" that conflicts with "cpu" within "quota" | ||
if d.HasChange("cpu") { |
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.
this would be a breaking change without the feature flag
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 think the feature flag is not necessary, since cpu
will only be in schema when it's not 3.0.
if err := d.Set("quota", flattenSpringCloudDeploymentResourceRequests(settings.ResourceRequests)); err != nil { | ||
return fmt.Errorf("setting `quota`: %+v", err) | ||
} | ||
if !features.ThreePointOhBeta() { |
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.
isn't this feature flag around the wrong way?
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.
Since cpu
and memerory_in_gb
are not in 3.0 schema, so I set them by checking if !features.ThreePointOhBeta() {
internal/services/springcloud/spring_cloud_java_deployment_resource.go
Outdated
Show resolved
Hide resolved
Hi @tombuildsstuff , Thanks for the code review.
The
Above bug will be fixed and released to all regions on March 7th.
I'm not sure that I followed. But since cpu and memoryInGB are replaced with resouceRequests/cpu and resourceRequests/memory, so I planned to send both cpu and quota/cpu to resouceRequests/cpu, memory and quota/memory to resourceRequests/memory to simplify the logic.
Yes, the API does, but the changes can be swallowed in the provider without exposing to tf users. |
d498dbb
to
7bae98a
Compare
Hi @katbyte , all passed now. |
Hi @katbyte , just triggered test, all passed. Would you please take another look? Thanks! |
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.
LGTM 🍰
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
Hi, there's bug caused a test failed, and the bugfix will release on March 7th.