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

Added support for patch_mode in resource_linux_virtual_machine. #13866

Merged
merged 4 commits into from
Nov 3, 2021

Conversation

atombrella
Copy link
Contributor

Fixes #13257

I have not yet run the acceptance tests. I have an Azure account, but it's a bit inactive. I thought this might be a good occasion to learn a bit more about Azure :)

Copy link
Member

@catriona-m catriona-m left a comment

Choose a reason for hiding this comment

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

Hi @atombrella, thanks for submitting this! I ran the tests and can see the added test is currently failing:

------- Stdout: -------
=== RUN   TestAccLinuxVirtualMachine_linuxPatchModeSetting
=== PAUSE TestAccLinuxVirtualMachine_linuxPatchModeSetting
=== CONT  TestAccLinuxVirtualMachine_linuxPatchModeSetting
testcase.go:108: Step 1/2 error: Error running apply: exit status 1
Error: At least one `admin_ssh_key` must be specified when `disable_password_authentication` is set to `true`
with azurerm_linux_virtual_machine.test,
on terraform_plugin_test.tf line 43, in resource "azurerm_linux_virtual_machine" "test":
43: resource "azurerm_linux_virtual_machine" "test" {
--- FAIL: TestAccLinuxVirtualMachine_linuxPatchModeSetting (207.81s)
FAIL

It looks like there's a linting error that needs correcting too.

It would also be good if we could include this property in an update test to confirm that works as well.

@atombrella atombrella force-pushed the patch_mode_linux_13257 branch from 91a2e0b to 4bddc15 Compare October 28, 2021 18:45
@atombrella
Copy link
Contributor Author

@catriona-m Thanks for the review :) I'll try to push a "green version" of this during the weekend. Hopefully having a single test for the verification and update is fine, or do you prefer two separate tests?

@atombrella atombrella force-pushed the patch_mode_linux_13257 branch from 4bddc15 to f053f07 Compare October 31, 2021 11:19
@catriona-m
Copy link
Member

@catriona-m Thanks for the review :) I'll try to push a "green version" of this during the weekend. Hopefully having a single test for the verification and update is fine, or do you prefer two separate tests?

@atombrella thanks for updating this, the new changes look good, only this test is still failing:

------- Stdout: -------
=== RUN   TestAccLinuxVirtualMachine_linuxPatchModeSetting
=== PAUSE TestAccLinuxVirtualMachine_linuxPatchModeSetting
=== CONT  TestAccLinuxVirtualMachine_linuxPatchModeSetting
testcase.go:109: Step 1/3 error: Error running apply: exit status 1
Error: At least one `admin_ssh_key` must be specified when `disable_password_authentication` is set to `true`
with azurerm_linux_virtual_machine.test,
on terraform_plugin_test.tf line 43, in resource "azurerm_linux_virtual_machine" "test":
43: resource "azurerm_linux_virtual_machine" "test" {
--- FAIL: TestAccLinuxVirtualMachine_linuxPatchModeSetting (255.06s)
FAIL

You may need to add an admin_ssh_key in the test data to get this working eg -

@atombrella
Copy link
Contributor Author

@catriona-m Thanks for the review :) I'll try to push a "green version" of this during the weekend. Hopefully having a single test for the verification and update is fine, or do you prefer two separate tests?

@atombrella thanks for updating this, the new changes look good, only this test is still failing:

------- Stdout: -------
=== RUN   TestAccLinuxVirtualMachine_linuxPatchModeSetting
=== PAUSE TestAccLinuxVirtualMachine_linuxPatchModeSetting
=== CONT  TestAccLinuxVirtualMachine_linuxPatchModeSetting
testcase.go:109: Step 1/3 error: Error running apply: exit status 1
Error: At least one `admin_ssh_key` must be specified when `disable_password_authentication` is set to `true`
with azurerm_linux_virtual_machine.test,
on terraform_plugin_test.tf line 43, in resource "azurerm_linux_virtual_machine" "test":
43: resource "azurerm_linux_virtual_machine" "test" {
--- FAIL: TestAccLinuxVirtualMachine_linuxPatchModeSetting (255.06s)
FAIL

You may need to add an admin_ssh_key in the test data to get this working eg -

Done. Thanks :)

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 @atombrella - LGTM 💯

katbyte added a commit that referenced this pull request Nov 2, 2021
@katbyte katbyte merged commit 9510189 into hashicorp:main Nov 3, 2021
@atombrella atombrella deleted the patch_mode_linux_13257 branch November 4, 2021 19:46
@atombrella
Copy link
Contributor Author

Good :) @katbyte I think probably I forgot to add something to read the new property under the read-function.

@github-actions
Copy link

github-actions bot commented Nov 5, 2021

This functionality has been released in v2.84.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

github-actions bot commented Dec 6, 2021

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 Dec 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for enable_automatic_updates and patch_mode in azurerm_linux_virtual_machine
3 participants