Giter Site home page Giter Site logo

grootpiano / easegress Goto Github PK

View Code? Open in Web Editor NEW

This project forked from megaease/easegress

0.0 0.0 1.0 18.08 MB

A Cloud Native traffic orchestration system

Home Page: https://megaease.com/easegress/

License: Apache License 2.0

Makefile 0.17% Go 99.11% Shell 0.69% Dockerfile 0.03% Ruby 0.01%

easegress's People

Contributors

aniaan avatar benja-wu avatar coderabbit214 avatar danfu3000 avatar dependabot[bot] avatar g7tianyi avatar grootpiano avatar haoel avatar hhhcj avatar jack47 avatar jthann avatar jxd134 avatar killua525 avatar landyking avatar lingwei0604 avatar localvar avatar lokiwager avatar loyalsoldier avatar nevill avatar qdongxu avatar samanhappy avatar samutamm avatar sodarycn avatar suchen-sci avatar tg123 avatar xmh19936688 avatar xxx7xxxx avatar zhao-kun avatar zhiyanliu avatar zouyingjie avatar

easegress's Issues

[Bug]: wasm apply data command not worked

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)

    })

}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.