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(internal/jimm/controller.go): add default cloud region if none exist #1513

Merged

Conversation

alesstimec
Copy link
Collaborator

When adding a controller JIMM will query the controller for all known clouds and then add those clouds to its internal DB. If a cloud (e.g. MAAS or k8s) has no regions, JIMM would be unable to add a model to that cloud as it does not store association between clouds and controllers. To solve the issue we add a default region to clouds that do not have any regions and that cloud region will only have one controller associated with it.

Description

Engineering checklist

  • Documentation updated
  • Covered by unit tests
  • Covered by integration tests

Test instructions

@alesstimec alesstimec requested a review from a team as a code owner January 8, 2025 14:49
@alesstimec alesstimec requested review from SimoneDutto and kian99 and removed request for SimoneDutto and kian99 January 8, 2025 14:50
internal/jimm/controller_test.go Outdated Show resolved Hide resolved
@alesstimec alesstimec force-pushed the add-controller-with-cloud-with-no-regions branch from a46fb50 to 081cb58 Compare January 9, 2025 07:57
Copy link
Contributor

@SimoneDutto SimoneDutto left a comment

Choose a reason for hiding this comment

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

lgtm

internal/jimm/controller.go Show resolved Hide resolved
@@ -1,4 +1,4 @@
// Copyright 2024 Canonical.
// Copyright 2025 Canonical.
Copy link
Contributor

Choose a reason for hiding this comment

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

this is happening to me as well, do we want to change the cr header when we touch a file?

When adding a controller JIMM will query the controller for all known clouds and then add those
clouds to its internal DB. If a cloud (e.g. MAAS or k8s) has no regions, JIMM would be unable to add
a model to that cloud as it does not store association between clouds and controllers. To solve the
issue we add a `default` region to clouds that do not have any regions and that cloud region will
only have one controller associated with it.
@alesstimec alesstimec force-pushed the add-controller-with-cloud-with-no-regions branch from 081cb58 to 9fd582d Compare January 9, 2025 08:50
@alesstimec alesstimec merged commit 57ef498 into canonical:v3 Jan 9, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants