mirror of https://github.com/k3s-io/k3s
Use new codegen config options in kazel and fix boilerplate check for generated bzl
parent
5d743157b6
commit
4503d573d3
|
@ -6,5 +6,9 @@
|
||||||
"^third_party/etcd.*"
|
"^third_party/etcd.*"
|
||||||
],
|
],
|
||||||
"AddSourcesRules": true,
|
"AddSourcesRules": true,
|
||||||
"K8sOpenAPIGen": true
|
"K8sCodegenBzlFile": "build/kazel_generated.bzl",
|
||||||
|
"K8sCodegenBoilerplateFile": "hack/boilerplate/boilerplate.generatebzl.txt",
|
||||||
|
"K8sCodegenTags": [
|
||||||
|
"openapi-gen"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
# Copyright The Kubernetes Authors.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
|
@ -83,10 +83,12 @@ def file_passes(filename, refs, regexs):
|
||||||
generated = is_generated_file(filename, data, regexs)
|
generated = is_generated_file(filename, data, regexs)
|
||||||
|
|
||||||
basename = os.path.basename(filename)
|
basename = os.path.basename(filename)
|
||||||
|
extension = file_extension(filename)
|
||||||
if generated:
|
if generated:
|
||||||
extension = "generatego"
|
if extension == "go":
|
||||||
else:
|
extension = "generatego"
|
||||||
extension = file_extension(filename)
|
elif extension == "bzl":
|
||||||
|
extension = "generatebzl"
|
||||||
|
|
||||||
if extension != "":
|
if extension != "":
|
||||||
ref = refs[extension]
|
ref = refs[extension]
|
||||||
|
|
Loading…
Reference in New Issue