code: func (plugin *kubenetNetworkPlugin) teardown(namespace string, name string, id kubecontainer.ContainerID, podIP string) error {
  	errList := []error{}
  
  	if podIP != "" {
  		klog.V(5).Infof("Removing pod IP %s from shaper", podIP)
  		// shaper wants /32
  		if err := plugin.shaper().Reset(fmt.Sprintf("%s/32", podIP)); err != nil {
  			// Possible bandwidth shaping wasn't enabled for this pod anyways
  			klog.V(4).Infof("Failed to remove pod IP %s from shaper: %v", podIP, err)
  		}
  
  		delete(plugin.podIPs, id)
  	}
  
  	if err := plugin.delContainerFromNetwork(plugin.netConfig, network.DefaultInterfaceName, namespace, name, id); err != nil {
  		// This is to prevent returning error when TearDownPod is called twice on the same pod. This helps to reduce event pollution.
  		if podIP != "" {
  			klog.Warningf("Failed to delete container from kubenet: %v", err)
  		} else {
  			errList = append(errList, err)
  		}
  	}
  
  	portMappings, err := plugin.host.GetPodPortMappings(id.ID)
  	if err != nil {
  		errList = append(errList, err)
  	} else if portMappings != nil && len(portMappings) > 0 {
  		if err = plugin.hostportManager.Remove(id.ID, &hostport.PodPortMapping{
  			Namespace:    namespace,
  			Name:         name,
  			PortMappings: portMappings,
  			HostNetwork:  false,
  		}); err != nil {
  			errList = append(errList, err)
  		}
  	}
  	return utilerrors.NewAggregate(errList)
  }
docs: // Tears down as much of a pod's network as it can even if errors occur.  Returns
  // an aggregate error composed of all errors encountered during the teardown.