fjc0k / docker-YApi

接口管理平台 YApi 的 Docker 镜像。
https://hub.docker.com/r/jayfong/yapi/tags
MIT License
1.1k stars 262 forks source link

K8S部署yapi,通过环境变量替换YAPI_PLUGINS报错 #50

Open areswxin opened 4 years ago

areswxin commented 4 years ago

K8S部署yapi,通过环境变量替换YAPI_PLUGINS报错 覆盖其他配置没有问题,YAPI_PLUGINS报错

配置: YAPI_PLUGINS: [{"name":"gitlab","options":{}}]

报错如下: undefined:1 [map[name:gitlab options:map[]]] ^

SyntaxError: Unexpected token m in JSON at position 1 at JSON.parse () at Function.extractConfigFromEnv (/yapi/vendors/start.js:175:40) at Function.extractConfig (/yapi/vendors/start.js:213:44) at new Main (/yapi/vendors/start.js:295:36) at Object. (/yapi/vendors/start.js:370:1) at Module._compile (internal/modules/cjs/loader.js:1133:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10) at Module.load (internal/modules/cjs/loader.js:977:32) at Function.Module._load (internal/modules/cjs/loader.js:877:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)

求大佬看下

fjc0k commented 4 years ago

你试试把 json 用单引号括起来:YAPI_PLUGINS: '[{"name":"gitlab","options":{}}]'