Fix search contexts

This commit is contained in:
Alex Dadgar 2017-09-07 17:13:18 -07:00
parent 84d06f6abe
commit d329fbe54d
2 changed files with 7 additions and 6 deletions

View File

@ -15,11 +15,6 @@ const (
)
var (
// allContexts are the available contexts which are searched to find matches
// for a given prefix
allContexts = []structs.Context{structs.Allocs, structs.Jobs, structs.Nodes,
structs.Evals, structs.Deployments, structs.Namespaces}
// ossContexts are the oss contexts which are searched to find matches
// for a given prefix
ossContexts = []structs.Context{structs.Allocs, structs.Jobs, structs.Nodes,

View File

@ -10,6 +10,12 @@ import (
"github.com/hashicorp/nomad/nomad/structs"
)
var (
// allContexts are the available contexts which are searched to find matches
// for a given prefix
allContexts = ossContexts
)
// getEnterpriseMatch is a no-op in oss since there are no enterprise objects.
func getEnterpriseMatch(match interface{}) (id string, ok bool) {
return "", false
@ -20,5 +26,5 @@ func getEnterpriseMatch(match interface{}) (id string, ok bool) {
func getEnterpriseResourceIter(context structs.Context, namespace, prefix string, ws memdb.WatchSet, state *state.StateStore) (memdb.ResultIterator, error) {
// If we have made it here then it is an error since we have exhausted all
// open source contexts.
return nil, fmt.Errorf("context must be one of %v or 'all' for all contexts; got %q", ossContexts, context)
return nil, fmt.Errorf("context must be one of %v or 'all' for all contexts; got %q", allContexts, context)
}