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: debugHow the rollback step works
When the step runs, Harness executes the following actions in order:
Authenticates with Google Cloud using the connector configured on the infrastructure definition.
Reads Cloud Function Name and Previous Traffic Split from the rollback data saved by the deploy step.
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.
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.
Next steps
Go to Google Cloud Functions step library for the full list of available steps.
Go to Basic to use this step in a managed strategy.
Last updated
Was this helpful?