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

feat: use metadata package

Open JulienBreux opened this issue 1 year ago • 3 comments

Description

Use of the metadata package to show users how to properly obtain the metadata of an instance in Cloud Run.

Note

Removal of the region part in favor of the zone part. The region part is no longer part of the metadata package and API.

JulienBreux avatar Jul 12 '24 12:07 JulienBreux

cc @steren @grayside

JulienBreux avatar Jul 12 '24 12:07 JulienBreux

The original idea of this demo container was "no dependencies", and we preferred 20 lines to call metadata server that importing a package for that.

That being said, we then added some packages for cloudevents, so I'm fine with this change.

steren avatar Jul 12 '24 16:07 steren

Also note that Cloud Run metadata server now returns the region directly (``/computeMetadata/v1/instance/region`, but I am not totally sure this is supported on GCE.

steren avatar Jul 12 '24 16:07 steren