Descriptioncmd/juju/addunit.go: use the API for juju add-unit
This depends on both of my MPs:
https://code.launchpad.net/~jameinel/juju-core/apiconn-from-name/+merge/181990
And:
https://code.launchpad.net/~jameinel/juju-core/api-client-add-service-unit-to-spec-1216543/+merge/181992
But we only support 1 prereq at the moment.
Anyway, the change is actually quite simple, instead of
juju.NewConnFromName use juju.NewAPIConnFromName, and then use the
APIConn.Client() object to actually do the requests.
I've tested this integration with a 1.13.2 environment, and everything
works great. I also manually inspected 1.12 to ensure that the params
object already supported ToMachineSpec (it did).
With --debug I can see that it really is connecting to the API and not
to the MongoDB directly (it talks about connecting to wss://... rather
than ...:37017).
Also, it is actually *faster* to run than previously. I'm guessing it is
because we don't need the Presence code to trigger a sync of all the
existing nodes. When we start caching the API server addresses, this can
actually become quite fast (the current slowest part is still grabbing
the provider-state file and looking up the DNS name).
https://code.launchpad.net/~jameinel/juju-core/cli-api-add-unit/+merge/181997
Requires: https://code.launchpad.net/~jameinel/juju-core/api-client-add-service-unit-to-spec-1216543/+merge/181992
(do not edit description out of merge proposal)
Patch Set 1 #
Total comments: 1
Patch Set 2 : cmd/juju/addunit.go: use the API for juju add-unit #
MessagesTotal messages: 3
|