Bumping k8s dependencies to 1.13

This commit is contained in:
Cheng Xing
2018-11-16 14:08:25 -08:00
parent 305407125c
commit b4c0b68ec7
8002 changed files with 884099 additions and 276228 deletions

View File

@@ -30,9 +30,12 @@ import (
"path"
"strings"
"github.com/golang/protobuf/proto"
plugins "github.com/googleapis/gnostic/plugins"
"github.com/googleapis/gnostic/plugins/gnostic-analyze/statistics"
"github.com/golang/protobuf/proto"
openapiv2 "github.com/googleapis/gnostic/OpenAPIv2"
openapiv3 "github.com/googleapis/gnostic/OpenAPIv3"
plugins "github.com/googleapis/gnostic/plugins"
)
// Record an error, then serialize and return a response.
@@ -56,14 +59,24 @@ func main() {
env.RespondAndExitIfError(err)
var stats *statistics.DocumentStatistics
if env.Request.Openapi2 != nil {
// Analyze the API document.
stats = statistics.NewDocumentStatistics(env.Request.SourceName, env.Request.Openapi2)
}
if env.Request.Openapi3 != nil {
// Analyze the API document.
stats = statistics.NewDocumentStatisticsV3(env.Request.SourceName, env.Request.Openapi3)
for _, model := range env.Request.Models {
switch model.TypeUrl {
case "openapi.v2.Document":
documentv2 := &openapiv2.Document{}
err = proto.Unmarshal(model.Value, documentv2)
if err == nil {
// Analyze the API document.
stats = statistics.NewDocumentStatistics(env.Request.SourceName, documentv2)
}
case "openapi.v3.Document":
documentv3 := &openapiv3.Document{}
err = proto.Unmarshal(model.Value, documentv3)
if err == nil {
// Analyze the API document.
stats = statistics.NewDocumentStatisticsV3(env.Request.SourceName, documentv3)
}
}
}
if stats != nil {