Added TerminationGracePeriod field to PodSpec and grace-period flag to kubectl stop

Those are changes which touch users required by Termination Notice

Addresses #6804
This commit is contained in:
Piotr Szczesniak
2015-04-28 14:21:57 +02:00
parent dd976a27fb
commit 11a2dc496f
39 changed files with 164 additions and 58 deletions

View File

@@ -32,7 +32,7 @@ type PodsNamespacer interface {
type PodInterface interface {
List(label labels.Selector, field fields.Selector) (*api.PodList, error)
Get(name string) (*api.Pod, error)
Delete(name string) error
Delete(name string, options *api.DeleteOptions) error
Create(pod *api.Pod) (*api.Pod, error)
Update(pod *api.Pod) (*api.Pod, error)
Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)
@@ -69,8 +69,16 @@ func (c *pods) Get(name string) (result *api.Pod, err error) {
}
// Delete takes the name of the pod, and returns an error if one occurs
func (c *pods) Delete(name string) error {
return c.r.Delete().Namespace(c.ns).Resource("pods").Name(name).Do().Error()
func (c *pods) Delete(name string, options *api.DeleteOptions) error {
// TODO: to make this reusable in other client libraries
if options == nil {
return c.r.Delete().Namespace(c.ns).Resource("pods").Name(name).Do().Error()
}
body, err := api.Scheme.EncodeToVersion(options, c.r.APIVersion())
if err != nil {
return err
}
return c.r.Delete().Namespace(c.ns).Resource("pods").Name(name).Body(body).Do().Error()
}
// Create takes the representation of a pod. Returns the server's representation of the pod, and an error, if it occurs.