Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
state,apiserver, cmd/status: Add MeterStatus to the model #7120
Conversation
| + return model.SetMeterStatus(status, info) | ||
| +} | ||
| + | ||
| +func (st *State) ModelMeterStatus() (MeterStatus, error) { |
|
!!test!! |
|
!!test!! |
mattyw
referenced this pull request
Mar 20, 2017
Merged
state: Model migration for sla and meter status #7128
|
!!build!! |
cmars
requested changes
Mar 20, 2017
state/Unit.GetMeterStatus needs to combine mmStatus, the unit's containing model's meter status, and the unit's meter status.
| default: | ||
| - return errors.Errorf("invalid meter status %q", code) | ||
| + return MeterNotAvailable, errors.Errorf("invalid meter status %q", codeStr) |
| @@ -100,7 +100,7 @@ func (s *upgradesSuite) TestStripLocalUserDomainModels(c *gc.C) { | ||
| delete(initialModel, "txn-revno") | ||
| initialModel["owner"] = "test-admin" | ||
| - // TODO (mattyw, cmars) We need to confirm that setting sla in this test | ||
| + // TODO (mattyw, cmars) We need to confirm that setting sla and meter-status in this test |
cmars
Mar 20, 2017
Owner
What is the scenario this test attempts to recreate w.r.t SLAs? Upgrading models from a pre-SLA version of Juju?
mattyw
Mar 21, 2017
Member
@cmars no upgrade is required for SLAs or meter status. This test is actually checking completely seperate behaviour (local domains like "@Local" being stripped from user names. However it includes checking against a bson representation of the model, which now includes sla and meter status
cmars
Mar 21, 2017
Owner
@mattyw Thanks for the explanation. I think we can remove this TODO then as this test is unrelated and we're just testing for consistent model migration behavior.
|
Also need to consider the case where state has an empty model meter status doc, with an empty string for the status code, if that is the possible after migrating a pre-SLA model. Does that case give an unexpected error when the client apiserver tries to query model meter status? |
|
@cmars in the case where meter status is queried but non is set we return "NOT AVAILABLE" which is what we do for the unit meter status as well. This isn't bubbled up in juju status as it filters it out. @cmars regarding combining model & unit meter status. This was being done server side as I understand it |
|
!!test!! |
|
!!build!! |
| + ModelManagerBackend | ||
| +} | ||
| + | ||
| +func (m modelBackendShim) ForModel(tag names.ModelTag) (metricsender.ModelBackend, error) { |
| + *state.State | ||
| +} | ||
| + | ||
| +func (m modelBackendShim) ForModel(tag names.ModelTag) (metricsender.ModelBackend, error) { |
|
!!build!! |
|
@mattyw this one currently has compile errors:
|
|
!!build!! |
|
!!test!! |
|
!!build!! |
|
!!build!! |
|
add to whitelist |
|
!!test!! |
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Tests failed |
|
@mattyw Test failure is legit:
|
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Tests failed |
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
mattyw commentedMar 17, 2017
Description of change
With SLAs operating at the conceptual level of models each model now has the concept of a meter status, this is the same concept as the existing unit meter status.
QA steps
Documentation changes
How users react to meter status on models needs to be documented. This feature is just one of the features under the umbrella of SLAs
Bug reference
n/a