cf-resource icon indicating copy to clipboard operation
cf-resource copied to clipboard

Error setting integer-based env vars of a cf resource

Open Spimtav opened this issue 6 years ago • 2 comments

My partner (@athornton2012) and i ran into an interesting bug today when we

Version of concourse: 5.0.0

Background: Our team has a job which puts to a cf resource, and sets a number of env variables as it does so. We added a new env var this afternoon, which was a plain integer that represented the port of a server.

Expected: The resource upload to succeed without issue.

Actual: Received the following error message: error reading request from stdin: json: cannot unmarshal number into Go struct field Params.environment_variables of type string

As a workaround, we had to manually put the int in quotes for it to be interpolated as a string. When we did that, the error stopped and we were able to upload to the resource again

Our question is: is this intended behavior? Is the cf resource unable to process environment variables that are integers? Or is this a bug?

Thank you!

Spimtav avatar Feb 26 '19 21:02 Spimtav

Same issue here, on wings.

pdelagrave avatar Feb 28 '19 13:02 pdelagrave

I had the same issue. Looks like this resource just accepts string arguments, in my case it was rejecting integers and boolean types too. Surround the values with quotes resolve the problem but that may led to some unexpected effects

skypeter1 avatar Jul 31 '19 13:07 skypeter1