Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix service rollback options being cross-wired #1052

Merged
merged 1 commit into from
May 14, 2018

Conversation

thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented May 11, 2018

Fixes moby/moby#37027

The "update" and "rollback" configurations were cross-wired, as a result, setting
--rollback-* options would override the service's update-options.

Creating a service with both update, and rollback configuration:

docker service create \
  --name=test \
  --update-failure-action=pause \
  --update-max-failure-ratio=0.6 \
  --update-monitor=3s \
  --update-order=stop-first \
  --update-parallelism=3 \
  --rollback-failure-action=continue \
  --rollback-max-failure-ratio=0.5 \
  --rollback-monitor=4s \
  --rollback-order=start-first \
  --rollback-parallelism=2 \
  --tty \
  busybox

Before this change:

docker service inspect --format '[{{json .Spec.UpdateConfig}},{{json .Spec.RollbackConfig}}]' test

Produces:

[
  {"Parallelism":3,"FailureAction":"pause","Monitor":3000000000,"MaxFailureRatio":0.6,"Order":"stop-first"},
  {"Parallelism":3,"FailureAction":"pause","Monitor":3000000000,"MaxFailureRatio":0.6,"Order":"stop-first"}
]

After this change:

[
  {"Parallelism":3,"FailureAction":"pause","Monitor":3000000000,"MaxFailureRatio":0.6,"Order":"stop-first"},
  {"Parallelism":2,"FailureAction":"continue","Monitor":4000000000,"MaxFailureRatio":0.5,"Order":"start-first"}
]

- Description for the changelog

* Fix `--rollback-*` options overwriting `--update-*` options [docker/cli#1052](https://github.com/docker/cli/pull/1052)

The "update" and "rollback" configurations were cross-wired, as a result, setting
`--rollback-*` options would override the service's update-options.

Creating a service with both update, and rollback configuration:

    docker service create \
      --name=test \
      --update-failure-action=pause \
      --update-max-failure-ratio=0.6 \
      --update-monitor=3s \
      --update-order=stop-first \
      --update-parallelism=3 \
      --rollback-failure-action=continue \
      --rollback-max-failure-ratio=0.5 \
      --rollback-monitor=4s \
      --rollback-order=start-first \
      --rollback-parallelism=2 \
      --tty \
      busybox

Before this change:

    docker service inspect --format '{{json .Spec.UpdateConfig}}' test \
    && docker service inspect --format '{{json .Spec.RollbackConfig}}' test

Produces:

    {"Parallelism":3,"FailureAction":"pause","Monitor":3000000000,"MaxFailureRatio":0.6,"Order":"stop-first"}
    {"Parallelism":3,"FailureAction":"pause","Monitor":3000000000,"MaxFailureRatio":0.6,"Order":"stop-first"}

After this change:

    {"Parallelism":3,"FailureAction":"pause","Monitor":3000000000,"MaxFailureRatio":0.6,"Order":"stop-first"}
    {"Parallelism":2,"FailureAction":"continue","Monitor":4000000000,"MaxFailureRatio":0.5,"Order":"start-first"}

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah
Copy link
Member Author

ping @vdemeester @aaronlehmann PTAL

Copy link
Collaborator

@cpuguy83 cpuguy83 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🐯

@vdemeester vdemeester merged commit 74d86d4 into docker:master May 14, 2018
@GordonTheTurtle GordonTheTurtle added this to the 18.06.0 milestone May 14, 2018
@thaJeztah thaJeztah deleted the fix-rollback-config branch May 14, 2018 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants