pospt prep
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user