Merge pull request #314 from mercedes-benz/improve_error_message

Improve error messages in garm log
This commit is contained in:
Gabriel 2024-11-26 10:44:41 +02:00 committed by GitHub
commit 8e13588edd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 27 additions and 3 deletions

View file

@ -145,6 +145,13 @@ func (r *basePoolManager) HandleWorkflowJob(job params.WorkflowJob) error {
return errors.Wrap(err, "validating owner")
}
// we see events where the lables seem to be missing. We should ignore these
// as we can't know if we should handle them or not.
if len(job.WorkflowJob.Labels) == 0 {
slog.WarnContext(r.ctx, "job has no labels", "workflow_job", job.WorkflowJob.Name)
return nil
}
var jobParams params.Job
var err error
var triggeredBy int64