Skip to content

Commit

Permalink
Merge branch 'master' into f-ui/alloc-fs
Browse files Browse the repository at this point in the history
  • Loading branch information
backspace committed Jun 27, 2019
2 parents 429e89f + 72b9b87 commit 464aeae
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ IMPROVEMENTS:
BUG FIXES:

* core: Improved job spec parsing error messages for variable interpolation failures [[GH-5844](https://github.com/hashicorp/nomad/issues/5844)]
* core: Handle error case when attempting to stop a non-existent allocation [[GH-5865](https://github.com/hashicorp/nomad/issues/5865)]
* client: Fixed regression that prevented registering multiple services with the same name but different ports in Consul correctly [[GH-5829](https://github.com/hashicorp/nomad/issues/5829)]
* driver: Fixed an issue preventing external driver plugins from launching executor process [[GH-5726](https://github.com/hashicorp/nomad/issues/5726)]
* driver/docker: Fixed a bug mounting relative paths on Windows [[GH-5811](https://github.com/hashicorp/nomad/issues/5811)]
Expand Down
11 changes: 9 additions & 2 deletions command/agent/alloc_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,15 @@ func (s *HTTPServer) allocStop(allocID string, resp http.ResponseWriter, req *ht
s.parseWriteRequest(req, &sr.WriteRequest)

var out structs.AllocStopResponse
err := s.agent.RPC("Alloc.Stop", &sr, &out)
return &out, err
rpcErr := s.agent.RPC("Alloc.Stop", &sr, &out)

if rpcErr != nil {
if structs.IsErrUnknownAllocation(rpcErr) {
rpcErr = CodedError(404, allocNotFoundErr)
}
}

return &out, rpcErr
}

func (s *HTTPServer) ClientAllocRequest(resp http.ResponseWriter, req *http.Request) (interface{}, error) {
Expand Down
13 changes: 6 additions & 7 deletions command/agent/alloc_endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -424,17 +424,16 @@ func TestHTTP_AllocStop(t *testing.T) {
// Test that we 404 when the allocid is invalid
{
// Make the HTTP request
req, err := http.NewRequest("POST", "/v1/allocation/"+alloc.ID+"/stop", nil)
req, err := http.NewRequest("POST", "/v1/allocation/"+uuid.Generate()+"/stop", nil)
require.NoError(err)
respW := httptest.NewRecorder()

// Make the request
obj, err := s.Server.AllocSpecificRequest(respW, req)
require.NoError(err)

a := obj.(*structs.AllocStopResponse)
require.NotEmpty(a.EvalID, "missing eval")
require.NotEmpty(a.Index, "missing index")
_, err = s.Server.AllocSpecificRequest(respW, req)
require.NotNil(err)
if !strings.Contains(err.Error(), allocNotFoundErr) {
t.Fatalf("err: %v", err)
}
}
})
}
Expand Down
4 changes: 4 additions & 0 deletions nomad/alloc_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,10 @@ func (a *Alloc) Stop(args *structs.AllocStopRequest, reply *structs.AllocStopRes
return err
}

if alloc == nil {
return fmt.Errorf(structs.ErrUnknownAllocationPrefix)
}

eval := &structs.Evaluation{
ID: uuid.Generate(),
Namespace: alloc.Namespace,
Expand Down
1 change: 1 addition & 0 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"ember-moment": "^7.8.1",
"ember-native-dom-helpers": "^0.5.4",
"ember-power-select": "^2.2.3",
"ember-qunit-nice-errors": "^1.2.0",
"ember-resolver": "^5.0.1",
"ember-responsive": "^3.0.0",
"ember-sinon": "^2.2.0",
Expand Down
29 changes: 27 additions & 2 deletions ui/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1323,6 +1323,11 @@ assign-symbols@^1.0.0:
resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367"
integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=

[email protected]:
version "0.10.2"
resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.10.2.tgz#aef76a04fde54634976fc94defaad1a67e2eadb0"
integrity sha512-ufWX953VU1eIuWqxS0nRDMYlGyFH+yxln5CsmIHlpzEt3fdYqUnRtsFt0XAsQot8OaVCwFqxT1RiwvtzYjeYeg==

[email protected]:
version "0.9.6"
resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.9.6.tgz#102c9e9e9005d3e7e3829bf0c4fa24ee862ee9b9"
Expand Down Expand Up @@ -1415,7 +1420,7 @@ babel-code-frame@^6.26.0:
esutils "^2.0.2"
js-tokens "^3.0.2"

babel-core@^6.24.1, babel-core@^6.26.0, babel-core@^6.26.3:
babel-core@^6.10.4, babel-core@^6.24.1, babel-core@^6.26.0, babel-core@^6.26.3:
version "6.26.3"
resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.3.tgz#b2e2f09e342d0f0c88e2f02e067794125e75c207"
integrity sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==
Expand Down Expand Up @@ -4767,6 +4772,16 @@ ember-power-select@^2.2.3:
ember-text-measurer "^0.5.0"
ember-truth-helpers "^2.1.0"

ember-qunit-nice-errors@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/ember-qunit-nice-errors/-/ember-qunit-nice-errors-1.2.0.tgz#8db4468fbe761f42bec9adcddfd21efa31237267"
integrity sha512-DNvqrS6vSMf7VImW7RjlTbiUnYvyxNNeVMNBVyys7g8hgg/IqbWeXQjKUzeSp/dUbzVi9Fr/8cuLHH7S38DSOA==
dependencies:
babel-core "^6.10.4"
broccoli-persistent-filter "^1.4.3"
ember-cli-babel "^6.6.0"
recast "^0.13.0"

ember-qunit@^3.5.0:
version "3.5.3"
resolved "https://registry.yarnpkg.com/ember-qunit/-/ember-qunit-3.5.3.tgz#bfd0bff8298c78c77e870cca43fe0826e78a0d09"
Expand Down Expand Up @@ -5096,7 +5111,7 @@ espree@^5.0.1:
acorn-jsx "^5.0.0"
eslint-visitor-keys "^1.0.0"

esprima@^4.0.0:
esprima@^4.0.0, esprima@~4.0.0:
version "4.0.1"
resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71"
integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==
Expand Down Expand Up @@ -9116,6 +9131,16 @@ recast@^0.11.3:
private "~0.1.5"
source-map "~0.5.0"

recast@^0.13.0:
version "0.13.2"
resolved "https://registry.yarnpkg.com/recast/-/recast-0.13.2.tgz#919e7e856d5154f13284142ed1797753c6756137"
integrity sha512-Xqo0mKljGUWGUhnkdbODk7oJGFrMcpgKQ9cCyZ4y+G9VfoTKdum8nHbf/SxIdKx5aBSZ29VpVy20bTyt7jyC8w==
dependencies:
ast-types "0.10.2"
esprima "~4.0.0"
private "~0.1.5"
source-map "~0.6.1"

redent@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/redent/-/redent-1.0.0.tgz#cf916ab1fd5f1f16dfb20822dd6ec7f730c2afde"
Expand Down
7 changes: 5 additions & 2 deletions website/source/docs/configuration/index.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,11 @@ server {
client {
enabled = true
network_speed = 10
options {
"driver.raw_exec.enable" = "1"
}
plugin "raw_exec" {
config {
enabled = true
}
}
Expand Down

0 comments on commit 464aeae

Please sign in to comment.