open-nomad/nomad/plan_apply_oss.go

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
770 B
Go
Raw Normal View History

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
//go:build !ent
2017-10-13 21:36:02 +00:00
// +build !ent
package nomad
import (
"github.com/hashicorp/nomad/nomad/state"
"github.com/hashicorp/nomad/nomad/structs"
)
// refreshIndex returns the index the scheduler should refresh to as the maximum
// of both the allocation and node tables.
func refreshIndex(snap *state.StateSnapshot) (uint64, error) {
allocIndex, err := snap.Index("allocs")
if err != nil {
return 0, err
}
nodeIndex, err := snap.Index("nodes")
if err != nil {
return 0, err
}
return maxUint64(nodeIndex, allocIndex), nil
}
// evaluatePlanQuota returns whether the plan would be over quota
func evaluatePlanQuota(_ *state.StateSnapshot, _ *structs.Plan) (bool, error) {
2017-10-13 21:36:02 +00:00
return false, nil
}