File tree Expand file tree Collapse file tree 3 files changed +22
-9
lines changed Expand file tree Collapse file tree 3 files changed +22
-9
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,13 @@ func init() {
90
90
ValueProcessor : addArg ("remote-allow-origins" , "--remote-allow-origins=*" ),
91
91
},
92
92
"browserVersion" : {
93
+ ValueProcessor : func (value interface {}) interface {} {
94
+ // debug browser images tags should be like 125.0-debug
95
+ if v , ok := value .(string ); ok {
96
+ return strings .TrimSuffix (v , "-debug" )
97
+ }
98
+ return value
99
+ },
93
100
DeleteCapabilityProcessor : func (value interface {}) bool {
94
101
if version , ok := value .(string ); ok {
95
102
version = strings .ToLower (version )
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ package handlers
2
2
3
3
import (
4
4
"net/http"
5
- "strings"
6
5
"time"
7
6
8
7
"github.com/gin-gonic/gin"
@@ -42,10 +41,6 @@ func GetImages(c *gin.Context) {
42
41
43
42
imagesDataResponse := make ([]imageDataModel , 0 , len (images ))
44
43
for _ , image := range images {
45
- if strings .Contains (image .Tag , "-debug" ) {
46
- continue
47
- }
48
-
49
44
imgData := imageDataModel {
50
45
Name : image .BrowserName ,
51
46
Version : image .Tag ,
Original file line number Diff line number Diff line change 1
1
package handlers
2
2
3
3
import (
4
+ "encoding/json"
4
5
"fmt"
5
6
"net/http"
6
7
"os"
7
8
"runtime"
9
+ "strings"
8
10
"time"
9
11
10
12
log "github.com/sirupsen/logrus"
@@ -58,12 +60,21 @@ func ListDrivers(c *gin.Context) {
58
60
return
59
61
}
60
62
61
- _ , err = c .Writer .Write (resBody )
62
- if err != nil {
63
- c .Status (http .StatusInternalServerError )
64
- log .WithError (err ).Error ("Failed to write body server" )
63
+ originalImages := make ([]imageDataModel , 0 )
64
+ if err := json .Unmarshal (resBody , & originalImages ); err != nil {
65
+ log .WithError (err ).Error ("Failed to unmarshal list of the images from task-definitions server" )
65
66
return
66
67
}
68
+
69
+ filteredImages := make ([]imageDataModel , 0 )
70
+ for _ , image := range originalImages {
71
+ // -debug images should not be added to the reporting, it should be available silently
72
+ if strings .Contains (image .Version , "-debug" ) {
73
+ continue
74
+ }
75
+ filteredImages = append (filteredImages , image )
76
+ }
77
+ c .JSON (http .StatusOK , filteredImages )
67
78
}
68
79
69
80
func Welcome (c * gin.Context ) {
You can’t perform that action at this time.
0 commit comments