Documentation
¶
Overview ¶
Package drill implements the provider-neutral Goal01 backup/restore drill transaction. Provider and cluster mutations are available only through the content-pinned adapter protocol declared here.
Index ¶
- Constants
- Variables
- func AdapterRequestSHA256(request AdapterRequest) string
- func AdapterResponseSHA256(response AdapterResponse) string
- func AppendJournal(path string, entry JournalEntry) error
- func ApprovalReportSHA256(report ApprovalReport) string
- func ApprovalSHA256(report ApprovalReport) string
- func ApprovalScopeSHA256(plan Plan) string
- func ApprovalTuple(plan Plan, preflightBindingSHA256 string) string
- func CreateJournal(path string, entry JournalEntry) error
- func ExecutionReceiptSHA256(receipt ExecutionReceipt) string
- func JournalEntrySHA256(entry JournalEntry) string
- func PlanSHA256(plan Plan) string
- func PreflightBindingSHA256(plan Plan, responseSHA256, evidenceRef, evidenceSHA256 string) string
- func Rollback(ctx context.Context, plan Plan, approval ApprovalReport, ...) error
- func SystemClock() time.Time
- func ValidateAdapterResponse(request AdapterRequest, response AdapterResponse) error
- func ValidateApproval(plan Plan, approval ApprovalReport, now time.Time) error
- func ValidatePlan(plan Plan) error
- func ValidateReceipt(plan Plan, approval ApprovalReport, receipt ExecutionReceipt, ...) error
- type Adapter
- type AdapterRequest
- type AdapterResponse
- type ApprovalReport
- type Baseline
- type CleanupTarget
- type Clock
- type Evidence
- type ExecutableIdentity
- type ExecutionReceipt
- type IsolatedNamespace
- type JournalEntry
- type ObjectIdentity
- type ObjectStore
- type Plan
- type RestoreObservation
- type StorageLocation
- type TargetResult
Constants ¶
View Source
const ( PlanSchemaVersion = "cloudring.backup-drill.plan/v1" ApprovalSchemaVersion = "cloudring.backup-drill.approval/v1" AdapterRequestVersion = "cloudring.backup-drill.adapter-request/v1" AdapterResponseVersion = "cloudring.backup-drill.adapter-response/v1" JournalEntryVersion = "cloudring.backup-drill.journal-entry/v1" ReceiptSchemaVersion = "cloudring.backup-drill.execution-receipt/v1" AdapterProtocolVersion = "cloudring.backup-drill.adapter/v1" ApprovalTuplePrefix = "goal01-backup-restore" )
Variables ¶
View Source
var ApplySteps = []string{
"approval-consumed", "mutation-started", "etcd-offcell-complete", "velero-backup-complete",
"restore-watch-create-observe-complete", "etcd-sandbox-restored", "restore-validation-complete",
"cleanup-ready", "isolated-targets-deleted", "residual-sweep-1", "residual-sweep-2",
"proof-assembled", "completed",
}
View Source
var TargetKinds = []string{"Etcd", "VirtualMachineClaim", "Volume", "Namespace", "KubernetesClusterClaim"}
Functions ¶
func AdapterRequestSHA256 ¶
func AdapterRequestSHA256(request AdapterRequest) string
func AdapterResponseSHA256 ¶
func AdapterResponseSHA256(response AdapterResponse) string
func AppendJournal ¶
func AppendJournal(path string, entry JournalEntry) error
func ApprovalReportSHA256 ¶
func ApprovalReportSHA256(report ApprovalReport) string
func ApprovalSHA256 ¶
func ApprovalSHA256(report ApprovalReport) string
func ApprovalScopeSHA256 ¶
func ApprovalTuple ¶
func CreateJournal ¶
func CreateJournal(path string, entry JournalEntry) error
func ExecutionReceiptSHA256 ¶
func ExecutionReceiptSHA256(receipt ExecutionReceipt) string
func JournalEntrySHA256 ¶
func JournalEntrySHA256(entry JournalEntry) string
func PlanSHA256 ¶
func PreflightBindingSHA256 ¶
func SystemClock ¶
func ValidateAdapterResponse ¶
func ValidateAdapterResponse(request AdapterRequest, response AdapterResponse) error
func ValidateApproval ¶
func ValidateApproval(plan Plan, approval ApprovalReport, now time.Time) error
func ValidatePlan ¶
func ValidateReceipt ¶
func ValidateReceipt(plan Plan, approval ApprovalReport, receipt ExecutionReceipt, entries []JournalEntry) error
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
func PinAdapter ¶
func (*Adapter) IdentitySHA256 ¶
type AdapterRequest ¶
type AdapterRequest struct {
SchemaVersion string `json:"schemaVersion"`
ProtocolVersion string `json:"protocolVersion"`
OperationID string `json:"operationId"`
PlanSHA256 string `json:"planSha256"`
ApprovalSHA256 string `json:"approvalSha256,omitempty"`
ApprovalScopeSHA256 string `json:"approvalScopeSha256"`
AdapterExecutableSHA256 string `json:"adapterExecutableSha256"`
Mode string `json:"mode"`
Step string `json:"step"`
PreviousJournalSHA256 string `json:"previousJournalSha256,omitempty"`
RequestID string `json:"requestId"`
Plan Plan `json:"plan"`
RetainKinds []string `json:"retainKinds,omitempty"`
CleanupTargets []CleanupTarget `json:"cleanupTargets,omitempty"`
RequestSHA256 string `json:"requestSha256"`
}
type AdapterResponse ¶
type AdapterResponse struct {
SchemaVersion string `json:"schemaVersion"`
ProtocolVersion string `json:"protocolVersion"`
OperationID string `json:"operationId"`
Step string `json:"step"`
RequestSHA256 string `json:"requestSha256"`
AdapterExecutableSHA256 string `json:"adapterExecutableSha256"`
Status string `json:"status"`
Mutated bool `json:"mutated"`
Evidence Evidence `json:"evidence"`
RestoreObservations []RestoreObservation `json:"restoreObservations,omitempty"`
Targets []TargetResult `json:"targets,omitempty"`
IsolationEvidence *Evidence `json:"isolationEvidence,omitempty"`
CleanupEvidence *Evidence `json:"cleanupEvidence,omitempty"`
ObjectLockDeleteDenialReceiptSHA256 string `json:"objectLockDeleteDenialReceiptSha256,omitempty"`
AggregateProofArtifactSHA256 string `json:"aggregateProofArtifactSha256,omitempty"`
AggregateProofPathToken string `json:"aggregateProofPathToken,omitempty"`
ResponseSHA256 string `json:"responseSha256"`
}
type ApprovalReport ¶
type ApprovalReport struct {
SchemaVersion string `json:"schemaVersion"`
OperationID string `json:"operationId"`
PlanSHA256 string `json:"planSha256"`
ApprovalScopeSHA256 string `json:"approvalScopeSha256"`
AdapterExecutableSHA256 string `json:"adapterExecutableSha256"`
IssuedAt string `json:"issuedAt"`
ExpiresAt string `json:"expiresAt"`
ApprovalTuple string `json:"approvalTuple"`
PreflightRequestSHA256 string `json:"preflightRequestSha256"`
PreflightResponseSHA256 string `json:"preflightResponseSha256"`
PreflightEvidenceRef string `json:"preflightEvidenceRef"`
PreflightEvidenceSHA256 string `json:"preflightEvidenceSha256"`
PreflightBindingSHA256 string `json:"preflightBindingSha256"`
ReportSHA256 string `json:"reportSha256"`
}
type CleanupTarget ¶
type ExecutableIdentity ¶
type ExecutionReceipt ¶
type ExecutionReceipt struct {
SchemaVersion string `json:"schemaVersion"`
OperationID string `json:"operationId"`
ProofID string `json:"proofId"`
InstallationID string `json:"installationId"`
PlanSHA256 string `json:"planSha256"`
ApprovalSHA256 string `json:"approvalSha256"`
ApprovalScopeSHA256 string `json:"approvalScopeSha256"`
AdapterExecutableSHA256 string `json:"adapterExecutableSha256"`
Status string `json:"status"`
CompletedAt string `json:"completedAt"`
JournalHeadSHA256 string `json:"journalHeadSha256"`
ExecutionEvidenceResponseSHA256 string `json:"executionEvidenceResponseSha256"`
Targets []TargetResult `json:"targets"`
IsolationEvidence Evidence `json:"isolationEvidence"`
CleanupEvidence Evidence `json:"cleanupEvidence"`
ObjectLockDeleteDenialReceiptSHA256 string `json:"objectLockDeleteDenialReceiptSha256"`
AggregateProofArtifactSHA256 string `json:"aggregateProofArtifactSha256"`
AggregateProofPathToken string `json:"aggregateProofPathToken"`
ReceiptSHA256 string `json:"receiptSha256"`
}
type IsolatedNamespace ¶
type IsolatedNamespace struct {
RestoreIndex int `json:"restoreIndex"`
RestoreName string `json:"restoreName"`
RestoreScopeSHA256 string `json:"restoreScopeSha256"`
SourceNamespace string `json:"sourceNamespace"`
Destination ObjectIdentity `json:"destination"`
}
type JournalEntry ¶
type JournalEntry struct {
SchemaVersion string `json:"schemaVersion"`
Sequence int `json:"sequence"`
OperationID string `json:"operationId"`
PlanSHA256 string `json:"planSha256"`
ApprovalSHA256 string `json:"approvalSha256"`
ApprovalScopeSHA256 string `json:"approvalScopeSha256"`
AdapterExecutableSHA256 string `json:"adapterExecutableSha256"`
Step string `json:"step"`
RequestSHA256 string `json:"requestSha256"`
ResponseSHA256 string `json:"responseSha256"`
Response *AdapterResponse `json:"response,omitempty"`
PreviousEntrySHA256 string `json:"previousEntrySha256,omitempty"`
RecordedAt string `json:"recordedAt"`
EntrySHA256 string `json:"entrySha256"`
}
func LoadJournal ¶
func LoadJournal(path string) ([]JournalEntry, error)
type ObjectIdentity ¶
type ObjectStore ¶
type Plan ¶
type Plan struct {
SchemaVersion string `json:"schemaVersion"`
OperationID string `json:"operationId"`
ProofID string `json:"proofId"`
InstallationID string `json:"installationId"`
AcceptedPublicSHA string `json:"acceptedPublicSha"`
AcceptedDownstreamSHA string `json:"acceptedDownstreamSha"`
ClusterIdentitySHA256 string `json:"clusterIdentitySha256"`
BackupStorageLocation StorageLocation `json:"backupStorageLocation"`
ObjectStore ObjectStore `json:"objectStore"`
SourceBaselines []Baseline `json:"sourceBaselines"`
Tool ExecutableIdentity `json:"tool"`
Adapter ExecutableIdentity `json:"adapter"`
Backup ObjectIdentity `json:"backup"`
Restores []ObjectIdentity `json:"restores"`
IsolatedNamespaces []IsolatedNamespace `json:"isolatedNamespaces"`
EtcdSandbox ObjectIdentity `json:"etcdSandbox"`
CleanupTargets []CleanupTarget `json:"cleanupTargets"`
AggregateProofPathToken string `json:"aggregateProofPathToken"`
IssuedAt string `json:"issuedAt"`
ExpiresAt string `json:"expiresAt"`
RunNonceSHA256 string `json:"runNonceSha256"`
}
type RestoreObservation ¶
type RestoreObservation struct {
RestoreName string `json:"restoreName"`
RestoreScopeSHA256 string `json:"restoreScopeSha256"`
SourceNamespace string `json:"sourceNamespace"`
DestinationNamespace string `json:"destinationNamespace"`
DestinationScopeSHA256 string `json:"destinationScopeSha256"`
EvidenceRef string `json:"evidenceRef"`
EvidenceSHA256 string `json:"evidenceSha256"`
}
type StorageLocation ¶
type StorageLocation struct {
Name string `json:"name"`
UIDSHA256 string `json:"uidSha256"`
// Generation is the value observed when the plan is issued. It is audit
// context, not a universal desired-state fence: some provider CRDs update
// status through the main resource and legitimately advance generation.
// Adapters must bind live continuity with UIDSHA256 plus ConfigSHA256.
Generation int64 `json:"generation"`
ConfigSHA256 string `json:"configSha256"`
}
Click to show internal directories.
Click to hide internal directories.