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

azurerm_virtual_machine_scale_set: make os_profile.0.admin_password property optional #1958

Merged
merged 1 commit into from
Sep 25, 2018

Conversation

katbyte
Copy link
Collaborator

@katbyte katbyte commented Sep 20, 2018

fixes #1956
Also makes os_profile_linux_config a list

@katbyte katbyte added bug service/vmss Virtual Machine Scale Sets labels Sep 20, 2018
@katbyte katbyte added this to the 1.16.0 milestone Sep 20, 2018
@ghost ghost added the size/S label Sep 20, 2018
@ghost ghost added size/S size/M and removed size/S labels Sep 20, 2018
@katbyte
Copy link
Collaborator Author

katbyte commented Sep 20, 2018

Tests pass:
screen shot 2018-09-20 at 15 39 42

Copy link
Contributor

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

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

A few comments we should fix up - like the Set->List change which I think wants reverting, but this otherwise LGTM 👍

}

return nil
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Admin Password is a field which (IME) is almost always interpolated outside of simple scenarios - in which case this won't work, as such can we remove the CustomizeDiff here?

ssh_keys := make([]map[string]interface{}, 0, len(*config.SSH.PublicKeys))
for _, i := range *config.SSH.PublicKeys {
key := make(map[string]interface{})
key["path"] = *i.Path
Copy link
Contributor

Choose a reason for hiding this comment

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

could we nil-check this?

if config != nil {
result["disable_password_authentication"] = *config.DisablePasswordAuthentication

if config.SSH != nil && len(*config.SSH.PublicKeys) > 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

could we also nil-check config.SSH.PublicKeys here?

@@ -270,7 +271,7 @@ func resourceArmVirtualMachineScaleSet() *schema.Resource {
},

"os_profile_linux_config": {
Type: schema.TypeSet,
Type: schema.TypeList,
Copy link
Contributor

Choose a reason for hiding this comment

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

this could be a bigger scope than we anticipated, given how the ARM API's return the latest snapshot of a resource; I think it'd be worth reverting this back to a Set for the moment (with a separate test function, and the hash function; and then spending some time on both VM/VMSS for 2.0?)

@tombuildsstuff tombuildsstuff modified the milestones: 1.16.0, 1.17.0 Sep 25, 2018
@ghost ghost added size/S and removed size/M labels Sep 25, 2018
@katbyte
Copy link
Collaborator Author

katbyte commented Sep 25, 2018

Addressed comments @tombuildsstuff

Copy link
Contributor

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@tombuildsstuff tombuildsstuff merged commit 5f42b96 into master Sep 25, 2018
@tombuildsstuff tombuildsstuff deleted the b-vmss-admin_password branch September 25, 2018 22:25
tombuildsstuff added a commit that referenced this pull request Sep 25, 2018
tombuildsstuff added a commit that referenced this pull request Sep 25, 2018
@tombuildsstuff tombuildsstuff modified the milestones: 1.17.0, 1.16.0 Sep 27, 2018
@vijayakrishnarg1
Copy link

@tombuildsstuff Thanks for fix.

dghubble added a commit to poseidon/typhoon that referenced this pull request Oct 14, 2018
dghubble added a commit to poseidon/typhoon that referenced this pull request Oct 14, 2018
@ghost
Copy link

ghost commented Mar 6, 2019

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug service/vmss Virtual Machine Scale Sets size/S
Projects
None yet
3 participants