Skip to content

Commit

Permalink
Remove DefaultSeries from model summary
Browse files Browse the repository at this point in the history
It was not used anywhere by the client anyway. It's a hangover from a
previous version

This requires a rev of our modelmanager facade
  • Loading branch information
jack-w-shaw committed Jul 26, 2023
1 parent ee5d6dc commit ffd6339
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 24 deletions.
1 change: 0 additions & 1 deletion api/base/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ type UserModelSummary struct {
ControllerUUID string
IsController bool
ProviderType string
DefaultSeries string
Cloud string
CloudRegion string
CloudCredential string
Expand Down
1 change: 0 additions & 1 deletion api/client/modelmanager/modelmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ func (c *Client) ListModelSummaries(user string, all bool) ([]base.UserModelSumm
ControllerUUID: summary.ControllerUUID,
IsController: summary.IsController,
ProviderType: summary.ProviderType,
DefaultSeries: summary.DefaultSeries,
CloudRegion: summary.CloudRegion,
Life: summary.Life,
ModelUserAccess: string(summary.UserAccess),
Expand Down
2 changes: 1 addition & 1 deletion api/facadeversions.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ var facadeVersions = map[string]int{
"MigrationTarget": 2,
"ModelConfig": 3,
"ModelGeneration": 4,
"ModelManager": 9,
"ModelManager": 10,
"ModelSummaryWatcher": 1,
"ModelUpgrader": 1,
"NotifyWatcher": 1,
Expand Down
5 changes: 2 additions & 3 deletions apiserver/facades/client/modelmanager/modelmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -688,9 +688,8 @@ func (m *ModelManagerAPI) ListModelSummaries(req params.ModelSummariesRequest) (
Owner: mi.Owner,
},

DefaultSeries: mi.DefaultSeries,
ProviderType: mi.ProviderType,
AgentVersion: mi.AgentVersion,
ProviderType: mi.ProviderType,
AgentVersion: mi.AgentVersion,

Status: common.EntityStatusFromState(mi.Status),
Counts: []params.ModelEntityCount{},
Expand Down
6 changes: 3 additions & 3 deletions apiserver/facades/client/modelmanager/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ import (

// Register is called to expose a package of facades onto a given registry.
func Register(registry facade.FacadeRegistry) {
registry.MustRegister("ModelManager", 9, func(ctx facade.Context) (facade.Facade, error) {
return newFacadeV9(ctx)
registry.MustRegister("ModelManager", 10, func(ctx facade.Context) (facade.Facade, error) {
return newFacadeV10(ctx)
}, reflect.TypeOf((*ModelManagerAPI)(nil)))
}

// newFacadeV9 is used for API registration.
func newFacadeV9(ctx facade.Context) (*ModelManagerAPI, error) {
func newFacadeV10(ctx facade.Context) (*ModelManagerAPI, error) {
st := ctx.State()
pool := ctx.StatePool()
ctlrSt, err := pool.SystemState()
Expand Down
5 changes: 1 addition & 4 deletions apiserver/facades/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -27427,7 +27427,7 @@
{
"Name": "ModelManager",
"Description": "ModelManagerAPI implements the model manager interface and is\nthe concrete implementation of the api end point.",
"Version": 9,
"Version": 10,
"AvailableTo": [
"controller-machine-agent",
"machine-agent",
Expand Down Expand Up @@ -28364,9 +28364,6 @@
"$ref": "#/definitions/ModelEntityCount"
}
},
"default-series": {
"type": "string"
},
"is-controller": {
"type": "boolean"
},
Expand Down
1 change: 0 additions & 1 deletion rpc/params/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ type ModelSummary struct {
ControllerUUID string `json:"controller-uuid"`
IsController bool `json:"is-controller"`
ProviderType string `json:"provider-type,omitempty"`
DefaultSeries string `json:"default-series,omitempty"`
CloudTag string `json:"cloud-tag"`
CloudRegion string `json:"cloud-region,omitempty"`
CloudCredentialTag string `json:"cloud-credential-tag,omitempty"`
Expand Down
13 changes: 3 additions & 10 deletions state/modelsummaries.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,9 @@ type ModelSummary struct {
SLAOwner string

// Needs Config()
ProviderType string
DefaultSeries string
DefaultBase series.Base
AgentVersion *version.Number
ProviderType string
DefaultBase series.Base
AgentVersion *version.Number

// Needs Statuses collection
Status status.StatusInfo
Expand Down Expand Up @@ -151,12 +150,6 @@ func (p *modelSummaryProcessor) fillInFromConfig() error {
detail.ProviderType = cfg.Type()
detail.DefaultBase = config.PreferredBase(cfg)

// TODO(stickupkid): Ensure we fill in the default series for now, we
// can switch that out later.
if detail.DefaultSeries, err = series.GetSeriesFromBase(detail.DefaultBase); err != nil {
return errors.Trace(err)
}

if agentVersion, exists := cfg.AgentVersion(); exists {
detail.AgentVersion = &agentVersion
}
Expand Down

0 comments on commit ffd6339

Please sign in to comment.