Add requested labels to cli

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
Gabriel Adrian Samfira 2023-06-29 06:49:37 +00:00
parent 774b790cca
commit 45dceae88c

View file

@ -16,6 +16,7 @@ package cmd
import (
"fmt"
"strings"
"github.com/cloudbase/garm/params"
"github.com/google/uuid"
@ -54,7 +55,7 @@ var jobsListCmd = &cobra.Command{
func formatJobs(jobs []params.Job) {
t := table.NewWriter()
header := table.Row{"ID", "Name", "Status", "Conclusion", "Runner Name", "Repository", "Locked by"}
header := table.Row{"ID", "Name", "Status", "Conclusion", "Runner Name", "Repository", "Requested Labels", "Locked by"}
t.AppendHeader(header)
for _, job := range jobs {
@ -63,7 +64,7 @@ func formatJobs(jobs []params.Job) {
if job.LockedBy != uuid.Nil {
lockedBy = job.LockedBy.String()
}
t.AppendRow(table.Row{job.ID, job.Name, job.Status, job.Conclusion, job.RunnerName, repo, lockedBy})
t.AppendRow(table.Row{job.ID, job.Name, job.Status, job.Conclusion, job.RunnerName, repo, strings.Join(job.Labels, " "), lockedBy})
t.AppendSeparator()
}
fmt.Println(t.Render())