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

Make the container display the value of an env var if present

Open steren opened this issue 4 years ago • 4 comments

Now that Cloud Run supports traffic splits, we often need a demo container ro demo blue/green deployment.

What I usually do is I take a go hello world that display the value of an env var (if present), and I set it to "blue" and "green" in two revisions for my demo.

It could be useful to have this container do the same, so that we don't even need to build one.

One word of the text could change based on this env var for example

steren avatar Apr 07 '20 16:04 steren

If it helps showing blue/green deployments, we actively maintain:

  • gcr.io/google-samples/hello-app:1.0
  • gcr.io/google-samples/hello-app:2.0

which print different version numbers (hence indicating canary rollout).

ahmetb avatar Apr 07 '20 23:04 ahmetb

Good to know.

I still think it would help to show the concept of revision to be able to alter the page with an "quick and outside of the container" change.

No rush, I was just capturing a need I had this morning.

steren avatar Apr 07 '20 23:04 steren

+1 on this request. I demo these things randomly without much prep and I usually just grab the cloud-run-hello container because it's shown in the UI.

marcjoha avatar Dec 02 '20 15:12 marcjoha

PRs welcome, this change should be straightforward (the code already looks for some env vars)

steren avatar Dec 05 '20 20:12 steren