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_image - change os_disk property to a list #1443

Merged
merged 4 commits into from
Jun 29, 2018

Conversation

katbyte
Copy link
Collaborator

@katbyte katbyte commented Jun 25, 2018

Should fix #234

Also adds some validation

@katbyte katbyte added this to the 1.8.0 milestone Jun 25, 2018
@katbyte katbyte requested a review from a team June 25, 2018 23:23
@katbyte
Copy link
Collaborator Author

katbyte commented Jun 26, 2018

tests pass aside from failures due to too many virtual networks.
screen shot 2018-06-25 at 17 28 56
screen shot 2018-06-25 at 17 28 40

"net/url"

"github.com/hashicorp/terraform/helper/schema"
"strings"
Copy link
Contributor

Choose a reason for hiding this comment

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

can you move this up to the first group of imports?

"strings"
)

func UrlIsHttpOrHttps(i interface{}, k string) (_ []string, errors []error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

There may have been a precedent here you are following, but traditionally initialisms in Go are capitalized: https://github.com/golang/go/wiki/CodeReviewComments#initialisms

URLIsHTTPOrHTTPS I think? I may be misreading this thing from Go, may want to run the linter on it.

return UrlWithScheme([]string{"http", "https"})(i, k)
}

func UrlWithScheme(validSchemes []string) schema.SchemaValidateFunc {
Copy link
Contributor

Choose a reason for hiding this comment

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

See other comment on initialisms.

"testing"
)

func TestHelper_Validate_UrlIsHttpOrHttps(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would just call this Test<function name> and if its one of many methods Test<function name>_<description>

}

for _, tc := range cases {
_, errors := UrlIsHttpOrHttps(tc.Url, "test")
Copy link
Contributor

Choose a reason for hiding this comment

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

these cases should be inside a t.Run

@katbyte katbyte modified the milestones: 1.8.0, 1.9.0 Jun 28, 2018
@katbyte
Copy link
Collaborator Author

katbyte commented Jun 28, 2018

@paultyng,

Tests have been switched over to t.Run().

@katbyte katbyte force-pushed the b-image-osdisk_as_list branch 2 times, most recently from c2fa751 to 2b20c17 Compare June 28, 2018 16:16
@katbyte katbyte force-pushed the b-image-osdisk_as_list branch from 2b20c17 to a9d730e Compare June 28, 2018 16:16
@katbyte katbyte merged commit 27dabd1 into master Jun 29, 2018
@katbyte katbyte deleted the b-image-osdisk_as_list branch June 29, 2018 21:12
@ghost
Copy link

ghost commented Mar 30, 2020

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 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 30, 2020
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.

"azurerm_image" gets recreated with every run
2 participants