Add types for lifecycle events.

Why do user-initiated stops need a time param?


On Fri, Aug 29, 2014 at 9:16 AM, bgrant0607 <notifications@github.com>
wrote:

> In pkg/api/types.go:
>
> > +// TODO: merge this with liveness probing?
> > +// TODO: pass structured data to these actions, and document that data here.
> > +type Handler struct {
> > +	// One and only one of the following should be specified.
> > +	// Exec specifies the action to take.
> > +	Exec *ExecAction `yaml:"exec,omitempty" json:"exec,omitempty"`
> > +	// HTTPGet specifies the http request to perform.
> > +	HTTPGet *HTTPGetAction `yaml:"httpGet,omitempty" json:"httpGet,omitempty"`
> > +}
> > +
> > +// Lifecycle describes actions that the management system should take in response to container lifecycle
> > +// events.  For all lifecycle handlers, management of the container blocks until the action is complete.
> > +type Lifecycle struct {
> > +	// PostStart is called immediately after a container is created.
> > +	PostStart *Handler `yaml:"postStart,omitempty" json:"postStart,omitempty"`
> > +	// PreUserStop is called immediately before a container is terminated due to an API request.
>
> I'm ok without passing the timeout value in the initial version.
>
> But there is a 3rd scenario in addition to full and none: I think all
> user-initiated stops should have a stop time parameter. The alternative is
> an option to simply not respect the normal timeout, in which case it would
> look like an emergency scenario.
>
> --
> Reply to this email directly or view it on GitHub
> <https://github.com/GoogleCloudPlatform/kubernetes/pull/1041/files#r16899582>
> .
>