Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(5202)

Issue 10447043: Create temporary cert file for each ManagementAPI. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 10 months ago by jtv.canonical
Modified:
10 years, 8 months ago
Reviewers:
mp+170611, rog
Visibility:
Public.

Description

Create temporary cert file for each ManagementAPI. For now, each high-level function in the Azure provider will create its own storage contexts and management-API objects as needed. In the case of the management API, that comes with a temporary file containing an Azure certificate. (There is another way to pass the certificate to go-curl, but we want to avoid the complications and especially the unknowns at this point). Once done with your request(s) to the management, you release it. This cleans up the certificate file, but in the future it may also serve as a hook for connection pooling. We'll treat optimization as a separate problem — it seems easy but this sort of thing often brings out creative tendencies that aren't worth the time just at the moment. As long as we don't need any actual cleanup code for the storage-API side, we chose not to create a cleanup method there. This is all internal detail after all; it doesn't affect any exported APIs. https://code.launchpad.net/~jtv/juju-core/session-certificate/+merge/170611 Requires: https://code.launchpad.net/~jtv/juju-core/create-gwacl-sessions/+merge/170032 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+76 lines, -15 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M environs/azure/environ.go View 1 chunk +52 lines, -8 lines 3 comments Download
M environs/azure/environ_test.go View 1 chunk +22 lines, -7 lines 1 comment Download

Messages

Total messages: 4
jtv.canonical
Please take a look.
10 years, 10 months ago (2013-06-20 16:07:18 UTC) #1
rog
LGTM with some minor suggestions below. https://codereview.appspot.com/10447043/diff/1/environs/azure/environ.go File environs/azure/environ.go (right): https://codereview.appspot.com/10447043/diff/1/environs/azure/environ.go#newcode153 environs/azure/environ.go:153: certFile, err := ...
10 years, 10 months ago (2013-06-20 16:40:57 UTC) #2
jtv.canonical
Thanks Roger! On 2013/06/20 16:40:57, rog wrote: > i hope we manage to avoid the ...
10 years, 10 months ago (2013-06-20 16:58:34 UTC) #3
rog
10 years, 10 months ago (2013-06-20 17:24:45 UTC) #4
On 20 June 2013 17:58,  <jtv.canonical@gmail.com> wrote:
> Thanks Roger!
>
>
> On 2013/06/20 16:40:57, rog wrote:
>
>> i hope we manage to avoid the need for these temporary files sooner
>
> rather than
>>
>> later.
>
>
> Absolutely.  There are several ways it might happen: by replacing
> libcurl with Go's built-in http library if it starts supporting this
> site, or by going through libcurl's in-memory mechanism for passing the
> certificates, or by storing the certificate somewhere slightly more
> durable perhaps.  That's in descending order of desirability.
>
>
>
>> I'd probably just delete the defer and leave the
>> Delete in the NewManagementAPI error case.
>
>
> Done.
>
>
>
>> environs/azure/environ.go:178: // releaseManagementAPI frees up a
>
> context object
>>
>> for interfacing with Azure's
>> // releaseManagementAPI frees up an Azure management context.
>> ?
>
>
> I just made it say that it frees up the context object returned by
> getManagementAPI.  Once.  :)
>
>
>
>> i wouldn't mind seeing a test that checks that the temporary cert file
>
> is
>>
>> deleted when NewManagementAPI fails.
>
>
> There doesn't currently seem to be a failure path!

maybe just delete the error return from NewManagementAPI then
and code goes away :-)
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b