-
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
Add certificate support for Azure Batch #3097
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 @stuartleeks
Thanks for this PR :)
I've taken a look through and left some comments inline (most of which are minor/for consistency with other resources) but this is looking pretty good - if we can fix those comments up (and the tests pass) then we should be able to get this merged 👍
Thanks!
35cedb7
to
6c7704f
Compare
@tombuildsstuff , thanks for the review! I've pushed a few commits that address most of the feedback (have marked those conversations as resolved) and also rebased on master to keep the changes fresh. Waiting on the build to be queued currently. There are still a couple of discussion points that I'd value your feedback on. |
@tombuildsstuff - just checked back and see that the build/tests passed ok in CI build :-) Let me know your thoughts on the changes/remaining questions and whether you are happy with the PR (or have further changes you would like) |
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 @stuartleeks
Thanks for pushing those changes; I've taken a look through and left some additional (minor) comments in-line but this mostly LGTM - if we can fix those comments up we should be able to run the tests and get this merged 👍
Thanks!
@stuartleeks I've also just noticed the file |
6c7704f
to
4fa140d
Compare
Improves plan diff and output (aligns with ARM input/output)
Latest changes made (with the exception of one in docs where I wasn't sure which part you were referring to). |
@katbyte - I just realised that some of the comments in your review were on comments in @tombuildsstuff 's review but they weren't shown by default. Just responded to them inline now. Sorry for the confusion! |
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 @stuartleeks
Thanks for pushing those commits - this is now looking good, if we can fix up the minor remaining issues (and raise a bug in the Azure Swagger repo) this otherwise LGTM 👍
Thanks!
Type: schema.TypeString, | ||
Required: true, | ||
ValidateFunc: validate.NoEmptyStrings, | ||
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.
we should raise a bug about this API behaviour on the Rest API Specs Repository since the Resource ID should be returned in a consistent manner (whilst the ARM spec technically defines a Resource ID as case-insensitive; in practice both other ARM API's and downstream tooling don't handle these being case-insensitive - such that the casing for an ID should be the same within a Resource Provider API).
could we also add a TODO here with a link to the upstream API issue, when that's created?
7efa33c
to
3179d24
Compare
@tombuildsstuff - I've made the changes you requested (including adding a comment referencing the issue created in the azure swagger repo: Azure/azure-rest-api-specs#5574) Let me know if there's anything else needed to get this merged :-) |
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.
dismissing since changes have been pushed
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 @stuartleeks,
After running the tests I believe you may have a bug in the provider:
Test ended in panic.
------- Stdout: -------
=== RUN TestAccAzureRMBatchCertificatePfx
=== PAUSE TestAccAzureRMBatchCertificatePfx
=== CONT TestAccAzureRMBatchCertificatePfx
------- Stderr: -------
panic: Invalid address to set: []string{"public_data"}
goroutine 257 [running]:
github.com/hashicorp/terraform/helper/schema.(*ResourceData).Set(0xc0004ac070, 0x2bf0c5b, 0xb, 0x2806880, 0xc00068c540, 0x0, 0x0)
/opt/teamcity-agent/work/458e5e4800bd94f6/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/helper/schema/resource_data.go:191 +0x334
github.com/terraform-providers/terraform-provider-azurerm/azurerm.resourceArmBatchCertificateRead(0xc0004ac070, 0x2bb1100, 0xc000627000, 0xc0009c65a0, 0x0)
/opt/teamcity-agent/work/458e5e4800bd94f6/src/github.com/terraform-providers/terraform-provider-azurerm/azurerm/resource_arm_batch_certificate.go:163 +0x857
github.com/terraform-providers/terraform-provider-azurerm/azurerm.resourceArmBatchCertificateCreate(0xc0004ac070, 0x2bb1100, 0xc000627000, 0xc0004ac070, 0x0)
/opt/teamcity-agent/work/458e5e4800bd94f6/src/github.com/terraform-providers/terraform-provider-azurerm/azurerm/resource_arm_batch_certificate.go:132 +0xe42
github.com/hashicorp/terraform/helper/schema.(*Resource).Apply(0xc0004b0620, 0xc0005dd9a0, 0xc000c1b420, 0x2bb1100, 0xc000627000, 0xc0006ecb01, 0x3e, 0x0)
/opt/teamcity-agent/work/458e5e4800bd94f6/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/helper/schema/resource.go:225 +0x351
github.com/hashicorp/terraform/helper/schema.(*Provider).Apply(0xc00036fa40, 0xc0005dd310, 0xc0005dd9a0, 0xc000c1b420, 0x1, 0x4813d3, 0x0)
/opt/teamcity-agent/work/458e5e4800bd94f6/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/helper/schema/provider.go:283 +0x9c
github.com/hashicorp/terraform/terraform.(*EvalApply).Eval(0xc000c30980, 0x317ce00, 0xc00073cdd0, 0x2, 0x2, 0x2be6b2c, 0x4)
/opt/teamcity-agent/work/458e5e4800bd94f6/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/terraform/eval_apply.go:57 +0x226
github.com/hashicorp/terraform/terraform.EvalRaw(0x3138d60, 0xc000c30980, 0x317ce00, 0xc00073cdd0, 0x0, 0x0, 0x0, 0x0)
/opt/teamcity-agent/work/458e5e4800bd94f6/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/terraform/eval.go:53 +0x156
github.com/hashicorp/terraform/terraform.(*EvalSequence).Eval(0xc000c1ace0, 0x317ce00, 0xc00073cdd0, 0x2, 0x2, 0x2be6b2c, 0x4)
/opt/teamcity-agent/work/458e5e4800bd94f6/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/terraform/eval_sequence.go:14 +0x9c
github.com/hashicorp/terraform/terraform.EvalRaw(0x31392a0, 0xc000c1ace0, 0x317ce00, 0xc00073cdd0, 0x288e9a0, 0x4b504a2, 0x2806880, 0xc0006fd730)
/opt/teamcity-agent/work/458e5e4800bd94f6/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/terraform/eval.go:53 +0x156
github.com/hashicorp/terraform/terraform.Eval(0x31392a0, 0xc000c1ace0, 0x317ce00, 0xc00073cdd0, 0xc000c1ace0, 0x31392a0, 0xc000c1ace0, 0x2e55dc0)
/opt/teamcity-agent/work/458e5e4800bd94f6/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/terraform/eval.go:34 +0x4d
github.com/hashicorp/terraform/terraform.(*Graph).walk.func1(0x2b3d200, 0xc00000fe20, 0x0, 0x0)
/opt/teamcity-agent/work/458e5e4800bd94f6/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/terraform/graph.go:126 +0xc45
github.com/hashicorp/terraform/dag.(*Walker).walkVertex(0xc0008a01c0, 0x2b3d200, 0xc00000fe20, 0xc0009be940)
/opt/teamcity-agent/work/458e5e4800bd94f6/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/dag/walk.go:387 +0x367
created by github.com/hashicorp/terraform/dag.(*Walker).Update
/opt/teamcity-agent/work/458e5e4800bd94f6/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/dag/walk.go:310 +0x986
@katbyte - I'll take a look back over the code around that area. Did you make any changes to the tests? (I didn't see that error on my machine or in the Travis build) |
@stuartleeks this panic's caused by an Environment Variable ( Taking a look into this it appears the Thanks! |
dismissing since changes have been pushed
Great - thanks @tombuildsstuff :-) |
@tombuildsstuff / @katbyte are there any other changes that you want on this before it is merged? Do you want it rebased to the latest master? |
nope! we just had some issues moving to a new subscription and increasing batch account quota so we could easily test. Just ran them now and LGTM @stuartleeks 🙂 |
This has been released in version 1.25.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 = "~> 1.25.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 👉 hashibot-feedback@hashicorp.com. Thanks! |
Fixes #2822