1
1
package koyeb
2
2
3
3
import (
4
+ "fmt"
4
5
"strings"
5
6
6
7
"github.com/koyeb/koyeb-api-client-go/api/v1/koyeb"
@@ -54,7 +55,7 @@ func (r *GetDeploymentReply) Fields() []map[string]string {
54
55
"id" : renderer .FormatDeploymentID (r .mapper , item .GetId (), r .full ),
55
56
"service" : renderer .FormatServiceSlug (r .mapper , item .GetServiceId (), r .full ),
56
57
"status" : formatDeploymentStatus (item .GetStatus ()),
57
- "messages" : formatDeploymentMessages (item .GetMessages ()),
58
+ "messages" : formatDeploymentMessages (item .GetMessages (), 0 ),
58
59
"regions" : renderRegions (item .Definition .Regions ),
59
60
"created_at" : renderer .FormatTime (item .GetCreatedAt ()),
60
61
}
@@ -67,8 +68,12 @@ func formatDeploymentStatus(ds koyeb.DeploymentStatus) string {
67
68
return string (ds )
68
69
}
69
70
70
- func formatDeploymentMessages (messages []string ) string {
71
- return strings .Join (messages , " " )
71
+ func formatDeploymentMessages (messages []string , max int ) string {
72
+ concat := strings .Join (messages , " " )
73
+ if max == 0 || len (concat ) < max {
74
+ return concat
75
+ }
76
+ return fmt .Sprint (concat [:max ], "..." )
72
77
}
73
78
74
79
func renderRegions (regions * []string ) string {
0 commit comments