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

Issue 52050043: juju: cache API endpoints and credentials (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 3 months ago by dimitern
Modified:
10 years, 3 months ago
Reviewers:
mp+201593, jameinel, rog
Visibility:
Public.

Description

juju: cache API endpoints and credentials Fixes bug #1268471: 1. After the first successful connection to the API, the endpoints and credentials are cached in the environment's .jenv file. 2. Cached API connection settings are tried first when connecting to the API server (if available), otherwise we failback to using the provider storage to fetch the provider-state, wait for the instance DNS address and then use that to connect (slower). 3. After each successful API connection the cache is updated (in the future we might also fetch all API server addresses from the server using an API call, so we can always have up-to-date addresses). Tested live on EC2 - works like charm and speeds up all CLI commands quite a bit. https://code.launchpad.net/~dimitern/juju-core/230-cache-bootstrap-address-1268471/+merge/201593 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 12

Patch Set 2 : juju: cache API endpoints and credentials #

Total comments: 6

Patch Set 3 : juju: cache API endpoints and credentials #

Total comments: 12

Patch Set 4 : juju: cache API endpoints and credentials #

Unified diffs Side-by-side diffs Delta from patch set Stats (+206 lines, -28 lines) Patch
A [revision details] View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M juju/api.go View 1 2 3 7 chunks +74 lines, -18 lines 0 comments Download
M juju/apiconn_test.go View 1 2 3 3 chunks +96 lines, -8 lines 0 comments Download
M names/user.go View 1 chunk +6 lines, -1 line 0 comments Download
A names/user_test.go View 1 2 3 1 chunk +26 lines, -0 lines 0 comments Download
M state/user.go View 2 chunks +2 lines, -1 line 0 comments Download

Messages

Total messages: 9
dimitern
Please take a look.
10 years, 3 months ago (2014-01-14 14:00:29 UTC) #1
rog
Looks good in general, with some suggestions below. Two other points: - We need some ...
10 years, 3 months ago (2014-01-14 15:49:13 UTC) #2
jameinel
I think the change is great for the config code path, but when opening via ...
10 years, 3 months ago (2014-01-15 07:29:20 UTC) #3
dimitern
Please take a look. https://codereview.appspot.com/52050043/diff/1/juju/api.go File juju/api.go (left): https://codereview.appspot.com/52050043/diff/1/juju/api.go#oldcode207 juju/api.go:207: Addrs: endpoint.Addresses, On 2014/01/15 07:29:20, ...
10 years, 3 months ago (2014-01-15 11:21:59 UTC) #4
rog
Looks great modulo tests and some suggestions below. https://codereview.appspot.com/52050043/diff/20001/juju/api.go File juju/api.go (right): https://codereview.appspot.com/52050043/diff/20001/juju/api.go#newcode40 juju/api.go:40: fromEnviron ...
10 years, 3 months ago (2014-01-15 13:31:09 UTC) #5
dimitern
Please take a look. https://codereview.appspot.com/52050043/diff/20001/juju/api.go File juju/api.go (right): https://codereview.appspot.com/52050043/diff/20001/juju/api.go#newcode40 juju/api.go:40: fromEnviron bool On 2014/01/15 13:31:09, ...
10 years, 3 months ago (2014-01-15 14:24:02 UTC) #6
rog
LGTM modulo the below, thanks. https://codereview.appspot.com/52050043/diff/40001/juju/api.go File juju/api.go (right): https://codereview.appspot.com/52050043/diff/40001/juju/api.go#newcode37 juju/api.go:37: // cachedInfo is set ...
10 years, 3 months ago (2014-01-15 14:42:04 UTC) #7
dimitern
Please take a look. https://codereview.appspot.com/52050043/diff/40001/juju/api.go File juju/api.go (right): https://codereview.appspot.com/52050043/diff/40001/juju/api.go#newcode37 juju/api.go:37: // cachedInfo is set only ...
10 years, 3 months ago (2014-01-15 15:17:05 UTC) #8
rog
10 years, 3 months ago (2014-01-15 15:48:31 UTC) #9
Message was sent while issue was closed.
Still LGTM, thanks.
Sign in to reply to this message.

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