fix tag retention schedule none error (#8715)

Change-Id: I04cad9d4c520db751bfa413bb139317563716501
Signed-off-by: Ziming Zhang <zziming@vmware.com>
This commit is contained in:
Ziming 2019-08-19 12:25:54 +08:00 committed by GitHub
parent 94c930f150
commit 0c79352c9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -92,7 +92,7 @@ func (r *DefaultAPIController) GetRetention(id int64) (*policy.Metadata, error)
func (r *DefaultAPIController) CreateRetention(p *policy.Metadata) (int64, error) {
if p.Trigger.Kind == policy.TriggerKindSchedule {
cron, ok := p.Trigger.Settings[policy.TriggerSettingsCron]
if ok {
if ok && len(cron.(string)) > 0 {
jobid, err := r.scheduler.Schedule(cron.(string), SchedulerCallback, TriggerParam{
PolicyID: p.ID,
Trigger: ExecutionTriggerSchedule,