Dynamic Container Image Override

This feature allows administrators to dynamically switch the Docker container images used by sfops workflows without re-syncing the sfops-gh-actions repository.

Use Cases

  • Testing new sfp versions: Test RC or development images before rolling them out

  • Emergency rollback: Quickly revert to a previous container version if issues arise

  • Hotfix deployment: Switch to a patched image immediately across all workflows

How It Works

After syncing, sfops workflows use a pattern that checks for override variables:

container: ${{ vars.SFOPS_DOCKER_IMAGE_OVERRIDE || 'ghcr.io/your-org/sfops:latest' }}
  • No override variable set: Uses the default image (hardcoded during sync)

  • Override variable set: Uses the override image immediately

Configuration

Override Variables

Set these variables in your sfops-gh-actions repository (not the project repository):

Variable
Purpose

SFOPS_DOCKER_IMAGE_OVERRIDE

Override for the full sfops image

SFOPS_LITE_DOCKER_IMAGE_OVERRIDE

Override for the sfops-lite image

Setting Up an Override

  1. Navigate to your sfops-gh-actions repository

  2. Go to SettingsSecrets and variablesActionsVariables tab

  3. Click New repository variable

  4. Add the variable name and the full image path as the value

Example:

Removing an Override

To revert to the default image, simply delete the override variable from the repository settings. All workflows will immediately use the hardcoded default from the last sync.

Examples

Testing a Release Candidate

Emergency Rollback

Testing Both Image Variants

You can override one or both images independently:

Important Notes

Organization-wide Effect: When you set an override, it affects all workflows using that image across all projects that call the reusable workflows. This is by design for administrative control.

No Re-sync Required: Changes to override variables take effect immediately on the next workflow run. You don't need to re-sync or redeploy anything.

Comparison: Override vs Re-sync

Aspect
Override Variable
Re-sync

Speed

Immediate

Requires sync workflow run

Scope

All workflows

All workflows

Persistence

Until variable deleted

Permanent until next sync

Audit trail

Variable history

Git commit history

Best for

Testing, rollback

Production releases

Troubleshooting

Override Not Taking Effect

  1. Verify the variable is set in sfops-gh-actions repository (not project repo)

  2. Ensure the variable name is exactly SFOPS_DOCKER_IMAGE_OVERRIDE (case-sensitive)

  3. Check that the image path is valid and accessible

  4. Trigger a new workflow run (existing runs use the image at start time)

Image Pull Errors

If workflows fail with image pull errors after setting an override:

  1. Verify the image exists in your container registry

  2. Check that the image tag is correct

  3. Ensure GitHub Actions has permission to pull from that registry

Last updated