New 2.6 feature: Controller context for commands


In Juju v.2.6.0, the context for several commands change from the local client cache to an existing controller.

This change amounts to a better user experience since most commands already use a controller as context by default. For example, when a model is added with add-moel the model is added remotely, on a controller. When an application is deployed with the deploy command the application is deployed remotely.

The below commands become remote by default:

  • add-cloud (yet interactive mode is always local)
  • list-clouds
  • add-k8s
  • show-cloud
  • remove-cloud
  • update-cloud

They each grow a --local option for when the operator wishes to explicitly apply a command locally.

Note that the add-cloud command only makes sense in a remote context when a cloud is being added to an existing controller. This makes use of the equally new multi-controller feature.

A caveat is when a client is first installed. In this state, it is not aware of any controllers and issuing the list-clouds command would therefore lead to a null output. This foreseeable situation is awkward and so the output includes explanatory text and displays local context output:

There are no controllers running.
You can bootstrap a new controller using one of these clouds:
Cloud           Regions  Default          Type        Description
aws                  15  us-east-1        ec2         Amazon Web Services
aws-china             2  cn-north-1       ec2         Amazon China
rackspace             6  dfw              rackspace   Rackspace Cloud
localhost             1  localhost        lxd         LXD Container Hypervisor

A related enhancement is that the update-credential command can update a remote credential directly from a local YAML file. Previously, a credential needed to be updated locally and then use that to update the credential remotely.