Skip to content

Commit bf6f771

Browse files
author
Gal Topper
authored
Update versions (#637)
* Update dependencies * Update dependencies * tsdb bump * Support pairs in V3IO_SESSION + override with V3IO_API and V3IO_ACCESS_KEY
1 parent 2710587 commit bf6f771

File tree

15 files changed

+190
-73
lines changed

15 files changed

+190
-73
lines changed

backends/csv/backend_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ such restriction.
2121
package csv
2222

2323
import (
24-
"io/ioutil"
24+
"os"
2525
"path"
2626
"testing"
2727

@@ -163,7 +163,7 @@ func loadTempCSV(t *testing.T, req *frames.ReadRequest) []frames.Frame {
163163
}
164164

165165
func tmpCSV() (string, error) {
166-
tmp, err := ioutil.TempFile("", "csv-test")
166+
tmp, err := os.CreateTemp("", "csv-test")
167167
if err != nil {
168168
return "", err
169169
}

client.go

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,36 @@ func SessionFromEnv() (*pb.Session, error) {
5353
return session, nil
5454
}
5555

56+
// Support var1=val1,var2=val2,... format
57+
data = strings.TrimSpace(data)
58+
if !strings.HasPrefix(data, "{") {
59+
parts := strings.Split(data, ",")
60+
newData := map[string]string{}
61+
for _, part := range parts {
62+
pair := strings.SplitN(part, "=", 2)
63+
if len(pair) != 2 {
64+
return nil, errors.Errorf("%s was not recognized as either a JSON dictionary or comma-separated value pairs", envKey)
65+
}
66+
newData[pair[0]] = pair[1]
67+
}
68+
bytes, err := json.Marshal(newData)
69+
data = string(bytes)
70+
if err != nil {
71+
return nil, err
72+
}
73+
}
74+
5675
dec := json.NewDecoder(strings.NewReader(data))
5776
if err := dec.Decode(session); err != nil {
5877
return nil, errors.Wrapf(err, "can't read JSON from %s environment", envKey)
5978
}
6079

80+
if session.Url == "" {
81+
session.Url = os.Getenv("V3IO_API")
82+
}
83+
if session.Token == "" {
84+
session.Token = os.Getenv("V3IO_ACCESS_KEY")
85+
}
86+
6187
return session, nil
6288
}

cmd/framesd/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# (don't forget to update the -p accordingly)
2020

2121

22-
FROM golang:1.14-stretch as build
22+
FROM golang:1.19-stretch as build
2323

2424
WORKDIR /frames
2525
COPY . .

cmd/framesd/framesd.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ package main
2323
import (
2424
"flag"
2525
"fmt"
26-
"io/ioutil"
2726
"log"
2827
"net/http"
2928
_ "net/http/pprof"
@@ -63,7 +62,7 @@ func main() {
6362
log.Fatal("error: no config file given")
6463
}
6564

66-
data, err := ioutil.ReadFile(config.file)
65+
data, err := os.ReadFile(config.file)
6766
if err != nil {
6867
log.Fatalf("error: can't read config - %s", err)
6968
}

cmd/framulate/framulate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import (
3030
)
3131

3232
func run(configContents string, configPath string) error {
33-
loggerInstance, err := nucliozap.NewNuclioZapCmd("framulate", nucliozap.DebugLevel)
33+
loggerInstance, err := nucliozap.NewNuclioZapCmd("framulate", nucliozap.DebugLevel, os.Stdout)
3434
if err != nil {
3535
return errors.Wrap(err, "Failed to create logger")
3636
}

doc.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ under the Apache 2.0 license is conditioned upon your compliance with
1818
such restriction.
1919
*/
2020

21-
/*Package frames provides an efficient way of moving data from various sources.
21+
/*
22+
Package frames provides an efficient way of moving data from various sources.
2223
2324
The package is composed os a HTTP web server that can serve data from various
2425
sources and from clients in Go and in Python.

framulate/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ such restriction.
2020
package framulate
2121

2222
import (
23-
"io/ioutil"
23+
"os"
2424
"time"
2525

2626
"github.com/ghodss/yaml"
@@ -77,7 +77,7 @@ func NewConfigFromContentsOrPath(configContents []byte, configPath string) (*Con
7777
return nil, errors.New("Config contents or path must be specified")
7878
}
7979

80-
configContents, err = ioutil.ReadFile(configPath)
80+
configContents, err = os.ReadFile(configPath)
8181
if err != nil {
8282
return nil, errors.Wrapf(err, "Failed to config file at %s", configPath)
8383
}

go.mod

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,48 @@
11
module github.com/v3io/frames
22

3-
go 1.14
3+
go 1.19
44

55
require (
66
github.com/ghodss/yaml v1.0.0
77
github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9
88
github.com/golang/protobuf v1.2.0
9-
github.com/nuclio/errors v0.0.1
9+
github.com/nuclio/errors v0.0.4
1010
github.com/nuclio/logger v0.0.1
11-
github.com/nuclio/zap v0.0.2
11+
github.com/nuclio/zap v0.1.2
1212
github.com/pkg/errors v0.8.1
13-
github.com/stretchr/testify v1.4.0
14-
github.com/v3io/v3io-go v0.2.5-0.20210113095419-6c806b8d5186
15-
github.com/v3io/v3io-tsdb v0.13.1
16-
github.com/valyala/fasthttp v1.2.0
13+
github.com/stretchr/testify v1.8.1
14+
github.com/v3io/v3io-go v0.3.0
15+
github.com/v3io/v3io-tsdb v0.14.1
16+
github.com/valyala/fasthttp v1.44.0
1717
github.com/xwb1989/sqlparser v0.0.0-20180606152119-120387863bf2
18-
golang.org/x/net v0.0.0-20190311183353-d8887717615a
18+
golang.org/x/net v0.5.0
19+
golang.org/x/text v0.6.0
1920
google.golang.org/grpc v1.20.0
2021
)
2122

23+
require (
24+
github.com/andybalholm/brotli v1.0.4 // indirect
25+
github.com/cespare/xxhash v1.1.0 // indirect
26+
github.com/davecgh/go-spew v1.1.1 // indirect
27+
github.com/imdario/mergo v0.3.7 // indirect
28+
github.com/klauspost/compress v1.15.9 // indirect
29+
github.com/liranbg/uberzap v1.20.0-nuclio.1 // indirect
30+
github.com/logrusorgru/aurora/v3 v3.0.0 // indirect
31+
github.com/pmezard/go-difflib v1.0.0 // indirect
32+
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a // indirect
33+
github.com/valyala/bytebufferpool v1.0.0 // indirect
34+
go.uber.org/atomic v1.7.0 // indirect
35+
go.uber.org/multierr v1.6.0 // indirect
36+
golang.org/x/sync v0.1.0 // indirect
37+
golang.org/x/sys v0.4.0 // indirect
38+
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 // indirect
39+
gopkg.in/yaml.v2 v2.2.8 // indirect
40+
gopkg.in/yaml.v3 v3.0.1 // indirect
41+
zombiezen.com/go/capnproto2 v2.17.0+incompatible // indirect
42+
)
43+
2244
replace (
2345
github.com/v3io/frames => ./
24-
github.com/v3io/v3io-go => github.com/v3io/v3io-go v0.2.5-0.20210113095419-6c806b8d5186
46+
github.com/v3io/v3io-go => github.com/v3io/v3io-go v0.3.0
2547
github.com/xwb1989/sqlparser => github.com/v3io/sqlparser v0.0.0-20190306105200-4d7273501871
2648
)

0 commit comments

Comments
 (0)