code: func (r *controller) Shutdown(ctx context.Context) error {
  	if err := r.checkClosed(); err != nil {
  		return err
  	}
  
  	if r.cancelPull != nil {
  		r.cancelPull()
  	}
  
  	if r.hasServiceBinding() {
  		// remove container from service binding
  		if err := r.adapter.deactivateServiceBinding(); err != nil {
  			log.G(ctx).WithError(err).Warningf("failed to deactivate service binding for container %s", r.adapter.container.name())
  			// Don't return an error here, because failure to deactivate
  			// the service binding is expected if the container was never
  			// started.
  		}
  
  		// add a delay for gossip converge
  		// TODO(dongluochen): this delay should be configurable to fit different cluster size and network delay.
  		time.Sleep(defaultGossipConvergeDelay)
  	}
  
  	if err := r.adapter.shutdown(ctx); err != nil {
  		if isUnknownContainer(err) || isStoppedContainer(err) {
  			return nil
  		}
  
  		return err
  	}
  
  	return nil
  }
docs: // Shutdown the container cleanly.