Bumping k8s dependencies to 1.13
This commit is contained in:
10
vendor/k8s.io/kubernetes/build/root/BUILD.root
generated
vendored
10
vendor/k8s.io/kubernetes/build/root/BUILD.root
generated
vendored
@@ -1,16 +1,20 @@
|
||||
# gazelle:build_file_name BUILD,BUILD.bazel
|
||||
|
||||
# gazelle:exclude _artifacts
|
||||
# gazelle:exclude _gopath
|
||||
# gazelle:exclude _output
|
||||
# gazelle:exclude _tmp
|
||||
|
||||
# gazelle:prefix k8s.io/kubernetes
|
||||
|
||||
# Disable proto rules, since the Go sources are currently generated by
|
||||
# hack/update-generated-protobuf.sh and checked into the repo.
|
||||
# gazelle:proto disable_global
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_prefix")
|
||||
load("@io_kubernetes_build//defs:build.bzl", "gcs_upload")
|
||||
|
||||
go_prefix("k8s.io/kubernetes")
|
||||
|
||||
filegroup(
|
||||
name = "_binary-artifacts-and-hashes",
|
||||
srcs = [
|
||||
|
57
vendor/k8s.io/kubernetes/build/root/Makefile
generated
vendored
57
vendor/k8s.io/kubernetes/build/root/Makefile
generated
vendored
@@ -124,7 +124,7 @@ ifeq ($(PRINT_HELP),y)
|
||||
verify:
|
||||
@echo "$$VERIFY_HELP_INFO"
|
||||
else
|
||||
verify: verify_generated_files
|
||||
verify:
|
||||
KUBE_VERIFY_GIT_BRANCH=$(BRANCH) hack/make-rules/verify.sh
|
||||
endif
|
||||
|
||||
@@ -139,7 +139,7 @@ ifeq ($(PRINT_HELP),y)
|
||||
quick-verify:
|
||||
@echo "$$QUICK_VERIFY_HELP_INFO"
|
||||
else
|
||||
quick-verify: verify_generated_files
|
||||
quick-verify:
|
||||
QUICK=true SILENT=false hack/make-rules/verify.sh
|
||||
endif
|
||||
|
||||
@@ -386,6 +386,24 @@ release-in-a-container:
|
||||
build/release-in-a-container.sh
|
||||
endif
|
||||
|
||||
define RELEASE_IMAGES_HELP_INFO
|
||||
# Build release images
|
||||
#
|
||||
# Args:
|
||||
# KUBE_BUILD_HYPERKUBE: Whether to build hyperkube image as well. Set to 'n' to skip.
|
||||
#
|
||||
# Example:
|
||||
# make release-images
|
||||
endef
|
||||
.PHONY: release-images
|
||||
ifeq ($(PRINT_HELP),y)
|
||||
release-images:
|
||||
@echo "$$RELEASE_IMAGES_HELP_INFO"
|
||||
else
|
||||
release-images:
|
||||
build/release-images.sh
|
||||
endif
|
||||
|
||||
define RELEASE_SKIP_TESTS_HELP_INFO
|
||||
# Build a release, but skip tests
|
||||
#
|
||||
@@ -408,6 +426,26 @@ release-skip-tests quick-release:
|
||||
build/release.sh
|
||||
endif
|
||||
|
||||
define QUICK_RELEASE_IMAGES_HELP_INFO
|
||||
# Build release images, but only for linux/amd64
|
||||
#
|
||||
# Args:
|
||||
# KUBE_FASTBUILD: Whether to cross-compile for other architectures. Set to 'false' to do so.
|
||||
# KUBE_BUILD_HYPERKUBE: Whether to build hyperkube image as well. Set to 'n' to skip.
|
||||
#
|
||||
# Example:
|
||||
# make quick-release-images
|
||||
endef
|
||||
.PHONY: quick-release-images
|
||||
ifeq ($(PRINT_HELP),y)
|
||||
quick-release-images:
|
||||
@echo "$$QUICK_RELEASE_IMAGES_HELP_INFO"
|
||||
else
|
||||
quick-release-images: KUBE_FASTBUILD = true
|
||||
quick-release-images:
|
||||
build/release-images.sh
|
||||
endif
|
||||
|
||||
define PACKAGE_HELP_INFO
|
||||
# Package tarballs
|
||||
# Use the 'package-tarballs' target to run the final packaging steps of
|
||||
@@ -483,21 +521,6 @@ generated_files:
|
||||
$(MAKE) -f Makefile.generated_files $@ CALLED_FROM_MAIN_MAKEFILE=1
|
||||
endif
|
||||
|
||||
define VERIFY_GENERATED_FILES_HELP_INFO
|
||||
# Verify auto-generated files needed for the build.
|
||||
#
|
||||
# Example:
|
||||
# make verify_generated_files
|
||||
endef
|
||||
.PHONY: verify_generated_files
|
||||
ifeq ($(PRINT_HELP),y)
|
||||
verify_generated_files:
|
||||
@echo "$$VERIFY_GENERATED_FILES_HELP_INFO"
|
||||
else
|
||||
verify_generated_files:
|
||||
$(MAKE) -f Makefile.generated_files $@ CALLED_FROM_MAIN_MAKEFILE=1
|
||||
endif
|
||||
|
||||
define HELP_INFO
|
||||
# Print make targets and help info
|
||||
#
|
||||
|
694
vendor/k8s.io/kubernetes/build/root/Makefile.generated_files
generated
vendored
694
vendor/k8s.io/kubernetes/build/root/Makefile.generated_files
generated
vendored
@@ -37,81 +37,54 @@ SHELL := /bin/bash
|
||||
.PHONY: generated_files
|
||||
generated_files: gen_deepcopy gen_defaulter gen_conversion gen_openapi gen_bindata
|
||||
|
||||
.PHONY: verify_generated_files
|
||||
verify_generated_files: verify_gen_deepcopy \
|
||||
verify_gen_defaulter \
|
||||
verify_gen_conversion
|
||||
#
|
||||
# Helper logic to calculate Go's dependency DAG ourselves.
|
||||
#
|
||||
|
||||
# This is a file that will be emitted by the go2make tool, containing a
|
||||
# variable for each Go package in the project (including deps) which lists all
|
||||
# of the transitive deps of that package. Each variable is named the same as
|
||||
# the package - for example the variable for `k8s.io/kubernetes/pkg/api` is
|
||||
# $(k8s.io/kubernetes/pkg/api). This is roughly the same DAG that the Go
|
||||
# compiler uses. These variables can be used to figure out if, for example,
|
||||
# generated code needs to be regenerated.
|
||||
GO_PKGDEPS_FILE = go-pkgdeps.mk
|
||||
|
||||
# Include the Go package dependencies file. This will cause the rule of
|
||||
# the same name to be considered and if it is updated, make will restart and
|
||||
# reload the updated deps.
|
||||
sinclude $(META_DIR)/$(GO_PKGDEPS_FILE)
|
||||
|
||||
# Update the set of Go deps for our project. This will let us determine if
|
||||
# we really need to do expensive codegen. We use FORCE because it is not a
|
||||
# PHONY file, but we do want it to be re-evaluated every time make is run. The
|
||||
# file will only be touched if it actually changes.
|
||||
$(META_DIR)/$(GO_PKGDEPS_FILE): FORCE
|
||||
if [[ "$(DBG_CODEGEN)" == 1 ]]; then \
|
||||
echo "DBG: calculating Go dependencies"; \
|
||||
fi
|
||||
hack/run-in-gopath.sh go install ./hack/make-rules/helpers/go2make
|
||||
hack/run-in-gopath.sh go2make \
|
||||
k8s.io/kubernetes/... \
|
||||
--prune k8s.io/kubernetes/staging \
|
||||
--prune k8s.io/kubernetes/vendor \
|
||||
k8s.io/kubernetes/vendor/k8s.io/... \
|
||||
github.com/jteeuwen/go-bindata/go-bindata/... \
|
||||
> $@.tmp
|
||||
if ! cmp -s $@.tmp $@; then \
|
||||
if [[ "$(DBG_CODEGEN)" == 1 ]]; then \
|
||||
echo "DBG: $(GO_PKGDEPS_FILE) changed"; \
|
||||
fi; \
|
||||
cat $@.tmp > $@; \
|
||||
fi
|
||||
rm -f $@.tmp
|
||||
|
||||
.PHONY: FORCE
|
||||
FORCE:
|
||||
|
||||
# Code-generation logic.
|
||||
#
|
||||
# This stuff can be pretty tricky, and there's probably some corner cases that
|
||||
# we don't handle well. That said, here's a straightforward test to prove that
|
||||
# the most common cases work. Sadly, it is manual.
|
||||
# Helper logic to find which directories need codegen as quickly as possible.
|
||||
#
|
||||
# make clean
|
||||
# find . -name .make\* | xargs rm -f
|
||||
# find . -name zz_generated\* | xargs rm -f
|
||||
# # verify `find . -name zz_generated.deepcopy.go | wc -l` is 0
|
||||
# # verify `find . -name .make | wc -l` is 0
|
||||
#
|
||||
# make nonexistent
|
||||
# # expect "No rule to make target"
|
||||
# # verify `find .make/ -type f | wc -l` has many files
|
||||
#
|
||||
# make gen_deepcopy
|
||||
# # expect deepcopy-gen is built exactly once
|
||||
# # expect many files to be regenerated
|
||||
# # verify `find . -name zz_generated.deepcopy.go | wc -l` has files
|
||||
# make gen_deepcopy
|
||||
# # expect nothing to be rebuilt, finish in O(seconds)
|
||||
# touch pkg/api/types.go
|
||||
# make gen_deepcopy
|
||||
# # expect one file to be regenerated
|
||||
# make gen_deepcopy
|
||||
# # expect nothing to be rebuilt, finish in O(seconds)
|
||||
# touch vendor/k8s.io/code-generator/cmd/deepcopy-gen/main.go
|
||||
# make gen_deepcopy
|
||||
# # expect deepcopy-gen is built exactly once
|
||||
# # expect many files to be regenerated
|
||||
# # verify `find . -name zz_generated.deepcopy.go | wc -l` has files
|
||||
# make gen_deepcopy
|
||||
# # expect nothing to be rebuilt, finish in O(seconds)
|
||||
#
|
||||
# make gen_conversion
|
||||
# # expect conversion-gen is built exactly once
|
||||
# # expect many files to be regenerated
|
||||
# # verify `find . -name zz_generated.conversion.go | wc -l` has files
|
||||
# make gen_conversion
|
||||
# # expect nothing to be rebuilt, finish in O(seconds)
|
||||
# touch pkg/api/types.go
|
||||
# make gen_conversion
|
||||
# # expect one file to be regenerated
|
||||
# make gen_conversion
|
||||
# # expect nothing to be rebuilt, finish in O(seconds)
|
||||
# touch vendor/k8s.io/code-generator/cmd/conversion-gen/main.go
|
||||
# make gen_conversion
|
||||
# # expect conversion-gen is built exactly once
|
||||
# # expect many files to be regenerated
|
||||
# # verify `find . -name zz_generated.conversion.go | wc -l` has files
|
||||
# make gen_conversion
|
||||
# # expect nothing to be rebuilt, finish in O(seconds)
|
||||
#
|
||||
# make all
|
||||
# # expect it to build
|
||||
#
|
||||
# make test
|
||||
# # expect it to pass
|
||||
#
|
||||
# make clean
|
||||
# # verify `find . -name zz_generated.deepcopy.go | wc -l` is 0
|
||||
# # verify `find . -name .make | wc -l` is 0
|
||||
#
|
||||
# make all WHAT=cmd/kube-proxy
|
||||
# # expect it to build
|
||||
#
|
||||
# make clean
|
||||
# make test WHAT=cmd/kube-proxy
|
||||
# # expect it to pass
|
||||
|
||||
# This variable holds a list of every directory that contains Go files in this
|
||||
# project. Other rules and variables can use this as a starting point to
|
||||
@@ -123,63 +96,6 @@ ALL_GO_DIRS := $(shell \
|
||||
hack/make-rules/helpers/cache_go_dirs.sh $(META_DIR)/all_go_dirs.mk \
|
||||
)
|
||||
|
||||
# The name of the metadata file which lists *.go files in each pkg.
|
||||
GOFILES_META := gofiles.mk
|
||||
|
||||
# Establish a dependency between the deps file and the dir. Whenever a dir
|
||||
# changes (files added or removed) the deps file will be considered stale.
|
||||
#
|
||||
# The variable value was set in $(GOFILES_META) and included as part of the
|
||||
# dependency management logic.
|
||||
#
|
||||
# This is looser than we really need (e.g. we don't really care about non *.go
|
||||
# files or even *_test.go files), but this is much easier to represent.
|
||||
#
|
||||
# Because we 'sinclude' the deps file, it is considered for rebuilding, as part
|
||||
# of make's normal evaluation. If it gets rebuilt, make will restart.
|
||||
#
|
||||
# The '$(eval)' is needed because this has a different RHS for each LHS, and
|
||||
# would otherwise produce results that make can't parse.
|
||||
$(foreach dir, $(ALL_GO_DIRS), $(eval \
|
||||
$(META_DIR)/$(dir)/$(GOFILES_META): $(dir) \
|
||||
))
|
||||
|
||||
# How to rebuild a deps file. When make determines that the deps file is stale
|
||||
# (see above), it executes this rule, and then re-loads the deps file.
|
||||
#
|
||||
# This is looser than we really need (e.g. we don't really care about test
|
||||
# files), but this is MUCH faster than calling `go list`.
|
||||
#
|
||||
# We regenerate the output file in order to satisfy make's "newer than" rules,
|
||||
# but we only need to rebuild targets if the contents actually changed. That
|
||||
# is what the .stamp file represents.
|
||||
$(foreach dir, $(ALL_GO_DIRS), \
|
||||
$(META_DIR)/$(dir)/$(GOFILES_META)):
|
||||
FILES=$$(ls $</*.go | grep --color=never -v $(GENERATED_FILE_PREFIX)); \
|
||||
mkdir -p $(@D); \
|
||||
echo "gofiles__$< := $$(echo $${FILES})" >$@.tmp; \
|
||||
if ! cmp -s $@.tmp $@; then \
|
||||
if [[ "$(DBG_CODEGEN)" == 1 ]]; then \
|
||||
echo "DBG: gofiles changed for $@"; \
|
||||
fi; \
|
||||
touch $@.stamp; \
|
||||
fi; \
|
||||
mv $@.tmp $@
|
||||
|
||||
# This is required to fill in the DAG, since some cases (e.g. 'make clean all')
|
||||
# will reference the .stamp file when it doesn't exist. We don't need to
|
||||
# rebuild it in that case, just keep make happy.
|
||||
$(foreach dir, $(ALL_GO_DIRS), \
|
||||
$(META_DIR)/$(dir)/$(GOFILES_META).stamp):
|
||||
|
||||
# Include any deps files as additional Makefile rules. This triggers make to
|
||||
# consider the deps files for rebuild, which makes the whole
|
||||
# dependency-management logic work. 'sinclude' is "silent include" which does
|
||||
# not fail if the file does not exist.
|
||||
$(foreach dir, $(ALL_GO_DIRS), $(eval \
|
||||
sinclude $(META_DIR)/$(dir)/$(GOFILES_META) \
|
||||
))
|
||||
|
||||
# Generate a list of all files that have a `+k8s:` comment-tag. This will be
|
||||
# used to derive lists of files/dirs for generation tools.
|
||||
ifeq ($(DBG_MAKEFILE),1)
|
||||
@@ -190,7 +106,12 @@ ALL_K8S_TAG_FILES := $(shell \
|
||||
| xargs grep --color=never -l '^// *+k8s:' \
|
||||
)
|
||||
|
||||
|
||||
#
|
||||
# Code generation logic.
|
||||
#
|
||||
|
||||
|
||||
# Deep-copy generation
|
||||
#
|
||||
# Any package that wants deep-copy functions generated must include a
|
||||
@@ -220,34 +141,27 @@ DEEPCOPY_DIRS := $(shell \
|
||||
)
|
||||
DEEPCOPY_FILES := $(addsuffix /$(DEEPCOPY_FILENAME), $(DEEPCOPY_DIRS))
|
||||
|
||||
# Shell function for reuse in rules.
|
||||
RUN_GEN_DEEPCOPY = \
|
||||
function run_gen_deepcopy() { \
|
||||
if [[ -f $(META_DIR)/$(DEEPCOPY_GEN).todo ]]; then \
|
||||
pkgs=$$(cat $(META_DIR)/$(DEEPCOPY_GEN).todo | paste -sd, -); \
|
||||
if [[ "$(DBG_CODEGEN)" == 1 ]]; then \
|
||||
echo "DBG: running $(DEEPCOPY_GEN) for $$pkgs"; \
|
||||
fi; \
|
||||
./hack/run-in-gopath.sh $(DEEPCOPY_GEN) \
|
||||
--v $(KUBE_VERBOSE) \
|
||||
--logtostderr \
|
||||
-i "$$pkgs" \
|
||||
--bounding-dirs $(PRJ_SRC_PATH),"k8s.io/api" \
|
||||
-O $(DEEPCOPY_BASENAME) \
|
||||
"$$@"; \
|
||||
fi \
|
||||
}; \
|
||||
run_gen_deepcopy
|
||||
# Reset the list of packages that need generation.
|
||||
$(shell mkdir -p $$(dirname $(META_DIR)/$(DEEPCOPY_GEN)))
|
||||
$(shell rm -f $(META_DIR)/$(DEEPCOPY_GEN).todo)
|
||||
|
||||
# This rule aggregates the set of files to generate and then generates them all
|
||||
# in a single run of the tool.
|
||||
.PHONY: gen_deepcopy
|
||||
gen_deepcopy: $(DEEPCOPY_FILES) $(DEEPCOPY_GEN)
|
||||
$(RUN_GEN_DEEPCOPY)
|
||||
|
||||
.PHONY: verify_gen_deepcopy
|
||||
verify_gen_deepcopy: $(DEEPCOPY_GEN)
|
||||
$(RUN_GEN_DEEPCOPY) --verify-only
|
||||
gen_deepcopy: $(DEEPCOPY_GEN) $(META_DIR)/$(DEEPCOPY_GEN).todo
|
||||
if [[ -s $(META_DIR)/$(DEEPCOPY_GEN).todo ]]; then \
|
||||
pkgs=$$(cat $(META_DIR)/$(DEEPCOPY_GEN).todo | paste -sd, -); \
|
||||
if [[ "$(DBG_CODEGEN)" == 1 ]]; then \
|
||||
echo "DBG: running $(DEEPCOPY_GEN) for $$pkgs"; \
|
||||
fi; \
|
||||
./hack/run-in-gopath.sh $(DEEPCOPY_GEN) \
|
||||
--v $(KUBE_VERBOSE) \
|
||||
--logtostderr \
|
||||
-i "$$pkgs" \
|
||||
--bounding-dirs $(PRJ_SRC_PATH),"k8s.io/api" \
|
||||
-O $(DEEPCOPY_BASENAME) \
|
||||
"$$@"; \
|
||||
fi \
|
||||
|
||||
# For each dir in DEEPCOPY_DIRS, this establishes a dependency between the
|
||||
# output file and the input files that should trigger a rebuild.
|
||||
@@ -258,71 +172,35 @@ verify_gen_deepcopy: $(DEEPCOPY_GEN)
|
||||
#
|
||||
# The '$(eval)' is needed because this has a different RHS for each LHS, and
|
||||
# would otherwise produce results that make can't parse.
|
||||
#
|
||||
# We depend on the $(GOFILES_META).stamp to detect when the set of input files
|
||||
# has changed. This allows us to detect deleted input files.
|
||||
$(foreach dir, $(DEEPCOPY_DIRS), $(eval \
|
||||
$(dir)/$(DEEPCOPY_FILENAME): $(META_DIR)/$(dir)/$(GOFILES_META).stamp \
|
||||
$(gofiles__$(dir)) \
|
||||
$(foreach dir, $(DEEPCOPY_DIRS), $(eval \
|
||||
$(dir)/$(DEEPCOPY_FILENAME): $($(PRJ_SRC_PATH)/$(dir)) \
|
||||
))
|
||||
|
||||
# Unilaterally remove any leftovers from previous runs.
|
||||
$(shell rm -f $(META_DIR)/$(DEEPCOPY_GEN)*.todo)
|
||||
|
||||
# How to regenerate deep-copy code. This is a little slow to run, so we batch
|
||||
# it up and trigger the batch from the 'generated_files' target.
|
||||
$(META_DIR)/$(DEEPCOPY_GEN).todo: $(DEEPCOPY_FILES)
|
||||
|
||||
$(DEEPCOPY_FILES): $(DEEPCOPY_GEN)
|
||||
mkdir -p $$(dirname $(META_DIR)/$(DEEPCOPY_GEN))
|
||||
if [[ "$(DBG_CODEGEN)" == 1 ]]; then \
|
||||
echo "DBG: deepcopy needed $(@D): $?"; \
|
||||
ls -lf --full-time $@ $? || true; \
|
||||
fi
|
||||
echo $(PRJ_SRC_PATH)/$(@D) >> $(META_DIR)/$(DEEPCOPY_GEN).todo
|
||||
|
||||
# This calculates the dependencies for the generator tool, so we only rebuild
|
||||
# it when needed. It is PHONY so that it always runs, but it only updates the
|
||||
# file if the contents have actually changed. We 'sinclude' this later.
|
||||
.PHONY: $(META_DIR)/$(DEEPCOPY_GEN).mk
|
||||
$(META_DIR)/$(DEEPCOPY_GEN).mk:
|
||||
mkdir -p $(@D); \
|
||||
(echo -n "$(DEEPCOPY_GEN): "; \
|
||||
./hack/run-in-gopath.sh go list \
|
||||
-f '{{.ImportPath}}{{"\n"}}{{range .Deps}}{{.}}{{"\n"}}{{end}}' \
|
||||
./vendor/k8s.io/code-generator/cmd/deepcopy-gen \
|
||||
| grep --color=never "^$(PRJ_SRC_PATH)/" \
|
||||
| xargs ./hack/run-in-gopath.sh go list \
|
||||
-f '{{$$d := .Dir}}{{$$d}}{{"\n"}}{{range .GoFiles}}{{$$d}}/{{.}}{{"\n"}}{{end}}' \
|
||||
| paste -sd' ' - \
|
||||
| sed 's/ / \\=,/g' \
|
||||
| tr '=,' '\n\t' \
|
||||
| sed "s|$$(pwd -P)/||"; \
|
||||
) > $@.tmp; \
|
||||
if ! cmp -s $@.tmp $@; then \
|
||||
if [[ "$(DBG_CODEGEN)" == 1 ]]; then \
|
||||
echo "DBG: $(DEEPCOPY_GEN).mk changed"; \
|
||||
fi; \
|
||||
cat $@.tmp > $@; \
|
||||
rm -f $@.tmp; \
|
||||
fi
|
||||
|
||||
# Include dependency info for the generator tool. This will cause the rule of
|
||||
# the same name to be considered and if it is updated, make will restart.
|
||||
sinclude $(META_DIR)/$(DEEPCOPY_GEN).mk
|
||||
|
||||
# How to build the generator tool. The deps for this are defined in
|
||||
# the $(DEEPCOPY_GEN).mk, above.
|
||||
# the $(GO_PKGDEPS_FILE), above.
|
||||
#
|
||||
# A word on the need to touch: This rule might trigger if, for example, a
|
||||
# non-Go file was added or deleted from a directory on which this depends.
|
||||
# This target needs to be reconsidered, but Go realizes it doesn't actually
|
||||
# have to be rebuilt. In that case, make will forever see the dependency as
|
||||
# newer than the binary, and try to rebuild it over and over. So we touch it,
|
||||
# and make is happy.
|
||||
$(DEEPCOPY_GEN):
|
||||
hack/make-rules/build.sh ./vendor/k8s.io/code-generator/cmd/deepcopy-gen
|
||||
# newer than the binary, and try to "rebuild" it over and over. So we touch
|
||||
# it, and make is happy.
|
||||
$(DEEPCOPY_GEN): $(k8s.io/kubernetes/vendor/k8s.io/code-generator/cmd/deepcopy-gen)
|
||||
KUBE_BUILD_PLATFORMS="" hack/make-rules/build.sh ./vendor/k8s.io/code-generator/cmd/deepcopy-gen
|
||||
touch $@
|
||||
|
||||
#
|
||||
|
||||
# Defaulter generation
|
||||
#
|
||||
# Any package that wants defaulter functions generated must include a
|
||||
@@ -359,134 +237,64 @@ DEFAULTER_DIRS := $(shell \
|
||||
|
||||
DEFAULTER_FILES := $(addsuffix /$(DEFAULTER_FILENAME), $(DEFAULTER_DIRS))
|
||||
|
||||
RUN_GEN_DEFAULTER := \
|
||||
function run_gen_defaulter() { \
|
||||
if [[ -f $(META_DIR)/$(DEFAULTER_GEN).todo ]]; then \
|
||||
pkgs=$$(cat $(META_DIR)/$(DEFAULTER_GEN).todo | paste -sd, -); \
|
||||
if [[ "$(DBG_CODEGEN)" == 1 ]]; then \
|
||||
echo "DBG: running $(DEFAULTER_GEN) for $$pkgs"; \
|
||||
fi; \
|
||||
./hack/run-in-gopath.sh $(DEFAULTER_GEN) \
|
||||
--v $(KUBE_VERBOSE) \
|
||||
--logtostderr \
|
||||
-i "$$pkgs" \
|
||||
--extra-peer-dirs $$(echo $(addprefix $(PRJ_SRC_PATH)/, $(DEFAULTER_DIRS)) | sed 's/ /,/g') \
|
||||
-O $(DEFAULTER_BASENAME) \
|
||||
"$$@"; \
|
||||
fi \
|
||||
}; \
|
||||
run_gen_defaulter
|
||||
# Reset the list of packages that need generation.
|
||||
$(shell mkdir -p $$(dirname $(META_DIR)/$(DEFAULTER_GEN)))
|
||||
$(shell rm -f $(META_DIR)/$(DEFAULTER_GEN).todo)
|
||||
|
||||
# This rule aggregates the set of files to generate and then generates them all
|
||||
# in a single run of the tool.
|
||||
.PHONY: gen_defaulter
|
||||
gen_defaulter: $(DEFAULTER_FILES) $(DEFAULTER_GEN)
|
||||
$(RUN_GEN_DEFAULTER)
|
||||
|
||||
.PHONY: verify_gen_deepcopy
|
||||
verify_gen_defaulter: $(DEFAULTER_GEN)
|
||||
$(RUN_GEN_DEFAULTER) --verify-only
|
||||
gen_defaulter: $(DEFAULTER_GEN) $(META_DIR)/$(DEFAULTER_GEN).todo
|
||||
if [[ -s $(META_DIR)/$(DEFAULTER_GEN).todo ]]; then \
|
||||
pkgs=$$(cat $(META_DIR)/$(DEFAULTER_GEN).todo | paste -sd, -); \
|
||||
if [[ "$(DBG_CODEGEN)" == 1 ]]; then \
|
||||
echo "DBG: running $(DEFAULTER_GEN) for $$pkgs"; \
|
||||
fi; \
|
||||
./hack/run-in-gopath.sh $(DEFAULTER_GEN) \
|
||||
--v $(KUBE_VERBOSE) \
|
||||
--logtostderr \
|
||||
-i "$$pkgs" \
|
||||
--extra-peer-dirs $$(echo $(addprefix $(PRJ_SRC_PATH)/, $(DEFAULTER_DIRS)) | sed 's/ /,/g') \
|
||||
-O $(DEFAULTER_BASENAME) \
|
||||
"$$@"; \
|
||||
fi
|
||||
|
||||
# For each dir in DEFAULTER_DIRS, this establishes a dependency between the
|
||||
# output file and the input files that should trigger a rebuild.
|
||||
#
|
||||
# The variable value was set in $(GOFILES_META) and included as part of the
|
||||
# dependency management logic.
|
||||
#
|
||||
# Note that this is a deps-only statement, not a full rule (see below). This
|
||||
# has to be done in a distinct step because wildcards don't work in static
|
||||
# pattern rules.
|
||||
# Note that this is a deps-only statement, not a full rule (see below for that).
|
||||
#
|
||||
# The '$(eval)' is needed because this has a different RHS for each LHS, and
|
||||
# would otherwise produce results that make can't parse.
|
||||
#
|
||||
# We depend on the $(GOFILES_META).stamp to detect when the set of input files
|
||||
# has changed. This allows us to detect deleted input files.
|
||||
$(foreach dir, $(DEFAULTER_DIRS), $(eval \
|
||||
$(dir)/$(DEFAULTER_FILENAME): $(META_DIR)/$(dir)/$(GOFILES_META).stamp \
|
||||
$(gofiles__$(dir)) \
|
||||
$(foreach dir, $(DEFAULTER_DIRS), $(eval \
|
||||
$(dir)/$(DEFAULTER_FILENAME): $($(PRJ_SRC_PATH)/$(dir)) \
|
||||
))
|
||||
|
||||
# For each dir in DEFAULTER_DIRS, for each target in $(defaulters__$(dir)),
|
||||
# this establishes a dependency between the output file and the input files
|
||||
# that should trigger a rebuild.
|
||||
#
|
||||
# The variable value was set in $(GOFILES_META) and included as part of the
|
||||
# dependency management logic.
|
||||
#
|
||||
# Note that this is a deps-only statement, not a full rule (see below). This
|
||||
# has to be done in a distinct step because wildcards don't work in static
|
||||
# pattern rules.
|
||||
#
|
||||
# The '$(eval)' is needed because this has a different RHS for each LHS, and
|
||||
# would otherwise produce results that make can't parse.
|
||||
#
|
||||
# We depend on the $(GOFILES_META).stamp to detect when the set of input files
|
||||
# has changed. This allows us to detect deleted input files.
|
||||
$(foreach dir, $(DEFAULTER_DIRS), \
|
||||
$(foreach tgt, $(defaulters__$(dir)), $(eval \
|
||||
$(dir)/$(DEFAULTER_FILENAME): $(META_DIR)/$(tgt)/$(GOFILES_META).stamp \
|
||||
$(gofiles__$(tgt)) \
|
||||
)) \
|
||||
)
|
||||
|
||||
# Unilaterally remove any leftovers from previous runs.
|
||||
$(shell rm -f $(META_DIR)/$(DEFAULTER_GEN)*.todo)
|
||||
|
||||
# How to regenerate defaulter code. This is a little slow to run, so we batch
|
||||
# it up and trigger the batch from the 'generated_files' target.
|
||||
$(META_DIR)/$(DEFAULTER_GEN).todo: $(DEFAULTER_FILES)
|
||||
|
||||
$(DEFAULTER_FILES): $(DEFAULTER_GEN)
|
||||
mkdir -p $$(dirname $(META_DIR)/$(DEFAULTER_GEN))
|
||||
if [[ "$(DBG_CODEGEN)" == 1 ]]; then \
|
||||
echo "DBG: defaulter needed $(@D): $?"; \
|
||||
ls -lf --full-time $@ $? || true; \
|
||||
fi
|
||||
echo $(PRJ_SRC_PATH)/$(@D) >> $(META_DIR)/$(DEFAULTER_GEN).todo
|
||||
|
||||
# This calculates the dependencies for the generator tool, so we only rebuild
|
||||
# it when needed. It is PHONY so that it always runs, but it only updates the
|
||||
# file if the contents have actually changed. We 'sinclude' this later.
|
||||
.PHONY: $(META_DIR)/$(DEFAULTER_GEN).mk
|
||||
$(META_DIR)/$(DEFAULTER_GEN).mk:
|
||||
mkdir -p $(@D); \
|
||||
(echo -n "$(DEFAULTER_GEN): "; \
|
||||
./hack/run-in-gopath.sh go list \
|
||||
-f '{{.ImportPath}}{{"\n"}}{{range .Deps}}{{.}}{{"\n"}}{{end}}' \
|
||||
./vendor/k8s.io/code-generator/cmd/defaulter-gen \
|
||||
| grep --color=never "^$(PRJ_SRC_PATH)/" \
|
||||
| xargs ./hack/run-in-gopath.sh go list \
|
||||
-f '{{$$d := .Dir}}{{$$d}}{{"\n"}}{{range .GoFiles}}{{$$d}}/{{.}}{{"\n"}}{{end}}' \
|
||||
| paste -sd' ' - \
|
||||
| sed 's/ / \\=,/g' \
|
||||
| tr '=,' '\n\t' \
|
||||
| sed "s|$$(pwd -P)/||"; \
|
||||
) > $@.tmp; \
|
||||
if ! cmp -s $@.tmp $@; then \
|
||||
if [[ "$(DBG_CODEGEN)" == 1 ]]; then \
|
||||
echo "DBG: $(DEFAULTER_GEN).mk changed"; \
|
||||
fi; \
|
||||
cat $@.tmp > $@; \
|
||||
rm -f $@.tmp; \
|
||||
fi
|
||||
|
||||
# Include dependency info for the generator tool. This will cause the rule of
|
||||
# the same name to be considered and if it is updated, make will restart.
|
||||
sinclude $(META_DIR)/$(DEFAULTER_GEN).mk
|
||||
|
||||
# How to build the generator tool. The deps for this are defined in
|
||||
# the $(DEFAULTER_GEN).mk, above.
|
||||
# the $(GO_PKGDEPS_FILE), above.
|
||||
#
|
||||
# A word on the need to touch: This rule might trigger if, for example, a
|
||||
# non-Go file was added or deleted from a directory on which this depends.
|
||||
# This target needs to be reconsidered, but Go realizes it doesn't actually
|
||||
# have to be rebuilt. In that case, make will forever see the dependency as
|
||||
# newer than the binary, and try to rebuild it over and over. So we touch it,
|
||||
# and make is happy.
|
||||
$(DEFAULTER_GEN):
|
||||
hack/make-rules/build.sh ./vendor/k8s.io/code-generator/cmd/defaulter-gen
|
||||
# newer than the binary, and try to "rebuild" it over and over. So we touch
|
||||
# it, and make is happy.
|
||||
$(DEFAULTER_GEN): $(k8s.io/kubernetes/vendor/k8s.io/code-generator/cmd/defaulter-gen)
|
||||
KUBE_BUILD_PLATFORMS="" hack/make-rules/build.sh ./vendor/k8s.io/code-generator/cmd/defaulter-gen
|
||||
touch $@
|
||||
|
||||
#
|
||||
|
||||
# Conversion generation
|
||||
#
|
||||
# Any package that wants conversion functions generated must include one or
|
||||
@@ -526,171 +334,52 @@ CONVERSION_DIRS := $(shell \
|
||||
CONVERSION_FILES := $(addsuffix /$(CONVERSION_FILENAME), $(CONVERSION_DIRS))
|
||||
CONVERSION_EXTRA_PEER_DIRS := k8s.io/kubernetes/pkg/apis/core,k8s.io/kubernetes/pkg/apis/core/v1,k8s.io/api/core/v1
|
||||
|
||||
# Shell function for reuse in rules.
|
||||
RUN_GEN_CONVERSION = \
|
||||
function run_gen_conversion() { \
|
||||
if [[ -f $(META_DIR)/$(CONVERSION_GEN).todo ]]; then \
|
||||
pkgs=$$(cat $(META_DIR)/$(CONVERSION_GEN).todo | paste -sd, -); \
|
||||
if [[ "$(DBG_CODEGEN)" == 1 ]]; then \
|
||||
echo "DBG: running $(CONVERSION_GEN) for $$pkgs"; \
|
||||
fi; \
|
||||
./hack/run-in-gopath.sh $(CONVERSION_GEN) \
|
||||
--extra-peer-dirs $(CONVERSION_EXTRA_PEER_DIRS) \
|
||||
--v $(KUBE_VERBOSE) \
|
||||
--logtostderr \
|
||||
-i "$$pkgs" \
|
||||
-O $(CONVERSION_BASENAME) \
|
||||
"$$@"; \
|
||||
fi \
|
||||
}; \
|
||||
run_gen_conversion
|
||||
# Reset the list of packages that need generation.
|
||||
$(shell mkdir -p $$(dirname $(META_DIR)/$(CONVERSION_GEN)))
|
||||
$(shell rm -f $(META_DIR)/$(CONVERSION_GEN).todo)
|
||||
|
||||
# This rule aggregates the set of files to generate and then generates them all
|
||||
# in a single run of the tool.
|
||||
.PHONY: gen_conversion
|
||||
gen_conversion: $(CONVERSION_FILES) $(CONVERSION_GEN)
|
||||
$(RUN_GEN_CONVERSION)
|
||||
|
||||
.PHONY: verify_gen_conversion
|
||||
verify_gen_conversion: $(CONVERSION_GEN)
|
||||
$(RUN_GEN_CONVERSION) --verify-only
|
||||
|
||||
# Establish a dependency between the deps file and the dir. Whenever a dir
|
||||
# changes (files added or removed) the deps file will be considered stale.
|
||||
#
|
||||
# This is looser than we really need (e.g. we don't really care about non *.go
|
||||
# files or even *_test.go files), but this is much easier to represent.
|
||||
#
|
||||
# Because we 'sinclude' the deps file, it is considered for rebuilding, as part
|
||||
# of make's normal evaluation. If it gets rebuilt, make will restart.
|
||||
#
|
||||
# The '$(eval)' is needed because this has a different RHS for each LHS, and
|
||||
# would otherwise produce results that make can't parse.
|
||||
$(foreach dir, $(CONVERSION_DIRS), $(eval \
|
||||
$(META_DIR)/$(dir)/$(CONVERSIONS_META): $(dir) \
|
||||
))
|
||||
|
||||
# How to rebuild a deps file. When make determines that the deps file is stale
|
||||
# (see above), it executes this rule, and then re-loads the deps file.
|
||||
#
|
||||
# This is looser than we really need (e.g. we don't really care about test
|
||||
# files), but this is MUCH faster than calling `go list`.
|
||||
#
|
||||
# We regenerate the output file in order to satisfy make's "newer than" rules,
|
||||
# but we only need to rebuild targets if the contents actually changed. That
|
||||
# is what the .stamp file represents.
|
||||
$(foreach dir, $(CONVERSION_DIRS), \
|
||||
$(META_DIR)/$(dir)/$(CONVERSIONS_META)):
|
||||
TAGS=$$(grep --color=never -h '^// *+k8s:conversion-gen=' $</*.go \
|
||||
| cut -f2- -d= \
|
||||
| sed 's|$(PRJ_SRC_PATH)/||' \
|
||||
| sed 's|^k8s.io/|vendor/k8s.io/|'); \
|
||||
mkdir -p $(@D); \
|
||||
echo "conversions__$< := $$(echo $${TAGS})" >$@.tmp; \
|
||||
if ! cmp -s $@.tmp $@; then \
|
||||
if [[ "$(DBG_CODEGEN)" == 1 ]]; then \
|
||||
echo "DBG: conversions changed for $@"; \
|
||||
fi; \
|
||||
touch $@.stamp; \
|
||||
fi; \
|
||||
mv $@.tmp $@
|
||||
|
||||
# Include any deps files as additional Makefile rules. This triggers make to
|
||||
# consider the deps files for rebuild, which makes the whole
|
||||
# dependency-management logic work. 'sinclude' is "silent include" which does
|
||||
# not fail if the file does not exist.
|
||||
$(foreach dir, $(CONVERSION_DIRS), $(eval \
|
||||
sinclude $(META_DIR)/$(dir)/$(CONVERSIONS_META) \
|
||||
))
|
||||
gen_conversion: $(CONVERSION_GEN) $(META_DIR)/$(CONVERSION_GEN).todo
|
||||
if [[ -s $(META_DIR)/$(CONVERSION_GEN).todo ]]; then \
|
||||
pkgs=$$(cat $(META_DIR)/$(CONVERSION_GEN).todo | paste -sd, -); \
|
||||
if [[ "$(DBG_CODEGEN)" == 1 ]]; then \
|
||||
echo "DBG: running $(CONVERSION_GEN) for $$pkgs"; \
|
||||
fi; \
|
||||
./hack/run-in-gopath.sh $(CONVERSION_GEN) \
|
||||
--extra-peer-dirs $(CONVERSION_EXTRA_PEER_DIRS) \
|
||||
--v $(KUBE_VERBOSE) \
|
||||
--logtostderr \
|
||||
-i "$$pkgs" \
|
||||
-O $(CONVERSION_BASENAME) \
|
||||
"$$@"; \
|
||||
fi
|
||||
|
||||
# For each dir in CONVERSION_DIRS, this establishes a dependency between the
|
||||
# output file and the input files that should trigger a rebuild.
|
||||
#
|
||||
# The variable value was set in $(GOFILES_META) and included as part of the
|
||||
# dependency management logic.
|
||||
#
|
||||
# Note that this is a deps-only statement, not a full rule (see below). This
|
||||
# has to be done in a distinct step because wildcards don't work in static
|
||||
# pattern rules.
|
||||
# Note that this is a deps-only statement, not a full rule (see below for that).
|
||||
#
|
||||
# The '$(eval)' is needed because this has a different RHS for each LHS, and
|
||||
# would otherwise produce results that make can't parse.
|
||||
#
|
||||
# We depend on the $(GOFILES_META).stamp to detect when the set of input files
|
||||
# has changed. This allows us to detect deleted input files.
|
||||
$(foreach dir, $(CONVERSION_DIRS), $(eval \
|
||||
$(dir)/$(CONVERSION_FILENAME): $(META_DIR)/$(dir)/$(GOFILES_META).stamp \
|
||||
$(gofiles__$(dir)) \
|
||||
$(foreach dir, $(CONVERSION_DIRS), $(eval \
|
||||
$(dir)/$(CONVERSION_FILENAME): $($(PRJ_SRC_PATH)/$(dir)) \
|
||||
))
|
||||
|
||||
# For each dir in CONVERSION_DIRS, for each target in $(conversions__$(dir)),
|
||||
# this establishes a dependency between the output file and the input files
|
||||
# that should trigger a rebuild.
|
||||
#
|
||||
# The variable value was set in $(GOFILES_META) and included as part of the
|
||||
# dependency management logic.
|
||||
#
|
||||
# Note that this is a deps-only statement, not a full rule (see below). This
|
||||
# has to be done in a distinct step because wildcards don't work in static
|
||||
# pattern rules.
|
||||
#
|
||||
# The '$(eval)' is needed because this has a different RHS for each LHS, and
|
||||
# would otherwise produce results that make can't parse.
|
||||
#
|
||||
# We depend on the $(GOFILES_META).stamp to detect when the set of input files
|
||||
# has changed. This allows us to detect deleted input files.
|
||||
$(foreach dir, $(CONVERSION_DIRS), \
|
||||
$(foreach tgt, $(conversions__$(dir)), $(eval \
|
||||
$(dir)/$(CONVERSION_FILENAME): $(META_DIR)/$(tgt)/$(GOFILES_META).stamp \
|
||||
$(gofiles__$(tgt)) \
|
||||
)) \
|
||||
)
|
||||
|
||||
# Unilaterally remove any leftovers from previous runs.
|
||||
$(shell rm -f $(META_DIR)/$(CONVERSION_GEN)*.todo)
|
||||
|
||||
# How to regenerate conversion code. This is a little slow to run, so we batch
|
||||
# it up and trigger the batch from the 'generated_files' target.
|
||||
$(META_DIR)/$(CONVERSION_GEN).todo: $(CONVERSION_FILES)
|
||||
|
||||
$(CONVERSION_FILES): $(CONVERSION_GEN)
|
||||
mkdir -p $$(dirname $(META_DIR)/$(CONVERSION_GEN))
|
||||
if [[ "$(DBG_CODEGEN)" == 1 ]]; then \
|
||||
echo "DBG: conversion needed $(@D): $?"; \
|
||||
ls -lf --full-time $@ $? || true; \
|
||||
fi
|
||||
echo $(PRJ_SRC_PATH)/$(@D) >> $(META_DIR)/$(CONVERSION_GEN).todo
|
||||
|
||||
# This calculates the dependencies for the generator tool, so we only rebuild
|
||||
# it when needed. It is PHONY so that it always runs, but it only updates the
|
||||
# file if the contents have actually changed. We 'sinclude' this later.
|
||||
.PHONY: $(META_DIR)/$(CONVERSION_GEN).mk
|
||||
$(META_DIR)/$(CONVERSION_GEN).mk:
|
||||
mkdir -p $(@D); \
|
||||
(echo -n "$(CONVERSION_GEN): "; \
|
||||
./hack/run-in-gopath.sh go list \
|
||||
-f '{{.ImportPath}}{{"\n"}}{{range .Deps}}{{.}}{{"\n"}}{{end}}' \
|
||||
./vendor/k8s.io/code-generator/cmd/conversion-gen \
|
||||
| grep --color=never "^$(PRJ_SRC_PATH)/" \
|
||||
| xargs ./hack/run-in-gopath.sh go list \
|
||||
-f '{{$$d := .Dir}}{{$$d}}{{"\n"}}{{range .GoFiles}}{{$$d}}/{{.}}{{"\n"}}{{end}}' \
|
||||
| paste -sd' ' - \
|
||||
| sed 's/ / \\=,/g' \
|
||||
| tr '=,' '\n\t' \
|
||||
| sed "s|$$(pwd -P)/||"; \
|
||||
) > $@.tmp; \
|
||||
if ! cmp -s $@.tmp $@; then \
|
||||
if [[ "$(DBG_CODEGEN)" == 1 ]]; then \
|
||||
echo "DBG: $(CONVERSION_GEN).mk changed"; \
|
||||
fi; \
|
||||
cat $@.tmp > $@; \
|
||||
rm -f $@.tmp; \
|
||||
fi
|
||||
|
||||
# Include dependency info for the generator tool. This will cause the rule of
|
||||
# the same name to be considered and if it is updated, make will restart.
|
||||
sinclude $(META_DIR)/$(CONVERSION_GEN).mk
|
||||
|
||||
# How to build the generator tool. The deps for this are defined in
|
||||
# the $(CONVERSION_GEN).mk, above.
|
||||
# the $(GO_PKGDEPS_FILE), above.
|
||||
#
|
||||
# A word on the need to touch: This rule might trigger if, for example, a
|
||||
# non-Go file was added or deleted from a directory on which this depends.
|
||||
@@ -698,12 +387,12 @@ sinclude $(META_DIR)/$(CONVERSION_GEN).mk
|
||||
# have to be rebuilt. In that case, make will forever see the dependency as
|
||||
# newer than the binary, and try to rebuild it over and over. So we touch it,
|
||||
# and make is happy.
|
||||
$(CONVERSION_GEN):
|
||||
hack/make-rules/build.sh ./vendor/k8s.io/code-generator/cmd/conversion-gen
|
||||
$(CONVERSION_GEN): $(k8s.io/kubernetes/vendor/k8s.io/code-generator/cmd/conversion-gen)
|
||||
KUBE_BUILD_PLATFORMS="" hack/make-rules/build.sh ./vendor/k8s.io/code-generator/cmd/conversion-gen
|
||||
touch $@
|
||||
|
||||
#
|
||||
# Open-api generation
|
||||
|
||||
# OpenAPI generation
|
||||
#
|
||||
# Any package that wants open-api functions generated must include a
|
||||
# comment-tag in column 0 of one file of the form:
|
||||
@@ -713,6 +402,10 @@ $(CONVERSION_GEN):
|
||||
OPENAPI_BASENAME := $(GENERATED_FILE_PREFIX)openapi
|
||||
OPENAPI_FILENAME := $(OPENAPI_BASENAME).go
|
||||
OPENAPI_OUTPUT_PKG := pkg/generated/openapi
|
||||
BOILERPLATE_FILENAME := vendor/k8s.io/code-generator/hack/boilerplate.go.txt
|
||||
REPORT_FILENAME := $(OUT_DIR)/violations.report
|
||||
KNOWN_VIOLATION_FILENAME := api/api-rules/violation_exceptions.list
|
||||
API_RULE_CHECK_FAILURE_MESSAGE := "Error: API rules check failed. Reported violations \"$(REPORT_FILENAME)\" differ from known violations \"$(KNOWN_VIOLATION_FILENAME)\". Please fix API source file if new violation is detected, or update known violations \"$(KNOWN_VIOLATION_FILENAME)\" if existing violation is being fixed. Please refer to api/api-rules/README.md and https://github.com/kubernetes/kube-openapi/tree/master/pkg/generators/rules for more information about the API rules being enforced."
|
||||
|
||||
# The tool used to generate open apis.
|
||||
OPENAPI_GEN := $(BIN_DIR)/openapi-gen
|
||||
@@ -736,77 +429,46 @@ gen_openapi: $(OPENAPI_OUTFILE) $(OPENAPI_GEN)
|
||||
# For each dir in OPENAPI_DIRS, this establishes a dependency between the
|
||||
# output file and the input files that should trigger a rebuild.
|
||||
#
|
||||
# Note that this is a deps-only statement, not a full rule (see below). This
|
||||
# has to be done in a distinct step because wildcards don't work in static
|
||||
# pattern rules.
|
||||
# Note that this is a deps-only statement, not a full rule (see below for that).
|
||||
#
|
||||
# The '$(eval)' is needed because this has a different RHS for each LHS, and
|
||||
# would otherwise produce results that make can't parse.
|
||||
#
|
||||
# We depend on the $(GOFILES_META).stamp to detect when the set of input files
|
||||
# has changed. This allows us to detect deleted input files.
|
||||
$(foreach dir, $(OPENAPI_DIRS), $(eval \
|
||||
$(OPENAPI_OUTFILE): $(META_DIR)/$(dir)/$(GOFILES_META).stamp \
|
||||
$(gofiles__$(dir)) \
|
||||
$(foreach dir, $(OPENAPI_DIRS), $(eval \
|
||||
$(OPENAPI_OUTFILE): $($(PRJ_SRC_PATH)/$(dir)) \
|
||||
))
|
||||
|
||||
# How to regenerate open-api code. This emits a single file for all results.
|
||||
$(OPENAPI_OUTFILE): $(OPENAPI_GEN) $(OPENAPI_GEN)
|
||||
function run_gen_openapi() { \
|
||||
./hack/run-in-gopath.sh $(OPENAPI_GEN) \
|
||||
--v $(KUBE_VERBOSE) \
|
||||
--logtostderr \
|
||||
-i $$(echo $(addprefix $(PRJ_SRC_PATH)/, $(OPENAPI_DIRS)) | sed 's/ /,/g') \
|
||||
-p $(PRJ_SRC_PATH)/$(OPENAPI_OUTPUT_PKG) \
|
||||
-O $(OPENAPI_BASENAME) \
|
||||
"$$@"; \
|
||||
}; \
|
||||
run_gen_openapi
|
||||
# The Make rule fails if generated API rule violation report differs from the checked-in
|
||||
# violation file, and prints error message to request developer to fix either the API
|
||||
# source code, or the known API rule violation file.
|
||||
$(OPENAPI_OUTFILE): $(OPENAPI_GEN) $(KNOWN_VIOLATION_FILENAME)
|
||||
./hack/run-in-gopath.sh $(OPENAPI_GEN) \
|
||||
--v $(KUBE_VERBOSE) \
|
||||
--logtostderr \
|
||||
-i $$(echo $(addprefix $(PRJ_SRC_PATH)/, $(OPENAPI_DIRS)) | sed 's/ /,/g') \
|
||||
-p $(PRJ_SRC_PATH)/$(OPENAPI_OUTPUT_PKG) \
|
||||
-O $(OPENAPI_BASENAME) \
|
||||
-h $(BOILERPLATE_FILENAME) \
|
||||
-r $(REPORT_FILENAME) \
|
||||
"$$@"; \
|
||||
diff $(REPORT_FILENAME) $(KNOWN_VIOLATION_FILENAME) || \
|
||||
(echo $(API_RULE_CHECK_FAILURE_MESSAGE); exit 1)
|
||||
|
||||
# This calculates the dependencies for the generator tool, so we only rebuild
|
||||
# it when needed. It is PHONY so that it always runs, but it only updates the
|
||||
# file if the contents have actually changed. We 'sinclude' this later.
|
||||
.PHONY: $(META_DIR)/$(OPENAPI_GEN).mk
|
||||
$(META_DIR)/$(OPENAPI_GEN).mk:
|
||||
mkdir -p $(@D); \
|
||||
(echo -n "$(OPENAPI_GEN): "; \
|
||||
./hack/run-in-gopath.sh go list \
|
||||
-f '{{.ImportPath}}{{"\n"}}{{range .Deps}}{{.}}{{"\n"}}{{end}}' \
|
||||
./vendor/k8s.io/code-generator/cmd/openapi-gen \
|
||||
| grep --color=never "^$(PRJ_SRC_PATH)/" \
|
||||
| xargs ./hack/run-in-gopath.sh go list \
|
||||
-f '{{$$d := .Dir}}{{$$d}}{{"\n"}}{{range .GoFiles}}{{$$d}}/{{.}}{{"\n"}}{{end}}' \
|
||||
| paste -sd' ' - \
|
||||
| sed 's/ / \\=,/g' \
|
||||
| tr '=,' '\n\t' \
|
||||
| sed "s|$$(pwd -P)/||"; \
|
||||
) > $@.tmp; \
|
||||
if ! cmp -s $@.tmp $@; then \
|
||||
if [[ "$(DBG_CODEGEN)" == 1 ]]; then \
|
||||
echo "DBG: $(OPENAPI_GEN).mk changed"; \
|
||||
fi; \
|
||||
cat $@.tmp > $@; \
|
||||
rm -f $@.tmp; \
|
||||
fi
|
||||
|
||||
# Include dependency info for the generator tool. This will cause the rule of
|
||||
# the same name to be considered and if it is updated, make will restart.
|
||||
sinclude $(META_DIR)/$(OPENAPI_GEN).mk
|
||||
|
||||
# How to build the generator tool. The deps for this are defined in
|
||||
# the $(OPENAPI_GEN).mk, above.
|
||||
# the $(GO_PKGDEPS_FILE), above.
|
||||
#
|
||||
# A word on the need to touch: This rule might trigger if, for example, a
|
||||
# non-Go file was added or deleted from a directory on which this depends.
|
||||
# This target needs to be reconsidered, but Go realizes it doesn't actually
|
||||
# have to be rebuilt. In that case, make will forever see the dependency as
|
||||
# newer than the binary, and try to rebuild it over and over. So we touch it,
|
||||
# and make is happy.
|
||||
$(OPENAPI_GEN):
|
||||
hack/make-rules/build.sh ./vendor/k8s.io/code-generator/cmd/openapi-gen
|
||||
# newer than the binary, and try to "rebuild" it over and over. So we touch
|
||||
# it, and make is happy.
|
||||
$(OPENAPI_GEN): $(k8s.io/kubernetes/vendor/k8s.io/kube-openapi/cmd/openapi-gen)
|
||||
KUBE_BUILD_PLATFORMS="" hack/make-rules/build.sh ./vendor/k8s.io/kube-openapi/cmd/openapi-gen
|
||||
touch $@
|
||||
|
||||
#
|
||||
|
||||
# bindata generation
|
||||
#
|
||||
|
||||
@@ -822,38 +484,6 @@ BINDATA_SCRIPT := hack/generate-bindata.sh
|
||||
gen_bindata: $(BINDATA_GEN) FORCE
|
||||
./hack/run-in-gopath.sh $(BINDATA_SCRIPT)
|
||||
|
||||
FORCE:
|
||||
|
||||
# This calculates the dependencies for the generator tool, so we only rebuild
|
||||
# it when needed. It is PHONY so that it always runs, but it only updates the
|
||||
# file if the contents have actually changed. We 'sinclude' this later.
|
||||
.PHONY: $(META_DIR)/$(BINDATA_GEN).mk
|
||||
$(META_DIR)/$(BINDATA_GEN).mk:
|
||||
mkdir -p $(@D); \
|
||||
(echo -n "$(BINDATA_GEN): "; \
|
||||
./hack/run-in-gopath.sh go list \
|
||||
-f '{{.ImportPath}}{{"\n"}}{{range .Deps}}{{.}}{{"\n"}}{{end}}' \
|
||||
./vendor/github.com/jteeuwen/go-bindata/go-bindata \
|
||||
| grep --color=never "^$(PRJ_SRC_PATH)/" \
|
||||
| xargs ./hack/run-in-gopath.sh go list \
|
||||
-f '{{$$d := .Dir}}{{$$d}}{{"\n"}}{{range .GoFiles}}{{$$d}}/{{.}}{{"\n"}}{{end}}' \
|
||||
| paste -sd' ' - \
|
||||
| sed 's/ / \\=,/g' \
|
||||
| tr '=,' '\n\t' \
|
||||
| sed "s|$$(pwd -P)/||"; \
|
||||
) > $@.tmp; \
|
||||
if ! cmp -s $@.tmp $@; then \
|
||||
if [[ "$(DBG_CODEGEN)" == 1 ]]; then \
|
||||
echo "DBG: $(BINDATA_GEN).mk changed"; \
|
||||
fi; \
|
||||
cat $@.tmp > $@; \
|
||||
rm -f $@.tmp; \
|
||||
fi
|
||||
|
||||
# Include dependency info for the generator tool. This will cause the rule of
|
||||
# the same name to be considered and if it is updated, make will restart.
|
||||
sinclude $(META_DIR)/$(BINDATA_GEN).mk
|
||||
|
||||
# How to build the generator tool. The deps for this are defined in
|
||||
# the $(BINDATA_GEN).mk, above.
|
||||
#
|
||||
@@ -863,6 +493,6 @@ sinclude $(META_DIR)/$(BINDATA_GEN).mk
|
||||
# have to be rebuilt. In that case, make will forever see the dependency as
|
||||
# newer than the binary, and try to rebuild it over and over. So we touch it,
|
||||
# and make is happy.
|
||||
$(BINDATA_GEN):
|
||||
hack/make-rules/build.sh ./vendor/github.com/jteeuwen/go-bindata/go-bindata
|
||||
$(BINDATA_GEN): $(k8s.io/kubernetes/vendor/github.com/jteeuwen/go-bindata/go-bindata)
|
||||
KUBE_BUILD_PLATFORMS="" hack/make-rules/build.sh ./vendor/github.com/jteeuwen/go-bindata/go-bindata
|
||||
touch $@
|
||||
|
40
vendor/k8s.io/kubernetes/build/root/WORKSPACE
generated
vendored
40
vendor/k8s.io/kubernetes/build/root/WORKSPACE
generated
vendored
@@ -3,15 +3,15 @@ load("//build:workspace.bzl", "CRI_TOOLS_VERSION")
|
||||
|
||||
http_archive(
|
||||
name = "io_bazel_rules_go",
|
||||
sha256 = "6c770aece75ac47fe218ad881775c37cf29db013ab751d0bfef01c0b5a6ee01f",
|
||||
urls = mirror("https://github.com/bazelbuild/rules_go/releases/download/0.10.4/rules_go-0.10.4.tar.gz"),
|
||||
sha256 = "97cf62bdef33519412167fd1e4b0810a318a7c234f5f8dc4f53e2da86241c492",
|
||||
urls = mirror("https://github.com/bazelbuild/rules_go/releases/download/0.15.3/rules_go-0.15.3.tar.gz"),
|
||||
)
|
||||
|
||||
http_archive(
|
||||
name = "io_kubernetes_build",
|
||||
sha256 = "007774f06536059f3f782d1a092bddc625d88c17f20bbe731cea844a52485b11",
|
||||
strip_prefix = "repo-infra-97099dccc8807e9159dc28f374a8f0602cab07e1",
|
||||
urls = mirror("https://github.com/kubernetes/repo-infra/archive/97099dccc8807e9159dc28f374a8f0602cab07e1.tar.gz"),
|
||||
sha256 = "1188feb932cefad328b0a3dd75b3ebd1d79dd26dbdd723f019ceb760e27ba6d8",
|
||||
strip_prefix = "repo-infra-84d52408a061e87d45aebf5a0867246bdf66d180",
|
||||
urls = mirror("https://github.com/kubernetes/repo-infra/archive/84d52408a061e87d45aebf5a0867246bdf66d180.tar.gz"),
|
||||
)
|
||||
|
||||
http_archive(
|
||||
@@ -21,34 +21,34 @@ http_archive(
|
||||
urls = mirror("https://github.com/bazelbuild/bazel-skylib/archive/2169ae1c374aab4a09aa90e65efe1a3aad4e279b.tar.gz"),
|
||||
)
|
||||
|
||||
ETCD_VERSION = "3.2.18"
|
||||
ETCD_VERSION = "3.2.24"
|
||||
|
||||
new_http_archive(
|
||||
name = "com_coreos_etcd",
|
||||
build_file = "third_party/etcd.BUILD",
|
||||
sha256 = "b729db0732448064271ea6fdcb901773c4fe917763ca07776f22d0e5e0bd4097",
|
||||
sha256 = "947849dbcfa13927c81236fb76a7c01d587bbab42ab1e807184cd91b026ebed7",
|
||||
strip_prefix = "etcd-v%s-linux-amd64" % ETCD_VERSION,
|
||||
urls = mirror("https://github.com/coreos/etcd/releases/download/v%s/etcd-v%s-linux-amd64.tar.gz" % (ETCD_VERSION, ETCD_VERSION)),
|
||||
)
|
||||
|
||||
http_archive(
|
||||
name = "io_bazel_rules_docker",
|
||||
sha256 = "c440717ee9b1b2f4a1e9bf5622539feb5aef9db83fc1fa1517818f13c041b0be",
|
||||
strip_prefix = "rules_docker-8bbe2a8abd382641e65ff7127a3700a8530f02ce",
|
||||
urls = mirror("https://github.com/bazelbuild/rules_docker/archive/8bbe2a8abd382641e65ff7127a3700a8530f02ce.tar.gz"),
|
||||
sha256 = "29d109605e0d6f9c892584f07275b8c9260803bf0c6fcb7de2623b2bedc910bd",
|
||||
strip_prefix = "rules_docker-0.5.1",
|
||||
urls = mirror("https://github.com/bazelbuild/rules_docker/archive/v0.5.1.tar.gz"),
|
||||
)
|
||||
|
||||
load("@bazel_skylib//:lib.bzl", "versions")
|
||||
|
||||
versions.check(minimum_bazel_version = "0.13.0")
|
||||
versions.check(minimum_bazel_version = "0.16.0")
|
||||
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains", "go_download_sdk")
|
||||
load("@io_bazel_rules_docker//docker:docker.bzl", "docker_repositories", "docker_pull")
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_download_sdk", "go_register_toolchains", "go_rules_dependencies")
|
||||
load("@io_bazel_rules_docker//docker:docker.bzl", "docker_pull", "docker_repositories")
|
||||
|
||||
go_rules_dependencies()
|
||||
|
||||
go_register_toolchains(
|
||||
go_version = "1.10.2",
|
||||
go_version = "1.10.4",
|
||||
)
|
||||
|
||||
docker_repositories()
|
||||
@@ -61,29 +61,29 @@ http_file(
|
||||
|
||||
http_file(
|
||||
name = "cri_tools",
|
||||
sha256 = "bdc838174778223a1af4bdeaaed4bd266120c0e152588f78750fb86221677fb4",
|
||||
sha256 = "e7d913bcce40bf54e37ab1d4b75013c823d0551e6bc088b217bc1893207b4844",
|
||||
urls = mirror("https://github.com/kubernetes-incubator/cri-tools/releases/download/v%s/crictl-v%s-linux-amd64.tar.gz" % (CRI_TOOLS_VERSION, CRI_TOOLS_VERSION)),
|
||||
)
|
||||
|
||||
docker_pull(
|
||||
name = "debian-iptables-amd64",
|
||||
digest = "sha256:fb18678f8203ca1bd2fad2671e3ebd80cb408a1baae423d4ad39c05f4caac4e1",
|
||||
digest = "sha256:0987db7ce42949d20ed2647a65d4bee0b616b4d40c7ea54769cc24b7ad003677",
|
||||
registry = "k8s.gcr.io",
|
||||
repository = "debian-iptables-amd64",
|
||||
tag = "v10", # ignored, but kept here for documentation
|
||||
tag = "v10.2", # ignored, but kept here for documentation
|
||||
)
|
||||
|
||||
docker_pull(
|
||||
name = "debian-hyperkube-base-amd64",
|
||||
digest = "sha256:cc782ed16599000ca4c85d47ec6264753747ae1e77520894dca84b104a7621e2",
|
||||
digest = "sha256:c50522965140c9f206900bf47d547d601c04943e1e59801ba5f70235773cfbb6",
|
||||
registry = "k8s.gcr.io",
|
||||
repository = "debian-hyperkube-base-amd64",
|
||||
tag = "0.10", # ignored, but kept here for documentation
|
||||
tag = "0.10.2", # ignored, but kept here for documentation
|
||||
)
|
||||
|
||||
docker_pull(
|
||||
name = "official_busybox",
|
||||
digest = "sha256:4cee1979ba0bf7db9fc5d28fb7b798ca69ae95a47c5fecf46327720df4ff352d",
|
||||
digest = "sha256:cb63aa0641a885f54de20f61d152187419e8f6b159ed11a251a09d115fdff9bd",
|
||||
registry = "index.docker.io",
|
||||
repository = "library/busybox",
|
||||
tag = "latest", # ignored, but kept here for documentation
|
||||
|
Reference in New Issue
Block a user