mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Fix runner changes (#135)
* Upgrade iron-io/runner to 165c16a9 * fix support for Stdin to work
This commit is contained in:
committed by
C Cirello
parent
1da3c7c7cf
commit
064d597b60
@@ -29,7 +29,7 @@ type Config struct {
|
|||||||
AppName string
|
AppName string
|
||||||
Memory uint64
|
Memory uint64
|
||||||
Env map[string]string
|
Env map[string]string
|
||||||
Input io.Reader
|
Stdin io.Reader
|
||||||
Stdout io.Writer
|
Stdout io.Writer
|
||||||
Stderr io.Writer
|
Stderr io.Writer
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -33,9 +34,7 @@ func TestRunnerHello(t *testing.T) {
|
|||||||
ID: fmt.Sprintf("hello-%d-%d", i, time.Now().Unix()),
|
ID: fmt.Sprintf("hello-%d-%d", i, time.Now().Unix()),
|
||||||
Image: test.route.Image,
|
Image: test.route.Image,
|
||||||
Timeout: 5 * time.Second,
|
Timeout: 5 * time.Second,
|
||||||
Env: map[string]string{
|
Stdin: strings.NewReader(test.payload),
|
||||||
"PAYLOAD": test.payload,
|
|
||||||
},
|
|
||||||
Stdout: &stdout,
|
Stdout: &stdout,
|
||||||
Stderr: &stderr,
|
Stderr: &stderr,
|
||||||
}
|
}
|
||||||
@@ -82,9 +81,7 @@ func TestRunnerError(t *testing.T) {
|
|||||||
ID: fmt.Sprintf("err-%d-%d", i, time.Now().Unix()),
|
ID: fmt.Sprintf("err-%d-%d", i, time.Now().Unix()),
|
||||||
Image: test.route.Image,
|
Image: test.route.Image,
|
||||||
Timeout: 5 * time.Second,
|
Timeout: 5 * time.Second,
|
||||||
Env: map[string]string{
|
Stdin: strings.NewReader(test.payload),
|
||||||
"PAYLOAD": test.payload,
|
|
||||||
},
|
|
||||||
Stdout: &stdout,
|
Stdout: &stdout,
|
||||||
Stderr: &stderr,
|
Stderr: &stderr,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ func (t *containerTask) EnvVars() map[string]string {
|
|||||||
return t.cfg.Env
|
return t.cfg.Env
|
||||||
}
|
}
|
||||||
func (t *containerTask) Input() io.Reader {
|
func (t *containerTask) Input() io.Reader {
|
||||||
return t.cfg.Input
|
return t.cfg.Stdin
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *containerTask) Labels() map[string]string {
|
func (t *containerTask) Labels() map[string]string {
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ func handleRequest(c *gin.Context, enqueue models.Enqueue) {
|
|||||||
Stderr: stderr,
|
Stderr: stderr,
|
||||||
Env: envVars,
|
Env: envVars,
|
||||||
Memory: el.Memory,
|
Memory: el.Memory,
|
||||||
Input: payload,
|
Stdin: payload,
|
||||||
}
|
}
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
|
|||||||
2
glide.lock
generated
2
glide.lock
generated
@@ -112,7 +112,7 @@ imports:
|
|||||||
subpackages:
|
subpackages:
|
||||||
- registry
|
- registry
|
||||||
- name: github.com/iron-io/runner
|
- name: github.com/iron-io/runner
|
||||||
version: 1e9a5d73469d222c859fbd2c54ac99bc1c07f711
|
version: 165c16a9bec62628dc8a8f17e4cbdc6f30707366
|
||||||
repo: git@github.com:iron-io/runner.git
|
repo: git@github.com:iron-io/runner.git
|
||||||
vcs: git
|
vcs: git
|
||||||
subpackages:
|
subpackages:
|
||||||
|
|||||||
Reference in New Issue
Block a user