mirror of https://github.com/k3s-io/k3s
Merge pull request #54600 from marun/enable-federation-vendoring
Automatic merge from submit-queue (batch tested with PRs 54081, 54271, 51783, 54600, 54594). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Update to latest kube-openapi and kazel - update vendored kube-openapi to include https://github.com/kubernetes/kube-openapi/pull/14 - update hash of repo infra used for bazel generation so kazel includes https://github.com/kubernetes/repo-infra/pull/48 This is the final step in enabling federation to generate openapi code for itself and vendored kube (#54335). /sig multicluster testingpull/6/head
commit
3f5f9c3df9
|
@ -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",
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -216,7 +216,7 @@
|
|||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/kube-openapi/pkg/common",
|
||||
"Rev": "89ae48fe8691077463af5b7fb3b6f194632c5946"
|
||||
"Rev": "61b46af70dfed79c6d24530cd23b41440a7f22a5"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery/pkg/api/resource",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -216,7 +216,7 @@
|
|||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/kube-openapi/pkg/common",
|
||||
"Rev": "89ae48fe8691077463af5b7fb3b6f194632c5946"
|
||||
"Rev": "61b46af70dfed79c6d24530cd23b41440a7f22a5"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -692,7 +692,7 @@
|
|||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/kube-openapi/pkg/common",
|
||||
"Rev": "89ae48fe8691077463af5b7fb3b6f194632c5946"
|
||||
"Rev": "61b46af70dfed79c6d24530cd23b41440a7f22a5"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -520,7 +520,7 @@
|
|||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/kube-openapi/pkg/common",
|
||||
"Rev": "89ae48fe8691077463af5b7fb3b6f194632c5946"
|
||||
"Rev": "61b46af70dfed79c6d24530cd23b41440a7f22a5"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -940,7 +940,7 @@
|
|||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/kube-openapi/pkg/common",
|
||||
"Rev": "89ae48fe8691077463af5b7fb3b6f194632c5946"
|
||||
"Rev": "61b46af70dfed79c6d24530cd23b41440a7f22a5"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -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)}
|
||||
|
|
Loading…
Reference in New Issue