// Drain drains the provided node.
Drain drains the provided node.
// Drain drains the provided node .
func Drain(node *corev1.Node, clientSet kubernetes.Interface, params Params) error {
	drainer := &Helper{
		Client:              clientSet,
		Force:               params.Force,
		DeleteLocalData:     params.DeleteLocalData,
		IgnoreAllDaemonSets: params.IgnoreAllDaemonSets,
		IgnoreDaemonSets:    params.IgnoreDaemonSets,
	}
	if err := drainer.CanUseEvictions(); err != nil {
		return errors.Wrapf(err, "checking if cluster implements policy API")
	}
	if err := cordon(node, clientSet); err != nil {
		return err
	}
	return evictPods(node, getOrDefault(params.TimeOut), drainer)
}
func Drain ( node * corev1 . Node , clientSet kubernetes . Interface , params Params ) error { drainer := & Helper { Client : clientSet , Force : params . Force , DeleteLocalData : params . DeleteLocalData , IgnoreAllDaemonSets : params . IgnoreAllDaemonSets , IgnoreDaemonSets : params . IgnoreDaemonSets , } if err := drainer . CanUseEvictions ( ) ; err != nil { return errors . Wrapf ( err , " " ) } if err := cordon ( node , clientSet ) ; err != nil { return err } return evictPods ( node , getOrDefault ( params . TimeOut ) , drainer ) }
Drain drains the provided node.
Drain drains the provided node .
// TODO: this wrapping should really be done within CanUseEvictions: