Skip to content

Commit

Permalink
fixup! fix: panic introduced by hashicorp#8453
Browse files Browse the repository at this point in the history
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
  • Loading branch information
greut committed Sep 6, 2020
1 parent cd8c6ee commit c8078b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions nomad/job_endpoint_oss.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
vapi "github.com/hashicorp/vault/api"
)

// MultipleNamespacesErr is send when multiple namespaces are used in the OSS setup
var MultipleNamespacesErr = errors.New("multiple vault namespaces requires Nomad Enterprise")
// ErrMultipleNamespaces is send when multiple namespaces are used in the OSS setup
var ErrMultipleNamespaces = errors.New("multiple vault namespaces requires Nomad Enterprise")

// enforceSubmitJob is used to check any Sentinel policies for the submit-job scope
func (j *Job) enforceSubmitJob(override bool, job *structs.Job) (error, error) {
Expand Down Expand Up @@ -55,7 +55,7 @@ func (j *Job) multiVaultNamespaceValidation(
) error {
requestedNamespaces := structs.VaultNamespaceSet(policies)
if len(requestedNamespaces) > 0 {
return fmt.Errorf("%w, Namespaces: %s", MultipleNamespacesErr, strings.Join(requestedNamespaces, ", "))
return fmt.Errorf("%w, Namespaces: %s", ErrMultipleNamespaces, strings.Join(requestedNamespaces, ", "))
}
return nil
}
2 changes: 1 addition & 1 deletion nomad/job_endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1737,7 +1737,7 @@ func TestJobEndpoint_Register_Vault_MultiNamespaces(t *testing.T) {
err := msgpackrpc.CallWithCodec(codec, "Job.Register", req, &resp)
// OSS or Ent check
if s1.EnterpriseState.Features() == 0 {
require.True(t, errors.Is(err, MultipleNamespacesErr))
require.True(t, errors.Is(err, ErrMultipleNamespaces))
} else {
require.NoError(t, err)
}
Expand Down

0 comments on commit c8078b2

Please sign in to comment.