Skip to content

Commit 436d507

Browse files
committed
Update SDK: fix error
Signed-off-by: Takeshi Yoneda <[email protected]>
1 parent b9024b0 commit 436d507

File tree

8 files changed

+24
-14
lines changed

8 files changed

+24
-14
lines changed

data/extension/init/templates/tinygo/envoy.access_loggers/default/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ go 1.15
44

55
require (
66
github.com/stretchr/testify v1.6.1
7-
github.com/tetratelabs/proxy-wasm-go-sdk v0.0.16-0.20210310041209-1980230c2fb8
7+
github.com/tetratelabs/proxy-wasm-go-sdk v0.0.16-0.20210312030126-362d11ef7757
88
)

data/extension/init/templates/tinygo/envoy.access_loggers/default/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
55
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
66
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
77
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
8-
github.com/tetratelabs/proxy-wasm-go-sdk v0.0.16-0.20210310041209-1980230c2fb8 h1:Epa+Lnq1Erqpsv8T9gQBUaIxIhn9iG2Orrqv/UuwrnQ=
9-
github.com/tetratelabs/proxy-wasm-go-sdk v0.0.16-0.20210310041209-1980230c2fb8/go.mod h1:y1ZQT4bQEBnR8Do4nSOzb3roczzPvcAp8UrF6NEYWNY=
8+
github.com/tetratelabs/proxy-wasm-go-sdk v0.0.16-0.20210312030126-362d11ef7757 h1:97z8twAIBLEll7HkPHVaMCLs/+OyzCJyazAFTCiHKhA=
9+
github.com/tetratelabs/proxy-wasm-go-sdk v0.0.16-0.20210312030126-362d11ef7757/go.mod h1:y1ZQT4bQEBnR8Do4nSOzb3roczzPvcAp8UrF6NEYWNY=
1010
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
1111
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
1212
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=

data/extension/init/templates/tinygo/envoy.filters.http/default/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ go 1.15
44

55
require (
66
github.com/stretchr/testify v1.6.1
7-
github.com/tetratelabs/proxy-wasm-go-sdk v0.0.16-0.20210310041209-1980230c2fb8
7+
github.com/tetratelabs/proxy-wasm-go-sdk v0.0.16-0.20210312030126-362d11ef7757
88
)

data/extension/init/templates/tinygo/envoy.filters.http/default/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
55
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
66
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
77
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
8-
github.com/tetratelabs/proxy-wasm-go-sdk v0.0.16-0.20210310041209-1980230c2fb8 h1:Epa+Lnq1Erqpsv8T9gQBUaIxIhn9iG2Orrqv/UuwrnQ=
9-
github.com/tetratelabs/proxy-wasm-go-sdk v0.0.16-0.20210310041209-1980230c2fb8/go.mod h1:y1ZQT4bQEBnR8Do4nSOzb3roczzPvcAp8UrF6NEYWNY=
8+
github.com/tetratelabs/proxy-wasm-go-sdk v0.0.16-0.20210312030126-362d11ef7757 h1:97z8twAIBLEll7HkPHVaMCLs/+OyzCJyazAFTCiHKhA=
9+
github.com/tetratelabs/proxy-wasm-go-sdk v0.0.16-0.20210312030126-362d11ef7757/go.mod h1:y1ZQT4bQEBnR8Do4nSOzb3roczzPvcAp8UrF6NEYWNY=
1010
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
1111
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
1212
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=

data/extension/init/templates/tinygo/envoy.filters.http/default/main_test.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ ENVOY=ISTIO`
2121
defer host.Done()
2222

2323
// Call OnPluginStart -> the metric is initialized.
24-
host.StartPlugin()
24+
status := host.StartPlugin()
25+
// Check the status returned by OnNewConnection is ActionContinue.
26+
require.Equal(t, types.OnPluginStartStatusOK, status)
2527

2628
// Create http context.
2729
contextID := host.InitializeHttpContext()
@@ -31,10 +33,14 @@ ENVOY=ISTIO`
3133
{"key1", "value1"},
3234
{"key2", "value2"},
3335
}
34-
host.CallOnRequestHeaders(contextID, hs, false)
36+
action := host.CallOnRequestHeaders(contextID, hs, false)
37+
// Check the action returned by OnRequestHeaders is Continue.
38+
require.Equal(t, types.ActionContinue, action)
3539

3640
// Call OnHttpResponseHeaders.
37-
host.CallOnResponseHeaders(contextID, nil, false)
41+
action = host.CallOnResponseHeaders(contextID, nil, false)
42+
// Check the action returned by OnResponseHeaders is Continue.
43+
require.Equal(t, types.ActionContinue, action)
3844

3945
// Check Envoy logs.
4046
logs := host.GetLogs(types.LogLevelInfo)

data/extension/init/templates/tinygo/envoy.filters.network/default/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ go 1.15
44

55
require (
66
github.com/stretchr/testify v1.6.1
7-
github.com/tetratelabs/proxy-wasm-go-sdk v0.0.16-0.20210310041209-1980230c2fb8
7+
github.com/tetratelabs/proxy-wasm-go-sdk v0.0.16-0.20210312030126-362d11ef7757
88
)

data/extension/init/templates/tinygo/envoy.filters.network/default/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
55
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
66
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
77
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
8-
github.com/tetratelabs/proxy-wasm-go-sdk v0.0.16-0.20210310041209-1980230c2fb8 h1:Epa+Lnq1Erqpsv8T9gQBUaIxIhn9iG2Orrqv/UuwrnQ=
9-
github.com/tetratelabs/proxy-wasm-go-sdk v0.0.16-0.20210310041209-1980230c2fb8/go.mod h1:y1ZQT4bQEBnR8Do4nSOzb3roczzPvcAp8UrF6NEYWNY=
8+
github.com/tetratelabs/proxy-wasm-go-sdk v0.0.16-0.20210312030126-362d11ef7757 h1:97z8twAIBLEll7HkPHVaMCLs/+OyzCJyazAFTCiHKhA=
9+
github.com/tetratelabs/proxy-wasm-go-sdk v0.0.16-0.20210312030126-362d11ef7757/go.mod h1:y1ZQT4bQEBnR8Do4nSOzb3roczzPvcAp8UrF6NEYWNY=
1010
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
1111
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
1212
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=

data/extension/init/templates/tinygo/envoy.filters.network/default/main_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ func TestNetworkFilter_OnNewConnection(t *testing.T) {
1919
defer host.Done()
2020

2121
// Initialize the plugin and read the config.
22-
host.StartPlugin()
22+
status := host.StartPlugin()
23+
// Check the status returned by OnPluginStart is OK.
24+
require.Equal(t, types.OnPluginStartStatusOK, status)
2325

2426
// OnNewConnection is called.
2527
host.InitializeConnection()
@@ -41,7 +43,9 @@ func TestNetworkFilter_counter(t *testing.T) {
4143
host.StartPlugin()
4244

4345
// Establish the connection.
44-
contextID := host.InitializeConnection()
46+
contextID, action := host.InitializeConnection()
47+
// Check the status returned by OnNewConnection is ActionContinue.
48+
require.Equal(t, types.ActionContinue, action)
4549

4650
// Call OnDone on contextID -> increment the connection counter.
4751
host.CompleteConnection(contextID)

0 commit comments

Comments
 (0)