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.
This commit is contained in:
Ta-Ching Chen
2018-02-07 21:44:12 +08:00
committed by GitHub
parent 3c513c7f61
commit 9deb4f53db
+24 -7
View File
@@ -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)