Skip to content

Commit

Permalink
Added more tests
Browse files Browse the repository at this point in the history
TestControllerCreationMutationHandler, TestControllerCreationValidationHandler, TestControllerUpsertGameServerSet
more tests


more tests
  • Loading branch information
alexey-kremsa-globant committed May 18, 2020
1 parent 59cc707 commit 7ee5c1f
Show file tree
Hide file tree
Showing 2 changed files with 395 additions and 98 deletions.
6 changes: 3 additions & 3 deletions pkg/fleets/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,10 +408,10 @@ func (c *Controller) recreateDeployment(fleet *agonesv1.Fleet, rest []*agonesv1.
func (c *Controller) rollingUpdateDeployment(fleet *agonesv1.Fleet, active *agonesv1.GameServerSet, rest []*agonesv1.GameServerSet) (int32, error) {
replicas, err := c.rollingUpdateActive(fleet, active, rest)
if err != nil {
return replicas, err
return 0, err
}
if err := c.rollingUpdateRest(fleet, rest); err != nil {
return replicas, err
return 0, err
}
return replicas, nil
}
Expand All @@ -437,7 +437,7 @@ func (c *Controller) rollingUpdateActive(fleet *agonesv1.Fleet, active *agonesv1

r, err := intstr.GetValueFromIntOrPercent(fleet.Spec.Strategy.RollingUpdate.MaxSurge, int(fleet.Spec.Replicas), true)
if err != nil {
return replicas, errors.Wrapf(err, "error calculating scaling gameserverset: %s", fleet.ObjectMeta.Name)
return 0, errors.Wrapf(err, "error calculating scaling gameserverset: %s", fleet.ObjectMeta.Name)
}
surge := int32(r)

Expand Down
Loading

0 comments on commit 7ee5c1f

Please sign in to comment.