Skip to content

Commit

Permalink
Fix datetime parsing for deadline
Browse files Browse the repository at this point in the history
  • Loading branch information
mickours committed Apr 24, 2024
1 parent f961351 commit bba5c21
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions connectors/k8s.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func WatchQueues(channel chan interface{}) {
log.Infof("Pod %s/%s added", pod.ObjectMeta.Namespace, pod.ObjectMeta.Name)
// Exclude pod if explicitly requested
if pod.Annotations[bebida_prefix+"bebida"] == "exclude" {
log.Infof("Found exclusion annotation %s, do exclude this pod", bebida_prefix+"bebida: \"exclude\"")
log.Infof("Found exclusion annotation %s, do exclude this pod", bebida_prefix+"bebida: exclude")
return
}
pendingPod := events.NewPendingPod()
Expand All @@ -57,9 +57,9 @@ func WatchQueues(channel chan interface{}) {
if nbCpu > 0 {
pendingPod.NbCores = int(nbCpu)
}
deadline, err := time.Parse(pod.Annotations[bebida_prefix+"deadline"], time.RFC3339)
deadline, err := time.Parse(time.RFC3339, pod.Annotations[bebida_prefix+"deadline"])
if err != nil {
log.Warnf("Error %s while retrieving CPU request for Pod %v+\n", err, pod)
log.Warnf("Error %s while retrieving deadline for Pod %v+\n", err, pod)
}
if deadline.After(time.Now().Add(time.Minute)) {
pendingPod.Deadline = deadline
Expand Down

0 comments on commit bba5c21

Please sign in to comment.