Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add: rename-space #11143

Merged
merged 30 commits into from Feb 5, 2020
Merged

add: rename-space #11143

merged 30 commits into from Feb 5, 2020

Conversation

nammn
Copy link

@nammn nammn commented Jan 22, 2020

Checklist

  • Checked if it requires a pylibjuju change?
  • Added integration tests for the PR?
  • Added or updated doc.go related to packages changed?
  • Do comments answer the question of why design decisions were made?

Description of change

  • adds support to rename spaces
  • maas should not support it, currently only supports aws ec2

QA steps

  • create/use existing space
  • deploy a machine/application with space constraint (db)
  • deploy a machine/application with a negated space constraint (^db)
  • set a controller setting (juju-ha-space or juju-mgmt-space)
    Below is my QA history
❯ juju models                        
Controller: awsspace

Model       Cloud/Region      Type  Status     Machines  Cores  Units  Access  Last connection
controller  aws/eu-central-1  ec2   available         1      2  -      admin   just now
default*    aws/eu-central-1  ec2   available         2      4  2      admin   50 seconds ago <--- important

~
❯ juju spaces
Space  Name   Subnets       
0      alpha  172.31.1.0/28 
              172.31.16.0/20
              172.31.2.0/28 
              172.31.3.0/24 
              252.1.0.0/20  
              252.16.0.0/12 
              252.2.0.0/20  
              252.3.0.0/16  
1      db     172.31.0.0/28 
              252.0.0.0/20  
                            
~
❯ juju deploy mysql --constraints spaces=alpha,db
Located charm "cs:mysql-58".
Deploying charm "cs:mysql-58".

~
❯ juju deploy mediawiki --constraints spaces=alpha,^db
Located charm "cs:mediawiki-19".
Deploying charm "cs:mediawiki-19".

~
❯ juju show-application mysql
mysql:
  charm: mysql
  series: xenial
  channel: stable
  constraints:
    spaces:
    - alpha
    - db
  principal: true
  exposed: false
  remote: false
  endpoint-bindings:
    "": alpha
    ceph: alpha
    cluster: alpha
    data: alpha
    db: alpha
    db-admin: alpha
    ha: alpha
    local-monitors: alpha
    master: alpha
    monitors: alpha
    munin: alpha
    nrpe-external-master: alpha
    shared-db: alpha
    slave: alpha

~
❯ juju show-application mediawiki
mediawiki:
  charm: mediawiki
  series: trusty
  channel: stable
  constraints:
    spaces:
    - alpha
    - ^db
  principal: true
  exposed: false
  remote: false
  endpoint-bindings:
    "": alpha
    cache: alpha
    db: alpha
    slave: alpha
    website: alpha

~
❯ juju rename-space db bla  
renamed space "db" to "bla"

~
❯ juju show-application mediawiki
mediawiki:
  charm: mediawiki
  series: trusty
  channel: stable
  constraints:
    spaces:
    - alpha
    - ^bla
  principal: true
  exposed: false
  remote: false
  endpoint-bindings:
    "": alpha
    cache: alpha
    db: alpha
    slave: alpha
    website: alpha

❯ juju controller-config juju-mgmt-space=alpha

~
❯ juju rename-space alpha alpha2 
renamed space "alpha" to "alpha2"

~
❯ juju show-application mediawiki
mediawiki:
  charm: mediawiki
  series: trusty
  channel: stable
  constraints:
    spaces:
    - alpha2
    - ^bla
  principal: true
  exposed: false
  remote: false
  endpoint-bindings:
    "": alpha2
    cache: alpha2
    db: alpha2
    slave: alpha2
    website: alpha2

❯ juju show-application mysql
mysql:
  charm: mysql
  series: xenial
  channel: stable
  constraints:
    spaces:
    - alpha2
    - bla
  principal: true
  exposed: false
  remote: false
  endpoint-bindings:
    "": alpha2
    ceph: alpha2
    cluster: alpha2
    data: alpha2
    db: alpha2
    db-admin: alpha2
    ha: alpha2
    local-monitors: alpha2
    master: alpha2
    monitors: alpha2
    munin: alpha2
    nrpe-external-master: alpha2
    shared-db: alpha2
    slave: alpha2

The controller config should not change, as we are currently in the default model (or not in the controller model in general)

❯ juju controller-config juju-mgmt-space      
alpha  

@mitechie
Copy link
Contributor

Please make sure to spec out the provider specific impacts/details as part of this. Thanks!

@nammn nammn marked this pull request as ready for review January 28, 2020 15:57
@nammn
Copy link
Author

nammn commented Jan 28, 2020

Changing/Adding the docID seems to destroy whole juju.. I should take a proper look at this..

state/constraints.go Outdated Show resolved Hide resolved
@nammn
Copy link
Author

nammn commented Jan 29, 2020

!!build!!

state/state.go Outdated Show resolved Hide resolved
Copy link
Member

@manadart manadart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few more things to address.

provider/oracle/network/environ.go Outdated Show resolved Hide resolved
state/constraints.go Outdated Show resolved Hide resolved
state/controller.go Outdated Show resolved Hide resolved
state/spaces.go Outdated Show resolved Hide resolved
apiserver/facades/client/spaces/spaces_rename.go Outdated Show resolved Hide resolved
apiserver/facades/client/spaces/spaces_rename.go Outdated Show resolved Hide resolved
apiserver/facades/client/spaces/opfactory.go Outdated Show resolved Hide resolved
state/constraints.go Outdated Show resolved Hide resolved
@nammn
Copy link
Author

nammn commented Feb 3, 2020

!!build!!

Copy link
Member

@manadart manadart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one rewording and we're good to go.

apiserver/facades/client/spaces/rename.go Outdated Show resolved Hide resolved
@nammn
Copy link
Author

nammn commented Feb 5, 2020

thanks! $$merge$$

@jujubot jujubot merged commit 135ecde into juju:develop Feb 5, 2020
@nammn nammn deleted the feature-rename-space branch February 5, 2020 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants