pospt prep

This commit is contained in:
mr
2026-03-26 11:15:02 +01:00
parent 12eba65a01
commit f8a6e69ef3
3 changed files with 32 additions and 9 deletions

View File

@@ -1,13 +1,27 @@
package conf
import "sync"
import (
"sync"
"time"
)
type Config struct {
KubeHost string
KubePort string
KubeCA string
KubeCert string
KubeData string
KubeHost string
KubePort string
KubeCA string
KubeCert string
KubeData string
// PrepLeadSeconds must match oc-schedulerd's PREP_LEAD_SECONDS.
// Used both as the ASAP buffer and as the minimum allowed lead time
// when validating explicit booking start dates.
PrepLeadSeconds int
}
func (c *Config) PrepLead() time.Duration {
if c.PrepLeadSeconds <= 0 {
return 2 * time.Minute
}
return time.Duration(c.PrepLeadSeconds) * time.Second
}
var instance *Config