engine-api icon indicating copy to clipboard operation
engine-api copied to clipboard

RestartPolicy constants

Open dgageot opened this issue 10 years ago • 3 comments

I think it would make sense to provide constants or an enumerate type for valid Restart Policies. Before I submit a PR, I'd like to know what's the more idiomatic way to do that. Can somebody help?

dgageot avatar Jan 07 '16 09:01 dgageot

We actually have a RestartPolicy type already, maybe adding some default values would be good:

https://github.com/docker/engine-api/blob/master/types/container/host_config.go#L124-L152

calavera avatar Jan 07 '16 16:01 calavera

@calavera You mean default instances of RestartPolicy? I meant a list of valid Names

dgageot avatar Jan 07 '16 16:01 dgageot

having both sounds actually good to me.

calavera avatar Jan 07 '16 17:01 calavera