diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index 32c6a03ac92..da9159de680 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -3069,31 +3069,31 @@ }, { "ImportPath": "k8s.io/kube-openapi/pkg/aggregator", - "Rev": "89ae48fe8691077463af5b7fb3b6f194632c5946" + "Rev": "61b46af70dfed79c6d24530cd23b41440a7f22a5" }, { "ImportPath": "k8s.io/kube-openapi/pkg/builder", - "Rev": "89ae48fe8691077463af5b7fb3b6f194632c5946" + "Rev": "61b46af70dfed79c6d24530cd23b41440a7f22a5" }, { "ImportPath": "k8s.io/kube-openapi/pkg/common", - "Rev": "89ae48fe8691077463af5b7fb3b6f194632c5946" + "Rev": "61b46af70dfed79c6d24530cd23b41440a7f22a5" }, { "ImportPath": "k8s.io/kube-openapi/pkg/generators", - "Rev": "89ae48fe8691077463af5b7fb3b6f194632c5946" + "Rev": "61b46af70dfed79c6d24530cd23b41440a7f22a5" }, { "ImportPath": "k8s.io/kube-openapi/pkg/handler", - "Rev": "89ae48fe8691077463af5b7fb3b6f194632c5946" + "Rev": "61b46af70dfed79c6d24530cd23b41440a7f22a5" }, { "ImportPath": "k8s.io/kube-openapi/pkg/util", - "Rev": "89ae48fe8691077463af5b7fb3b6f194632c5946" + "Rev": "61b46af70dfed79c6d24530cd23b41440a7f22a5" }, { "ImportPath": "k8s.io/kube-openapi/pkg/util/proto", - "Rev": "89ae48fe8691077463af5b7fb3b6f194632c5946" + "Rev": "61b46af70dfed79c6d24530cd23b41440a7f22a5" }, { "ImportPath": "k8s.io/utils/exec", diff --git a/hack/update-bazel.sh b/hack/update-bazel.sh index 91ebb56caba..486cdbc5db8 100755 --- a/hack/update-bazel.sh +++ b/hack/update-bazel.sh @@ -36,7 +36,7 @@ rm -f "${KUBE_ROOT}/pkg/generated/openapi/zz_generated.openapi.go" # The git commit sha1s here should match the values in $KUBE_ROOT/WORKSPACE. kube::util::go_install_from_commit \ github.com/kubernetes/repo-infra/kazel \ - e26fc85d14a1d3dc25569831acc06919673c545a + ae4e9a3906ace4ba657b7a09242610c6266e832c kube::util::go_install_from_commit \ github.com/bazelbuild/rules_go/go/tools/gazelle/gazelle \ c72631a220406c4fae276861ee286aaec82c5af2 diff --git a/staging/src/k8s.io/api/Godeps/Godeps.json b/staging/src/k8s.io/api/Godeps/Godeps.json index a428e12931c..ff3729d7321 100644 --- a/staging/src/k8s.io/api/Godeps/Godeps.json +++ b/staging/src/k8s.io/api/Godeps/Godeps.json @@ -216,7 +216,7 @@ }, { "ImportPath": "k8s.io/kube-openapi/pkg/common", - "Rev": "89ae48fe8691077463af5b7fb3b6f194632c5946" + "Rev": "61b46af70dfed79c6d24530cd23b41440a7f22a5" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/resource", diff --git a/staging/src/k8s.io/apiextensions-apiserver/Godeps/Godeps.json b/staging/src/k8s.io/apiextensions-apiserver/Godeps/Godeps.json index a167e4f92e7..a7d7125fc5a 100644 --- a/staging/src/k8s.io/apiextensions-apiserver/Godeps/Godeps.json +++ b/staging/src/k8s.io/apiextensions-apiserver/Godeps/Godeps.json @@ -1548,19 +1548,19 @@ }, { "ImportPath": "k8s.io/kube-openapi/pkg/builder", - "Rev": "89ae48fe8691077463af5b7fb3b6f194632c5946" + "Rev": "61b46af70dfed79c6d24530cd23b41440a7f22a5" }, { "ImportPath": "k8s.io/kube-openapi/pkg/common", - "Rev": "89ae48fe8691077463af5b7fb3b6f194632c5946" + "Rev": "61b46af70dfed79c6d24530cd23b41440a7f22a5" }, { "ImportPath": "k8s.io/kube-openapi/pkg/handler", - "Rev": "89ae48fe8691077463af5b7fb3b6f194632c5946" + "Rev": "61b46af70dfed79c6d24530cd23b41440a7f22a5" }, { "ImportPath": "k8s.io/kube-openapi/pkg/util", - "Rev": "89ae48fe8691077463af5b7fb3b6f194632c5946" + "Rev": "61b46af70dfed79c6d24530cd23b41440a7f22a5" }, { "ImportPath": "k8s.io/apimachinery/pkg/api/equality", diff --git a/staging/src/k8s.io/apimachinery/Godeps/Godeps.json b/staging/src/k8s.io/apimachinery/Godeps/Godeps.json index d51013e02ec..550188e95e0 100644 --- a/staging/src/k8s.io/apimachinery/Godeps/Godeps.json +++ b/staging/src/k8s.io/apimachinery/Godeps/Godeps.json @@ -216,7 +216,7 @@ }, { "ImportPath": "k8s.io/kube-openapi/pkg/common", - "Rev": "89ae48fe8691077463af5b7fb3b6f194632c5946" + "Rev": "61b46af70dfed79c6d24530cd23b41440a7f22a5" } ] } diff --git a/staging/src/k8s.io/apiserver/Godeps/Godeps.json b/staging/src/k8s.io/apiserver/Godeps/Godeps.json index 821f9482d2c..83a4569c5c3 100644 --- a/staging/src/k8s.io/apiserver/Godeps/Godeps.json +++ b/staging/src/k8s.io/apiserver/Godeps/Godeps.json @@ -1608,19 +1608,19 @@ }, { "ImportPath": "k8s.io/kube-openapi/pkg/builder", - "Rev": "89ae48fe8691077463af5b7fb3b6f194632c5946" + "Rev": "61b46af70dfed79c6d24530cd23b41440a7f22a5" }, { "ImportPath": "k8s.io/kube-openapi/pkg/common", - "Rev": "89ae48fe8691077463af5b7fb3b6f194632c5946" + "Rev": "61b46af70dfed79c6d24530cd23b41440a7f22a5" }, { "ImportPath": "k8s.io/kube-openapi/pkg/handler", - "Rev": "89ae48fe8691077463af5b7fb3b6f194632c5946" + "Rev": "61b46af70dfed79c6d24530cd23b41440a7f22a5" }, { "ImportPath": "k8s.io/kube-openapi/pkg/util", - "Rev": "89ae48fe8691077463af5b7fb3b6f194632c5946" + "Rev": "61b46af70dfed79c6d24530cd23b41440a7f22a5" }, { "ImportPath": "k8s.io/client-go/discovery", diff --git a/staging/src/k8s.io/client-go/Godeps/Godeps.json b/staging/src/k8s.io/client-go/Godeps/Godeps.json index 7ca2e273ef5..ffbdd3b1689 100644 --- a/staging/src/k8s.io/client-go/Godeps/Godeps.json +++ b/staging/src/k8s.io/client-go/Godeps/Godeps.json @@ -692,7 +692,7 @@ }, { "ImportPath": "k8s.io/kube-openapi/pkg/common", - "Rev": "89ae48fe8691077463af5b7fb3b6f194632c5946" + "Rev": "61b46af70dfed79c6d24530cd23b41440a7f22a5" } ] } diff --git a/staging/src/k8s.io/code-generator/Godeps/Godeps.json b/staging/src/k8s.io/code-generator/Godeps/Godeps.json index dc8730e7399..3aab9de2044 100644 --- a/staging/src/k8s.io/code-generator/Godeps/Godeps.json +++ b/staging/src/k8s.io/code-generator/Godeps/Godeps.json @@ -252,11 +252,11 @@ }, { "ImportPath": "k8s.io/kube-openapi/pkg/common", - "Rev": "89ae48fe8691077463af5b7fb3b6f194632c5946" + "Rev": "61b46af70dfed79c6d24530cd23b41440a7f22a5" }, { "ImportPath": "k8s.io/kube-openapi/pkg/generators", - "Rev": "89ae48fe8691077463af5b7fb3b6f194632c5946" + "Rev": "61b46af70dfed79c6d24530cd23b41440a7f22a5" } ] } diff --git a/staging/src/k8s.io/kube-aggregator/Godeps/Godeps.json b/staging/src/k8s.io/kube-aggregator/Godeps/Godeps.json index f5c48a4b925..5166f2208c9 100644 --- a/staging/src/k8s.io/kube-aggregator/Godeps/Godeps.json +++ b/staging/src/k8s.io/kube-aggregator/Godeps/Godeps.json @@ -1536,23 +1536,23 @@ }, { "ImportPath": "k8s.io/kube-openapi/pkg/aggregator", - "Rev": "89ae48fe8691077463af5b7fb3b6f194632c5946" + "Rev": "61b46af70dfed79c6d24530cd23b41440a7f22a5" }, { "ImportPath": "k8s.io/kube-openapi/pkg/builder", - "Rev": "89ae48fe8691077463af5b7fb3b6f194632c5946" + "Rev": "61b46af70dfed79c6d24530cd23b41440a7f22a5" }, { "ImportPath": "k8s.io/kube-openapi/pkg/common", - "Rev": "89ae48fe8691077463af5b7fb3b6f194632c5946" + "Rev": "61b46af70dfed79c6d24530cd23b41440a7f22a5" }, { "ImportPath": "k8s.io/kube-openapi/pkg/handler", - "Rev": "89ae48fe8691077463af5b7fb3b6f194632c5946" + "Rev": "61b46af70dfed79c6d24530cd23b41440a7f22a5" }, { "ImportPath": "k8s.io/kube-openapi/pkg/util", - "Rev": "89ae48fe8691077463af5b7fb3b6f194632c5946" + "Rev": "61b46af70dfed79c6d24530cd23b41440a7f22a5" } ] } diff --git a/staging/src/k8s.io/metrics/Godeps/Godeps.json b/staging/src/k8s.io/metrics/Godeps/Godeps.json index d990b7b94f2..a9bc3f71d48 100644 --- a/staging/src/k8s.io/metrics/Godeps/Godeps.json +++ b/staging/src/k8s.io/metrics/Godeps/Godeps.json @@ -520,7 +520,7 @@ }, { "ImportPath": "k8s.io/kube-openapi/pkg/common", - "Rev": "89ae48fe8691077463af5b7fb3b6f194632c5946" + "Rev": "61b46af70dfed79c6d24530cd23b41440a7f22a5" } ] } diff --git a/staging/src/k8s.io/sample-apiserver/Godeps/Godeps.json b/staging/src/k8s.io/sample-apiserver/Godeps/Godeps.json index 29654d5c359..dd01da6b284 100644 --- a/staging/src/k8s.io/sample-apiserver/Godeps/Godeps.json +++ b/staging/src/k8s.io/sample-apiserver/Godeps/Godeps.json @@ -1524,19 +1524,19 @@ }, { "ImportPath": "k8s.io/kube-openapi/pkg/builder", - "Rev": "89ae48fe8691077463af5b7fb3b6f194632c5946" + "Rev": "61b46af70dfed79c6d24530cd23b41440a7f22a5" }, { "ImportPath": "k8s.io/kube-openapi/pkg/common", - "Rev": "89ae48fe8691077463af5b7fb3b6f194632c5946" + "Rev": "61b46af70dfed79c6d24530cd23b41440a7f22a5" }, { "ImportPath": "k8s.io/kube-openapi/pkg/handler", - "Rev": "89ae48fe8691077463af5b7fb3b6f194632c5946" + "Rev": "61b46af70dfed79c6d24530cd23b41440a7f22a5" }, { "ImportPath": "k8s.io/kube-openapi/pkg/util", - "Rev": "89ae48fe8691077463af5b7fb3b6f194632c5946" + "Rev": "61b46af70dfed79c6d24530cd23b41440a7f22a5" } ] } diff --git a/staging/src/k8s.io/sample-controller/Godeps/Godeps.json b/staging/src/k8s.io/sample-controller/Godeps/Godeps.json index aeb4e335bb8..72401457d9b 100644 --- a/staging/src/k8s.io/sample-controller/Godeps/Godeps.json +++ b/staging/src/k8s.io/sample-controller/Godeps/Godeps.json @@ -940,7 +940,7 @@ }, { "ImportPath": "k8s.io/kube-openapi/pkg/common", - "Rev": "89ae48fe8691077463af5b7fb3b6f194632c5946" + "Rev": "61b46af70dfed79c6d24530cd23b41440a7f22a5" } ] } diff --git a/vendor/k8s.io/kube-openapi/pkg/generators/openapi.go b/vendor/k8s.io/kube-openapi/pkg/generators/openapi.go index c9f05fd29bf..5efb3f45c6f 100644 --- a/vendor/k8s.io/kube-openapi/pkg/generators/openapi.go +++ b/vendor/k8s.io/kube-openapi/pkg/generators/openapi.go @@ -118,17 +118,32 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat `)...) - if err := context.AddDir(arguments.OutputPackagePath); err != nil { + outputPath := arguments.OutputPackagePath + + if err := context.AddDir(outputPath); err != nil { glog.Fatalf("Failed to load output package: %v", err) } - pkg := context.Universe[arguments.OutputPackagePath] + + // Compute the canonical output path to allow retrieval of the + // package for a vendored output path. + const vendorPath = "/vendor/" + canonicalOutputPath := outputPath + if strings.Contains(outputPath, vendorPath) { + canonicalOutputPath = outputPath[strings.Index(outputPath, vendorPath)+len(vendorPath):] + } + + // The package for outputPath is mapped to the canonical path + pkg := context.Universe[canonicalOutputPath] if pkg == nil { glog.Fatalf("Got nil output package: %v", err) } return generator.Packages{ &generator.DefaultPackage{ PackageName: strings.Split(filepath.Base(pkg.Path), ".")[0], - PackagePath: pkg.Path, + // Use the supplied output path rather than the canonical + // one to allow generation into the path of a + // vendored package. + PackagePath: outputPath, HeaderText: header, GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { return []generator.Generator{NewOpenAPIGen(arguments.OutputFileBaseName, pkg, context)}