Skip to content

Commit

Permalink
feat: introduce a model manager domain service
Browse files Browse the repository at this point in the history
The model manager package in internal/jimm is the first for a Juju related domain that moves logic away from the large jimm struct into a dedicated package. This PR shows that the model manager relies on bits from what will eventually be the cloud and controller managers and also requires a way to dial Juju controllers.

This change is incomplete because I'd like the team to get a feel for whether they enjoy this approach of a smaller package with more dependencies OR whether they'd prefer a larger (i.e. single) Juju package that has less dependencies.
  • Loading branch information
kian99 committed Jan 17, 2025
1 parent 3cb6e2d commit ebc57a6
Show file tree
Hide file tree
Showing 5 changed files with 258 additions and 122 deletions.
7 changes: 7 additions & 0 deletions internal/jimm/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"github.com/juju/juju/state"
"github.com/juju/names/v5"
semversion "github.com/juju/version"
"github.com/juju/version/v2"
"gopkg.in/macaroon.v2"

"github.com/canonical/jimm/v3/internal/dbmodel"
Expand Down Expand Up @@ -1471,6 +1472,12 @@ func TestInitiateMigration(t *testing.T) {
}
}

// newVersion wraps version.MustParse to return a *version.Number
func newVersion(s string) *version.Number {
n := version.MustParse(s)
return &n
}

type result struct {
err error
result any
Expand Down
4 changes: 4 additions & 0 deletions internal/jimm/juju/model/export_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package model

// ModelManager is a type alias to export modelManager for use in tests.
type ModelManager = modelManager
Loading

0 comments on commit ebc57a6

Please sign in to comment.