omitempty on possible null flields
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline was successful

This commit is contained in:
2023-10-30 22:49:48 +01:00
parent e615144396
commit b0577f3c55
2 changed files with 4 additions and 3 deletions

View File

@ -41,6 +41,7 @@ func CheckPending(cfg *config.Config) error {
return errors.New(fmt.Sprintf("Error from QueueInfo: %s", err.Error()))
}
if queueInfo.Stats.PendingCount > 0 {
// TODO: queueInfo.Pending may be empty
for _, pendingJobs := range queueInfo.Pending {
// TODO: separate key and value from LabelSelector and compare them deeply
_, exists := pendingJobs.Labels[cfg.LabelSelector]