Skip to content

Commit

Permalink
wip deployments works
Browse files Browse the repository at this point in the history
  • Loading branch information
shoenig committed Feb 14, 2022
1 parent 8e0202c commit 24f3308
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions command/agent/deployment_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ func (s *HTTPServer) DeploymentsRequest(resp http.ResponseWriter, req *http.Requ
return nil, nil
}

query := req.URL.Query()
args.OrderAscending = query.Get("ascending") == "true"

var out structs.DeploymentListResponse
if err := s.agent.RPC("Deployment.List", &args, &out); err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion command/agent/eval_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func (s *HTTPServer) EvalsRequest(resp http.ResponseWriter, req *http.Request) (
query := req.URL.Query()
args.FilterEvalStatus = query.Get("status")
args.FilterJobID = query.Get("job")
args.OrderAscending = query.Has("ascending")
args.OrderAscending = query.Get("ascending") == "true"

var out structs.EvalListResponse
if err := s.agent.RPC("Eval.List", &args, &out); err != nil {
Expand Down
2 changes: 2 additions & 0 deletions nomad/eval_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ func (e *Eval) GetEval(args *structs.EvalSpecificRequest,
return structs.ErrPermissionDenied
}

fmt.Println("SH Eval.GetEval, id:", args.EvalID, "ns:", args.RequestNamespace())

// Setup the blocking query
opts := blockingOptions{
queryOpts: &args.QueryOptions,
Expand Down
2 changes: 1 addition & 1 deletion nomad/state/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ func deploymentSchema() *memdb.TableSchema {
Name: "create",
AllowMissing: false,
Unique: false,
Indexer: &memdb.UUIDFieldIndex{
Indexer: &memdb.UintFieldIndex{
Field: "CreateIndex",
},
},
Expand Down
2 changes: 2 additions & 0 deletions nomad/state/state_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -3066,6 +3066,8 @@ func (s *StateStore) DeleteEval(index uint64, evals []string, allocs []string) e
func (s *StateStore) EvalByID(ws memdb.WatchSet, id string) (*structs.Evaluation, error) {
txn := s.db.ReadTxn()

fmt.Println("SH StateStore.EvalByID, id:", id)

watchCh, existing, err := txn.FirstWatch("evals", "id", id)
if err != nil {
return nil, fmt.Errorf("eval lookup failed: %v", err)
Expand Down

0 comments on commit 24f3308

Please sign in to comment.