GoogleCloudPlatform / cloud-run-button

Let anyone deploy your GitHub repos to Google Cloud Run with a single click
https://cloud.run
Apache License 2.0
523 stars 91 forks source link

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

Open scosman opened 1 year ago

scosman commented 1 year ago

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

jamesward commented 1 year ago

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

glasnt commented 1 year ago

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

jamesward commented 1 year ago

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": ""
scosman commented 1 year ago

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