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

feat(modelmanager): listmodels #1493

Merged
merged 17 commits into from
Dec 13, 2024
Merged

feat(modelmanager): listmodels #1493

merged 17 commits into from
Dec 13, 2024

Conversation

ale8k
Copy link
Contributor

@ale8k ale8k commented Dec 11, 2024

ListModels now correctly calls ListModels. Dialing the controllers themselves and returning models only those users can view. This is used upon Login and Register commands to persist model details, and whether or not it is a CAAS model.

We don't return controller models as with JIMM this does not make sense - we intentionally choose not to expose these details to the user.

Driveby: The api was trying to call /version, but our mock didn't implement it.

Description

The what and why - include a summary of the change, describe what it does, and include relevant motivation and context.

Fixes JIRA/GitHub issue number

Engineering checklist

Check only items that apply

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

Test instructions

Notes for code reviewers

The api was trying to call /version, but our mock didn't implement it.
@ale8k ale8k requested a review from a team as a code owner December 11, 2024 13:40
@ale8k ale8k changed the title test(modelmanager): k8s tests fix feat(modelmanager): listmodels Dec 12, 2024
internal/jujuclient/modelmanager.go Show resolved Hide resolved
internal/jujuapi/modelmanager_test.go Show resolved Hide resolved
internal/jimm/model.go Outdated Show resolved Hide resolved
internal/jimm/jimm.go Outdated Show resolved Hide resolved
internal/jimm/jimm.go Outdated Show resolved Hide resolved
internal/jimm/jimm.go Outdated Show resolved Hide resolved
internal/jimm/jimm.go Show resolved Hide resolved
internal/jimm/model.go Outdated Show resolved Hide resolved
internal/jimm/model.go Show resolved Hide resolved
}

// Find the controllers these models reside on and remove duplicates
var controllers []dbmodel.Controller
Copy link
Collaborator

Choose a reason for hiding this comment

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

i wonder if there's a way we could write this bit with generics or something, because we seem to be looking for unique lists in a few places in jimm code. also not for this pr :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Already on it :P

internal/jimm/model.go Outdated Show resolved Hide resolved
internal/jimm/model_test.go Show resolved Hide resolved
internal/jimm/model.go Show resolved Hide resolved
internal/jimm/model_test.go Show resolved Hide resolved
internal/jujuapi/modelmanager.go Show resolved Hide resolved
internal/jimm/model.go Show resolved Hide resolved
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.

good job

internal/jimm/model.go Outdated Show resolved Hide resolved
internal/jimm/model.go Outdated Show resolved Hide resolved
internal/jimm/model.go Outdated Show resolved Hide resolved
internal/jimm/model.go Outdated Show resolved Hide resolved
@ale8k ale8k merged commit 486ff61 into canonical:v3 Dec 13, 2024
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