grootpiano / easegress Goto Github PK
View Code? Open in Web Editor NEWThis project forked from megaease/easegress
A Cloud Native traffic orchestration system
Home Page: https://megaease.com/easegress/
License: Apache License 2.0
This project forked from megaease/easegress
A Cloud Native traffic orchestration system
Home Page: https://megaease.com/easegress/
License: Apache License 2.0
Describe the bug
Hi guys, I found two kind of issues when walking through our Flash Sale demo.
Issue 1: Parameters' type error in section 6.1 example spec
According to WasmHost filter's spec declaration, parameters' value type should be string
:
type Spec struct {
Parameters map[string]string `json:"parameters" jsonschema:"omitempty"`
}
But the example in section 6.1 6.1 Parameters used a number value:
filters:
- name: wasm
kind: WasmHost
parameters: # +
startTime: "2021-08-08T00:00:00+00:00" # +
blockRatio: 0.4 # +
maxPermission: 3 # +
So egctl
client returned error:
Error: 400: {"generalErrs":["*pipeline.Spec: filters: json: cannot unmarshal number into Go struct field Spec.parameters of type string"]}
Issue 2: Wasm apply-data
command not worked
When executing the command blow, I got this error:
$ echo '
id/user4: "true"
id/user5: "true"' | egctl wasm apply-data flash-sale-pipeline wasm
Error: name is empty:
id/user4: "true"
id/user5: "true"
I found that we used SpecVisitor to get spec doc:
Run: func(cmd *cobra.Command, args []string) {
visitor := buildSpecVisitor(specFile, cmd)
}
But SpecVisitor
did not allow empty name:
func (v *specVisitor) Visit(fn func(*spec) error) error {
err := v.v.Visit(func(yamlDoc []byte) error {
if s.Name == "" {
return fmt.Errorf("name is empty: %s", doc)
}
})
}
And another issue I found in the same command is that we used createObject handler to hanle apply data request instead of wasmApplyData handler:
Run: func(cmd *cobra.Command, args []string) {
visitor.Visit(func(s *spec) error {
handleRequest(http.MethodPost, makeURL(objectsURL), []byte(s.doc), cmd)
})
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.