mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-26 20:26:13 +01:00
Merge pull request #8898 from bitsf/tag_retention_fix
tag retention fix duration and show trigger
This commit is contained in:
commit
fb56951259
@ -184,7 +184,7 @@ func (r *DefaultAPIController) TriggerRetentionExec(policyID int64, trigger stri
|
||||
|
||||
exec := &Execution{
|
||||
PolicyID: policyID,
|
||||
StartTime: time.Now(),
|
||||
StartTime: time.Now().Truncate(time.Second),
|
||||
Trigger: trigger,
|
||||
DryRun: dryRun,
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ func (d *DefaultManager) GetPolicy(id int64) (*policy.Metadata, error) {
|
||||
func (d *DefaultManager) CreateExecution(execution *Execution) (int64, error) {
|
||||
exec := &models.RetentionExecution{}
|
||||
exec.PolicyID = execution.PolicyID
|
||||
exec.StartTime = time.Now()
|
||||
exec.StartTime = execution.StartTime
|
||||
exec.DryRun = execution.DryRun
|
||||
exec.Trigger = execution.Trigger
|
||||
return dao.CreateExecution(exec)
|
||||
@ -160,6 +160,7 @@ func (d *DefaultManager) ListExecutions(policyID int64, query *q.Query) ([]*Exec
|
||||
e1.Status = e.Status
|
||||
e1.StartTime = e.StartTime
|
||||
e1.EndTime = e.EndTime
|
||||
e1.Trigger = e.Trigger
|
||||
e1.DryRun = e.DryRun
|
||||
execs1 = append(execs1, e1)
|
||||
}
|
||||
@ -183,6 +184,7 @@ func (d *DefaultManager) GetExecution(eid int64) (*Execution, error) {
|
||||
e1.Status = e.Status
|
||||
e1.StartTime = e.StartTime
|
||||
e1.EndTime = e.EndTime
|
||||
e1.Trigger = e.Trigger
|
||||
e1.DryRun = e.DryRun
|
||||
return e1, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user