-
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
New Resource: MariaDB #2406
New Resource: MariaDB #2406
Conversation
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.
hey @jeffreyCline
I've taken a look through and left some minor comments in line but on the whole this looks pretty good - if we can fix those up this otherwise should be good to merge 👍
Thanks!
"MO_Gen5_8", | ||
"MO_Gen5_16", | ||
}, true), | ||
DiffSuppressFunc: suppress.CaseDifference, |
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 this is a new resource can we make this case sensitive?
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.
Done.
string(mariadb.GeneralPurpose), | ||
string(mariadb.MemoryOptimized), | ||
}, true), | ||
DiffSuppressFunc: suppress.CaseDifference, |
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.
(same here) can we make this case sensitive?
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.
Done.
string(mariadb.Enabled), | ||
string(mariadb.Disabled), | ||
}, true), | ||
DiffSuppressFunc: suppress.CaseDifference, |
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.
(same here)
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.
Done.
string(mariadb.SslEnforcementEnumDisabled), | ||
string(mariadb.SslEnforcementEnumEnabled), | ||
}, true), | ||
DiffSuppressFunc: suppress.CaseDifference, |
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.
(and here)
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.
Done.
tier, _ := diff.GetOk("sku.0.tier") | ||
storageMB, _ := diff.GetOk("storage_profile.0.storage_mb") | ||
|
||
if strings.ToLower(tier.(string)) == "basic" && storageMB.(int) > 1048576 { |
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.
both of these fields are likely to be interpolated, as such it's likely the values won't be resolved at this point (due to a known bug in customizeDiff) and these values would be nil, so there'd be a crash here - as such I think we'd be better to put this logic in the Create method for the moment, unfortunately
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.
Thanks for the heads up about customizeDiff, moved the validation to the create method.
|
||
--- | ||
|
||
`sku` supports the following: |
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.
in some of the newer resources this has been updated to:
`sku` supports the following: | |
A `sku` block supports the following: |
|
||
# azurerm_mariadb_server | ||
|
||
Manage a MariaDB Server. |
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.
Manage a MariaDB Server. | |
Manages a MariaDB Server. |
Co-Authored-By: jeffreyCline <[email protected]>
Co-Authored-By: jeffreyCline <[email protected]>
Co-Authored-By: jeffreyCline <[email protected]>
Co-Authored-By: jeffreyCline <[email protected]>
Co-Authored-By: jeffreyCline <[email protected]>
Co-Authored-By: jeffreyCline <[email protected]>
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 @jeffreyCline,
Thank you for the changes, i've taken a look through and left some mostly minor and stylistic comments.
The major issue is not accessing the response properties through the .Properties object after a nil check.
} | ||
|
||
err = future.WaitForCompletionRef(ctx, client.Client) | ||
if err != nil { |
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.
Very minor, but these two lines could be merged too.
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.
Updated both.
} | ||
} | ||
|
||
func flattenMariaDbServerSku(resp *mariadb.Sku) []interface{} { |
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.
minor, but should be be sku
instead of resp
?
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.
fixed.
return []interface{}{values} | ||
} | ||
|
||
func flattenMariaDbStorageProfile(resp *mariadb.StorageProfile) []interface{} { |
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.
Same here, should this be storage
or profile
rather then resp
?
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.
fixed.
|
||
// | ||
|
||
func testCheckAzureRMMariaDbServerExists(name string) resource.TestCheckFunc { |
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.
Could we rename name to resourceName
to prevent the shadowing down below on line 245?
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.
Yeah, good catch... didn't see that 😄
Co-Authored-By: jeffreyCline <[email protected]>
Co-Authored-By: jeffreyCline <[email protected]>
Co-Authored-By: jeffreyCline <[email protected]>
Co-Authored-By: jeffreyCline <[email protected]>
Co-Authored-By: jeffreyCline <[email protected]>
Co-Authored-By: jeffreyCline <[email protected]>
Co-Authored-By: jeffreyCline <[email protected]>
Co-Authored-By: jeffreyCline <[email protected]>
Co-Authored-By: jeffreyCline <[email protected]>
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.
@jeffreyCline,
Thanks for the updates, aside from one comment left inline LGTM 👍
} | ||
|
||
if properties := resp.ServerProperties; properties != nil { | ||
d.Set("administrator_login", properties.AdministratorLogin) |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
LGTM 💯 Feel free to merge |
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! |
Added support for the new MariaDB
fixes #2044