orchard/pkg/resource/v1/worker.go

23 lines
431 B
Go

package v1
import "time"
type Worker struct {
// LastSeen is set by the Worker and is used by the Controller
// to track unhealthy Workers.
LastSeen time.Time
MachineID string
SchedulingPaused bool
// Resources available on this Worker.
Resources Resources `json:"resources"`
Meta
}
func (worker Worker) Offline(workerOfflineTimeout time.Duration) bool {
return time.Since(worker.LastSeen) > workerOfflineTimeout
}