Skip to content

values 传yaml文本 invalid character 'x' after object key:value pair" #64

@lic0914

Description

@lic0914

版本最新的
传值的 values 如下
获取方式

values="`curl -s -X GET $url --header 'Content-Type: application/json' | jq ".data"`"
env:\n  ASPNETCORE_ENVIRONMENT: Staging\n  PayOrderAppSetting__RunEnvironment: Test\nglobal:\n  cattle:\n    clusterId: c-9lmh5\n    clusterName: k8s-online\n    rkePathPrefix: \"\"\n    rkeWindowsPathPrefix: \"\"\n    systemDefaultRegistry: \"\"\n    url: https://rancher.xxxx.com\n  systemDefaultRegistry: \"\"\nimage:\n  pullPolicy: Always\n  tag: final-0.0.2\ningress:\n  hosts:\n  - host: www.xxx.cn\n    paths:\n    - path: /gateway/xxx\n      pathType: ImplementationSpecific\nreplicaCount: 1\n

更新

res=`curl -s  -X PUT $url     --header 'Content-Type: application/json'     -d "{ \"set\": [\"image.tag=$version\"],  \"repo\": \"$Chart_Repo\",  \"values\": \"$values\"  }"`
echo "response : $res"
code=`echo $res | jq ".code"`
exit $code

在更新时会出现

{"code":1,"error":"invalid character 'e' after object key:value pair"}

在 Postman 中执行 正常

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions