Skip to content

Commit

Permalink
Merge pull request #256 from uselagoon/pod-fails
Browse files Browse the repository at this point in the history
fix: if pod fails send failure correctly
  • Loading branch information
shreddedbacon authored Jul 5, 2024
2 parents d976943 + 054deaa commit 567de23
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.20-alpine as builder
FROM golang:1.20-alpine AS builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand Down
2 changes: 1 addition & 1 deletion controllers/v1beta1/podmonitor_buildhandlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ func (r *LagoonMonitorReconciler) updateDeploymentWithLogs(
// if the buildstatus is pending or running, or the cancel flag is provided
// send the update status to lagoon
if helpers.ContainsString(
helpers.BuildRunningPendingStatus,
helpers.BuildRunningPendingFailedStatus,
lagoonBuild.Labels["lagoon.sh/buildStatus"],
) || cancel {
opLog.Info(
Expand Down
2 changes: 1 addition & 1 deletion controllers/v1beta1/podmonitor_taskhandlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ func (r *LagoonMonitorReconciler) updateTaskWithLogs(
// then update the task to reflect the current pod status
// we do this so we don't update the status of the task again
if helpers.ContainsString(
helpers.TaskRunningPendingStatus,
helpers.TaskRunningPendingFailedStatus,
lagoonTask.Labels["lagoon.sh/taskStatus"],
) || cancel {
opLog.Info(
Expand Down
14 changes: 14 additions & 0 deletions internal/helpers/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ var (
lagoonv1beta1.BuildStatusComplete.String(),
lagoonv1beta1.BuildStatusCancelled.String(),
}
// BuildRunningPendingStatus .
BuildRunningPendingFailedStatus = []string{
lagoonv1beta1.BuildStatusPending.String(),
lagoonv1beta1.BuildStatusQueued.String(),
lagoonv1beta1.BuildStatusRunning.String(),
lagoonv1beta1.BuildStatusFailed.String(),
}
// TaskRunningPendingStatus .
TaskRunningPendingStatus = []string{
lagoonv1beta1.TaskStatusPending.String(),
Expand All @@ -48,6 +55,13 @@ var (
lagoonv1beta1.TaskStatusComplete.String(),
lagoonv1beta1.TaskStatusCancelled.String(),
}
// TaskRunningPendingStatus .
TaskRunningPendingFailedStatus = []string{
lagoonv1beta1.TaskStatusPending.String(),
lagoonv1beta1.TaskStatusQueued.String(),
lagoonv1beta1.TaskStatusRunning.String(),
lagoonv1beta1.TaskStatusFailed.String(),
}
)

const (
Expand Down

0 comments on commit 567de23

Please sign in to comment.