Skip to content

Commit

Permalink
Merge pull request juju#13830 from hmlanigan/rename-removeValidator-r…
Browse files Browse the repository at this point in the history
…emoteValidator

juju#13830

While investigating other work, I noticed this typo, removeValidator. Renaming to remoteValidator.

## QA steps

This is a mechanical change, with no impact to current behavior. Unit tests should succeed.
  • Loading branch information
jujubot authored Mar 14, 2022
2 parents b9fb403 + c579b0d commit 155fc94
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions apiserver/facades/client/machinemanager/upgradeseries.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,13 +284,13 @@ func (s upgradeSeriesState) ApplicationsFromMachine(machine Machine) ([]Applicat

type upgradeSeriesValidator struct {
localValidator ApplicationValidator
removeValidator ApplicationValidator
remoteValidator ApplicationValidator
}

func makeUpgradeSeriesValidator(client CharmhubClient) upgradeSeriesValidator {
return upgradeSeriesValidator{
localValidator: stateSeriesValidator{},
removeValidator: charmhubSeriesValidator{
remoteValidator: charmhubSeriesValidator{
client: client,
},
}
Expand Down Expand Up @@ -367,7 +367,7 @@ func (s upgradeSeriesValidator) ValidateApplications(applications []Application,
return errors.Trace(err)
}

return s.removeValidator.ValidateApplications(requestApps, series, force)
return s.remoteValidator.ValidateApplications(requestApps, series, force)
}

// ValidateMachine validates a given machine for ensuring it meets a given
Expand Down
12 changes: 6 additions & 6 deletions apiserver/facades/client/machinemanager/upgradeseries_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,12 +277,12 @@ func (s ValidatorSuite) TestValidateApplications(c *gc.C) {

localValidator := NewMockUpgradeSeriesValidator(ctrl)
localValidator.EXPECT().ValidateApplications([]Application{localApp, storeApp}, "focal", false)
removeValidator := NewMockUpgradeSeriesValidator(ctrl)
removeValidator.EXPECT().ValidateApplications([]Application{charmhubApp}, "focal", false)
remoteValidator := NewMockUpgradeSeriesValidator(ctrl)
remoteValidator.EXPECT().ValidateApplications([]Application{charmhubApp}, "focal", false)

validator := upgradeSeriesValidator{
localValidator: localValidator,
removeValidator: removeValidator,
remoteValidator: remoteValidator,
}

err := validator.ValidateApplications(applications, "focal", false)
Expand All @@ -299,12 +299,12 @@ func (s ValidatorSuite) TestValidateApplicationsWithNoOrigin(c *gc.C) {

localValidator := NewMockUpgradeSeriesValidator(ctrl)
localValidator.EXPECT().ValidateApplications(applications, "focal", false)
removeValidator := NewMockUpgradeSeriesValidator(ctrl)
removeValidator.EXPECT().ValidateApplications([]Application(nil), "focal", false)
remoteValidator := NewMockUpgradeSeriesValidator(ctrl)
remoteValidator.EXPECT().ValidateApplications([]Application(nil), "focal", false)

validator := upgradeSeriesValidator{
localValidator: localValidator,
removeValidator: removeValidator,
remoteValidator: remoteValidator,
}

err := validator.ValidateApplications(applications, "focal", false)
Expand Down

0 comments on commit 155fc94

Please sign in to comment.