Skip to content

Commit d68a34d

Browse files
authored
Record recovery status for individual FileGroup (#222)
Fixes #213
1 parent 15a24b7 commit d68a34d

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

recover.go

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"github.com/appscode/go/log"
55
"github.com/appscode/kutil"
66
"github.com/appscode/stash/client/typed/stash/v1alpha1"
7-
"github.com/appscode/stash/pkg/eventer"
87
"github.com/appscode/stash/pkg/recovery"
98
"github.com/spf13/cobra"
109
"k8s.io/client-go/kubernetes"
@@ -27,14 +26,13 @@ func NewCmdRecover() *cobra.Command {
2726
if err != nil {
2827
log.Fatalln(err)
2928
}
30-
opt := &recovery.RecoveryOpt{
31-
Namespace: kutil.Namespace(),
32-
KubeClient: kubernetes.NewForConfigOrDie(config),
33-
StashClient: v1alpha1.NewForConfigOrDie(config),
34-
RecoveryName: recoveryName,
35-
}
36-
opt.Recorder = eventer.NewEventRecorder(opt.KubeClient, "stash-recovery")
37-
opt.RunRecovery()
29+
c := recovery.New(
30+
kubernetes.NewForConfigOrDie(config),
31+
v1alpha1.NewForConfigOrDie(config),
32+
kutil.Namespace(),
33+
recoveryName,
34+
)
35+
c.Run()
3836
},
3937
}
4038
cmd.Flags().StringVar(&masterURL, "master", masterURL, "The address of the Kubernetes API server (overrides any value in kubeconfig)")

schedule.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func NewCmdSchedule() *cobra.Command {
6969

7070
// split code from here for leader election
7171
switch opt.Workload.Kind {
72-
case api.AppKindDeployment, api.AppKindReplicaSet, api.AppKindReplicationController:
72+
case api.KindDeployment, api.KindReplicaSet, api.KindReplicationController:
7373
ctrl.ElectLeader(stopBackup)
7474
default:
7575
ctrl.SetupAndRun(stopBackup)

0 commit comments

Comments
 (0)