Skip to content

Conversation

hannseman
Copy link
Contributor

This PR adds support for setting the boolean Init in ContainerSpec when creating and updating services.

I'm not really sure about what API version this feature was actually introduced.

https://docs.docker.com/engine/reference/commandline/service_create/ states that --init is supported from 1.37. But when comparing the API spec it looks like it was supported in 1.38.

Check TaskTemplate.ContainerSpec.Init:
https://docs.docker.com/engine/api/v1.38/#operation/ServiceCreate
vs
https://docs.docker.com/engine/api/v1.37/#operation/ServiceCreate

I've set the minimum version to 1.38.

Fixes #2293

Copy link
Contributor

@ijc ijc left a comment

Choose a reason for hiding this comment

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

LGTM. I also wasn't able to definitively pin down the API version, but 1.38 is the conservative choice.

moby/moby@e401b88 seems to be the commit which added it, and at the point in time api/common.go said 1.38

Signed-off-by: Hannes Ljungberg <hannes@5monkeys.se>
@shin- shin- added this to the 4.0.0 milestone Apr 14, 2019
@shin-
Copy link
Contributor

shin- commented Apr 14, 2019

Thanks!

@shin- shin- merged commit 1aaa76d into docker:master Apr 14, 2019
@hannseman
Copy link
Contributor Author

@ijc @shin- thanks for the review! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

client.services.create does not support init option

3 participants