Change cloud.Cloud.Regions to slice #4469

Closed
wants to merge 52 commits into
from

Conversation

Projects
None yet
6 participants
Member

axw commented Feb 19, 2016

No description provided.

waigani and others added some commits Jan 7, 2016

Manifold Worker: API Address Updater
Move the API address updater worker out of the machine runner and put it under
the machine agent dependency engine.
MADE: machiner
Move the machiner worker from the machine agent runner to under the dependency engine.
Merge pull request #4107 from waigani/MADE-machiner
MADE: machiner

Move the machiner worker from the machine agent runner to under the dependency engine.

(Review request: http://reviews.vapour.ws/r/3528/)
MADE: proxyupdater
Move the proxyupdater worker from machine agent runner to dependency engine.
Merge pull request #4118 from waigani/worker-dep-apiaddressupdater
Manifold Worker: API Address Updater

Move the API address updater worker out of the machine runner and put it under
the machine agent dependency engine.

(Review request: http://reviews.vapour.ws/r/3540/)
MADE - Log Sender
Move the logsender worker from the machine agent runner to the dependency
engine.
Merge pull request #4101 from waigani/MADE-logsender
MADE - Log Sender

Move the logsender worker from the machine agent runner to the dependency
engine.

(Review request: http://reviews.vapour.ws/r/3522/)
MADE: Disk Manager
Move the diskmanager worker from the machine agent runner to under the machine
dependency engine.
Merge pull request #4100 from waigani/MADE-proxyupdater
MADE: proxyupdater

Move the proxyupdater worker from machine agent runner to dependency engine.

(Review request: http://reviews.vapour.ws/r/3521/)
MADE: Logseynder Fix bug
The log sender worker was not converted to the dep engine correctly. Tests
were passing because the worker was still being started in the machine agent
runner.
Merge pull request #4151 from waigani/MADE-logsender-fixbug
MADE: Logseynder Fix bug

The log sender worker was not converted to the dep engine correctly. Tests
were passing because the worker was still being started in the machine agent
runner.

(Review request: http://reviews.vapour.ws/r/3573/)
MADE: authentication worker
Move the authentication worker from the machine agent runner to a machine
dep engine manifold.
Merge pull request #4234 from waigani/MADE-authentication
MADE: authentication worker

Move the authentication worker from the machine agent runner to a machine
dep engine manifold.

(Review request: http://reviews.vapour.ws/r/3674/)
MADE deployer
Move the deployer worker from the machine agent runner to the dependency
engine.
worker/testing: Add helpers for testing PostUpgradeManifold based man…
…ifolds

These helpers simplify writing unit tests for manifolds based on
PostUpgradeManifold.
worker/proxyupdater: Add unit tests for proxyupdater manifold
Tests like this are now easier to write thanks to the
RunPostUpgradeManifold helper.
Merge pull request #4272 from waigani/MADE-deployer
MADE deployer

Move the deployer worker from the machine agent runner to the dependency
engine.

(Review request: http://reviews.vapour.ws/r/3710/)
Merge pull request #4277 from mjs/postupgrademanifold-test-helper
Add helpers for testing PostUpgradeManifold based manifolds

worker/testing: Add helpers for testing PostUpgradeManifold based manifolds

These helpers simplify writing unit tests for manifolds based on PostUpgradeManifold.

---

worker/proxyupdater: Add unit tests for proxyupdater manifold

Tests like this are now easier to write thanks to the RunPostUpgradeManifold helper.



(Review request: http://reviews.vapour.ws/r/3715/)
Merge pull request #4449 from voidspace/still-discovering-again
Make test resilient to space discovery

Fix timing related issue in the upgrade test.

(Review request: http://reviews.vapour.ws/r/3886/)
cmd/juju/backups: fix issue 1546826
Fixes LP # 1546826

Remove the duplicate configuration of the logger in the backups
subcommand.

There is no test because of the way that the logging configuration
passed to the test runner interacts with logger -- in debug mode the
warning logger is not redefined, but in real use it failed.

This has been manually tested.

We should have an integration test asserting that backup and restore
work as specified.
Merge pull request #4466 from juju/MADE-workers
Made workers

MADE-workers branch is ready for merge. The two failures shown on
     http://reports.vapour.ws/releases/3640
are from master, and merging into master is the fix.

There are no bugs reported against the branch, none ever were.

The 386 tests had initial failures that we attribute to to the host being under load. The unittests passed twice in succession when the host was idle.
Merge pull request #4460 from davecheney/fixedbugs/1546826
cmd/juju/backups: fix issue 1546826

Fixes LP # 1546826

Remove the duplicate configuration of the logger in the backups
subcommand.

There is no test because of the way that the logging configuration
passed to the test runner interacts with logger -- in debug mode the
warning logger is not redefined, but in real use it failed.

This has been manually tested.

We should have an integration test asserting that backup and restore
work as specified.

(Review request: http://reviews.vapour.ws/r/3895/)
Merge pull request #4468 from juju/cloud-credentials
Cloud credentials

Cloud-credentials is good to merge. The branch has two successive blesses
    http://reports.vapour.ws/releases/3652
There are no outstanding bugs
    https://bugs.launchpad.net/juju-core/cloud-credentials/

(Review request: http://reviews.vapour.ws/r/3903/)
cloud/clouds.go
// Regions are the regions available in the cloud.
- Regions map[string]Region `yaml:"regions,omitempty"`
+ //
+ // Regions is a slice, and not a mpa, because order is important:
cloud/clouds.go
@@ -134,28 +173,91 @@ func PublicCloudMetadata(searchPath ...string) (result map[string]Cloud, fallbac
return clouds, true, err
}
+var logger = loggo.GetLogger("juju.cloud")
@wallyworld

wallyworld Feb 19, 2016

Owner

move to top?

@axw

axw Feb 19, 2016

Member

will be deleting, just here while debugging an issue

cloud/clouds.go
+ logger.Debugf("%v", cloud.Regions)
+ for _, item := range cloud.Regions.Slice {
+ name := fmt.Sprint(item.Key)
+ r := cloud.Regions.Map[name]
@wallyworld

wallyworld Feb 19, 2016

Owner

why can't we use item.Value here?
I don't get why we need both a Map and a Slice

@axw

axw Feb 19, 2016

Member

This means I don't have to extract map items explicitly, so easier to maintain (Region may grow fields). The MapSlice is used only for the key ordering.

@wallyworld

wallyworld Feb 19, 2016

Owner

r := item.Value.(*region)

won't work?

    var regions []Region
    if len(cloud.Regions.Slice) > 0 {
        for _, item := range cloud.Regions.Slice {
            name := fmt.Sprint(item.Key)
            r := item.Value.(*region)
            regions = append(regions, Region{
                name, r.Endpoint, r.StorageEndpoint,
            })
        }
    }
+// is populated so we can identify the first map item, which
+// becomes the default region for the cloud.
+type regions struct {
+ Map map[string]*region
@wallyworld

wallyworld Feb 19, 2016

Owner

there's no yaml tags here - are Map and Slice implicitly support by goyaml.v2?

@axw

axw Feb 19, 2016

Member

using MarshalYAML, don't need tags

axw added some commits Feb 18, 2016

cloud: represent regions as a slice in API
cloud.Cloud.Regions is now a slice, with
the name in the Region type. The first region
in the slice is the default for bootstrap if
none is specified.
Member

axw commented Feb 19, 2016

Retargeting to master.

@axw axw closed this Feb 19, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment