cloud-run-button icon indicating copy to clipboard operation
cloud-run-button copied to clipboard

ENV required:false still forcing user to set value in setup console

Open scosman opened this issue 1 year ago • 4 comments

I have an open source project using Cloud Run + app.json to specify env vars.

Even though required=false in app.json, in the console I get the error message Sorry, your reply was invalid: Value is required if I try to skip setting it (via enter). It looks like required=false isn't being respected?

https://github.com/scosman/zipstreamer/tree/docker-docs

scosman avatar Nov 03 '22 20:11 scosman

Can you try to remove the required key? (false is the default) Maybe the parsing of the false value is wrong.

jamesward avatar Nov 03 '22 20:11 jamesward

@jamesward required is true by default according to https://github.com/GoogleCloudPlatform/cloud-run-button/blob/master/cmd/cloudshell_open/appfile.go#L112

glasnt avatar Nov 03 '22 20:11 glasnt

Oh right. I got that backwards. I think that what might be needed to make this work is the default value which could (hopefully) be set to an empty string, like:

"value": ""

jamesward avatar Nov 03 '22 20:11 jamesward

I'm still seeing the issue with "value": "". And not to nit, but an empty string might be handled differently than no value in some apps. An easy way to skip non-required ENV vars would be nice. Thank you!!

Test file: https://github.com/scosman/zipstreamer/blob/cloudrun_fix_required/app.json

CR Link: https://deploy.cloud.run?git_repo=https%3A%2F%2Fgithub.com%2Fscosman%2Fzipstreamer?revision=cloudrun_fix_required

scosman avatar Nov 03 '22 23:11 scosman