Skip to content
This repository has been archived by the owner on Dec 9, 2022. It is now read-only.

Commit

Permalink
Add additional logging
Browse files Browse the repository at this point in the history
  • Loading branch information
me committed Jan 12, 2018
1 parent c7593e4 commit e95a851
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cli/pipeline/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ func runPipelineStep(pipeline *PipelineDefinition, step *PipelineDefinitionStep,
TailLogs(ctx, clientset, e.Pod, e.Container)
}
case Deleted:
log.Println("[paddle] Pod deleted")
return errors.New("Pod was deleted unexpectedly.")
case Removed:
log.Printf("[paddle] Container removed: %s", e.Container)
continue
Expand Down
3 changes: 3 additions & 0 deletions cli/pipeline/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ func Watch(ctx context.Context, c kubernetes.Interface, watchPod *v1.Pod) (<-cha

parsePodStatus := func(pod *v1.Pod) {
if pod.Status.Phase == v1.PodSucceeded {
log.Println("Status: succeded")
out <- WatchEvent{Completed, pod, "", ""}
} else if pod.Status.Phase == v1.PodFailed {
log.Println("Status: failed")
out <- WatchEvent{Failed, pod, "", ""}
} else {
for _, container := range pod.Status.ContainerStatuses {
Expand Down Expand Up @@ -105,6 +107,7 @@ func Watch(ctx context.Context, c kubernetes.Interface, watchPod *v1.Pod) (<-cha
for {
select {
case <-time.After(watchPollInterval):
log.Println("Polling pod status:")
pod, err := c.CoreV1().Pods(watchPod.Namespace).Get(watchPod.Name, metav1.GetOptions{})
if err != nil {
parsePodStatus(pod)
Expand Down

0 comments on commit e95a851

Please sign in to comment.