Skip to content
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

sqlvm upgrade include new features #15945

Closed
wants to merge 41 commits into from

Conversation

tikicoder
Copy link
Contributor

This builds off the PR of #15835
This adds the newer functionality from the new version of the API

@tikicoder tikicoder changed the title sqlvm upgrade sqlvm upgrade include new features Mar 22, 2022
Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

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

Thanks for the pr @tikicoder - i've left some minor comments about schema inline. in addtion to this we'll need to add these to a test. once thats done this should be good to merge! thanks

@tikicoder
Copy link
Contributor Author

@katbyte I have accepted all the changes.

@myc2h6o
Copy link
Contributor

myc2h6o commented May 13, 2022

Hi @tikicoder thanks for the pr! I found there seems to be a missing update of the expandSqlVirtualMachineTempDbSettings and flattenSqlVirtualMachineTempDbSettings functions for the updated SQLTempDBStorageSettingSchema. Would you mind updating them? And it would be great if you could add a test around these new properties. Thanks!

@tikicoder
Copy link
Contributor Author

@myc2h6o can you verify the updates and I think I have updated the test to at least a couple of the new settings.

@tikicoder tikicoder requested a review from katbyte May 13, 2022 04:22
Comment on lines 880 to 887
return &sqlvirtualmachine.SQLTempDbSettings{
Luns: expandSqlVirtualMachineStorageSettingsLuns(dataStorageSettings["luns"].([]interface{})),
DefaultFilePath: utils.String(dataStorageSettings["default_file_path"].(string)),
luns: expandSqlVirtualMachineStorageSettingsLuns(tempDbSettings["luns"].([]interface{})),
data_file_count: utils.Int32(int32(tempDbSettings.Get("data_file_count").(int))),
data_file_size_mb: utils.Int32(int32(tempDbSettings.Get("data_file_size_mb").(int))),
data_file_growth_in_mb: utils.Int32(int32(tempDbSettings.Get("data_file_growth_in_mb").(int))),
default_file_path: utils.String(tempDbSettings["default_file_path"].(string)),
log_file_size_mb: utils.Int32(int32(tempDbSettings.Get("log_file_size_mb").(int))),
log_file_growth_mb: utils.Int32(int32(tempDbSettings.Get("log_file_growth_mb").(int)))
Copy link
Contributor

Choose a reason for hiding this comment

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

field name of SQLTempDbSettings needs to be corrected, e.g. data_file_count ->DataFileCount

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok this should be resolved

@@ -882,12 +894,32 @@ func flattenSqlVirtualMachineTempDbSettings(input *sqlvirtualmachine.SQLTempDbSe
}
attrs := make(map[string]interface{})

if input.Luns != nil {
attrs["luns"] = *input.Luns
if input.luns != nil {
Copy link
Contributor

@myc2h6o myc2h6o May 13, 2022

Choose a reason for hiding this comment

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

Same here, field name of SQLTempDbSettings needs to be corrected. e.g. in Terraform the attribute name is luns and in the sdk struct its Luns

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok this should be resolved

@tikicoder
Copy link
Contributor Author

@myc2h6o @katbyte It's ready for the workflow. I think I got the issues resolved.

@tikicoder
Copy link
Contributor Author

@katbyte can you approve running the workflows. This is my first contribution to the repo.

@tikicoder
Copy link
Contributor Author

@myc2h6o @katbyte Can one of you trigger the rest of the approval steps. This is my first time contributing so I am unable to.

@myc2h6o
Copy link
Contributor

myc2h6o commented Jun 30, 2022

Hi @tikicoder thanks for the update. the workflow seems to fail due to build issue.
This resource has been switched to use the new sdk github.com/hashicorp/go-azure-sdk/resource-manager/sqlvirtualmachine/2022-02-01/sqlvirtualmachines thus the build fails, would you mind merge the latest main branch? You may need to update some code to use the new sdk as well.

@tikicoder
Copy link
Contributor Author

@myc2h6o Thanks I will check it out.

@tikicoder
Copy link
Contributor Author

Hi @tikicoder thanks for the update. the workflow seems to fail due to build issue. This resource has been switched to use the new sdk github.com/hashicorp/go-azure-sdk/resource-manager/sqlvirtualmachine/2022-02-01/sqlvirtualmachines thus the build fails, would you mind merge the latest main branch? You may need to update some code to use the new sdk as well.

I have pulled in the latest changes.

@myc2h6o
Copy link
Contributor

myc2h6o commented Aug 3, 2022

@tikicoder thanks for the update and sorry for the late response. There are some build errors due to the sdk migration. I've opened tikicoder#3 to resolve them. Could you take a look there?
And there is a duplicate test config storageConfiguration in mssql_virtual_machine_resource_test.go, would you mind updating its name and put it into the test step? I think you can take TestAccMsSqlVirtualMachine_autoPatching as a reference

@mbfrahry
Copy link
Member

Hey @tikicoder, thanks for getting the bulk of this work done. I went ahead and fixed it up in #18923 and that'll go out in the next release!

@mbfrahry mbfrahry closed this Oct 24, 2022
@tikicoder
Copy link
Contributor Author

@mbfrahry Thanks for taking it home, work has me swamped.

Thanks again.

@github-actions
Copy link

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.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants