Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Google Cloud Functions Rollback

Restore a Google Cloud Function's previous serving traffic split on rollback.

The rollback step restores the previous serving traffic split on a Google Cloud Function's backing Cloud Run service. It reads rollback data saved by the deploy step, so it must run in the stage's rollback steps, after a deploy step has run in the same stage.


Rollback YAML

Minimal form:

- name: Google Cloud Function Rollback
  id: googleCloudFunctionRollbackStep
  template:
    uses: googleCloudFunctionRollbackStep
    with:
      function_name: ${{rollback.data.FUNCTION_NAME}}
      active_cloud_run_revisions: ${{rollback.data.ACTIVE_CLOUD_RUN_REVISIONS}}

With explicit overrides:

- name: Google Cloud Function Rollback
  id: googleCloudFunctionRollbackStep
  template:
    uses: googleCloudFunctionRollbackStep
    with:
      function_name: ${{rollback.data.FUNCTION_NAME}}
      active_cloud_run_revisions: ${{rollback.data.ACTIVE_CLOUD_RUN_REVISIONS}}
      command_timeout: 15m
      log_level: debug

How the rollback step works

When the step runs, Harness executes the following actions in order:

  1. Authenticates with Google Cloud using the connector configured on the infrastructure definition.

  2. Reads Cloud Function Name and Previous Traffic Split from the rollback data saved by the deploy step.

  3. For subsequent deployments, restores the previous serving traffic split on the backing Cloud Run service.


Rollback fields

The following fields configure which function the rollback step restores traffic for.

Field
Default
Description

Cloud Function Manifest Path

${{runtime.manifestPath}}

The rendered Cloud Function manifest path, used to identify the function configuration during rollback.

Cloud Function Name

${{rollback.data.FUNCTION_NAME}}

The function to roll back. Auto-resolved from the deploy step's rollback data.

Previous Traffic Split

${{rollback.data.ACTIVE_CLOUD_RUN_REVISIONS}}

The revision and traffic percentage that were active before the deployment. Auto-resolved from the deploy step's rollback data.

GCP Connector

—

The Google Cloud connector used to authenticate and roll back. Required.

GCP Region

${{infra.region}}

The Google Cloud region of the function. Auto-resolved from the infrastructure definition.

GCP Project

${{infra.project}}

The Google Cloud project of the function. Auto-resolved from the infrastructure definition.

Command Timeout

10m

Maximum time for the step to complete.

Log Level

info

Log verbosity for the step execution.

Advanced section

The step template also has a collapsible Advanced section for additional overrides not covered above.


Next steps

Last updated

Was this helpful?