Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions coconut/control/control.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ func GetEnvironments(cxt context.Context, rpc *coconut.RpcClient, cmd *cobra.Com

data := make([][]string, 0, 0)
for _, envi := range response.GetEnvironments() {
formatted := formatTimestamp(envi.GetCreatedWhen())
formatted := formatTimestamp(time.Millisecond*time.Duration(envi.GetCreatedWhen()))
data = append(data, []string{envi.GetId(), envi.GetRootRole(), formatted, colorState(envi.GetState())})
}

Expand Down Expand Up @@ -539,7 +539,7 @@ func ShowEnvironment(cxt context.Context, rpc *coconut.RpcClient, cmd *cobra.Com
_, _ = fmt.Fprintf(o, "environment id: %s\n", env.GetId())
_, _ = fmt.Fprintf(o, "workflow template: %s\n", env.GetRootRole())
_, _ = fmt.Fprintf(o, "description: %s\n", env.GetDescription())
_, _ = fmt.Fprintf(o, "created: %s\n", formatTimestamp(env.GetCreatedWhen()))
_, _ = fmt.Fprintf(o, "created: %s\n", formatTimestamp(time.Millisecond*time.Duration(env.GetCreatedWhen())))
_, _ = fmt.Fprintf(o, "state: %s\n", colorState(env.GetState()))
if currentTransition := env.GetCurrentTransition(); len(currentTransition) != 0 {
_, _ = fmt.Fprintf(o, "transition: %s\n", currentTransition)
Expand Down
7 changes: 3 additions & 4 deletions coconut/control/controlutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,9 @@ func drawTableShortTaskInfos(tasks []*pb.ShortTaskInfo, headers []string, linePr
table.Render()
}

func formatTimestamp(int64timestamp int64) string {
timestamp := time.Unix(0, int64timestamp)
formatted := timestamp.Local().Format("2006-01-02 15:04:05 MST")
return formatted
func formatTimestamp(timestamp time.Duration) string {
time := time.Unix(int64(timestamp.Seconds()), 0)
return time.Local().Format("2006-01-02 15:04:05 MST")
}

func formatNumber(numberOfMachines int32) string {
Expand Down