@@ -9,24 +9,26 @@ import (
9
9
"github.com/labstack/echo/v4"
10
10
configv1alpha1 "github.com/padok-team/burrito/api/v1alpha1"
11
11
"github.com/padok-team/burrito/internal/annotations"
12
+ "github.com/padok-team/burrito/internal/server/utils"
12
13
log "github.com/sirupsen/logrus"
13
14
)
14
15
15
16
type layer struct {
16
- UID string `json:"uid"`
17
- Name string `json:"name"`
18
- Namespace string `json:"namespace"`
19
- Repository string `json:"repository"`
20
- Branch string `json:"branch"`
21
- Path string `json:"path"`
22
- State string `json:"state"`
23
- RunCount int `json:"runCount"`
24
- LastRun Run `json:"lastRun"`
25
- LastRunAt string `json:"lastRunAt"`
26
- LastResult string `json:"lastResult"`
27
- IsRunning bool `json:"isRunning"`
28
- IsPR bool `json:"isPR"`
29
- LatestRuns []Run `json:"latestRuns"`
17
+ UID string `json:"uid"`
18
+ Name string `json:"name"`
19
+ Namespace string `json:"namespace"`
20
+ Repository string `json:"repository"`
21
+ Branch string `json:"branch"`
22
+ Path string `json:"path"`
23
+ State string `json:"state"`
24
+ RunCount int `json:"runCount"`
25
+ LastRun Run `json:"lastRun"`
26
+ LastRunAt string `json:"lastRunAt"`
27
+ LastResult string `json:"lastResult"`
28
+ IsRunning bool `json:"isRunning"`
29
+ IsPR bool `json:"isPR"`
30
+ LatestRuns []Run `json:"latestRuns"`
31
+ ManualSyncStatus utils.ManualSyncStatus `json:"manualSyncStatus"`
30
32
}
31
33
32
34
type Run struct {
@@ -83,20 +85,21 @@ func (a *API) LayersHandler(c echo.Context) error {
83
85
running = runStillRunning (run )
84
86
}
85
87
results = append (results , layer {
86
- UID : string (l .UID ),
87
- Name : l .Name ,
88
- Namespace : l .Namespace ,
89
- Repository : fmt .Sprintf ("%s/%s" , l .Spec .Repository .Namespace , l .Spec .Repository .Name ),
90
- Branch : l .Spec .Branch ,
91
- Path : l .Spec .Path ,
92
- State : a .getLayerState (l ),
93
- RunCount : len (l .Status .LatestRuns ),
94
- LastRun : runAPI ,
95
- LastRunAt : l .Status .LastRun .Date .Format (time .RFC3339 ),
96
- LastResult : l .Status .LastResult ,
97
- IsRunning : running ,
98
- IsPR : a .isLayerPR (l ),
99
- LatestRuns : transformLatestRuns (l .Status .LatestRuns ),
88
+ UID : string (l .UID ),
89
+ Name : l .Name ,
90
+ Namespace : l .Namespace ,
91
+ Repository : fmt .Sprintf ("%s/%s" , l .Spec .Repository .Namespace , l .Spec .Repository .Name ),
92
+ Branch : l .Spec .Branch ,
93
+ Path : l .Spec .Path ,
94
+ State : a .getLayerState (l ),
95
+ RunCount : len (l .Status .LatestRuns ),
96
+ LastRun : runAPI ,
97
+ LastRunAt : l .Status .LastRun .Date .Format (time .RFC3339 ),
98
+ LastResult : l .Status .LastResult ,
99
+ IsRunning : running ,
100
+ IsPR : a .isLayerPR (l ),
101
+ LatestRuns : transformLatestRuns (l .Status .LatestRuns ),
102
+ ManualSyncStatus : utils .GetManualSyncStatus (l ),
100
103
})
101
104
}
102
105
return c .JSON (http .StatusOK , & layersResponse {
0 commit comments