From 9deb4f53db6d5764b5d4530b6f74355b21054505 Mon Sep 17 00:00:00 2001 From: Ta-Ching Chen Date: Wed, 7 Feb 2018 21:44:12 +0800 Subject: [PATCH] Fix binary environment build failure due to package not found (#487) Subpackage k8s.io/client-go/pkg/api/v1 is no longer exist in HEAD. (https://github.com/kubernetes-incubator/external-storage/issues/324) For now, just duplicate the FunctionLoadRequest struct like what go environment did. --- environments/binary/server.go | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/environments/binary/server.go b/environments/binary/server.go index 2d22c2d2..28ae70fa 100644 --- a/environments/binary/server.go +++ b/environments/binary/server.go @@ -11,8 +11,6 @@ import ( "os/exec" "path/filepath" "strings" - - "github.com/fission/fission" ) const ( @@ -22,10 +20,29 @@ const ( var specialized bool -type BinaryServer struct { - fetchedCodePath string - internalCodePath string -} +type ( + BinaryServer struct { + fetchedCodePath string + internalCodePath string + } + + FunctionLoadRequest struct { + // FilePath is an absolute filesystem path to the + // function. What exactly is stored here is + // env-specific. Optional. + FilePath string `json:"filepath"` + + // FunctionName has an environment-specific meaning; + // usually, it defines a function within a module + // containing multiple functions. Optional; default is + // environment-specific. + FunctionName string `json:"functionName"` + + // URL to expose this function at. Optional; defaults + // to "/". + URL string `json:"url"` + } +) func (bs *BinaryServer) SpecializeHandler(w http.ResponseWriter, r *http.Request) { if specialized { @@ -34,7 +51,7 @@ func (bs *BinaryServer) SpecializeHandler(w http.ResponseWriter, r *http.Request return } - request := fission.FunctionLoadRequest{} + request := FunctionLoadRequest{} codePath := bs.fetchedCodePath err := json.NewDecoder(r.Body).Decode(&request)