open-nomad/nomad/structs/structs_oss.go

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

39 lines
768 B
Go
Raw Normal View History

//go:build !ent
// +build !ent
package structs
2020-09-29 21:57:46 +00:00
import (
"errors"
"fmt"
multierror "github.com/hashicorp/go-multierror"
)
func (m *Multiregion) Validate(jobType string, jobDatacenters []string) error {
if m != nil {
return errors.New("Multiregion jobs are unlicensed.")
}
return nil
}
2020-09-29 21:57:46 +00:00
func (p *ScalingPolicy) validateType() multierror.Error {
var mErr multierror.Error
// Check policy type and target
switch p.Type {
case ScalingPolicyTypeHorizontal:
targetErr := p.validateTargetHorizontal()
mErr.Errors = append(mErr.Errors, targetErr.Errors...)
default:
mErr.Errors = append(mErr.Errors, fmt.Errorf(`scaling policy type "%s" is not valid`, p.Type))
}
return mErr
}
func (j *Job) GetEntScalingPolicies() []*ScalingPolicy {
return nil
}