-
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: azurerm_spring_cloud_service
#4928
Conversation
4e8b9fe
to
6f66ad2
Compare
Could anyone help review this PR? |
@katbyte Could you please have a review of this PR ? |
f1b526c
to
5dff6f9
Compare
azurerm_spring_cloud
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 @njuCZ, I've given this a initial review
azurerm/internal/services/appplatform/data_source_spring_cloud.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/appplatform/data_source_spring_cloud_config_server.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/appplatform/resource_arm_spring_cloud.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/appplatform/resource_arm_spring_cloud.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/appplatform/resource_arm_spring_cloud.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/appplatform/resource_arm_spring_cloud_config_server.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/appplatform/resource_arm_spring_cloud_config_server.go
Outdated
Show resolved
Hide resolved
@katbyte thanks for your suggestion, I have modified the codes, Could you please have a look again? |
a4a3f4b
to
61ccc5b
Compare
@katbyte Could you have a review of the modified revision? I am sorry I don't know how to dismiss the |
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 @njuCZ
I've left some comments and change requests, mostly around documentation and a little refactor on the schema to reduce repetition.
There's also a question on API behaviour for the exclusivity of the auth type for repos.
Thanks
Ste
azurerm/internal/services/appplatform/data_source_spring_cloud_service.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/appplatform/data_source_spring_cloud_service.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/appplatform/parse/spring_cloud_service_test.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/appplatform/resource_arm_spring_cloud_service.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/appplatform/resource_arm_spring_cloud_service.go
Outdated
Show resolved
Hide resolved
@jackofallops thanks for your review suggestions. I have refined the PR accordingly. Could you please have a look again ? |
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 @njuCZ
Thanks for the changes, looking good. Just a few minor things left I think, mostly for clarity. There's one additional condition I think we should have in there, commented below about guarding against the user specifying both auth types for the config server and pattern repos.
Thanks!
azurerm/internal/services/appplatform/spring_cloud_config_server.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/appplatform/spring_cloud_config_server.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/appplatform/resource_arm_spring_cloud_service.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/appplatform/resource_arm_spring_cloud_service.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/appplatform/resource_arm_spring_cloud_service.go
Outdated
Show resolved
Hide resolved
if httpBasicAuth := v["http_basic_auth"].([]interface{}); len(httpBasicAuth) > 0 { | ||
v := httpBasicAuth[0].(map[string]interface{}) | ||
result.Username = utils.String(v["username"].(string)) | ||
result.Password = utils.String(v["password"].(string)) | ||
} | ||
if sshAuth := v["ssh_auth"].([]interface{}); len(sshAuth) > 0 { | ||
v := sshAuth[0].(map[string]interface{}) | ||
result.PrivateKey = utils.String(v["private_key"].(string)) | ||
result.StrictHostKeyChecking = utils.Bool(v["strict_host_key_checking_enabled"].(bool)) | ||
|
||
if hostKey := v["host_key"].(string); hostKey != "" { | ||
result.HostKey = utils.String(hostKey) | ||
} | ||
if hostKeyAlgorithm := v["host_key_algorithm"].(string); hostKeyAlgorithm != "" { | ||
result.HostKeyAlgorithm = utils.String(hostKeyAlgorithm) | ||
} | ||
} |
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.
as with the top level repo, we should test against these both being set and error out to the user to prevent both being attempted to be sent to the API since only one will be accepted (based on your comments from the service team that this is conditional based on the protocol used in the URI).
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.
@jackofallops I have added check to prevent setting both the fields, please have a look. Thanks for your suggestion
azurerm/internal/services/appplatform/resource_arm_spring_cloud_service.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/appplatform/resource_arm_spring_cloud_service.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/appplatform/resource_arm_spring_cloud_service.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/appplatform/resource_arm_spring_cloud_service.go
Outdated
Show resolved
Hide resolved
@jackofallops thanks for the suggestion, Could you please have a look again? |
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 @njuCZ
Thanks again for the changes - looking really close now. Just one schema item (sorry I missed this on previous review) and a slight rewording on a bit of the docs and I believe this will be ready.
Thanks
@@ -0,0 +1,132 @@ | |||
subcategory: "App Platform" |
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.
subcategory: "App Platform" | |
--- | |
subcategory: "App Platform" |
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.
@jackofallops just curious about this rule, because in my previous comments, Tom told me to remove the first line. #4928 (comment)
so in my future PRs, should I add the first line ---
?
azurerm/internal/services/appplatform/spring_cloud_config_server.go
Outdated
Show resolved
Hide resolved
Hi @njuCZ - Hope you don't mind, I pushed the final suggestions so we can close and merge this asap. Many thanks again for this work. |
many thanks! |
This has been released in version 2.4.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example: provider "azurerm" {
version = "~> 2.4.0"
}
# ... other configuration ... |
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! |
the first PR of issue #4891
this PR includes changes:
config server is a property of spring cloud service, but currently the create api does not take care of config server part, it is a part of UPDATE operation by azure spring cloud team's design. So I split them and implement two different resource and datasource