Преглед изворни кода

Adding builder version

Signed-off-by: Krystian Wojcicki <kwojcicki@sympatico.ca>
Krystian Wojcicki пре 6 година
родитељ
комит
f821f002e5
3 измењених фајлова са 5 додато и 1 уклоњено
  1. 2 0
      api/server/router/system/system_routes.go
  2. 1 0
      api/types/types.go
  3. 2 1
      integration/system/info_test.go

+ 2 - 0
api/server/router/system/system_routes.go

@@ -44,6 +44,8 @@ func (s *systemRouter) getInfo(ctx context.Context, w http.ResponseWriter, r *ht
 		info.Swarm = s.cluster.Info()
 	}
 
+	info.Builder = build.BuilderVersion(*s.features)
+
 	if versions.LessThan(httputils.VersionFromContext(ctx), "1.25") {
 		// TODO: handle this conversion in engine-api
 		type oldInfo struct {

+ 1 - 0
api/types/types.go

@@ -146,6 +146,7 @@ type Commit struct {
 // GET "/info"
 type Info struct {
 	ID                 string
+	Builder            BuilderVersion
 	Containers         int
 	ContainersRunning  int
 	ContainersPaused   int

+ 2 - 1
integration/system/info_test.go

@@ -35,7 +35,8 @@ func TestInfoAPI(t *testing.T) {
 		"KernelVersion",
 		"Driver",
 		"ServerVersion",
-		"SecurityOptions"}
+		"SecurityOptions",
+		"Builder"}
 
 	out := fmt.Sprintf("%+v", info)
 	for _, linePrefix := range stringsToCheck {