Once we get #76 any resource provisioning will have to happen in postcreate because there is no way to propagate the config to the create command or env vars. This means the app is created with missing resources which could cause the app deployment to fail (depending on how the app is built). It's tough to generalize the passing of config from precreate scripts to our cloudshell_open because sometimes an env var is needed, sometimes multiple, and sometimes additional params for gcloud run deploy. So while it'd be really nice to do provisioning in precreate I don't really see a good way to make it work. The only way I can come up with so far is to have precreate optionally write a /tmp/create-$K_SERVICE file that could contain something like:
Once we get #76 any resource provisioning will have to happen in
postcreate
because there is no way to propagate the config to the create command or env vars. This means the app is created with missing resources which could cause the app deployment to fail (depending on how the app is built). It's tough to generalize the passing of config fromprecreate
scripts to ourcloudshell_open
because sometimes an env var is needed, sometimes multiple, and sometimes additional params forgcloud run deploy
. So while it'd be really nice to do provisioning inprecreate
I don't really see a good way to make it work. The only way I can come up with so far is to haveprecreate
optionally write a/tmp/create-$K_SERVICE
file that could contain something like:Then if that file exists our
cloudshell_open
would merge that config with it's own for service creation. But I don't love this approach.This would be an alternative to #74