Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Rebase master #3788
Closed
Commits
Show all changes
511 commits
Select commit
Hold shift + click to select a range
05171df
Add the remote to the client config.
ericsnowcurrently 7b16946
Do not bother trying to chmod the socket file.
ericsnowcurrently e71a4f4
Add an important TODO.
ericsnowcurrently 20febff
Ignore errors.NotImplemented in the firewaller, for now.
ericsnowcurrently d92c226
Add a TODO comment.
ericsnowcurrently 35c6d69
Properly set up a dummy firewaller implementation.
ericsnowcurrently 1614aa2
Stop the instance before destroying it.
ericsnowcurrently de8de2a
Factor out fixSockfile.
ericsnowcurrently 4fcb394
Fixes after rebasing.
ericsnowcurrently ef49a61
lxd_client -> lxdclient.
ericsnowcurrently 56fc31e
Add a Config field to environs.StartInstanceResult.
ericsnowcurrently cec41e7
Try the env config from the StartInstance result before falling back …
ericsnowcurrently 05fc037
The userdata is no longer compressed by default.
ericsnowcurrently e8bb0e0
Stub out the code to take care of an implicit remote.
ericsnowcurrently 51a143a
Factor out bootstrap-related code.
ericsnowcurrently a9234ca
Add environs.BootstrapResult.
ericsnowcurrently 08c5a2a
Condense the signature of Environ.Bootstrap.
ericsnowcurrently 50e24b3
Fix environ.Bootstrap.
ericsnowcurrently 95dbc4f
Only propagate the "unknown" attrs from result.Config.
ericsnowcurrently d773846
Factory out SupportedArchitectures into a separate interface.
ericsnowcurrently 625ea0f
Fix default handling for "namespace".
ericsnowcurrently 0f9b285
Fix the tests.
ericsnowcurrently ec33116
Fix the "raw client" tests.
ericsnowcurrently 37f5e75
added client_key, client_cert to lxd config
wwitzel3 5e86de1
Add cert handling.
ericsnowcurrently e53dad9
Add remote handling.
ericsnowcurrently 89879af
Add remotes to Config.
ericsnowcurrently 8d54d57
Drop ParsePEM.
ericsnowcurrently 5362fd8
Adjust to changes in lxdclient.
ericsnowcurrently ea1c92e
Always apply the config before connecting.
ericsnowcurrently 3133723
Partially fold RemoteInfo into Remote.
ericsnowcurrently 9ecc20a
remote -> remote-url.
ericsnowcurrently 5e06ce2
Do not expose the lxd container type to environments.
ericsnowcurrently 753890b
Adding build tag for lxd provider
wwitzel3 ab32450
Added build tag for container factory
wwitzel3 391f0a1
build tags on stuff
natefinch 6e5f503
fix a weird compiler issue and move lxd container tests to go1.3 file
natefinch fd69d87
Add build constraints to more files.
ericsnowcurrently c532de5
Mark client-cert/key as immutable.
ericsnowcurrently 1857d2d
Add tests.
ericsnowcurrently f8e76c4
Update the config based on the client config.
ericsnowcurrently 32d861a
Fix order of operations in SetDefaults.
ericsnowcurrently ae124cd
Add the remote to the LXC config file.
ericsnowcurrently ee7d842
Properly initialize the config dir.
ericsnowcurrently 81e62d1
Update the remote even when it is already set.
ericsnowcurrently 22572aa
Always use a temp dir for LXD configs during tests.
ericsnowcurrently 0fb6a6b
Add "remote" field to lxdclient.Config.
ericsnowcurrently d006bc1
Use the client's remote as the image remote.
ericsnowcurrently bfeb773
Only call exposeHostAPI if using the Local remote.
ericsnowcurrently c4d1167
Fix up a TODO.
ericsnowcurrently aca831f
Drop auth*File (and change config*file -> config*File).
ericsnowcurrently f8ed4e9
Always save the config.
ericsnowcurrently 9743afe
Certificate -> Cert.
ericsnowcurrently c23702d
Drop GenerateCert.
ericsnowcurrently 7abf69d
Clarify why we call LoadConfig/SaveConfig.
ericsnowcurrently 61f5382
Drop some dead code.
ericsnowcurrently 00cfdac
Add test skips for unimplemented tests.
ericsnowcurrently 67ba537
Add some explanatory comments.
ericsnowcurrently 8a5d716
Drop Config.Apply.
ericsnowcurrently b4d914c
Drop some dead code.
ericsnowcurrently 1b0b86a
Compare against Local.Host for the implicit local unix socket.
ericsnowcurrently 87d8371
Defer to lxdclient pkg for determining "local-ness".
ericsnowcurrently c21ee05
Fold RemoteInfo into Remote.
ericsnowcurrently 3ca8502
Check "local-ness" via Remote.ID() instead of Remote.Host.
ericsnowcurrently 50d9937
Add Remote.isLocal().
ericsnowcurrently 7d9a610
Drop a superfluous line.
ericsnowcurrently 9aeac09
Clean up writeConfigFile a little.
ericsnowcurrently 07ca634
Use Remote.isLocal() (missed one).
ericsnowcurrently 3f06e15
Clarify what Remote.ID() is for.
ericsnowcurrently 81eb484
Add Certificate.X509().
ericsnowcurrently cb7ad97
Add Remote.AsNonLocal().
ericsnowcurrently dcda6fe
Add Client.setUpRemote().
ericsnowcurrently 60bf6c6
Add Config.AsNonLocal().
ericsnowcurrently 4139700
Add Certificate.Fingerprint().
ericsnowcurrently 3529f00
Add Client.RemoveCert().
ericsnowcurrently 4e592b2
Add Client.ListCerts().
ericsnowcurrently 653d67c
Add Client.RemoveCertByFingerprint().
ericsnowcurrently 29542ac
Remove any added certs.
ericsnowcurrently 1c1827b
Drop lxdclient.Client.exposeHostAPI().
ericsnowcurrently 2db9d4f
Do not return a Config from finishInstanceConfig.
ericsnowcurrently 9234ed3
Use the base suite in the LXD provider config tests.
ericsnowcurrently 844ac7e
Drop environConfig.SetRemoteFromHost().
ericsnowcurrently 27fd5a6
Use clientCfg.AsNonLocal() in the local case.
ericsnowcurrently aa38b93
Add a doc comment to clientServerMethods.
ericsnowcurrently 2d5b85f
Factor out prepareRemote().
ericsnowcurrently 24fc577
Add a missing doc comment.
ericsnowcurrently b71f41b
Split up (and rename) clientServerMethods.
ericsnowcurrently bc7b8f5
Patch out AsNonLocal().
ericsnowcurrently 0fc94eb
Add Certificate.Name.
ericsnowcurrently b69e04f
Add Cert.SetDefaults().
ericsnowcurrently 8270344
Add a doc comment for remoteLocalName (and drop remoteDefaultName).
ericsnowcurrently 3e82950
Clean up some comments.
ericsnowcurrently 4d7dac9
Add Client.isLocal.
ericsnowcurrently 55947d1
Add tests for fixAddr().
ericsnowcurrently f1694b8
Clean up the fixAddr tests.
ericsnowcurrently 7843665
Clean up fixAddrs().
ericsnowcurrently c148079
Make fixAddr() more strict.
ericsnowcurrently 2d72e42
Drop support for unix: URLs.
ericsnowcurrently 11cbee8
SetDefaults -> WithDefaults.
ericsnowcurrently 7549a83
Add missing build constraints.
ericsnowcurrently 17db1d9
make the error from bad connection on local into something more under…
natefinch c1ac2f5
added profile methods to lxdclient
wwitzel3 0d21252
added default profile for environ
wwitzel3 b17dabd
added default profile to instanceSpec
wwitzel3 9197339
Set cert defaults when setting remote defaults.
ericsnowcurrently 8ee89b0
Use Certificate.Name.
ericsnowcurrently 0e6a49c
Use a juju-specific cert name.
ericsnowcurrently 2f0f2f6
Add a TODO.
ericsnowcurrently 65c14a0
Fix tests.
ericsnowcurrently fbadf6b
add some tests
natefinch 00f2898
touch up
natefinch e49787e
Return a value instead of a pointer from NewCertificate().
ericsnowcurrently 38945b2
Add a note about the implicit copy with a value receiver.
ericsnowcurrently f352b13
Return a value from Cert.SetDefaults().
ericsnowcurrently 09a50a1
AsNonLocal -> UsingTCPRemote.
ericsnowcurrently eded4a0
Return a value from Remote.UsingTCP().
ericsnowcurrently 3e32d8f
Propagate lxdclient changes to the provider.
ericsnowcurrently a242f86
code review changes
natefinch d402d32
SetDefaults -> WithDefaults.
ericsnowcurrently a424e08
lxd: create juju config directory
wwitzel3 6a487d1
Minor clean up and doc comment
wwitzel3 6d59bd8
rename Config method and cleanup dir parsing
wwitzel3 a668c0c
removing unneeded updateLXDVars
wwitzel3 b78eb00
rename to ConfigDir
wwitzel3 a6cce79
updating comments
wwitzel3 7b99463
Add missing build constraints.
ericsnowcurrently 216a026
Move prepareRemote to near where it is used.
ericsnowcurrently c70b274
review comments
natefinch 5b567e5
use remoteidforlocal
natefinch bfa6920
mark tests as go1.3
natefinch 078e1a1
Merge branch 'lxd-provider-rebased' into lxd-provider
kat-co e1f226d
Merge pull request #3694 from kat-co/lxd-provider
kat-co a60393c
Fix client tests.
ericsnowcurrently e2c0ffc
Fix config tests.
ericsnowcurrently 689fc1e
Add a missing build constraint.
ericsnowcurrently 3e6e6c1
Move the Client instance methods onto a new instanceClient type.
ericsnowcurrently 6fe7d1a
Drop unused Client fields.
ericsnowcurrently bd0e648
conn -> client.
ericsnowcurrently dc4b95c
Move the logger to the right file.
ericsnowcurrently 183470f
Drop some dead code.
ericsnowcurrently 6eaba80
Update to the latest LXD release, 0.21.
ericsnowcurrently cd1d357
Add notes about setting up LXD to the boilerplate config.
ericsnowcurrently e850f3a
Move lxdclient package under LXD provider.
ericsnowcurrently 1737ce0
mongo: prefer machine address for replica set peername
575ff76
fix bugs with unit assigned by making it a singular worker
natefinch 573567c
fix tests
natefinch e8934a0
Merge pull request #3427 from natefinch/assign-worker
jujubot 61d23d6
cmd/juju/storage: fix storage commands
axw 0984149
Add Doc comments
c36c6e8
Comment updates
8eebee0
re-remove the old non-singular worker
natefinch 91b08c4
fix build
natefinch 63c0021
cmd/jujud/agent: remove the use of Context.Dir as the root directory
mjs f289441
utils: move Network operation helpers into apiserver
davecheney d228b73
cmd/jujud/agent: construct symlinks in a Windows-safe way
mjs 61af96c
Address review comments
axw e3e0b21
Merge pull request #3705 from natefinch/fix-build
jujubot 7401579
a more minimal change to the test
natefinch da0c106
Merge pull request #3708 from mjs/1515066-win-symlink-creation
jujubot e0272ac
Merge branch 'master' into merge-master-1211
wallyworld 60a9df5
Merge pull request #3697 from frobware/master-lp1412621
jujubot a0eaf18
Merge pull request #3711 from wallyworld/merge-master-1211
jujubot 39bbb01
utils: remove Must helper function
davecheney 639f3a7
Merge pull request #3707 from davecheney/remove-utils-must
jujubot 4ec044d
Merge pull request #3706 from davecheney/remove-utils-network
jujubot 20808c8
Increase the dependency engine logging level in 2 places
mjs c56f228
Plan authorization when deploying charms.
tasdomas a6b9414
utils: move LoggedErrorStack helper to worker/provisioner
davecheney 3340d80
Merge pull request #3691 from davecheney/remove-juju-utils-logging
jujubot d42c6f4
Merge pull request #3698 from natefinch/assign-worker
jujubot abd59f7
Merge branch 'series-in-metadata' into merge-series-in-metadata
wallyworld edbc0e4
Merge pull request #3665 from natefinch/fix-assign-worker-tests
jujubot e16fa23
Merge pull request #3722 from wallyworld/merge-series-in-metadata
jujubot 428d7f4
Merge pull request #3680 from axw/upload-tools-extra-series
jujubot 717c6de
Fix tests
axw d4786b3
Merge pull request #3702 from axw/cmd-juju-storage-fix
jujubot dbe0d1c
Merge pull request #3696 from ericsnowcurrently/lxd-fixes
jujubot a22f7e3
Merge pull request #3537 from axw/lp1494542-worker-uniter-runcommands
jujubot e65ffe2
worker/peergrouper: stop using globals
axw 58ace75
Delete "external" tests
axw ca7a6bb
Default plan lookup on charm deployment.
tasdomas d11f447
More logging for problematic test
f387763
maas: change testing.invalid DNS name to have leading "-"
38942be
Add comment clarifying the use of "-testing.invalid"
059ecf5
address flaky reports test; fix self-manifold deadlock
fwereade 4d1099c
don't use Timer
axw 0547b01
state: Ensure the collectionwatcher always filters by environment
mjs 0bf7c38
Merge pull request #3737 from mjs/1516144-unitassigner-watcher-fix
jujubot 45816fe
extended comments
fwereade 122832f
api: Ensure safe access to state.loggedIn
mjs dc53064
Fixed lp:1483879: Use MAAS 1.8+ devices for containers by default
jujubot 0f33e7f
ec2: Subnets are now used when specified in constraints
jujubot af4a99a
Merge pull request #3749 from dimitern/lp-1499426-panic-space-no-subnets
jujubot fb15197
Machine Principals method for testing
9b889d4
Merge commit master into lxd-provider.
kat-co c083f73
Merge pull request #3753 from kat-co/lxd-provider
jujubot d9b0997
Added dependency missed in merge.
kat-co f593345
Merge pull request #3757 from kat-co/lxd-provider
jujubot 9cc3e1a
Use cinder endpoint as given to openstack provider
b318240
api/unitassigner: fix data race in test
davecheney a1f9e37
Tweaks from reviews by katco and waigani
8b16c5b
Drop table based tests and use several cases
1265e93
state: remove unit assignment docs after assigning
axw 283d21b
Merge pull request #3768 from axw/lp1516144-assignunit-remove
jujubot badcb76
Merge pull request #3751 from dimitern/master-lp-1499426-panic-space-…
jujubot 4df0698
Merge pull request #3748 from dimitern/ec2-use-subnets-from-constrain…
jujubot 754b146
Merge pull request #3746 from dimitern/lp-1483879-maas-devices-master
jujubot 7d70037
Merge pull request #3692 from voidspace/pick-provider-first-master
jujubot de417eb
Merge pull request #3760 from juju/lxd-provider
jujubot 95c4832
Merge pull request #3363 from mattyw/keep-for-24-hours
jujubot d52a4b3
Merge pull request #3720 from tasdomas/d001-deploy-plan-auth
jujubot f45e69a
Merge pull request #3732 from fwereade/dependency-self-deadlock
jujubot d7092bd
Merge pull request #3762 from bz2/cinder_endpoints
jujubot 14132c7
utils: switch to yaml.v2
davecheney d0cb1b7
all: remove juju/utils.go yaml fork, revert to juju/utils repo
davecheney 9d8b143
Merge pull request #3724 from davecheney/upgrade-yaml-v2
jujubot ab509f7
Merge pull request #3743 from mjs/api-safe-loggedin
jujubot 9632e71
cmd/jujud/agent/unit: removed APIInfo gate
mjs 2e4de3d
Merge pull request #3717 from mjs/dep-eng-logging
jujubot 8bd466d
Merge pull request #3766 from davecheney/fixedbugs/1516498
jujubot d776dea
Merge pull request #3741 from mjs/remove-apiinfo-gate
jujubot 6ef3675
provider/azure: Azure Resource Manager provider
axw 80c161f
Update to new Bootstrap signature
axw 9dd7d7c
Merge pull request #3742 from axw/peergrouper-fixes
jujubot fbd3035
Merge pull request #3772 from axw/azure-arm-merge-master
jujubot 9c792a1
worker/rsyslog: use net.JoinHostPort
mjs 4acbd26
Merge pull request #3776 from mjs/rsyslog-address-joining-master
jujubot 8a3d71c
Merge pull request #3731 from frobware/lp-1516036
jujubot 29ca55b
all: use charm.URL rather than charm.Reference
rogpeppe b5cda73
Merge pull request #3745 from rogpeppe/068-remove-charm.Reference
jujubot 1e9ad6f
Merge pull request #3778 from natefinch/fix-1382556-mark2
jujubot d592108
update deps to point to modifications in juju/utils
natefinch 7124ea4
update deps to point to merged fp of ssh code
natefinch b1854f0
Use the latest util & testing repos and adjust to a changed signature…
ericsnowcurrently 97012aa
update to latest juju/utils
natefinch f1012f1
update tests for new lock signature
natefinch 60350f6
network: remove racy InitaliseFromConfig
davecheney 18bf2c6
Merge pull request #3783 from natefinch/fix-fslock
jujubot d1ec2da
Merge pull request #3785 from davecheney/fix-global-ipv6-race
jujubot d690b20
Merge pull request #3782 from natefinch/fix-1382556-mark2-fp
jujubot b1b4829
Implement SupportsSpaces for maas 1.9
a1ec9ee
Test
22023ee
Extended test
e29578a
Rename capability
18b0a16
Add server url back
6fff5c4
Properly check result of calling SupportsSpaces
6f39cbd
Remove unneeded logging
383654d
Implemented spaces constraints and initial interface bindings handlin…
df03fb8
Changes after review
80a4edc
Fixed imports ordering
The table of contents is too big for display.
10
api/state.go
| @@ -0,0 +1,14 @@ | ||
| +// Copyright 2015 Canonical Ltd. | ||
| +// Licensed under the AGPLv3, see LICENCE file for details. | ||
| + | ||
| +package unitassigner | ||
| + | ||
| +import ( | ||
| + "testing" | ||
| + | ||
| + gc "gopkg.in/check.v1" | ||
| +) | ||
| + | ||
| +func TestPackage(t *testing.T) { | ||
| + gc.TestingT(t) | ||
| +} |
| @@ -0,0 +1,82 @@ | ||
| +// Copyright 2015 Canonical Ltd. | ||
| +// Licensed under the AGPLv3, see LICENCE file for details. | ||
| + | ||
| +package unitassigner | ||
| + | ||
| +import ( | ||
| + "github.com/juju/errors" | ||
| + "github.com/juju/juju/api/base" | ||
| + "github.com/juju/juju/api/watcher" | ||
| + "github.com/juju/juju/apiserver/params" | ||
| + | ||
| + "github.com/juju/names" | ||
| +) | ||
| + | ||
| +const uaFacade = "UnitAssigner" | ||
| + | ||
| +// API provides access to the UnitAssigner API facade. | ||
| +type API struct { | ||
| + facade base.FacadeCaller | ||
| +} | ||
| + | ||
| +// New creates a new client-side UnitAssigner facade. | ||
| +func New(caller base.APICaller) API { | ||
| + fc := base.NewFacadeCaller(caller, uaFacade) | ||
| + return API{facade: fc} | ||
| +} | ||
| + | ||
| +// AssignUnits tells the state server to run whatever unit assignments it has. | ||
| +// Unit assignments for units that no longer exist will return an error that | ||
| +// satisfies errors.IsNotFound. | ||
| +func (a API) AssignUnits(tags []names.UnitTag) ([]error, error) { | ||
| + entities := make([]params.Entity, len(tags)) | ||
| + for i, tag := range tags { | ||
| + entities[i] = params.Entity{Tag: tag.String()} | ||
| + } | ||
| + args := params.Entities{Entities: entities} | ||
| + var result params.ErrorResults | ||
| + if err := a.facade.FacadeCall("AssignUnits", args, &result); err != nil { | ||
| + return nil, err | ||
| + } | ||
| + | ||
| + errs := make([]error, len(result.Results)) | ||
| + for i, e := range result.Results { | ||
| + if e.Error != nil { | ||
| + errs[i] = convertNotFound(e.Error) | ||
| + } | ||
| + } | ||
| + return errs, nil | ||
| +} | ||
| + | ||
| +// convertNotFound converts param notfound errors into errors.notfound values. | ||
| +func convertNotFound(err error) error { | ||
| + if params.IsCodeNotFound(err) { | ||
| + return errors.NewNotFound(err, "") | ||
| + } | ||
| + return err | ||
| +} | ||
| + | ||
| +// WatchUnitAssignments watches the server for new unit assignments to be | ||
| +// created. | ||
| +func (a API) WatchUnitAssignments() (watcher.StringsWatcher, error) { | ||
| + var result params.StringsWatchResult | ||
| + err := a.facade.FacadeCall("WatchUnitAssignments", nil, &result) | ||
| + if err != nil { | ||
| + return nil, err | ||
| + } | ||
| + if result.Error != nil { | ||
| + return nil, result.Error | ||
| + } | ||
| + w := watcher.NewStringsWatcher(a.facade.RawAPICaller(), result) | ||
| + return w, nil | ||
| +} | ||
| + | ||
| +// SetAgentStatus sets the status of the unit agents. | ||
| +func (a API) SetAgentStatus(args params.SetStatus) error { | ||
| + var result params.ErrorResults | ||
| + err := a.facade.FacadeCall("SetAgentStatus", args, &result) | ||
| + if err != nil { | ||
| + return err | ||
| + } | ||
| + return result.Combine() | ||
| +} |
Oops, something went wrong.