Skip to content

Commit

Permalink
feat: restore tenant from backup, activate or replay
Browse files Browse the repository at this point in the history
  • Loading branch information
powerfooI committed Sep 25, 2023
1 parent 5534d68 commit 19d4648
Show file tree
Hide file tree
Showing 20 changed files with 783 additions and 182 deletions.
18 changes: 17 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -205,4 +205,20 @@ commit-hook: $(GOLANGCI_LINT) ## Install commit hook.
touch .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
echo "#!/bin/sh" > .git/hooks/pre-commit
echo "make lint" >> .git/hooks/pre-commit
echo "make lint" >> .git/hooks/pre-commit

.PHONY: connect
connect:
ifdef TENANT
mysq -h$(shell kubectl get pods -o jsonpath='{.items[0].status.podIP}') -P2881 -A -uroot@${TENANT}
else
mysql -h$(shell kubectl get pods -o jsonpath='{.items[0].status.podIP}') -P2881 -A -uroot -p
endif

.PHONY: connectob
connectob:
ifdef TENANT
mysq -h$(shell kubectl get pods -o jsonpath='{.items[0].status.podIP}') -P2881 -A -uroot@${TENANT} -Doceanbase
else
mysql -h$(shell kubectl get pods -o jsonpath='{.items[0].status.podIP}') -P2881 -A -uroot -p -Doceanbase
endif
5 changes: 5 additions & 0 deletions api/v1alpha1/obtenantrestore_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ func (in *OBTenantRestoreStatus) DeepCopyInto(out *OBTenantRestoreStatus) {

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
//+kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.status`
//+kubebuilder:printcolumn:name="TargetTenant",type=string,JSONPath=`.spec.targetTenant`
//+kubebuilder:printcolumn:name="TargetCluster",type=string,JSONPath=`.spec.targetCluster`
//+kubebuilder:printcolumn:name="RestoreRole",type=string,JSONPath=`.spec.restoreRole`
//+kubebuilder:printcolumn:name="StatusInDB",type=string,JSONPath=`.status.restoreProgress.status`

// OBTenantRestore is the Schema for the obtenantrestores API
// An instance of OBTenantRestore stands for a tenant restore job
Expand Down
18 changes: 17 additions & 1 deletion config/crd/bases/oceanbase.oceanbase.com_obtenantrestores.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,23 @@ spec:
singular: obtenantrestore
scope: Namespaced
versions:
- name: v1alpha1
- additionalPrinterColumns:
- jsonPath: .status.status
name: Status
type: string
- jsonPath: .spec.targetTenant
name: TargetTenant
type: string
- jsonPath: .spec.targetCluster
name: TargetCluster
type: string
- jsonPath: .spec.restoreRole
name: RestoreRole
type: string
- jsonPath: .status.restoreProgress.status
name: StatusInDB
type: string
name: v1alpha1
schema:
openAPIV3Schema:
description: OBTenantRestore is the Schema for the obtenantrestores API An
Expand Down
1 change: 1 addition & 0 deletions config/default/manager_auth_proxy_patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,4 @@ spec:
- "--health-probe-bind-address=:8081"
- "--metrics-bind-address=127.0.0.1:8080"
- "--leader-elect"
- "--manager-namespace=oceanbase-system"
2 changes: 1 addition & 1 deletion config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ kind: Kustomization
images:
- name: controller
newName: oceanbasedev/ob-operator
newTag: 2.0.0-alpha.8
newTag: 2.0.0
Loading

0 comments on commit 19d4648

Please sign in to comment.