Skip to content

Commit c71a2e5

Browse files
chore(API): bump api version and change log output (#96)
1 parent 4d98271 commit c71a2e5

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

apps/apps.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ func Logs(c *deis.Client, appID string, lines int) (string, error) {
107107
}
108108

109109
// We need to trim a few characters off the front and end of the string
110-
return string(body[2 : len(body)-1]), reqErr
110+
return string(body), reqErr
111111
}
112112

113113
// Run a one-time command in your app. This will start a kubernetes job with the

apps/apps_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,14 @@ func (f *fakeHTTPServer) ServeHTTP(res http.ResponseWriter, req *http.Request) {
9797
// The entire log message is prefixed and suffixed with a few characters (not entirely sure why)
9898
// We mimic those here
9999
if req.URL.Path == "/v2/apps/example-go/logs" && req.URL.RawQuery == "" && req.Method == "GET" {
100-
res.Write([]byte("b'\"test foo bar\"'"))
100+
res.Write([]byte(`test\nfoo\nbar`))
101101
return
102102
}
103103

104104
// The entire log message is prefixed and suffixed with a few characters (not entirely sure why)
105105
// We mimic those here
106106
if req.URL.Path == "/v2/apps/example-go/logs" && req.URL.RawQuery == "log_lines=1" && req.Method == "GET" {
107-
res.Write([]byte("b'\"test\"'"))
107+
res.Write([]byte("test"))
108108
return
109109
}
110110

@@ -307,11 +307,11 @@ func TestAppsLogs(t *testing.T) {
307307
tests := []testExpected{
308308
{
309309
Input: -1,
310-
Expected: "\"test foo bar\"",
310+
Expected: `test\nfoo\nbar`,
311311
},
312312
{
313313
Input: 1,
314-
Expected: "\"test\"",
314+
Expected: "test",
315315
},
316316
}
317317

deis.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ type Client struct {
9797
// controller is unsafe.
9898
//
9999
// If the SDK detects an API version mismatch, it will return ErrAPIMismatch.
100-
const APIVersion = "2.2"
100+
const APIVersion = "2.3"
101101

102102
var (
103103
// ErrAPIMismatch occurs when the sdk is using a different api version than the deis.

0 commit comments

Comments
 (0)