Skip to content

Commit

Permalink
Revert ":bug: Detect image issues. (#678)"
Browse files Browse the repository at this point in the history
This reverts commit 83b8519.
  • Loading branch information
shawn-hurley authored Jul 3, 2024
1 parent 2ba93e2 commit 27a758a
Showing 1 changed file with 1 addition and 33 deletions.
34 changes: 1 addition & 33 deletions task/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ const (
const (
AddonSelected = "AddonSelected"
ExtSelected = "ExtensionSelected"
ImageError = "ImageError"
PodNotFound = "PodNotFound"
PodCreated = "PodCreated"
PodRunning = "PodRunning"
Expand Down Expand Up @@ -946,10 +945,7 @@ func (m *Manager) podEvent(pod *core.Pod) (events []Event, err error) {

// podLogs - get and store pod logs as a Files.
func (m *Manager) podLogs(pod *core.Pod) (files []*model.File, err error) {
for _, container := range pod.Status.ContainerStatuses {
if container.State.Waiting != nil {
continue
}
for _, container := range pod.Spec.Containers {
f, nErr := m.containerLog(pod, container.Name)
if nErr == nil {
files = append(files, f)
Expand Down Expand Up @@ -1238,23 +1234,6 @@ func (r *Task) podPending(pod *core.Pod) {
pod.Status.ContainerStatuses...)
started := 0
for _, status := range status {
state := status.State
if state.Waiting != nil {
waiting := state.Waiting
reason := strings.ToLower(waiting.Reason)
if r.containsAny(reason, "invalid", "error", "backoff") {
r.Error(
"Error",
"Container (%s) failed: %s",
status.Name,
waiting.Reason)
mark := time.Now()
r.Terminated = &mark
r.Event(ImageError, waiting.Reason)
r.State = Failed
return
}
}
if status.Started == nil {
continue
}
Expand Down Expand Up @@ -1572,17 +1551,6 @@ func (r *Task) attach(file *model.File) {
})
}

// containsAny returns true when the str contains any of substr.
func (r *Task) containsAny(str string, substr ...string) (matched bool) {
for i := range substr {
if strings.Contains(str, substr[i]) {
matched = true
break
}
}
return
}

// Event represents a pod event.
type Event struct {
Type string
Expand Down

0 comments on commit 27a758a

Please sign in to comment.