Skip to content

Commit

Permalink
check io copy error
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-sun-star committed Mar 13, 2024
1 parent 499a186 commit ba16178
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/resource/utils/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,10 @@ func RunJob(c client.Client, logger *logr.Logger, namespace string, jobName stri
logger.Error(err, "failed to get job logs")
} else {
defer logs.Close()
io.Copy(&outputBuffer, logs)
_, err = io.Copy(&outputBuffer, logs)
if err != nil {
logger.Error(err, "failed to copy logs")
}
output = outputBuffer.String()
}
} else {
Expand Down

0 comments on commit ba16178

Please sign in to comment.