I have found the solution, the google cloud run is in beta so the commands using to deploy may change in future.
What I did is updated the gcloud
gcloud components update
then after the update they introduced an additional parameter to specify platform.
The updated CLI code is
gcloud beta run deploy --platform managed --image gcr.io/cloud-run-test/image-name
--allow-unauthenticated --update-env-vars environment="PRODUCTION"
You can specify platform as managed or gke
Available platforms:
- gke: Cloud Run on Google Kubernetes Engine. Use with the
--cluster and --cluster-location flags or set the [run/cluster] and [run/cluster_location] properties to specify a cluster in a given zone.
- managed: Fully managed version of Cloud Run. Use with the
--region flag or set the [run/region] property to specify a Cloud Run region.