Skip to content

Commit

Permalink
Merge pull request #608 from k82cn/cli_enhance
Browse files Browse the repository at this point in the history
Enahcement cli.
  • Loading branch information
volcano-sh-bot authored Dec 15, 2019
2 parents 3907b30 + 93364de commit c064572
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/cli/job/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ func ListJobs() error {
func PrintJobs(jobs *v1alpha1.JobList, writer io.Writer) {
maxLenInfo := getMaxLen(jobs)

titleFormat := "%%-%ds%%-25s%%-12s%%-12s%%-12s%%-6s%%-10s%%-10s%%-12s%%-10s%%-12s%%-10s\n"
contentFormat := "%%-%ds%%-25s%%-12s%%-12s%%-12d%%-6d%%-10d%%-10d%%-12d%%-10d%%-12d%%-10d\n"
titleFormat := "%%-%ds%%-15s%%-12s%%-12s%%-12s%%-6s%%-10s%%-10s%%-12s%%-10s%%-12s%%-10s\n"
contentFormat := "%%-%ds%%-15s%%-12s%%-12s%%-12d%%-6d%%-10d%%-10d%%-12d%%-10d%%-12d%%-10d\n"

var err error
if listJobFlags.allNamespace {
Expand Down Expand Up @@ -148,11 +148,11 @@ func PrintJobs(jobs *v1alpha1.JobList, writer io.Writer) {

if listJobFlags.allNamespace {
_, err = fmt.Fprintf(writer, fmt.Sprintf("%%-%ds"+contentFormat, maxLenInfo[1], maxLenInfo[0]),
job.Namespace, job.Name, job.CreationTimestamp.Format("2006-01-02 15:04:05"), job.Status.State.Phase, jobType, replicas,
job.Namespace, job.Name, job.CreationTimestamp.Format("2006-01-02"), job.Status.State.Phase, jobType, replicas,
job.Status.MinAvailable, job.Status.Pending, job.Status.Running, job.Status.Succeeded, job.Status.Failed, job.Status.Unknown, job.Status.RetryCount)
} else {
_, err = fmt.Fprintf(writer, fmt.Sprintf(contentFormat, maxLenInfo[0]),
job.Name, job.CreationTimestamp.Format("2006-01-02 15:04:05"), job.Status.State.Phase, jobType, replicas,
job.Name, job.CreationTimestamp.Format("2006-01-02"), job.Status.State.Phase, jobType, replicas,
job.Status.MinAvailable, job.Status.Pending, job.Status.Running, job.Status.Succeeded, job.Status.Failed, job.Status.Unknown, job.Status.RetryCount)
}
if err != nil {
Expand Down

0 comments on commit c064572

Please sign in to comment.