2017-09-19 14:47:10 +00:00
|
|
|
// +build !ent
|
|
|
|
|
|
|
|
package nomad
|
|
|
|
|
2020-07-17 14:41:45 +00:00
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
"github.com/hashicorp/nomad/nomad/structs"
|
|
|
|
vapi "github.com/hashicorp/vault/api"
|
|
|
|
)
|
2017-09-19 14:47:10 +00:00
|
|
|
|
|
|
|
// enforceSubmitJob is used to check any Sentinel policies for the submit-job scope
|
|
|
|
func (j *Job) enforceSubmitJob(override bool, job *structs.Job) (error, error) {
|
|
|
|
return nil, nil
|
|
|
|
}
|
2020-06-15 20:18:14 +00:00
|
|
|
|
|
|
|
// multiregionRegister is used to send a job across multiple regions
|
2020-07-14 14:57:37 +00:00
|
|
|
func (j *Job) multiregionRegister(args *structs.JobRegisterRequest, reply *structs.JobRegisterResponse, existingVersion uint64) (bool, error) {
|
|
|
|
return false, nil
|
|
|
|
}
|
2020-07-03 14:44:41 +00:00
|
|
|
|
2020-07-14 14:57:37 +00:00
|
|
|
// multiregionStart is used to kick-off a deployment across multiple regions
|
|
|
|
func (j *Job) multiregionStart(args *structs.JobRegisterRequest, reply *structs.JobRegisterResponse) error {
|
2020-06-15 20:18:14 +00:00
|
|
|
return nil
|
|
|
|
}
|
2020-06-24 17:24:55 +00:00
|
|
|
|
|
|
|
// interpolateMultiregionFields interpolates a job for a specific region
|
|
|
|
func (j *Job) interpolateMultiregionFields(args *structs.JobPlanRequest) error {
|
|
|
|
return nil
|
|
|
|
}
|
2020-07-17 14:41:45 +00:00
|
|
|
|
|
|
|
// multiVaultNamespaceValidation provides a convience check to ensure
|
|
|
|
// multiple vault namespaces were not requested, this returns an early friendly
|
|
|
|
// error before job registry and further feature checks.
|
|
|
|
func (j *Job) multiVaultNamespaceValidation(
|
|
|
|
policies map[string]map[string]*structs.Vault,
|
|
|
|
s *vapi.Secret,
|
|
|
|
) error {
|
|
|
|
requestedNamespaces := structs.VaultNamespaceSet(policies)
|
|
|
|
if len(requestedNamespaces) > 0 {
|
|
|
|
return fmt.Errorf("multiple vault namespaces requires Nomad Enterprise, Namespaces: %s", strings.Join(requestedNamespaces, ", "))
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|