fix: fixes add-model response when no controllers are registered#1801
Merged
ale8k merged 4 commits intocanonical:v3from Jan 13, 2026
Merged
fix: fixes add-model response when no controllers are registered#1801ale8k merged 4 commits intocanonical:v3from
ale8k merged 4 commits intocanonical:v3from
Conversation
33bd6f5 to
9a26a73
Compare
kian99
reviewed
Jan 13, 2026
alesstimec
reviewed
Jan 13, 2026
kian99
approved these changes
Jan 13, 2026
Contributor
kian99
left a comment
There was a problem hiding this comment.
Loosk good, truncating the int64 to int is also fine and I'd make that change.
alesstimec
approved these changes
Jan 13, 2026
Collaborator
alesstimec
left a comment
There was a problem hiding this comment.
LGTM with final two comments
e3a6f90 to
789ca67
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes https://warthogs.atlassian.net/browse/JUJU-9051, a bug that @alesstimec found.
When running add-model against JIMM, and no controllers were registered, the code path for this was running. This is because Juju was attempting to get the cloud here in order to retrieve the credential to add the model.
I've solved this by adding a count controllers DB call, and checking in ForEachUserCloud that controllers are registered. This error is propogated through the facade and now returned from the Clouds() call. Surfaced like so:
I did think of putting it in the facade call but any call to ForEachUserCloud is moot without having controllers, hence why I added the check here. We should probably add this to all Cloud retrieval calls, but I didn't want to scope creep this PR.
Engineering checklist
Test instructions
Spin up jimm without controllers, login, and run add-model.