mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
rbd: run schedule during promote operation
Moved to add scheduling to the promote operation as scheduling need to be added when the image is promoted and this is the correct method of adding the scheduling to make the scheduling take place. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
committed by
Madhu Rajanna
parent
7125df23c1
commit
e4e0f397a6
@ -2050,28 +2050,6 @@ func (ri *rbdImage) addSnapshotScheduling(
|
||||
return err
|
||||
}
|
||||
adminConn := ra.MirrorSnashotSchedule()
|
||||
// list all the snapshot scheduling and check at least one image scheduling
|
||||
// exists with specified interval.
|
||||
ssList, err := adminConn.List(ls)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, ss := range ssList {
|
||||
// make sure we are matching image level scheduling. The
|
||||
// `adminConn.List` lists the global level scheduling also.
|
||||
if ss.Name == ri.String() {
|
||||
for _, s := range ss.Schedule {
|
||||
// TODO: Add support to check start time also.
|
||||
// The start time is currently stored with different format
|
||||
// in ceph. Comparison is not possible unless we know in
|
||||
// which format ceph is storing it.
|
||||
if s.Interval == interval {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
err = adminConn.Add(ls, interval, startTime)
|
||||
if err != nil {
|
||||
return err
|
||||
|
Reference in New Issue
Block a user