When testing code that talks to SQL, it's convenient to use different connection strings depending on whether you connect from the cloud (SQL instance) or your dev laptop (localhost). In GAE programs, you can do this:
if os.environ.get('GAE_ENV') == 'standard': # connect with local socket; else you're in your laptop, connect via TCP
Is there a similar variable visible to cloud run jobs?
Thank you!
I found some here. CLOUD_RUN_JOB seems to work. Would appreciate confirmation from a Googler that this is future safe.