This document describes the fully automated release pipeline for VirtGitSync operator.
When you push a version tag, three GitHub Actions workflows orchestrate the complete release:
graph TD
A[Push tag v0.2.0] --> B[Release Workflow]
B --> C[Build Container Image]
B --> D[Generate Bundle]
B --> E[Run Tests]
B --> F[Create GitHub Release]
F --> G[Operator Catalog PR Workflow]
G --> H[Fork k8s-operatorhub/community-operators]
G --> I[Fork redhat-openshift-ecosystem/community-operators-prod]
H --> J[Create PR to OperatorHub.io]
I --> K[Create PR to OpenShift Catalog]
J --> L[Review & Merge]
K --> M[Review & Merge]
L --> N[Available on OperatorHub.io]
M --> O[Available in OpenShift Console]
Trigger: Push tag matching v*.*.*
Steps:
-
Build Container Image
- Platform:
linux/amd64 - Tagged:
v0.2.0andlatest - Pushed to:
quay.io/mathianasj/virt-git-sync:v0.2.0
- Platform:
-
Generate Bundle
- Uses versioned image tag
- Sets
imagePullPolicy: IfNotPresent(production default) - Validates bundle with operator-sdk
-
Build and Push Bundle Image
- Image:
quay.io/mathianasj/virt-git-sync-bundle:v0.2.0
- Image:
-
Build and Push Catalog Image
- Image:
quay.io/mathianasj/virt-git-sync-catalog:v0.2.0
- Image:
-
Run Tests and Linting
- Unit tests
- Integration tests
- Go linting
-
Create GitHub Release
- Attaches
install.yaml(CRD + operator deployment) - Attaches CRD files
- Generates release notes from commits
- Attaches
Trigger: Release published OR manual workflow dispatch
Job 1: Submit to OperatorHub.io
- Checkout virt-git-sync repository
- Extract version from tag
- Checkout
k8s-operatorhub/community-operators(to your fork) - Create directory:
operators/virt-git-sync/0.2.0/ - Copy bundle contents (manifests, metadata, tests)
- Create PR with automated description
Job 2: Submit to OpenShift Catalog
- Checkout virt-git-sync repository
- Extract version from tag
- Checkout
redhat-openshift-ecosystem/community-operators-prod(to your fork) - Create directory:
operators/virt-git-sync/0.2.0/ - Copy bundle contents
- Create PR with OpenShift-specific description
-
Create Personal Access Token (PAT):
Settings → Developer settings → Personal access tokens → Tokens (classic)- Scopes:
public_repo,workflow - Name: "OperatorHub Catalog Submissions"
- Save the token securely
- Scopes:
-
Add to GitHub Secrets:
Repository → Settings → Secrets and variables → Actions → New repository secret- Name:
OPERATOR_CATALOG_TOKEN - Value: Your PAT
- Name:
-
Fork Catalog Repositories:
-
Configure Quay.io:
- Repositories must be public
- Robot account for GitHub Actions (optional but recommended)
- Add
QUAY_USERNAMEandQUAY_TOKENto GitHub Secrets
| Secret | Required | Purpose |
|---|---|---|
QUAY_USERNAME |
Yes | Quay.io username for pushing images |
QUAY_TOKEN |
Yes | Quay.io robot account token |
OPERATOR_CATALOG_TOKEN |
Yes | GitHub PAT for creating catalog PRs |
- All tests passing:
make test - Bundle validates:
operator-sdk bundle validate ./bundle - Manual testing completed (see development-workflow.md)
- CHANGELOG updated with release notes
- Version bumped in appropriate files
- CSV icon is custom (not placeholder)
- Documentation up to date
Automated (Recommended):
./release.shThe script will:
- ✅ Validate you're on master branch
- ✅ Check for uncommitted changes
- ✅ Pull latest from origin
- ✅ Prompt for new version
- ✅ Run tests and validate bundle
- ✅ Create and push tag
- ✅ Display next steps and monitoring links
Manual:
# Ensure you're on master with latest changes
git checkout master
git pull origin master
# Create and push tag
git tag v0.2.0
git push origin v0.2.0GitHub Actions automatically:
- Builds images (~5 minutes)
- Creates GitHub release (~1 minute)
- Creates catalog PRs (~2 minutes)
Total automation time: ~8 minutes
-
Release workflow:
-
Catalog PR workflow:
-
Created PRs:
- Check your fork's branches:
add-virt-git-sync-0.2.0 - PRs appear in upstream repos within minutes
- Check your fork's branches:
Once PRs are created:
-
OperatorHub.io (k8s-operatorhub/community-operators):
- Bot assigns reviewers
- CI runs: bundle validation, deployment tests
- Review typically takes 1-3 days
- Merge makes operator available immediately
-
OpenShift (redhat-openshift-ecosystem/community-operators-prod):
- Bot assigns reviewers
- CI runs: OpenShift-specific tests
- Review typically takes 3-7 days
- Merge makes operator available in next OpenShift catalog sync (24-48h)
PR Creation Failed:
- Check
OPERATOR_CATALOG_TOKENis valid - Ensure you forked both catalog repositories
- Verify GitHub Actions permissions
CI Tests Failing:
- Check bundle validation:
operator-sdk bundle validate ./bundle - Ensure images are publicly accessible
- Review CI logs in the PR
Review Blocked:
- Respond to reviewer feedback
- Push fixes to your fork's branch
- CI re-runs automatically
Each release should increment the version following semantic versioning:
- Major (1.0.0): Breaking changes, API incompatibilities
- Minor (0.2.0): New features, backwards compatible
- Patch (0.1.1): Bug fixes, backwards compatible
When bumping version:
-
Makefile:VERSION ?= 0.2.0 -
Create new tag:
git tag v0.2.0
Everything else is automated!
If you prefer manual submission or automation fails:
See OPERATOR_CATALOG_SUBMISSION.md for manual process.
Release workflow builds for:
linux/amd64- Intel/AMD x86_64 (most clusters)linux/arm64- ARM64 (Apple Silicon, ARM servers)
This creates a multi-arch manifest that works on both architectures automatically.
| Tag | Purpose | Updated When |
|---|---|---|
v0.2.0 |
Specific version | On release |
latest |
Latest stable | On every release |
dev |
Development | Manual builds only |
Each release creates a new bundle version in the catalog:
operators/virt-git-sync/
├── 0.1.0/ # First release
│ ├── manifests/
│ ├── metadata/
│ └── tests/
└── 0.2.0/ # Second release
├── manifests/
├── metadata/
└── tests/
OLM automatically handles upgrades between versions.
Once merged to catalogs:
Kubernetes:
- Open https://operatorhub.io/
- Search "VirtGitSync"
- Click "Install"
- Follow instructions
OpenShift:
- Console → Operators → OperatorHub
- Search "VirtGitSync"
- Click "Install"
- Configure namespace and approval strategy
operator-sdk run bundle quay.io/mathianasj/virt-git-sync-bundle:v0.2.0kubectl apply -f https://github.com/mathianasj/virt-git-sync/releases/download/v0.2.0/install.yamlTo rollback to a previous version:
# Delete current subscription
kubectl delete subscription virt-git-sync -n operators
# Install previous version
operator-sdk run bundle quay.io/mathianasj/virt-git-sync-bundle:v0.1.0# Apply previous release
kubectl apply -f https://github.com/mathianasj/virt-git-sync/releases/download/v0.1.0/install.yaml