Running `juju add-k8s <name>` multiple times raises no error

Running multiple times the juju add-k8s <name> raises no error, just works.

As a user, I’d expect to get an error when trying to add another K8S with the same name, since it could overwrite any credentials already stored.

juju --version
2.9-rc6-catalina-amd64
$ juju add-k8s my-k8s
This operation can be applied to both a copy on this client and to the one on a controller.
No current controller was detected and there are no registered controllers on this client: either bootstrap one or register one.

k8s substrate added as cloud "my-k8s" with storage provisioned
by the existing "standard" storage class.
You can now bootstrap to this cloud by running 'juju bootstrap my-k8s'.

# then again
$ juju add-k8s my-k8s
This operation can be applied to both a copy on this client and to the one on a controller.
No current controller was detected and there are no registered controllers on this client: either bootstrap one or register one.

k8s substrate added as cloud "my-k8s" with storage provisioned
by the existing "standard" storage class.
You can now bootstrap to this cloud by running 'juju bootstrap my-k8s'.

Thanks for the info.

I’ve raised a bug for this Bug #1913974 “Running `juju add-k8s <name>` multiple times raise...” : Bugs : juju

In general, it’s probably better to create bugs directly for issues such as this rather than a discourse post. That will avoid the double entry of the information and allows the bug triage workflow to be performed more easily.

Thanks, will keep track there!