Skip to content

Commit

Permalink
fix(sctool): tasks cmd to render schedule with deprecated interval co…
Browse files Browse the repository at this point in the history
…rrectly
  • Loading branch information
karol-kokoszka committed May 9, 2024
1 parent 17e0698 commit 769fc4f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/managerclient/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -514,8 +514,14 @@ func (li TaskListItems) Render(w io.Writer) error {
id = "*" + id
}

emptySpec := scheduler.CronSpecification{}
bytesEmptySpec, err := json.Marshal(emptySpec)
if err != nil {
return errors.New("cannot marshall empty cron specification object")
}

var schedule string
if t.Schedule.Cron != "" {
if t.Schedule.Cron != "" && t.Schedule.Cron != string(bytesEmptySpec) {
var cronSpec scheduler.CronSpecification
err := json.Unmarshal([]byte(t.Schedule.Cron), &cronSpec)
if err != nil {
Expand Down

0 comments on commit 769fc4f

Please sign in to comment.