code: func podToTask(pod apiv1.Pod) swarm.Task {
  	var startTime time.Time
  	if pod.Status.StartTime != nil {
  		startTime = (*pod.Status.StartTime).Time
  	}
  	task := swarm.Task{
  		ID:     string(pod.UID),
  		NodeID: pod.Spec.NodeName,
  		Spec: swarm.TaskSpec{
  			ContainerSpec: &swarm.ContainerSpec{
  				Image: getContainerImage(pod.Spec.Containers),
  			},
  		},
  		DesiredState: podPhaseToState(pod.Status.Phase),
  		Status: swarm.TaskStatus{
  			State:     podPhaseToState(pod.Status.Phase),
  			Timestamp: startTime,
  			PortStatus: swarm.PortStatus{
  				Ports: getPorts(pod.Spec.Containers),
  			},
  		},
  	}
  
  	return task
  }
docs: // Pod conversion