From 3a6ddb2740e8c584376ba63f3ba5cdb533cc4d3f Mon Sep 17 00:00:00 2001 From: Seth Vargo Date: Thu, 28 Mar 2024 12:03:33 -0400 Subject: [PATCH] Document how set traffic to the latest revision (#498) Closes https://github.com/google-github-actions/deploy-cloudrun/issues/466 --- README.md | 7 +++++++ action.yml | 16 +++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6cf4efe..5211e57 100644 --- a/README.md +++ b/README.md @@ -215,6 +215,13 @@ jobs: revision_traffic: 'my-revision=10' # percentage ``` + To update traffic to the latest revision, use the special tag "LATEST": + + ```yaml + with: + revision_traffic: 'LATEST=100' + ``` + - `tag_traffic`: (Optional, mutually-exclusive with `revision_traffic`) Comma-separated list of tag traffic assignments. diff --git a/action.yml b/action.yml index a963f7b..809a052 100644 --- a/action.yml +++ b/action.yml @@ -123,16 +123,22 @@ inputs: revision_traffic: description: |- - Comma separated list of traffic assignments in the form REVISION-NAME=PERCENTAGE. - REVISION-NAME must be the name for a revision for the service as returned - by 'gcloud beta run list revisions'. PERCENTAGE must be an integer - percentage between 0 and 100 inclusive. - Ex service-nw9hs=10,service-nw9hs=20 Up to 100 percent of traffic may be + Comma separated list of traffic assignments in the form + REVISION-NAME=PERCENTAGE. REVISION-NAME must be the name for a revision + for the service as returned by 'gcloud beta run list revisions'. + PERCENTAGE must be an integer percentage between 0 and 100 inclusive. Ex + service-nw9hs=10,service-nw9hs=20 Up to 100 percent of traffic may be assigned. If 100 percent of traffic is assigned, the Service traffic is updated as specified. If under 100 percent of traffic is assigned, the Service traffic is updated as specified for revisions with assignments and traffic is scaled up or down down proportionally as needed for revision that are currently serving traffic but that do not have new assignments. + For example assume revision-1 is serving 40 percent of traffic and + revision-2 is serving 60 percent. If revision-1 is assigned 45 percent of + traffic and no assignment is made for revision-2, the service is updated + with revsion-1 assigned 45 percent of traffic and revision-2 scaled down + to 55 percent. You can use "LATEST" as a special revision name to always + put the given percentage of traffic on the latest ready revision required: false tag_traffic: