yaml中的整数类型转换



下面是我的流量转移istio yaml。如果我在spinnaker中传递参数,我会得到以下错误。我只发送10、20等整数值。

"json:无法将字符串解组为int32类型的Go值">

我可以在yaml中将字符串改为integer吗?

- apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: webvs
namespace: default
spec:
gateways:
- xyz.default.svc.cluster.local
- mesh
hosts:
- web.xyz.com
http:
- route:
- destination:
host: web.default.svc.cluster.local
port:
number: 8080
subset: v1
weight: '${ parameters.Prodweightb }'
- destination:
host: web.default.svc.cluster.local
port:
number: 8080
subset: v2
weight: '${ parameters.Blineweightb }'
- destination:
host: web.default.svc.cluster.local
port:
number: 8080
subset: v3
weight: '${ parameters.Canaryweightb }'

yaml的问题是int参数值周围有单引号。尝试删除它们,例如:

weight: ${ parameters.Canaryweightb }

最新更新