diff --git a/CHANGELOG.md b/CHANGELOG.md index 5023e3c45..4e1560254 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -360,7 +360,7 @@ BUG FIXES: set [[GH-2544](https://github.com/hashicorp/nomad/issues/2544)] * server/periodic: Restoring periodic jobs takes launch time zone into consideration [[GH-2808](https://github.com/hashicorp/nomad/issues/2808)] - * server/vault: Fix Vault Client panic when given nonexistant role [[GH-2648](https://github.com/hashicorp/nomad/issues/2648)] + * server/vault: Fix Vault Client panic when given nonExistent role [[GH-2648](https://github.com/hashicorp/nomad/issues/2648)] * telemetry: Fix merging of use node name [[GH-2762](https://github.com/hashicorp/nomad/issues/2762)] ## 0.5.6 (March 31, 2017) diff --git a/api/agent_test.go b/api/agent_test.go index 7d88b5f72..523f33fba 100644 --- a/api/agent_test.go +++ b/api/agent_test.go @@ -77,7 +77,7 @@ func TestAgent_Join(t *testing.T) { }) defer s2.Stop() - // Attempting to join a non-existent host returns error + // Attempting to join a non-Existent host returns error n, err := a1.Join("nope") if err == nil { t.Fatalf("expected error, got nothing") @@ -123,7 +123,7 @@ func TestAgent_ForceLeave(t *testing.T) { defer s.Stop() a := c.Agent() - // Force-leave on a non-existent node does not error + // Force-leave on a non-Existent node does not error if err := a.ForceLeave("nope"); err != nil { t.Fatalf("err: %s", err) } diff --git a/api/evaluations_test.go b/api/evaluations_test.go index 83eb6c91b..1ac75a745 100644 --- a/api/evaluations_test.go +++ b/api/evaluations_test.go @@ -95,7 +95,7 @@ func TestEvaluations_Info(t *testing.T) { defer s.Stop() e := c.Evaluations() - // Querying a non-existent evaluation returns error + // Querying a non-Existent evaluation returns error _, _, err := e.Info("8E231CF4-CA48-43FF-B694-5801E69E22FA", nil) if err == nil || !strings.Contains(err.Error(), "not found") { t.Fatalf("expected not found error, got: %s", err) diff --git a/api/jobs_test.go b/api/jobs_test.go index 9c68d2835..106282e07 100644 --- a/api/jobs_test.go +++ b/api/jobs_test.go @@ -892,7 +892,7 @@ func TestJobs_Allocations(t *testing.T) { defer s.Stop() jobs := c.Jobs() - // Looking up by a non-existent job returns nothing + // Looking up by a non-Existent job returns nothing allocs, qm, err := jobs.Allocations("job1", true, nil) if err != nil { t.Fatalf("err: %s", err) @@ -914,7 +914,7 @@ func TestJobs_Evaluations(t *testing.T) { defer s.Stop() jobs := c.Jobs() - // Looking up by a non-existent job ID returns nothing + // Looking up by a non-Existent job ID returns nothing evals, qm, err := jobs.Evaluations("job1", nil) if err != nil { t.Fatalf("err: %s", err) @@ -1016,7 +1016,7 @@ func TestJobs_ForceEvaluate(t *testing.T) { defer s.Stop() jobs := c.Jobs() - // Force-eval on a non-existent job fails + // Force-eval on a non-Existent job fails _, _, err := jobs.ForceEvaluate("job1", nil) if err == nil || !strings.Contains(err.Error(), "not found") { t.Fatalf("expected not found error, got: %#v", err) @@ -1056,7 +1056,7 @@ func TestJobs_PeriodicForce(t *testing.T) { defer s.Stop() jobs := c.Jobs() - // Force-eval on a non-existent job fails + // Force-eval on a non-Existent job fails _, _, err := jobs.PeriodicForce("job1", nil) if err == nil || !strings.Contains(err.Error(), "not found") { t.Fatalf("expected not found error, got: %#v", err) diff --git a/api/nodes_test.go b/api/nodes_test.go index 2a2727788..ef959f96a 100644 --- a/api/nodes_test.go +++ b/api/nodes_test.go @@ -93,7 +93,7 @@ func TestNodes_Info(t *testing.T) { defer s.Stop() nodes := c.Nodes() - // Retrieving a non-existent node returns error + // Retrieving a non-Existent node returns error _, _, err := nodes.Info("12345678-abcd-efab-cdef-123456789abc", nil) if err == nil || !strings.Contains(err.Error(), "not found") { t.Fatalf("expected not found error, got: %#v", err) @@ -208,7 +208,7 @@ func TestNodes_Allocations(t *testing.T) { defer s.Stop() nodes := c.Nodes() - // Looking up by a non-existent node returns nothing. We + // Looking up by a non-Existent node returns nothing. We // don't check the index here because it's possible the node // has already registered, in which case we will get a non- // zero result anyways. @@ -229,7 +229,7 @@ func TestNodes_ForceEvaluate(t *testing.T) { defer s.Stop() nodes := c.Nodes() - // Force-eval on a non-existent node fails + // Force-eval on a non-Existent node fails _, _, err := nodes.ForceEvaluate("12345678-abcd-efab-cdef-123456789abc", nil) if err == nil || !strings.Contains(err.Error(), "not found") { t.Fatalf("expected not found error, got: %#v", err) diff --git a/client/allocdir/fs_linux_test.go b/client/allocdir/fs_linux_test.go index fd51400a4..148d58e1b 100644 --- a/client/allocdir/fs_linux_test.go +++ b/client/allocdir/fs_linux_test.go @@ -60,13 +60,13 @@ func TestLinuxRootSecretDir(t *testing.T) { secretsDir := filepath.Join(tmpdir, TaskSecrets) - // removing a nonexistent secrets dir should NOT error + // removing a nonExistent secrets dir should NOT error if err := removeSecretDir(secretsDir); err != nil { - t.Fatalf("error removing nonexistent secrets dir %q: %v", secretsDir, err) + t.Fatalf("error removing nonExistent secrets dir %q: %v", secretsDir, err) } // run twice as it should be idemptotent if err := removeSecretDir(secretsDir); err != nil { - t.Fatalf("error removing nonexistent secrets dir %q: %v", secretsDir, err) + t.Fatalf("error removing nonExistent secrets dir %q: %v", secretsDir, err) } // creating a secrets dir should work @@ -102,7 +102,7 @@ func TestLinuxRootSecretDir(t *testing.T) { // removing again should be a noop if err := removeSecretDir(secretsDir); err != nil { - t.Fatalf("error removing nonexistent secrets dir %q: %v", secretsDir, err) + t.Fatalf("error removing nonExistent secrets dir %q: %v", secretsDir, err) } } @@ -120,13 +120,13 @@ func TestLinuxUnprivilegedSecretDir(t *testing.T) { secretsDir := filepath.Join(tmpdir, TaskSecrets) - // removing a nonexistent secrets dir should NOT error + // removing a nonExistent secrets dir should NOT error if err := removeSecretDir(secretsDir); err != nil { - t.Fatalf("error removing nonexistent secrets dir %q: %v", secretsDir, err) + t.Fatalf("error removing nonExistent secrets dir %q: %v", secretsDir, err) } // run twice as it should be idemptotent if err := removeSecretDir(secretsDir); err != nil { - t.Fatalf("error removing nonexistent secrets dir %q: %v", secretsDir, err) + t.Fatalf("error removing nonExistent secrets dir %q: %v", secretsDir, err) } // creating a secrets dir should work @@ -162,6 +162,6 @@ func TestLinuxUnprivilegedSecretDir(t *testing.T) { // removing again should be a noop if err := removeSecretDir(secretsDir); err != nil { - t.Fatalf("error removing nonexistent secrets dir %q: %v", secretsDir, err) + t.Fatalf("error removing nonExistent secrets dir %q: %v", secretsDir, err) } } diff --git a/client/allocdir/task_dir_linux_test.go b/client/allocdir/task_dir_linux_test.go index 43faf3c85..14c3e9978 100644 --- a/client/allocdir/task_dir_linux_test.go +++ b/client/allocdir/task_dir_linux_test.go @@ -26,13 +26,13 @@ func TestLinuxSpecialDirs(t *testing.T) { // Despite the task dir not existing, unmountSpecialDirs should *not* // return an error if err := td.unmountSpecialDirs(); err != nil { - t.Fatalf("error removing nonexistent special dirs: %v", err) + t.Fatalf("error removing nonExistent special dirs: %v", err) } - // Mounting special dirs in a nonexistent task dir *should* return an + // Mounting special dirs in a nonExistent task dir *should* return an // error if err := td.mountSpecialDirs(); err == nil { - t.Fatalf("expected mounting in a nonexistent task dir %q to fail", td.Dir) + t.Fatalf("expected mounting in a nonExistent task dir %q to fail", td.Dir) } // Create the task dir like TaskDir.Build would diff --git a/client/allocdir/task_dir_test.go b/client/allocdir/task_dir_test.go index dc3491e42..ce4168eaf 100644 --- a/client/allocdir/task_dir_test.go +++ b/client/allocdir/task_dir_test.go @@ -9,7 +9,7 @@ import ( cstructs "github.com/hashicorp/nomad/client/structs" ) -// Test that building a chroot will skip nonexistent directories. +// Test that building a chroot will skip nonExistent directories. func TestTaskDir_EmbedNonExistent(t *testing.T) { tmp, err := ioutil.TempDir("", "AllocDir") if err != nil { diff --git a/client/driver/docker.go b/client/driver/docker.go index 66a51c6bd..cead4108e 100644 --- a/client/driver/docker.go +++ b/client/driver/docker.go @@ -1797,7 +1797,7 @@ func (h *DockerHandle) Kill() error { // Container has already been removed. if strings.Contains(err.Error(), NoSuchContainerError) { - h.logger.Printf("[DEBUG] driver.docker: attempted to stop non-existent container %s", h.containerID) + h.logger.Printf("[DEBUG] driver.docker: attempted to stop non-Existent container %s", h.containerID) return nil } h.logger.Printf("[ERR] driver.docker: failed to stop container %s: %v", h.containerID, err) diff --git a/client/driver/rkt_test.go b/client/driver/rkt_test.go index 604090dc0..3a4e97f14 100644 --- a/client/driver/rkt_test.go +++ b/client/driver/rkt_test.go @@ -679,7 +679,7 @@ func TestRktDriver_Remove_Error(t *testing.T) { ctestutils.RktCompatible(t) - // Removing a non-existent pod should return an error + // Removing a non-Existent pod should return an error if err := rktRemove("00000000-0000-0000-0000-000000000000"); err == nil { t.Fatalf("expected an error") } diff --git a/command/inspect_test.go b/command/inspect_test.go index 4d36cf796..aebd3f8d1 100644 --- a/command/inspect_test.go +++ b/command/inspect_test.go @@ -32,7 +32,7 @@ func TestInspectCommand_Fails(t *testing.T) { } ui.ErrorWriter.Reset() - // Fails on non-existent job ID + // Fails on non-Existent job ID if code := cmd.Run([]string{"-address=" + url, "nope"}); code != 1 { t.Fatalf("expect exit 1, got: %d", code) } diff --git a/command/node_drain_test.go b/command/node_drain_test.go index 08b5e7ca3..4371038e8 100644 --- a/command/node_drain_test.go +++ b/command/node_drain_test.go @@ -42,7 +42,7 @@ func TestNodeDrainCommand_Fails(t *testing.T) { } ui.ErrorWriter.Reset() - // Fails on non-existent node + // Fails on non-Existent node if code := cmd.Run([]string{"-address=" + url, "-enable", "12345678-abcd-efab-cdef-123456789abc"}); code != 1 { t.Fatalf("expected exit 1, got: %d", code) } diff --git a/command/node_status_test.go b/command/node_status_test.go index a3ec59f53..e9a59292d 100644 --- a/command/node_status_test.go +++ b/command/node_status_test.go @@ -189,7 +189,7 @@ func TestNodeStatusCommand_Fails(t *testing.T) { } ui.ErrorWriter.Reset() - // Fails on non-existent node + // Fails on non-Existent node if code := cmd.Run([]string{"-address=" + url, "12345678-abcd-efab-cdef-123456789abc"}); code != 1 { t.Fatalf("expected exit 1, got: %d", code) } diff --git a/command/stop_test.go b/command/stop_test.go index d13ac4503..69970b744 100644 --- a/command/stop_test.go +++ b/command/stop_test.go @@ -32,7 +32,7 @@ func TestStopCommand_Fails(t *testing.T) { } ui.ErrorWriter.Reset() - // Fails on non-existent job ID + // Fails on non-Existent job ID if code := cmd.Run([]string{"-address=" + url, "nope"}); code != 1 { t.Fatalf("expect exit 1, got: %d", code) } diff --git a/nomad/acl_endpoint.go b/nomad/acl_endpoint.go index 6c0d0d7fe..901825991 100644 --- a/nomad/acl_endpoint.go +++ b/nomad/acl_endpoint.go @@ -579,14 +579,14 @@ func (a *ACL) DeleteTokens(args *structs.ACLTokenDeleteRequest, reply *structs.G // Determine if we are deleting local or global tokens hasGlobal := false allGlobal := true - nonexistentTokens := make([]string, 0) + nonExistentTokens := make([]string, 0) for _, accessor := range args.AccessorIDs { token, err := state.ACLTokenByAccessorID(nil, accessor) if err != nil { return fmt.Errorf("token lookup failed: %v", err) } if token == nil { - nonexistentTokens = append(nonexistentTokens, accessor) + nonExistentTokens = append(nonExistentTokens, accessor) continue } if token.Global { @@ -596,8 +596,8 @@ func (a *ACL) DeleteTokens(args *structs.ACLTokenDeleteRequest, reply *structs.G } } - if len(nonexistentTokens) != 0 { - return fmt.Errorf("Cannot delete nonexistent tokens: %v", strings.Join(nonexistentTokens, ", ")) + if len(nonExistentTokens) != 0 { + return fmt.Errorf("Cannot delete nonExistent tokens: %v", strings.Join(nonExistentTokens, ", ")) } // Disallow mixed requests with global and non-global tokens since we forward diff --git a/nomad/acl_endpoint_test.go b/nomad/acl_endpoint_test.go index 506e78e19..eb2682908 100644 --- a/nomad/acl_endpoint_test.go +++ b/nomad/acl_endpoint_test.go @@ -907,7 +907,7 @@ func TestACLEndpoint_DeleteTokens(t *testing.T) { assert.NotEqual(t, uint64(0), resp.Index) } -func TestACLEndpoint_DeleteTokens_WithNonexistantToken(t *testing.T) { +func TestACLEndpoint_DeleteTokens_WithNonExistentToken(t *testing.T) { t.Parallel() assert := assert.New(t) @@ -930,7 +930,7 @@ func TestACLEndpoint_DeleteTokens_WithNonexistantToken(t *testing.T) { err := msgpackrpc.CallWithCodec(codec, "ACL.DeleteTokens", req, &resp) assert.NotNil(err) - expectedError := fmt.Sprintf("Cannot delete nonexistent tokens: %s", nonExistentToken.AccessorID) + expectedError := fmt.Sprintf("Cannot delete nonExistent tokens: %s", nonExistentToken.AccessorID) assert.Contains(expectedError, err.Error()) } diff --git a/nomad/alloc_endpoint_test.go b/nomad/alloc_endpoint_test.go index 2a72de7d2..4cf5ae922 100644 --- a/nomad/alloc_endpoint_test.go +++ b/nomad/alloc_endpoint_test.go @@ -417,7 +417,7 @@ func TestAllocEndpoint_GetAllocs(t *testing.T) { t.Fatalf("bad: %#v", resp.Allocs) } - // Lookup non-existent allocs. + // Lookup non-Existent allocs. get = &structs.AllocsGetRequest{ AllocIDs: []string{"foo"}, QueryOptions: structs.QueryOptions{Region: "global"}, diff --git a/nomad/fsm_test.go b/nomad/fsm_test.go index 4aecc7f03..528836092 100644 --- a/nomad/fsm_test.go +++ b/nomad/fsm_test.go @@ -416,7 +416,7 @@ func TestFSM_RegisterJob_BadNamespace(t *testing.T) { if !ok { t.Fatalf("resp not of error type: %T %v", resp, resp) } - if !strings.Contains(err.Error(), "non-existent namespace") { + if !strings.Contains(err.Error(), "non-Existent namespace") { t.Fatalf("bad error: %v", err) } diff --git a/nomad/job_endpoint_test.go b/nomad/job_endpoint_test.go index 3f9dbf310..5b947a7d5 100644 --- a/nomad/job_endpoint_test.go +++ b/nomad/job_endpoint_test.go @@ -161,7 +161,7 @@ func TestJobEndpoint_Register_InvalidNamespace(t *testing.T) { // Try without a token, expect failure var resp structs.JobRegisterResponse err := msgpackrpc.CallWithCodec(codec, "Job.Register", req, &resp) - if err == nil || !strings.Contains(err.Error(), "non-existent namespace") { + if err == nil || !strings.Contains(err.Error(), "non-Existent namespace") { t.Fatalf("expected namespace error: %v", err) } diff --git a/nomad/state/state_store.go b/nomad/state/state_store.go index de0fc7cc1..4f28826cb 100644 --- a/nomad/state/state_store.go +++ b/nomad/state/state_store.go @@ -719,7 +719,7 @@ func (s *StateStore) upsertJobImpl(index uint64, job *structs.Job, keepVersion b if exists, err := s.namespaceExists(txn, job.Namespace); err != nil { return err } else if !exists { - return fmt.Errorf("job %q is in non-existent namespace %q", job.ID, job.Namespace) + return fmt.Errorf("job %q is in non-Existent namespace %q", job.ID, job.Namespace) } // Check if the job already exists diff --git a/nomad/state/state_store_test.go b/nomad/state/state_store_test.go index 7b4a2ad90..fe4d85e29 100644 --- a/nomad/state/state_store_test.go +++ b/nomad/state/state_store_test.go @@ -1179,7 +1179,7 @@ func TestStateStore_UpsertJob_BadNamespace(t *testing.T) { job.Namespace = "foo" err := state.UpsertJob(1000, job) - assert.Contains(err.Error(), "non-existent namespace") + assert.Contains(err.Error(), "non-Existent namespace") ws := memdb.NewWatchSet() out, err := state.JobByID(ws, job.Namespace, job.ID) @@ -4963,11 +4963,11 @@ func TestJobSummary_UpdateClientStatus(t *testing.T) { } } -// Test that non-existent deployment can't be updated +// Test that non-Existent deployment can't be updated func TestStateStore_UpsertDeploymentStatusUpdate_NonExistent(t *testing.T) { state := testStateStore(t) - // Update the non-existent deployment + // Update the non-Existent deployment req := &structs.DeploymentStatusUpdateRequest{ DeploymentUpdate: &structs.DeploymentStatusUpdate{ DeploymentID: uuid.Generate(), @@ -5173,11 +5173,11 @@ func TestStateStore_UpdateJobStability(t *testing.T) { } } -// Test that non-existent deployment can't be promoted +// Test that non-Existent deployment can't be promoted func TestStateStore_UpsertDeploymentPromotion_NonExistent(t *testing.T) { state := testStateStore(t) - // Promote the non-existent deployment + // Promote the non-Existent deployment req := &structs.ApplyDeploymentPromoteRequest{ DeploymentPromoteRequest: structs.DeploymentPromoteRequest{ DeploymentID: uuid.Generate(), @@ -5294,7 +5294,7 @@ func TestStateStore_UpsertDeploymentPromotion_NoCanaries(t *testing.T) { t.Fatalf("bad: %v", err) } if !strings.Contains(err.Error(), "no canaries to promote") { - t.Fatalf("expect error promoting non-existent canaries: %v", err) + t.Fatalf("expect error promoting non-Existent canaries: %v", err) } } @@ -5490,11 +5490,11 @@ func TestStateStore_UpsertDeploymentPromotion_Subset(t *testing.T) { } } -// Test that allocation health can't be set against a non-existent deployment +// Test that allocation health can't be set against a non-Existent deployment func TestStateStore_UpsertDeploymentAllocHealth_NonExistent(t *testing.T) { state := testStateStore(t) - // Set health against the non-existent deployment + // Set health against the non-Existent deployment req := &structs.ApplyDeploymentAllocHealthRequest{ DeploymentAllocHealthRequest: structs.DeploymentAllocHealthRequest{ DeploymentID: uuid.Generate(), @@ -5532,7 +5532,7 @@ func TestStateStore_UpsertDeploymentAllocHealth_Terminal(t *testing.T) { } } -// Test that allocation health can't be set against a non-existent alloc +// Test that allocation health can't be set against a non-Existent alloc func TestStateStore_UpsertDeploymentAllocHealth_BadAlloc_NonExistent(t *testing.T) { state := testStateStore(t) diff --git a/nomad/structs/structs.go b/nomad/structs/structs.go index 62a1ba44b..63ccaf08c 100644 --- a/nomad/structs/structs.go +++ b/nomad/structs/structs.go @@ -3632,7 +3632,7 @@ func (t *Task) Validate(ephemeralDisk *EphemeralDisk) error { func validateServices(t *Task) error { var mErr multierror.Error - // Ensure that services don't ask for non-existent ports and their names are + // Ensure that services don't ask for non-Existent ports and their names are // unique. servicePorts := make(map[string]map[string]struct{}) addServicePort := func(label, service string) { diff --git a/nomad/vault_test.go b/nomad/vault_test.go index 922b20304..a8ca57c8f 100644 --- a/nomad/vault_test.go +++ b/nomad/vault_test.go @@ -291,7 +291,7 @@ func TestVaultClient_ValidateRole_NonExistant(t *testing.T) { v.Config.Token = v.RootToken logger := log.New(os.Stderr, "", log.LstdFlags) v.Config.ConnectionRetryIntv = 100 * time.Millisecond - v.Config.Role = "test-nonexistant" + v.Config.Role = "test-nonExistent" client, err := NewVaultClient(v.Config, logger, nil) if err != nil { t.Fatalf("failed to build vault client: %v", err) diff --git a/ui/tests/acceptance/allocation-detail-test.js b/ui/tests/acceptance/allocation-detail-test.js index a660c57a9..e4a3fe2d0 100644 --- a/ui/tests/acceptance/allocation-detail-test.js +++ b/ui/tests/acceptance/allocation-detail-test.js @@ -128,7 +128,7 @@ test('when the allocation is not found, an error message is shown, but the URL p assert.equal( server.pretender.handledRequests.findBy('status', 404).url, '/v1/allocation/not-a-real-allocation', - 'A request to the non-existent allocation is made' + 'A request to the non-Existent allocation is made' ); assert.equal(currentURL(), '/allocations/not-a-real-allocation', 'The URL persists'); assert.ok(find('[data-test-error]'), 'Error message is shown'); diff --git a/ui/tests/acceptance/client-detail-test.js b/ui/tests/acceptance/client-detail-test.js index 621135dd7..559fa1bd3 100644 --- a/ui/tests/acceptance/client-detail-test.js +++ b/ui/tests/acceptance/client-detail-test.js @@ -325,7 +325,7 @@ test('when the node is not found, an error message is shown, but the URL persist assert.equal( server.pretender.handledRequests.findBy('status', 404).url, '/v1/node/not-a-real-node', - 'A request to the non-existent node is made' + 'A request to the non-Existent node is made' ); assert.equal(currentURL(), '/clients/not-a-real-node', 'The URL persists'); assert.ok(find('[data-test-error]'), 'Error message is shown'); diff --git a/ui/tests/acceptance/job-detail-test.js b/ui/tests/acceptance/job-detail-test.js index be2593488..9e14c5ebf 100644 --- a/ui/tests/acceptance/job-detail-test.js +++ b/ui/tests/acceptance/job-detail-test.js @@ -39,7 +39,7 @@ test('when the job is not found, an error message is shown, but the URL persists assert.equal( server.pretender.handledRequests.findBy('status', 404).url, '/v1/job/not-a-real-job', - 'A request to the non-existent job is made' + 'A request to the non-Existent job is made' ); assert.equal(currentURL(), '/jobs/not-a-real-job', 'The URL persists'); assert.ok(find('[data-test-error]'), 'Error message is shown'); diff --git a/ui/tests/acceptance/task-detail-test.js b/ui/tests/acceptance/task-detail-test.js index 966ff218c..b4f687b90 100644 --- a/ui/tests/acceptance/task-detail-test.js +++ b/ui/tests/acceptance/task-detail-test.js @@ -143,7 +143,7 @@ test('when the allocation is not found, the application errors', function(assert assert.equal( server.pretender.handledRequests.findBy('status', 404).url, '/v1/allocation/not-a-real-allocation', - 'A request to the non-existent allocation is made' + 'A request to the non-Existent allocation is made' ); assert.equal( currentURL(),