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

Fix returned errors on network domain state layer #17291

Merged
merged 1 commit into from Apr 29, 2024

Conversation

nvinuesa
Copy link
Member

@nvinuesa nvinuesa commented Apr 26, 2024

This patch fixes two cases on which the wrong error was returned from the state layer on the network domain, meaning that the service layer wasn't handling those correctly.

The first one is when trying to add a subnet with the same provider-id (this happens when reloading spaces twice on a row for example). The second one is when trying to remove spaces that don't contain a provider id, this should not prevent the delete.

Checklist

  • Code style: imports ordered, good names, simple structure, etc
  • Comments saying why design decisions were made
  • Go unit tests, with comments saying what you're testing
  • Integration tests, with comments saying what you're testing
  • doc.go added or updated in changed packages

QA steps

Bootstrap, reload spaces twice. Then add a space and remove it. There should be no errors.

juju bootstrap localhost c
juju add-model m
juju reload-spaces
juju reload-spaces
juju add-space foo 10.68.58.0/24
juju spaces
Name   Space ID                              Subnets
alpha  0                                     10.170.236.0/24
                                             10.215.127.0/24
                                             172.17.0.0/16
                                             172.18.0.0/16
                                             192.168.49.0/24
foo    018f1a6f-069e-700b-9904-53921fa813ea  10.68.58.0/24
juju remove-space foo
juju spaces
Name   Space ID  Subnets
alpha  0         10.170.236.0/24
                 10.215.127.0/24
                 10.68.58.0/24
                 172.17.0.0/16
                 172.18.0.0/16
                 192.168.49.0/24

Links

Jira card: JUJU-

This patch fixes two cases on which the wrong error was returned from
the state layer on the network domain, meaning that the service layer
wasn't handling those correctly.

The first one is when trying to add a subnet with the same provider-id
(this happens when reloading spaces twice on a row for example). The
second one is when trying to remove spaces that don't contain a provider
id, this should not prevent the delete.
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.

All looks good.

@nvinuesa
Copy link
Member Author

/merge

@jujubot jujubot merged commit 4b06bed into juju:main Apr 29, 2024
15 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants