How openshift/hypershift-oadp-plugin works
HyperShift OADP Plugin is a Velero/OADP plugin for backing up and restoring Hosted Control Planes. Velero dispatches backup and restore item actions; the backup action validates and annotates HCP resources and can coordinate an etcd snapshot, while restore updates resources and signs snapshot URLs when needed. The README documents AWS, Azure, Agent/BareMetal, KubeVirt, and OpenStack support. Edges follow the sampled source, SOURCE INDEX references, and README; unsampled platform-specific behavior is not expanded into inferred call flows.
Main entry points: restore.go Restore action · backup.go Backup action · validation Action validation · main.go Plugin server
Components 16
Plugin runtime
- Plugin server
main.go
HCP lifecycle
- Backup action
pkg/core/backup.go - Restore action
pkg/core/restore.go - Action validation
pkg/core/validation - Shared types
pkg/core/types/types.go - Kubernetes utilities
pkg/common - Agent migration
pkg/platform/agent/agent.go - Platform support
pkg/core/validation
Etcd snapshots
- Etcd backup orchestration
pkg/etcdbackup/orchestrator.go
Cloud signing
- S3 URL signing
pkg/s3presign/presign.go - AWS STS credentials
pkg/s3presign/sts.go - Azure Blob SAS
pkg/azblobsas/sas.go - Azure delegation
pkg/azblobsas/delegation.go
Other components
- Velero
- Kubernetes API
- Backup object storage
Connections 19
- Velero → Plugin server: starts plugin
README.md - Plugin server → Backup action: registers action
main.go - Plugin server → Restore action: registers action
main.go - Backup action → Action validation: validates backup
pkg/core/backup.go - Restore action → Action validation: validates restore
pkg/core/restore.go - Action validation → Shared types: uses options
pkg/core/validation/backup.go - Backup action → Shared types: uses options
pkg/core/backup.go - Restore action → Shared types: uses options
pkg/core/restore.go - Backup action → Kubernetes utilities: uses utilities
pkg/core/backup.go - Restore action → Kubernetes utilities: uses utilities
pkg/core/restore.go - Backup action → Agent migration: runs migration tasks
pkg/core/backup.go - Backup action → Etcd backup orchestration: creates and awaits snapshot
pkg/core/backup.go - Etcd backup orchestration → Kubernetes API: reads and writes resources
pkg/etcdbackup/orchestrator.go - Etcd backup orchestration → Backup object storage: maps storage location
pkg/etcdbackup/orchestrator.go - Restore action → S3 URL signing: presigns snapshot URL
pkg/core/restore.go - Restore action → AWS STS credentials: resolves AWS credentials
pkg/core/restore.go - Restore action → Azure delegation: gets delegation key
pkg/core/restore.go - Restore action → Azure Blob SAS: signs blob URL
- Action validation → Platform support: checks platform type
pkg/core/validation/backup.go