Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify Kaniko error message #3870

Merged
merged 1 commit into from
Mar 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/skaffold/build/cluster/kaniko.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (b *Builder) buildWithKaniko(ctx context.Context, out io.Writer, workspace

if err := kubernetes.WaitForPodSucceeded(ctx, pods, pod.Name, b.timeout); err != nil {
waitForLogs()
return "", fmt.Errorf("waiting for pod to complete: %w", err)
return "", err
}

waitForLogs()
Expand Down
5 changes: 3 additions & 2 deletions pkg/skaffold/kubernetes/wait.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package kubernetes

import (
"context"
"errors"
"fmt"
"time"

Expand Down Expand Up @@ -46,7 +47,7 @@ func watchUntilTimeout(ctx context.Context, timeout time.Duration, w watch.Inter
case event := <-w.ResultChan():
done, err := condition(&event)
if err != nil {
return fmt.Errorf("condition error: %s", err)
return err
}
if done {
return nil
Expand Down Expand Up @@ -84,7 +85,7 @@ func isPodSucceeded(podName string) func(event *watch.Event) (bool, error) {
case v1.PodRunning:
return false, nil
case v1.PodFailed:
return false, fmt.Errorf("pod already in terminal phase: %s", pod.Status.Phase)
return false, errors.New("pod has failed")
case v1.PodUnknown, v1.PodPending:
return false, nil
}
Expand Down