add-k8s incorrectly reports "cloud already exists"

Bug #1768845 reported by Cory Johns
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Ian Booth

Bug Description

Steps to reproduce:

$ juju add-k8s kubernetes
$ juju remove-cloud kubernetes
Removed details of personal cloud "kubernetes"
$ juju show-cloud kubernetes
ERROR cloud "kubernetes" not found
$ juju add-k8s kubernetes
ERROR cloud "kubernetes" already exists (already exists)

Note that the cluster information is updated, but it is also updated if you don't remove-cloud first. Perhaps add-k8s should support an --overwrite option?

Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 1768845] [NEW] add-k8s incorrectly reports "cloud already exists"

It sounds more like we are leaving some bit of information behind that we
then treat incorrectly. We probably just need to be more careful around
'remove-cloud' really deleting it.

On Thu, May 3, 2018 at 3:31 PM, Cory Johns <email address hidden> wrote:

> Public bug reported:
>
> Steps to reproduce:
>
> $ juju add-k8s kubernetes
> $ juju remove-cloud kubernetes
> Removed details of personal cloud "kubernetes"
> $ juju show-cloud kubernetes
> ERROR cloud "kubernetes" not found
> $ juju add-k8s kubernetes
>
>
> ERROR cloud "kubernetes" already exists (already exists)
>
> Note that the cluster information is updated, but it is also updated if
> you don't remove-cloud first. Perhaps add-k8s should support an
> --overwrite option?
>
> ** Affects: juju
> Importance: Undecided
> Status: New
>
> --
> You received this bug notification because you are subscribed to juju.
> Matching subscriptions: juju bugs
> https://bugs.launchpad.net/bugs/1768845
>
> Title:
> add-k8s incorrectly reports "cloud already exists"
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/juju/+bug/1768845/+subscriptions
>

John A Meinel (jameinel)
Changed in juju:
status: New → Triaged
importance: Undecided → High
tags: added: add-cloud add-k8s caas k8s remove-cloud
Ian Booth (wallyworld)
Changed in juju:
milestone: none → 2.4-beta2
assignee: nobody → Yang Kelvin Liu (kelvin.liu)
Changed in juju:
assignee: Yang Kelvin Liu (kelvin.liu) → Christopher Lee (veebers)
Revision history for this message
Christopher Lee (veebers) wrote :

This is related to LP:1768847 where the command "add-k8s" populates data on the controller. remove-cloud isn't hitting the controller to get the DB cleaned up.

I'm hoping for clarification on the experience expectation of "add-k8s" which will guide the fix for this bug.

Possible outcome might be:
  - remove-cloud, if removing a kubernetes cloud type, hits all the controllers and removes from the db.

Revision history for this message
Christopher Lee (veebers) wrote :

The "add-k8s" command stores data on the active controller as well as local config.
"remove-cloud" needs to check the controller, if the cloud is in use refuse to remove and if not in use remove the details from the controller db. It then (potentially, see below) will remove the details from the local config.

Query:
What if someone has "add-k8s blah" on multi controllers? Thus having the details on many controllers, should the remove-cloud command:
  - attempt to contact all known controllers and attempt removal from them
  - Only remove from the active controller, and from the local config?

Should (and I know splitting commands is frowned upon) this be split, to:
  - remove-k8s -> remove details from controller (if not in use) leaving local config alone.
  - remove-cloud -> Only attempts to remove from local config
    - This might mean that "add-k8s" will fail if trying to re-run on a controller that hasn't had 'remove-k8s' on it
    - Perhaps need to add --overwrite or --replace to "add-k8s" that will re-populate the details on the controller side.

Changed in juju:
milestone: 2.4-beta2 → none
Ian Booth (wallyworld)
Changed in juju:
milestone: none → 2.4-rc1
Ian Booth (wallyworld)
Changed in juju:
assignee: Christopher Lee (veebers) → Ian Booth (wallyworld)
Ian Booth (wallyworld)
Changed in juju:
status: Triaged → In Progress
Revision history for this message
Ian Booth (wallyworld) wrote :

There's now a remove-k8s command which you can use to remove from the controller a k8s cluster/cloud previously added with add-k8s.

Changed in juju:
status: In Progress → Fix Committed
Changed in juju:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.