[ARVADOS] updated: 1.2.0-255-gfc40fe8a7

Git user git at public.curoverse.com
Tue Oct 23 14:32:17 EDT 2018


Summary of changes:
 lib/controller/fed_collections.go |  2 +-
 lib/controller/fed_containers.go  | 15 ++++++++++++++-
 sdk/go/httpserver/id_generator.go |  4 ++++
 3 files changed, 19 insertions(+), 2 deletions(-)

       via  fc40fe8a7706701d50f05d27b7e58032537fad50 (commit)
      from  dbd24713435a26232adcd3a0cefcf21aa1fcdc45 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit fc40fe8a7706701d50f05d27b7e58032537fad50
Author: Peter Amstutz <pamstutz at veritasgenetics.com>
Date:   Tue Oct 23 14:30:39 2018 -0400

    14262: Handle container_request posted as a string parameter
    
    Needs to be parsed as json second time (this is how the Ruby 'arv'
    client submits it, unfortunately.)
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz at veritasgenetics.com>

diff --git a/lib/controller/fed_collections.go b/lib/controller/fed_collections.go
index 62f98367c..70dbdc3f5 100644
--- a/lib/controller/fed_collections.go
+++ b/lib/controller/fed_collections.go
@@ -178,7 +178,7 @@ func (s *searchRemoteClusterForPDH) filterRemoteClusterResponse(resp *http.Respo
 		// Suppress returning unsuccessful result.  Maybe
 		// another request will find it.
 		// TODO collect and return error responses.
-		*s.errors = append(*s.errors, fmt.Sprintf("Response from %q: %v", s.remoteID, resp.Status))
+		*s.errors = append(*s.errors, fmt.Sprintf("Response to %q from %q: %v", httpserver.GetRequestID(resp.Header), s.remoteID, resp.Status))
 		if resp.StatusCode != 404 {
 			// Got a non-404 error response, convert into BadGateway
 			*s.statusCode = http.StatusBadGateway
diff --git a/lib/controller/fed_containers.go b/lib/controller/fed_containers.go
index 32ae25fc4..e8cc739b0 100644
--- a/lib/controller/fed_containers.go
+++ b/lib/controller/fed_containers.go
@@ -33,10 +33,23 @@ func remoteContainerRequestCreate(
 	defer req.Body.Close()
 	var request map[string]interface{}
 	err := json.NewDecoder(req.Body).Decode(&request)
+	if err != nil {
+		return false
+	}
+
+	crString, ok := request["container_request"].(string)
+	if ok {
+		var crJson map[string]interface{}
+		err := json.Unmarshal([]byte(crString), &crJson)
+		if err != nil {
+			return false
+		}
+
+		request["container_request"] = crJson
+	}
 
 	containerRequest, ok := request["container_request"].(map[string]interface{})
 	if !ok {
-		log.Printf("wah wah")
 		return false
 	}
 
diff --git a/sdk/go/httpserver/id_generator.go b/sdk/go/httpserver/id_generator.go
index 6452136d8..6093a8a7b 100644
--- a/sdk/go/httpserver/id_generator.go
+++ b/sdk/go/httpserver/id_generator.go
@@ -53,3 +53,7 @@ func AddRequestIDs(h http.Handler) http.Handler {
 		h.ServeHTTP(w, req)
 	})
 }
+
+func GetRequestID(h http.Header) string {
+	return h.Get("X-Request-Id")
+}

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list