Integer Type conversion in yaml
up vote
0
down vote
favorite
The below is my istio yaml
for traffic shifting. I am getting the below error if I pass parameter in spinnaker. I am sending only integer values like 10, 20 etc.
"json: cannot unmarshal string into Go value of type int32"
Can I change the string to integer in yaml ?
- 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 }'
types yaml istio spinnaker
add a comment |
up vote
0
down vote
favorite
The below is my istio yaml
for traffic shifting. I am getting the below error if I pass parameter in spinnaker. I am sending only integer values like 10, 20 etc.
"json: cannot unmarshal string into Go value of type int32"
Can I change the string to integer in yaml ?
- 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 }'
types yaml istio spinnaker
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
The below is my istio yaml
for traffic shifting. I am getting the below error if I pass parameter in spinnaker. I am sending only integer values like 10, 20 etc.
"json: cannot unmarshal string into Go value of type int32"
Can I change the string to integer in yaml ?
- 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 }'
types yaml istio spinnaker
The below is my istio yaml
for traffic shifting. I am getting the below error if I pass parameter in spinnaker. I am sending only integer values like 10, 20 etc.
"json: cannot unmarshal string into Go value of type int32"
Can I change the string to integer in yaml ?
- 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 }'
types yaml istio spinnaker
types yaml istio spinnaker
edited Nov 21 at 19:39
Frank B
36017
36017
asked Nov 21 at 14:22
Subit Das
63
63
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
The problem with your yaml is that there are single quotes around the int parameter value. Try to remove them, for example:
weight: ${ parameters.Canaryweightb }
Spinnaker is assigning those single quotes automatically.
– Subit Das
Nov 21 at 17:37
Isn't there a way to tell spinnaker that the value is int (not string) so it doesn't add the quotes?
– Frank B
Nov 21 at 23:04
I could resolve it using the following notation in spinnaker. '${ #toInt( parameters.Prodweightb ) }' '${ #toInt( parameters.Blineweightb ) }' '${ #toInt( parameters.Canaryweightb ) }'
– Subit Das
Nov 22 at 14:45
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
The problem with your yaml is that there are single quotes around the int parameter value. Try to remove them, for example:
weight: ${ parameters.Canaryweightb }
Spinnaker is assigning those single quotes automatically.
– Subit Das
Nov 21 at 17:37
Isn't there a way to tell spinnaker that the value is int (not string) so it doesn't add the quotes?
– Frank B
Nov 21 at 23:04
I could resolve it using the following notation in spinnaker. '${ #toInt( parameters.Prodweightb ) }' '${ #toInt( parameters.Blineweightb ) }' '${ #toInt( parameters.Canaryweightb ) }'
– Subit Das
Nov 22 at 14:45
add a comment |
up vote
0
down vote
The problem with your yaml is that there are single quotes around the int parameter value. Try to remove them, for example:
weight: ${ parameters.Canaryweightb }
Spinnaker is assigning those single quotes automatically.
– Subit Das
Nov 21 at 17:37
Isn't there a way to tell spinnaker that the value is int (not string) so it doesn't add the quotes?
– Frank B
Nov 21 at 23:04
I could resolve it using the following notation in spinnaker. '${ #toInt( parameters.Prodweightb ) }' '${ #toInt( parameters.Blineweightb ) }' '${ #toInt( parameters.Canaryweightb ) }'
– Subit Das
Nov 22 at 14:45
add a comment |
up vote
0
down vote
up vote
0
down vote
The problem with your yaml is that there are single quotes around the int parameter value. Try to remove them, for example:
weight: ${ parameters.Canaryweightb }
The problem with your yaml is that there are single quotes around the int parameter value. Try to remove them, for example:
weight: ${ parameters.Canaryweightb }
answered Nov 21 at 16:52
Frank B
36017
36017
Spinnaker is assigning those single quotes automatically.
– Subit Das
Nov 21 at 17:37
Isn't there a way to tell spinnaker that the value is int (not string) so it doesn't add the quotes?
– Frank B
Nov 21 at 23:04
I could resolve it using the following notation in spinnaker. '${ #toInt( parameters.Prodweightb ) }' '${ #toInt( parameters.Blineweightb ) }' '${ #toInt( parameters.Canaryweightb ) }'
– Subit Das
Nov 22 at 14:45
add a comment |
Spinnaker is assigning those single quotes automatically.
– Subit Das
Nov 21 at 17:37
Isn't there a way to tell spinnaker that the value is int (not string) so it doesn't add the quotes?
– Frank B
Nov 21 at 23:04
I could resolve it using the following notation in spinnaker. '${ #toInt( parameters.Prodweightb ) }' '${ #toInt( parameters.Blineweightb ) }' '${ #toInt( parameters.Canaryweightb ) }'
– Subit Das
Nov 22 at 14:45
Spinnaker is assigning those single quotes automatically.
– Subit Das
Nov 21 at 17:37
Spinnaker is assigning those single quotes automatically.
– Subit Das
Nov 21 at 17:37
Isn't there a way to tell spinnaker that the value is int (not string) so it doesn't add the quotes?
– Frank B
Nov 21 at 23:04
Isn't there a way to tell spinnaker that the value is int (not string) so it doesn't add the quotes?
– Frank B
Nov 21 at 23:04
I could resolve it using the following notation in spinnaker. '${ #toInt( parameters.Prodweightb ) }' '${ #toInt( parameters.Blineweightb ) }' '${ #toInt( parameters.Canaryweightb ) }'
– Subit Das
Nov 22 at 14:45
I could resolve it using the following notation in spinnaker. '${ #toInt( parameters.Prodweightb ) }' '${ #toInt( parameters.Blineweightb ) }' '${ #toInt( parameters.Canaryweightb ) }'
– Subit Das
Nov 22 at 14:45
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53414164%2finteger-type-conversion-in-yaml%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown