Commit eecbfb1a authored by k8s-merge-robot's avatar k8s-merge-robot Committed by GitHub

Merge pull request #25978 from thockin/dont-checkin-generated-code

Automatic merge from submit-queue Don't check in generated code, part 1 This PR is a first step towards not commiting generated files, which make up a huge portion of "needs rebase" errors. It only handles deep-copy generation and conversion generation. More will come later, if the model passes muster. This is a mega-PR. Sorry. It was necessary to do 2 generators to convince myself it worked, and the evolution of the techniques warranted multiple commits. I have tried to keep the commits self-contained and reviewable. A quick summary of the major points in the series: - Start by making everything call `make` rather than the various hack/* scripts. The hack scripts still exist, but give a warning to use make instead, and then they do what they did before, so it should be compatible. - Move deepcopy generation into the Makefile, so it is done automatically - Move conversion generation into the Makefile, so it is done automatically - Optimize makefile for faster rebuilds - Make CI pass Net result: if you run "make", it will rebuild any deepcopy or conversion files it needs. It takes a few seconds to figure out there's nothing to do, but it should be a net savings. There is more to do, and we can follow this up with other generators being converted, some of which are MUCH slower than these 2. @wojtek-t @lavalamp @smarterclayton @bgrant0607 @mikedanese @madhusudancs
parents ec47f5c9 fef16dd5
...@@ -97,3 +97,9 @@ network_closure.sh ...@@ -97,3 +97,9 @@ network_closure.sh
# Downloaded kubernetes binary release tar ball # Downloaded kubernetes binary release tar ball
kubernetes.tar.gz kubernetes.tar.gz
# generated files in any directory
zz_generated.*
# make-related metadata
/.make/
...@@ -12,21 +12,55 @@ ...@@ -12,21 +12,55 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
DBG_MAKEFILE ?=
ifeq ($(DBG_MAKEFILE),1)
$(warning ***** starting makefile for goal(s) "$(MAKECMDGOALS)")
$(warning ***** $(shell date))
else
# If we're not debugging the Makefile, don't echo recipes.
MAKEFLAGS += -s
endif
# Old-skool build tools. # Old-skool build tools.
# #
# Targets (see each target for more information): # Commonly used targets (see each target for more information):
# all: Build code. # all: Build code.
# check: Run tests.
# test: Run tests. # test: Run tests.
# clean: Clean up. # clean: Clean up.
OUT_DIR = _output # It's necessary to set this because some docker images don't make sh -> bash.
SHELL := /bin/bash
# We don't need make's built-in rules.
MAKEFLAGS += --no-builtin-rules
.SUFFIXES:
# We want make to yell at us if we use undefined variables.
MAKEFLAGS += --warn-undefined-variables
# Constants used throughout.
OUT_DIR ?= _output
BIN_DIR := $(OUT_DIR)/bin
PRJ_SRC_PATH := k8s.io/kubernetes
# Metadata for driving the build lives here.
META_DIR := .make
#
# Define variables that we use as inputs so we can warn about undefined variables.
#
WHAT ?=
TESTS ?=
GOFLAGS ?=
KUBE_GOFLAGS = $(GOFLAGS) KUBE_GOFLAGS = $(GOFLAGS)
export KUBE_GOFLAGS export KUBE_GOFLAGS GOFLAGS
GOLDFLAGS ?=
KUBE_GOLDFLAGS = $(GOLDFLAGS) KUBE_GOLDFLAGS = $(GOLDFLAGS)
export KUBE_GOLDFLAGS export KUBE_GOLDFLAGS GOLDFLAGS
# Build code. # Build code.
# #
...@@ -41,16 +75,16 @@ export KUBE_GOLDFLAGS ...@@ -41,16 +75,16 @@ export KUBE_GOLDFLAGS
# make # make
# make all # make all
# make all WHAT=cmd/kubelet GOFLAGS=-v # make all WHAT=cmd/kubelet GOFLAGS=-v
all:
hack/build-go.sh $(WHAT)
.PHONY: all .PHONY: all
all: generated_files
hack/make-rules/build.sh $(WHAT)
# Build ginkgo # Build ginkgo
# #
# Example: # Example:
# make ginkgo # make ginkgo
ginkgo: ginkgo:
hack/build-go.sh vendor/github.com/onsi/ginkgo/ginkgo hack/make-rules/build.sh vendor/github.com/onsi/ginkgo/ginkgo
.PHONY: ginkgo .PHONY: ginkgo
# Runs all the presubmission verifications. # Runs all the presubmission verifications.
...@@ -61,9 +95,9 @@ ginkgo: ...@@ -61,9 +95,9 @@ ginkgo:
# Example: # Example:
# make verify # make verify
# make verify BRANCH=branch_x # make verify BRANCH=branch_x
verify:
KUBE_VERIFY_GIT_BRANCH=$(BRANCH) hack/verify-all.sh -v
.PHONY: verify .PHONY: verify
verify:
KUBE_VERIFY_GIT_BRANCH=$(BRANCH) hack/make-rules/verify.sh -v
# Build and run tests. # Build and run tests.
# #
...@@ -78,60 +112,88 @@ verify: ...@@ -78,60 +112,88 @@ verify:
# make check # make check
# make test # make test
# make check WHAT=pkg/kubelet GOFLAGS=-v # make check WHAT=pkg/kubelet GOFLAGS=-v
check test:
hack/test-go.sh $(WHAT) $(TESTS)
.PHONY: check test .PHONY: check test
check test: generated_files
hack/make-rules/test.sh $(WHAT) $(TESTS)
# Build and run integration tests. # Build and run integration tests.
# #
# Example: # Example:
# make test_integration # make test-integration
test_integration: .PHONY: test-integration
hack/test-integration.sh test-integration: generated_files
.PHONY: test_integration test_integ hack/make-rules/test-integration.sh
# Build and run end-to-end tests. # Build and run end-to-end tests.
# #
# Example: # Example:
# make test_e2e # make test-e2e
test_e2e: .PHONY: test-e2e
test-e2e: ginkgo generated_files
go run hack/e2e.go -v --build --up --test --down go run hack/e2e.go -v --build --up --test --down
.PHONY: test_e2e
# Build and run node end-to-end tests. # Build and run node end-to-end tests.
# #
# Args: # Args:
# FOCUS: regexp that matches the tests to be run. Defaults to "". # FOCUS: Regexp that matches the tests to be run. Defaults to "".
# SKIP: regexp that matches the tests that needs to be skipped. Defaults to "". # SKIP: Regexp that matches the tests that needs to be skipped. Defaults
# RUN_UNTIL_FAILURE: Ff true, pass --untilItFails to ginkgo so tests are run repeatedly until they fail. Defaults to false. # to "".
# REMOTE: If true, run the tests on a remote host instance on GCE. Defaults to false. # RUN_UNTIL_FAILURE: If true, pass --untilItFails to ginkgo so tests are run
# IMAGES: for REMOTE=true only. Comma delimited list of images for creating remote hosts to run tests against. Defaults to "e2e-node-containervm-v20160321-image". # repeatedly until they fail. Defaults to false.
# LIST_IMAGES: If true, don't run tests. Just output the list of available images for testing. Defaults to false. # REMOTE: If true, run the tests on a remote host instance on GCE. Defaults
# HOSTS: for REMOTE=true only. Comma delimited list of running gce hosts to run tests against. Defaults to "". # to false.
# DELETE_INSTANCES: for REMOTE=true only. Delete any instances created as part of this test run. Defaults to false. # IMAGES: For REMOTE=true only. Comma delimited list of images for creating
# ARTIFACTS: for REMOTE=true only. Local directory to scp test artifacts into from the remote hosts. Defaults to ""/tmp/_artifacts". # remote hosts to run tests against. Defaults to a recent image.
# REPORT: for REMOTE=false only. Local directory to write juntil xml results to. Defaults to "/tmp/". # LIST_IMAGES: If true, don't run tests. Just output the list of available
# CLEANUP: for REMOTE=true only. If false, do not stop processes or delete test files on remote hosts. Defaults to true. # images for testing. Defaults to false.
# IMAGE_PROJECT: for REMOTE=true only. Project containing images provided to IMAGES. Defaults to "kubernetes-node-e2e-images". # HOSTS: For REMOTE=true only. Comma delimited list of running gce hosts to
# INSTANCE_PREFIX: for REMOTE=true only. Instances created from images will have the name "${INSTANCE_PREFIX}-${IMAGE_NAME}". Defaults to "test"/ # run tests against. Defaults to "".
# DELETE_INSTANCES: For REMOTE=true only. Delete any instances created as
# part of this test run. Defaults to false.
# ARTIFACTS: For REMOTE=true only. Local directory to scp test artifacts into
# from the remote hosts. Defaults to ""/tmp/_artifacts".
# REPORT: For REMOTE=false only. Local directory to write juntil xml results
# to. Defaults to "/tmp/".
# CLEANUP: For REMOTE=true only. If false, do not stop processes or delete
# test files on remote hosts. Defaults to true.
# IMAGE_PROJECT: For REMOTE=true only. Project containing images provided to
# IMAGES. Defaults to "kubernetes-node-e2e-images".
# INSTANCE_PREFIX: For REMOTE=true only. Instances created from images will
# have the name "${INSTANCE_PREFIX}-${IMAGE_NAME}". Defaults to "test".
# #
# Example: # Example:
# make test_e2e_node FOCUS=kubelet SKIP=container # make test-e2e-node FOCUS=kubelet SKIP=container
# make test_e2e_node REMOTE=true DELETE_INSTANCES=true # make test-e2e-node REMOTE=true DELETE_INSTANCES=true
# Build and run tests. # Build and run tests.
test_e2e_node: ginkgo .PHONY: test-e2e-node
hack/e2e-node-test.sh test-e2e-node: ginkgo generated_files
.PHONY: test_e2e_node hack/make-rules/test-e2e-node.sh
# Build and run cmdline tests.
#
# Example:
# make test-cmd
test-cmd:
@hack/make-rules/test-cmd.sh
.PHONY: test-cmd
# Remove all build artifacts. # Remove all build artifacts.
# #
# Example: # Example:
# make clean # make clean
clean: .PHONY: clean
clean: clean_generated clean_meta
build/make-clean.sh build/make-clean.sh
rm -rf $(OUT_DIR) rm -rf $(OUT_DIR)
rm -rf Godeps/_workspace # Just until we are sure it is gone rm -rf Godeps/_workspace # Just until we are sure it is gone
.PHONY: clean
# Remove make-related metadata files.
#
# Example:
# make clean_meta
.PHONY: clean_meta
clean_meta:
rm -rf $(META_DIR)
# Run 'go vet'. # Run 'go vet'.
# #
...@@ -139,30 +201,45 @@ clean: ...@@ -139,30 +201,45 @@ clean:
# WHAT: Directory names to vet. All *.go files under these # WHAT: Directory names to vet. All *.go files under these
# directories will be vetted. If not specified, "everything" will be # directories will be vetted. If not specified, "everything" will be
# vetted. # vetted.
# TESTS: Same as WHAT.
# GOFLAGS: Extra flags to pass to 'go' when building.
# GOLDFLAGS: Extra linking flags to pass to 'go' when building.
# #
# Example: # Example:
# make vet # make vet
# make vet WHAT=pkg/kubelet # make vet WHAT=pkg/kubelet
vet:
hack/verify-govet.sh $(WHAT) $(TESTS)
.PHONY: vet .PHONY: vet
vet:
hack/make-rules/vet.sh $(WHAT)
# Build a release # Build a release
# #
# Example: # Example:
# make release # make release
release:
build/release.sh
.PHONY: release .PHONY: release
release: generated_files
build/release.sh
# Build a release, but skip tests # Build a release, but skip tests
# #
# Example: # Example:
# make release-skip-tests # make release-skip-tests
release-skip-tests quick-release:
KUBE_RELEASE_RUN_TESTS=n KUBE_FASTBUILD=true build/release.sh
.PHONY: release-skip-tests quick-release .PHONY: release-skip-tests quick-release
release-skip-tests quick-release: generated_files
KUBE_RELEASE_RUN_TESTS=n KUBE_FASTBUILD=true build/release.sh
# Cross-compile for all platforms
#
# Example:
# make cross
.PHONY: cross
cross:
hack/make-rules/cross.sh
# Add rules for all directories in cmd/
#
# Example:
# make kubectl kube-proxy
.PHONY: $(notdir $(abspath $(wildcard cmd/*/)))
$(notdir $(abspath $(wildcard cmd/*/))): generated_files
hack/make-rules/build.sh cmd/$@
# Include logic for generated files.
include Makefile.generated_files
...@@ -24,10 +24,11 @@ There is also early support for building Docker "run" containers ...@@ -24,10 +24,11 @@ There is also early support for building Docker "run" containers
The following scripts are found in the `build/` directory: The following scripts are found in the `build/` directory:
* `run.sh`: Run a command in a build docker container. Common invocations: * `run.sh`: Run a command in a build docker container. Common invocations:
* `run.sh hack/build-go.sh`: Build just linux binaries in the container. Pass options and packages as necessary. * `run.sh make`: Build just linux binaries in the container. Pass options and packages as necessary.
* `run.sh hack/build-cross.sh`: Build all binaries for all platforms * `run.sh make cross`: Build all binaries for all platforms
* `run.sh hack/test-go.sh`: Run all unit tests * `run.sh make test`: Run all unit tests
* `run.sh hack/test-integration.sh`: Run integration test * `run.sh make test-integration`: Run integration test
* `run.sh make test-cmd`: Run CLI tests
* `copy-output.sh`: This will copy the contents of `_output/dockerized/bin` from any remote Docker container to the local `_output/dockerized/bin`. Right now this is only necessary on Mac OS X with `boot2docker` when your git repo isn't under `/Users`. * `copy-output.sh`: This will copy the contents of `_output/dockerized/bin` from any remote Docker container to the local `_output/dockerized/bin`. Right now this is only necessary on Mac OS X with `boot2docker` when your git repo isn't under `/Users`.
* `make-clean.sh`: Clean out the contents of `_output/dockerized` and remove any local built container images. * `make-clean.sh`: Clean out the contents of `_output/dockerized` and remove any local built container images.
* `shell.sh`: Drop into a `bash` shell in a build container with a snapshot of the current repo code. * `shell.sh`: Drop into a `bash` shell in a build container with a snapshot of the current repo code.
......
...@@ -25,7 +25,11 @@ RUN chmod -R a+rwx /usr/local/go/pkg ...@@ -25,7 +25,11 @@ RUN chmod -R a+rwx /usr/local/go/pkg
# of operations. # of operations.
ENV HOME /go/src/k8s.io/kubernetes ENV HOME /go/src/k8s.io/kubernetes
WORKDIR ${HOME} WORKDIR ${HOME}
RUN chmod -R a+rwx ${HOME} # We have to mkdir the dirs we need, or else Docker will create them when we
# mount volumes, and it will create them with root-only permissions. The
# explicit chmod of _output is required, but I can't really explain why.
RUN mkdir -p ${HOME} ${HOME}/_output \
&& chmod -R a+rwx ${HOME} ${HOME}/_output
# Propagate the git tree version into the build image # Propagate the git tree version into the build image
ADD kube-version-defs /kube-version-defs ADD kube-version-defs /kube-version-defs
......
...@@ -64,6 +64,9 @@ readonly LOCAL_OUTPUT_BINPATH="${LOCAL_OUTPUT_SUBPATH}/bin" ...@@ -64,6 +64,9 @@ readonly LOCAL_OUTPUT_BINPATH="${LOCAL_OUTPUT_SUBPATH}/bin"
readonly LOCAL_OUTPUT_GOPATH="${LOCAL_OUTPUT_SUBPATH}/go" readonly LOCAL_OUTPUT_GOPATH="${LOCAL_OUTPUT_SUBPATH}/go"
readonly LOCAL_OUTPUT_IMAGE_STAGING="${LOCAL_OUTPUT_ROOT}/images" readonly LOCAL_OUTPUT_IMAGE_STAGING="${LOCAL_OUTPUT_ROOT}/images"
# This is a symlink to binaries for "this platform" (e.g. build tools).
readonly THIS_PLATFORM_BIN="${LOCAL_OUTPUT_ROOT}/bin"
readonly OUTPUT_BINPATH="${CUSTOM_OUTPUT_BINPATH:-$LOCAL_OUTPUT_BINPATH}" readonly OUTPUT_BINPATH="${CUSTOM_OUTPUT_BINPATH:-$LOCAL_OUTPUT_BINPATH}"
readonly REMOTE_OUTPUT_ROOT="/go/src/${KUBE_GO_PACKAGE}/_output" readonly REMOTE_OUTPUT_ROOT="/go/src/${KUBE_GO_PACKAGE}/_output"
...@@ -478,24 +481,9 @@ function kube::build::build_image_built() { ...@@ -478,24 +481,9 @@ function kube::build::build_image_built() {
# The set of source targets to include in the kube-build image # The set of source targets to include in the kube-build image
function kube::build::source_targets() { function kube::build::source_targets() {
local targets=( local targets=(
api $(find . -mindepth 1 -maxdepth 1 -not \( \
build \( -path ./_\* -o -path ./.git\* \) -prune \
cluster \))
cmd
docs
examples
federation
Godeps/Godeps.json
hack
LICENSE
pkg
plugin
DESIGN.md
README.md
test
third_party
vendor
contrib/mesos
) )
if [ -n "${KUBERNETES_CONTRIB:-}" ]; then if [ -n "${KUBERNETES_CONTRIB:-}" ]; then
for contrib in "${KUBERNETES_CONTRIB}"; do for contrib in "${KUBERNETES_CONTRIB}"; do
...@@ -672,6 +660,8 @@ function kube::build::copy_output() { ...@@ -672,6 +660,8 @@ function kube::build::copy_output() {
kube::log::status "Syncing back _output/dockerized/bin directory from remote Docker" kube::log::status "Syncing back _output/dockerized/bin directory from remote Docker"
rm -rf "${LOCAL_OUTPUT_BINPATH}" rm -rf "${LOCAL_OUTPUT_BINPATH}"
mkdir -p "${LOCAL_OUTPUT_BINPATH}" mkdir -p "${LOCAL_OUTPUT_BINPATH}"
rm -f "${THIS_PLATFORM_BIN}"
ln -s "${LOCAL_OUTPUT_BINPATH}" "${THIS_PLATFORM_BIN}"
kube::build::destroy_container "${KUBE_BUILD_CONTAINER_NAME}" kube::build::destroy_container "${KUBE_BUILD_CONTAINER_NAME}"
"${docker_cmd[@]}" bash -c "cp -r ${REMOTE_OUTPUT_BINPATH} /tmp/bin;touch /tmp/finished;rm /tmp/bin/test_for_remote;/bin/sleep 600" > /dev/null 2>&1 "${docker_cmd[@]}" bash -c "cp -r ${REMOTE_OUTPUT_BINPATH} /tmp/bin;touch /tmp/finished;rm /tmp/bin/test_for_remote;/bin/sleep 600" > /dev/null 2>&1
......
...@@ -30,11 +30,11 @@ KUBE_RELEASE_RUN_TESTS=${KUBE_RELEASE_RUN_TESTS-y} ...@@ -30,11 +30,11 @@ KUBE_RELEASE_RUN_TESTS=${KUBE_RELEASE_RUN_TESTS-y}
kube::build::verify_prereqs kube::build::verify_prereqs
kube::build::build_image kube::build::build_image
kube::build::run_build_command hack/build-cross.sh kube::build::run_build_command make cross
if [[ $KUBE_RELEASE_RUN_TESTS =~ ^[yY]$ ]]; then if [[ $KUBE_RELEASE_RUN_TESTS =~ ^[yY]$ ]]; then
kube::build::run_build_command hack/test-go.sh kube::build::run_build_command make test
kube::build::run_build_command hack/test-integration.sh kube::build::run_build_command make test-integration
fi fi
if [[ "${FEDERATION:-}" == "true" ]];then if [[ "${FEDERATION:-}" == "true" ]];then
......
...@@ -514,7 +514,7 @@ function kube-down { ...@@ -514,7 +514,7 @@ function kube-down {
#} #}
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# Cluster specific test helpers used from hack/e2e-test.sh # Cluster specific test helpers
# Execute prior to running tests to build a release if required for env. # Execute prior to running tests to build a release if required for env.
# #
......
...@@ -10,7 +10,7 @@ See http://kubernetes.io/docs/getting-started-guides/docker/ for up-to-date comm ...@@ -10,7 +10,7 @@ See http://kubernetes.io/docs/getting-started-guides/docker/ for up-to-date comm
```console ```console
# First, build the binaries # First, build the binaries
$ build/run.sh hack/build-cross.sh $ build/run.sh make cross
# Build for linux/amd64 (default) # Build for linux/amd64 (default)
$ make push VERSION={target_version} ARCH=amd64 $ make push VERSION={target_version} ARCH=amd64
......
...@@ -85,6 +85,7 @@ esac ...@@ -85,6 +85,7 @@ esac
# to find the latest one. # to find the latest one.
if [[ -z "${KUBECTL_PATH:-}" ]]; then if [[ -z "${KUBECTL_PATH:-}" ]]; then
locations=( locations=(
"${KUBE_ROOT}/_output/bin/kubectl"
"${KUBE_ROOT}/_output/dockerized/bin/${host_os}/${host_arch}/kubectl" "${KUBE_ROOT}/_output/dockerized/bin/${host_os}/${host_arch}/kubectl"
"${KUBE_ROOT}/_output/local/bin/${host_os}/${host_arch}/kubectl" "${KUBE_ROOT}/_output/local/bin/${host_os}/${host_arch}/kubectl"
"${KUBE_ROOT}/platforms/${host_os}/${host_arch}/kubectl" "${KUBE_ROOT}/platforms/${host_os}/${host_arch}/kubectl"
...@@ -96,7 +97,7 @@ if [[ -z "${KUBECTL_PATH:-}" ]]; then ...@@ -96,7 +97,7 @@ if [[ -z "${KUBECTL_PATH:-}" ]]; then
echo "It looks as if you don't have a compiled kubectl binary" echo "It looks as if you don't have a compiled kubectl binary"
echo echo
echo "If you are running from a clone of the git repo, please run" echo "If you are running from a clone of the git repo, please run"
echo "'./build/run.sh hack/build-cross.sh'. Note that this requires having" echo "'./build/run.sh make cross'. Note that this requires having"
echo "Docker installed." echo "Docker installed."
echo echo
echo "If you are running from a binary release tarball, something is wrong. " echo "If you are running from a binary release tarball, something is wrong. "
......
...@@ -59,12 +59,10 @@ func main() { ...@@ -59,12 +59,10 @@ func main() {
arguments := args.Default() arguments := args.Default()
// Override defaults. // Override defaults.
arguments.OutputFileBaseName = "deep_copy_generated" arguments.OutputFileBaseName = "deepcopy_generated"
// Custom args. // Custom args.
customArgs := &generators.CustomArgs{ customArgs := &generators.CustomArgs{}
BoundingDirs: []string{"k8s.io/kubernetes"},
}
pflag.CommandLine.StringSliceVar(&customArgs.BoundingDirs, "bounding-dirs", customArgs.BoundingDirs, pflag.CommandLine.StringSliceVar(&customArgs.BoundingDirs, "bounding-dirs", customArgs.BoundingDirs,
"Comma-separated list of import paths which bound the types for which deep-copies will be generated.") "Comma-separated list of import paths which bound the types for which deep-copies will be generated.")
arguments.CustomArgs = customArgs arguments.CustomArgs = customArgs
......
...@@ -31,4 +31,4 @@ TEST_ARGS="$@" ...@@ -31,4 +31,4 @@ TEST_ARGS="$@"
KUBE_ROOT=$(cd "$(dirname "${BASH_SOURCE}")/../../.." && pwd) KUBE_ROOT=$(cd "$(dirname "${BASH_SOURCE}")/../../.." && pwd)
"${KUBE_ROOT}/contrib/mesos/ci/run.sh" make clean test_integration ${TEST_ARGS} "${KUBE_ROOT}/contrib/mesos/ci/run.sh" make clean test-integration ${TEST_ARGS}
...@@ -155,7 +155,7 @@ K8SM_IMAGE_NAME=haih/k8sm ...@@ -155,7 +155,7 @@ K8SM_IMAGE_NAME=haih/k8sm
git clone https://github.com/mesosphere/kubernetes git clone https://github.com/mesosphere/kubernetes
cd kubernetes cd kubernetes
git checkout release-v0.7-v1.1 git checkout release-v0.7-v1.1
KUBERNETES_CONTRIB=mesos build/run.sh hack/build-go.sh KUBERNETES_CONTRIB=mesos build/run.sh make
cd .. cd ..
sudo docker build -t $K8SM_IMAGE_NAME --no-cache . sudo docker build -t $K8SM_IMAGE_NAME --no-cache .
EOF EOF
......
...@@ -119,8 +119,8 @@ pkg/kubectl/cmd/util/factory.go. ...@@ -119,8 +119,8 @@ pkg/kubectl/cmd/util/factory.go.
1. Add your group in pkg/api/testapi/testapi.go, then you can access the group 1. Add your group in pkg/api/testapi/testapi.go, then you can access the group
in tests through testapi.`<group>`; in tests through testapi.`<group>`;
2. Add your "group/version" to `KUBE_API_VERSIONS` and `KUBE_TEST_API_VERSIONS` 2. Add your "group/version" to `KUBE_TEST_API_VERSIONS` in
in hack/test-go.sh. hack/make-rules/test.sh and hack/make-rules/test-integration.sh
TODO: Add a troubleshooting section. TODO: Add a troubleshooting section.
......
...@@ -470,7 +470,7 @@ hack/update-codegen.sh ...@@ -470,7 +470,7 @@ hack/update-codegen.sh
As part of the build, kubernetes will also generate code to handle deep copy of As part of the build, kubernetes will also generate code to handle deep copy of
your versioned api objects. The deep copy code resides with each versioned API: your versioned api objects. The deep copy code resides with each versioned API:
- `<path_to_versioned_api>/zz_generated.deep_copy.go` containing auto-generated copy functions - `<path_to_versioned_api>/zz_generated.deepcopy.go` containing auto-generated copy functions
If regeneration is somehow not possible due to compile errors, the easiest If regeneration is somehow not possible due to compile errors, the easiest
workaround is to comment out the code causing errors and let the script to workaround is to comment out the code causing errors and let the script to
......
...@@ -71,11 +71,16 @@ up a GOPATH. ...@@ -71,11 +71,16 @@ up a GOPATH.
To build Kubernetes using your local Go development environment (generate linux To build Kubernetes using your local Go development environment (generate linux
binaries): binaries):
hack/build-go.sh ```sh
make
```
You may pass build options and packages to the script as necessary. To build You may pass build options and packages to the script as necessary. To build
binaries for all platforms: binaries for all platforms:
hack/build-cross.sh ```sh
make cross
```
## Workflow ## Workflow
...@@ -314,8 +319,8 @@ Three basic commands let you run unit, integration and/or e2e tests: ...@@ -314,8 +319,8 @@ Three basic commands let you run unit, integration and/or e2e tests:
```sh ```sh
cd kubernetes cd kubernetes
hack/test-go.sh # Run unit tests make test # Run unit tests
hack/test-integration.sh # Run integration tests, requires etcd make test-integration # Run integration tests, requires etcd
go run hack/e2e.go -v --build --up --test --down # Run e2e tests go run hack/e2e.go -v --build --up --test --down # Run e2e tests
``` ```
......
...@@ -57,7 +57,7 @@ Prerequisites: ...@@ -57,7 +57,7 @@ Prerequisites:
From the Kubernetes base directory, run: From the Kubernetes base directory, run:
```sh ```sh
make test_e2e_node make test-e2e-node
``` ```
This will: run the *ginkgo* binary against the subdirectory *test/e2e_node*, which will in turn: This will: run the *ginkgo* binary against the subdirectory *test/e2e_node*, which will in turn:
...@@ -87,7 +87,7 @@ Prerequisites: ...@@ -87,7 +87,7 @@ Prerequisites:
Run: Run:
```sh ```sh
make test_e2e_node REMOTE=true make test-e2e-node REMOTE=true
``` ```
This will: This will:
...@@ -124,7 +124,7 @@ provided by the default image. ...@@ -124,7 +124,7 @@ provided by the default image.
List the available test images using gcloud. List the available test images using gcloud.
```sh ```sh
make test_e2e_node LIST_IMAGES=true make test-e2e-node LIST_IMAGES=true
``` ```
This will output a list of the available images for the default image project. This will output a list of the available images for the default image project.
...@@ -132,7 +132,7 @@ This will output a list of the available images for the default image project. ...@@ -132,7 +132,7 @@ This will output a list of the available images for the default image project.
Then run: Then run:
```sh ```sh
make test_e2e_node REMOTE=true IMAGES="<comma-separated-list-images>" make test-e2e-node REMOTE=true IMAGES="<comma-separated-list-images>"
``` ```
## Run tests against a running GCE instance (not an image) ## Run tests against a running GCE instance (not an image)
...@@ -140,7 +140,7 @@ make test_e2e_node REMOTE=true IMAGES="<comma-separated-list-images>" ...@@ -140,7 +140,7 @@ make test_e2e_node REMOTE=true IMAGES="<comma-separated-list-images>"
This is useful if you have an host instance running already and want to run the tests there instead of on a new instance. This is useful if you have an host instance running already and want to run the tests there instead of on a new instance.
```sh ```sh
make test_e2e_node REMOTE=true HOSTS="<comma-separated-list-of-hostnames>" make test-e2e-node REMOTE=true HOSTS="<comma-separated-list-of-hostnames>"
``` ```
## Delete instance after tests run ## Delete instance after tests run
...@@ -148,7 +148,7 @@ make test_e2e_node REMOTE=true HOSTS="<comma-separated-list-of-hostnames>" ...@@ -148,7 +148,7 @@ make test_e2e_node REMOTE=true HOSTS="<comma-separated-list-of-hostnames>"
This is useful if you want recreate the instance for each test run to trigger flakes related to starting the instance. This is useful if you want recreate the instance for each test run to trigger flakes related to starting the instance.
```sh ```sh
make test_e2e_node REMOTE=true DELETE_INSTANCES=true make test-e2e-node REMOTE=true DELETE_INSTANCES=true
``` ```
## Keep instance, test binaries, and *processes* around after tests run ## Keep instance, test binaries, and *processes* around after tests run
...@@ -156,7 +156,7 @@ make test_e2e_node REMOTE=true DELETE_INSTANCES=true ...@@ -156,7 +156,7 @@ make test_e2e_node REMOTE=true DELETE_INSTANCES=true
This is useful if you want to manually inspect or debug the kubelet process run as part of the tests. This is useful if you want to manually inspect or debug the kubelet process run as part of the tests.
```sh ```sh
make test_e2e_node REMOTE=true CLEANUP=false make test-e2e-node REMOTE=true CLEANUP=false
``` ```
## Run tests using an image in another project ## Run tests using an image in another project
...@@ -164,7 +164,7 @@ make test_e2e_node REMOTE=true CLEANUP=false ...@@ -164,7 +164,7 @@ make test_e2e_node REMOTE=true CLEANUP=false
This is useful if you want to create your own host image in another project and use it for testing. This is useful if you want to create your own host image in another project and use it for testing.
```sh ```sh
make test_e2e_node REMOTE=true IMAGE_PROJECT="<name-of-project-with-images>" IMAGES="<image-name>" make test-e2e-node REMOTE=true IMAGE_PROJECT="<name-of-project-with-images>" IMAGES="<image-name>"
``` ```
Setting up your own host image may require additional steps such as installing etcd or docker. See Setting up your own host image may require additional steps such as installing etcd or docker. See
...@@ -176,7 +176,7 @@ This is useful if you want to create instances using a different name so that yo ...@@ -176,7 +176,7 @@ This is useful if you want to create instances using a different name so that yo
test in parallel against different instances of the same image. test in parallel against different instances of the same image.
```sh ```sh
make test_e2e_node REMOTE=true INSTANCE_PREFIX="my-prefix" make test-e2e-node REMOTE=true INSTANCE_PREFIX="my-prefix"
``` ```
# Additional Test Options for both Remote and Local execution # Additional Test Options for both Remote and Local execution
...@@ -186,13 +186,13 @@ make test_e2e_node REMOTE=true INSTANCE_PREFIX="my-prefix" ...@@ -186,13 +186,13 @@ make test_e2e_node REMOTE=true INSTANCE_PREFIX="my-prefix"
To run tests matching a regex: To run tests matching a regex:
```sh ```sh
make test_e2e_node REMOTE=true FOCUS="<regex-to-match>" make test-e2e-node REMOTE=true FOCUS="<regex-to-match>"
``` ```
To run tests NOT matching a regex: To run tests NOT matching a regex:
```sh ```sh
make test_e2e_node REMOTE=true SKIP="<regex-to-match>" make test-e2e-node REMOTE=true SKIP="<regex-to-match>"
``` ```
## Run tests continually until they fail ## Run tests continually until they fail
...@@ -202,7 +202,7 @@ run the tests until they fail. **Note: this will only perform test setup once ( ...@@ -202,7 +202,7 @@ run the tests until they fail. **Note: this will only perform test setup once (
less useful for catching flakes related creating the instance from an image.** less useful for catching flakes related creating the instance from an image.**
```sh ```sh
make test_e2e_node REMOTE=true RUN_UNTIL_FAILURE=true make test-e2e-node REMOTE=true RUN_UNTIL_FAILURE=true
``` ```
# Notes on tests run by the Kubernetes project during pre-, post- submit. # Notes on tests run by the Kubernetes project during pre-, post- submit.
......
...@@ -69,9 +69,9 @@ Additionally, for infrequent or new contributors, we require the on call to appl ...@@ -69,9 +69,9 @@ Additionally, for infrequent or new contributors, we require the on call to appl
The following will save time for both you and your reviewer: The following will save time for both you and your reviewer:
* Enable [pre-commit hooks](development.md#committing-changes-to-your-fork) and verify they pass. * Enable [pre-commit hooks](development.md#committing-changes-to-your-fork) and verify they pass.
* Verify `hack/verify-all.sh` passes. * Verify `make verify` passes.
* Verify `hack/test-go.sh` passes. * Verify `make test` passes.
* Verify `hack/test-integration.sh` passes. * Verify `make test-integration.sh` passes.
## Release Notes ## Release Notes
......
...@@ -257,9 +257,11 @@ been automated that need to happen after the branch has been cut: ...@@ -257,9 +257,11 @@ been automated that need to happen after the branch has been cut:
*Please note that this information may be out of date. The scripts are the *Please note that this information may be out of date. The scripts are the
authoritative source on how version injection works.* authoritative source on how version injection works.*
Kubernetes may be built from either a git tree (using `hack/build-go.sh`) or Kubernetes may be built from either a git tree or from a tarball. We use
from a tarball (using either `hack/build-go.sh` or `go install`) or directly by `make` to encapsulate a number of build steps into a single command. This
the Go native build system (using `go get`). includes generating code, which means that tools like `go build` might work
(once files are generated) but might be using stale generated code. `make` is
the supported way to build.
When building from git, we want to be able to insert specific information about When building from git, we want to be able to insert specific information about
the build tree at build time. In particular, we want to use the output of `git the build tree at build time. In particular, we want to use the output of `git
...@@ -294,7 +296,7 @@ yield binaries that will identify themselves as `v0.4-dev` and will not be able ...@@ -294,7 +296,7 @@ yield binaries that will identify themselves as `v0.4-dev` and will not be able
to provide you with a SHA1. to provide you with a SHA1.
To add the extra versioning information when building from git, the To add the extra versioning information when building from git, the
`hack/build-go.sh` script will gather that information (using `git describe` and `make` build will gather that information (using `git describe` and
`git rev-parse`) and then create a `-ldflags` string to pass to `go install` and `git rev-parse`) and then create a `-ldflags` string to pass to `go install` and
tell the Go linker to override the contents of those variables at build time. It tell the Go linker to override the contents of those variables at build time. It
can, for instance, tell it to override `gitVersion` and set it to can, for instance, tell it to override `gitVersion` and set it to
......
...@@ -170,7 +170,7 @@ You are running a single node setup. This has the limitation of only supporting ...@@ -170,7 +170,7 @@ You are running a single node setup. This has the limitation of only supporting
```sh ```sh
cd kubernetes cd kubernetes
hack/build-go.sh make
hack/local-up-cluster.sh hack/local-up-cluster.sh
``` ```
......
...@@ -83,13 +83,13 @@ passing, so it is often a good idea to make sure the e2e tests work as well. ...@@ -83,13 +83,13 @@ passing, so it is often a good idea to make sure the e2e tests work as well.
### Run all unit tests ### Run all unit tests
The `hack/test-go.sh` script is the entrypoint for running the unit tests that `make test` is the entrypoint for running the unit tests that ensures that
ensures that `GOPATH` is set up correctly. If you have `GOPATH` set up `GOPATH` is set up correctly. If you have `GOPATH` set up correctly, you can
correctly, you can also just use `go test` directly. also just use `go test` directly.
```sh ```sh
cd kubernetes cd kubernetes
hack/test-go.sh # Run all unit tests. make test # Run all unit tests.
``` ```
### Set go flags during unit tests ### Set go flags during unit tests
...@@ -99,18 +99,23 @@ You can set [go flags](https://golang.org/cmd/go/) by setting the ...@@ -99,18 +99,23 @@ You can set [go flags](https://golang.org/cmd/go/) by setting the
### Run unit tests from certain packages ### Run unit tests from certain packages
The `hack/test-go.sh` script accepts packages as arguments; the `make test` accepts packages as arguments; the `k8s.io/kubernetes` prefix is
`k8s.io/kubernetes` prefix is added automatically to these: added automatically to these:
```sh ```sh
hack/test-go.sh pkg/api # run tests for pkg/api make test WHAT=pkg/api # run tests for pkg/api
hack/test-go.sh pkg/api pkg/kubelet # run tests for pkg/api and pkg/kubelet ```
To run multiple targets you need quotes:
```sh
make test WHAT="pkg/api pkg/kubelet" # run tests for pkg/api and pkg/kubelet
``` ```
In a shell, it's often handy to use brace expansion: In a shell, it's often handy to use brace expansion:
```sh ```sh
hack/test-go.sh pkg/{api,kubelet} # run tests for pkg/api and pkg/kubelet make test WHAT=pkg/{api,kubelet} # run tests for pkg/api and pkg/kubelet
``` ```
### Run specific unit test cases in a package ### Run specific unit test cases in a package
...@@ -121,10 +126,10 @@ regular expression for the name of the test that should be run. ...@@ -121,10 +126,10 @@ regular expression for the name of the test that should be run.
```sh ```sh
# Runs TestValidatePod in pkg/api/validation with the verbose flag set # Runs TestValidatePod in pkg/api/validation with the verbose flag set
KUBE_GOFLAGS="-v" KUBE_TEST_ARGS='-run ^TestValidatePod$' hack/test-go.sh pkg/api/validation make test WHAT=pkg/api/validation KUBE_GOFLAGS="-v" KUBE_TEST_ARGS='-run ^TestValidatePod$'
# Runs tests that match the regex ValidatePod|ValidateConfigMap in pkg/api/validation # Runs tests that match the regex ValidatePod|ValidateConfigMap in pkg/api/validation
KUBE_GOFLAGS="-v" KUBE_TEST_ARGS="-run ValidatePod\|ValidateConfigMap$" hack/test-go.sh pkg/api/validation make test WHAT=pkg/api/validation KUBE_GOFLAGS="-v" KUBE_TEST_ARGS="-run ValidatePod\|ValidateConfigMap$"
``` ```
For other supported test flags, see the [golang For other supported test flags, see the [golang
...@@ -137,7 +142,7 @@ You can do this efficiently. ...@@ -137,7 +142,7 @@ You can do this efficiently.
```sh ```sh
# Have 2 workers run all tests 5 times each (10 total iterations). # Have 2 workers run all tests 5 times each (10 total iterations).
hack/test-go.sh -p 2 -i 5 make test PARALLEL=2 ITERATION=5
``` ```
For more advanced ideas please see [flaky-tests.md](flaky-tests.md). For more advanced ideas please see [flaky-tests.md](flaky-tests.md).
...@@ -149,7 +154,7 @@ Currently, collecting coverage is only supported for the Go unit tests. ...@@ -149,7 +154,7 @@ Currently, collecting coverage is only supported for the Go unit tests.
To run all unit tests and generate an HTML coverage report, run the following: To run all unit tests and generate an HTML coverage report, run the following:
```sh ```sh
KUBE_COVER=y hack/test-go.sh make test KUBE_COVER=y
``` ```
At the end of the run, an HTML report will be generated with the path At the end of the run, an HTML report will be generated with the path
...@@ -159,7 +164,7 @@ To run tests and collect coverage in only one package, pass its relative path ...@@ -159,7 +164,7 @@ To run tests and collect coverage in only one package, pass its relative path
under the `kubernetes` directory as an argument, for example: under the `kubernetes` directory as an argument, for example:
```sh ```sh
KUBE_COVER=y hack/test-go.sh pkg/kubectl make test WHAT=pkg/kubectl KUBE_COVER=y
``` ```
Multiple arguments can be passed, in which case the coverage results will be Multiple arguments can be passed, in which case the coverage results will be
...@@ -224,14 +229,14 @@ for those internal etcd instances with the `TEST_ETCD_DIR` environment variable. ...@@ -224,14 +229,14 @@ for those internal etcd instances with the `TEST_ETCD_DIR` environment variable.
### Run integration tests ### Run integration tests
The integration tests are run using the `hack/test-integration.sh` script. The integration tests are run using `make test-integration`.
The Kubernetes integration tests are writting using the normal golang testing The Kubernetes integration tests are writting using the normal golang testing
package but expect to have a running etcd instance to connect to. The `test- package but expect to have a running etcd instance to connect to. The `test-
integration.sh` script wraps `hack/test-go.sh` and sets up an etcd instance integration.sh` script wraps `make test` and sets up an etcd instance
for the integration tests to use. for the integration tests to use.
```sh ```sh
hack/test-integration.sh # Run all integration tests. make test-integration # Run all integration tests.
``` ```
This script runs the golang tests in package This script runs the golang tests in package
...@@ -244,7 +249,7 @@ You can use also use the `KUBE_TEST_ARGS` environment variable with the `hack ...@@ -244,7 +249,7 @@ You can use also use the `KUBE_TEST_ARGS` environment variable with the `hack
```sh ```sh
# Run integration test TestPodUpdateActiveDeadlineSeconds with the verbose flag set. # Run integration test TestPodUpdateActiveDeadlineSeconds with the verbose flag set.
KUBE_GOFLAGS="-v" KUBE_TEST_ARGS="-run ^TestPodUpdateActiveDeadlineSeconds$" hack/test-integration.sh make test-integration KUBE_GOFLAGS="-v" KUBE_TEST_ARGS="-run ^TestPodUpdateActiveDeadlineSeconds$"
``` ```
If you set `KUBE_TEST_ARGS`, the test case will be run with only the `v1` API If you set `KUBE_TEST_ARGS`, the test case will be run with only the `v1` API
......
...@@ -23,7 +23,8 @@ GOARCH?=$(shell go env GOARCH) ...@@ -23,7 +23,8 @@ GOARCH?=$(shell go env GOARCH)
GOOS?=$(shell go env GOOS) GOOS?=$(shell go env GOOS)
kubectl: kubectl:
KUBE_STATIC_OVERRIDES="kubectl" ../../hack/build-go.sh cmd/kubectl; cp ../../_output/local/bin/$(GOOS)/$(GOARCH)/kubectl . make -C ../../ WHAT=cmd/kubectl KUBE_STATIC_OVERRIDES="kubectl"; \
cp ../../_output/local/bin/$(GOOS)/$(GOARCH)/kubectl .
.tag: kubectl .tag: kubectl
./kubectl version -c | grep -o 'GitVersion:"[^"]*"' | cut -f 2 -d '"' > .tag ./kubectl version -c | grep -o 'GitVersion:"[^"]*"' | cut -f 2 -d '"' > .tag
......
/*
Copyright 2016 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.
*/
package core
import (
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/runtime"
)
func addDefaultingFuncs(scheme *runtime.Scheme) {
scheme.AddDefaultingFuncs(
func(obj *api.ListOptions) {
if obj.LabelSelector == nil {
obj.LabelSelector = labels.Everything()
}
if obj.FieldSelector == nil {
obj.FieldSelector = fields.Everything()
}
},
)
}
func addConversionFuncs(scheme *runtime.Scheme) {
scheme.AddConversionFuncs(
api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta,
api.Convert_unversioned_ListMeta_To_unversioned_ListMeta,
api.Convert_intstr_IntOrString_To_intstr_IntOrString,
api.Convert_unversioned_Time_To_unversioned_Time,
api.Convert_Slice_string_To_unversioned_Time,
api.Convert_string_To_labels_Selector,
api.Convert_string_To_fields_Selector,
api.Convert_Pointer_bool_To_bool,
api.Convert_bool_To_Pointer_bool,
api.Convert_Pointer_string_To_string,
api.Convert_string_To_Pointer_string,
api.Convert_labels_Selector_To_string,
api.Convert_fields_Selector_To_string,
api.Convert_resource_Quantity_To_resource_Quantity,
)
}
...@@ -72,7 +72,4 @@ func AddToScheme(scheme *runtime.Scheme) { ...@@ -72,7 +72,4 @@ func AddToScheme(scheme *runtime.Scheme) {
&unversioned.APIGroup{}, &unversioned.APIGroup{},
&unversioned.APIResourceList{}, &unversioned.APIResourceList{},
) )
addDefaultingFuncs(scheme)
addConversionFuncs(scheme)
} }
/*
Copyright 2016 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.
*/
package v1
import (
"fmt"
"k8s.io/kubernetes/pkg/api/v1"
"k8s.io/kubernetes/pkg/runtime"
)
func addConversionFuncs(scheme *runtime.Scheme) {
// Add non-generated conversion functions
err := scheme.AddConversionFuncs(
v1.Convert_v1_DeleteOptions_To_api_DeleteOptions,
v1.Convert_api_DeleteOptions_To_v1_DeleteOptions,
v1.Convert_v1_ExportOptions_To_api_ExportOptions,
v1.Convert_api_ExportOptions_To_v1_ExportOptions,
v1.Convert_v1_List_To_api_List,
v1.Convert_api_List_To_v1_List,
v1.Convert_v1_ListOptions_To_api_ListOptions,
v1.Convert_api_ListOptions_To_v1_ListOptions,
v1.Convert_v1_ObjectFieldSelector_To_api_ObjectFieldSelector,
v1.Convert_api_ObjectFieldSelector_To_v1_ObjectFieldSelector,
v1.Convert_v1_ObjectMeta_To_api_ObjectMeta,
v1.Convert_api_ObjectMeta_To_v1_ObjectMeta,
v1.Convert_v1_ObjectReference_To_api_ObjectReference,
v1.Convert_api_ObjectReference_To_v1_ObjectReference,
v1.Convert_v1_OwnerReference_To_api_OwnerReference,
v1.Convert_api_OwnerReference_To_v1_OwnerReference,
v1.Convert_v1_Service_To_api_Service,
v1.Convert_api_Service_To_v1_Service,
v1.Convert_v1_ServiceList_To_api_ServiceList,
v1.Convert_api_ServiceList_To_v1_ServiceList,
v1.Convert_v1_ServicePort_To_api_ServicePort,
v1.Convert_api_ServicePort_To_v1_ServicePort,
v1.Convert_v1_ServiceProxyOptions_To_api_ServiceProxyOptions,
v1.Convert_api_ServiceProxyOptions_To_v1_ServiceProxyOptions,
v1.Convert_v1_ServiceSpec_To_api_ServiceSpec,
v1.Convert_api_ServiceSpec_To_v1_ServiceSpec,
v1.Convert_v1_ServiceStatus_To_api_ServiceStatus,
v1.Convert_api_ServiceStatus_To_v1_ServiceStatus,
)
if err != nil {
// If one of the conversion functions is malformed, detect it immediately.
panic(err)
}
// Add field label conversions for kinds having selectable nothing but ObjectMeta fields.
for _, kind := range []string{
"Service",
} {
err = scheme.AddFieldLabelConversionFunc("v1", kind,
func(label, value string) (string, string, error) {
switch label {
case "metadata.namespace",
"metadata.name":
return label, value, nil
default:
return "", "", fmt.Errorf("field label %q not supported for %q", label, kind)
}
})
if err != nil {
// If one of the conversion functions is malformed, detect it immediately.
panic(err)
}
}
}
...@@ -32,8 +32,6 @@ var SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: "v1 ...@@ -32,8 +32,6 @@ var SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: "v1
func AddToScheme(scheme *runtime.Scheme) { func AddToScheme(scheme *runtime.Scheme) {
// Add the API to Scheme. // Add the API to Scheme.
addKnownTypes(scheme) addKnownTypes(scheme)
addConversionFuncs(scheme)
addDefaultingFuncs(scheme)
} }
// Adds the list of known types to api.Scheme. // Adds the list of known types to api.Scheme.
......
// +build !ignore_autogenerated
/*
Copyright 2016 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.
*/
// This file was autogenerated by deepcopy-gen. Do not edit it manually!
package federation
import (
api "k8s.io/kubernetes/pkg/api"
conversion "k8s.io/kubernetes/pkg/conversion"
reflect "reflect"
)
func init() {
if err := api.Scheme.AddGeneratedDeepCopyFuncs(
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_federation_Cluster, InType: reflect.TypeOf(func() *Cluster { var x *Cluster; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_federation_ClusterCondition, InType: reflect.TypeOf(func() *ClusterCondition { var x *ClusterCondition; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_federation_ClusterList, InType: reflect.TypeOf(func() *ClusterList { var x *ClusterList; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_federation_ClusterSpec, InType: reflect.TypeOf(func() *ClusterSpec { var x *ClusterSpec; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_federation_ClusterStatus, InType: reflect.TypeOf(func() *ClusterStatus { var x *ClusterStatus; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_federation_ServerAddressByClientCIDR, InType: reflect.TypeOf(func() *ServerAddressByClientCIDR { var x *ServerAddressByClientCIDR; return x }())},
); err != nil {
// if one of the deep copy functions is malformed, detect it immediately.
panic(err)
}
}
func DeepCopy_federation_Cluster(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*Cluster)
out := out.(*Cluster)
out.TypeMeta = in.TypeMeta
if err := api.DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
return err
}
if err := DeepCopy_federation_ClusterSpec(&in.Spec, &out.Spec, c); err != nil {
return err
}
if err := DeepCopy_federation_ClusterStatus(&in.Status, &out.Status, c); err != nil {
return err
}
return nil
}
}
func DeepCopy_federation_ClusterCondition(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*ClusterCondition)
out := out.(*ClusterCondition)
out.Type = in.Type
out.Status = in.Status
out.LastProbeTime = in.LastProbeTime.DeepCopy()
out.LastTransitionTime = in.LastTransitionTime.DeepCopy()
out.Reason = in.Reason
out.Message = in.Message
return nil
}
}
func DeepCopy_federation_ClusterList(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*ClusterList)
out := out.(*ClusterList)
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]Cluster, len(*in))
for i := range *in {
if err := DeepCopy_federation_Cluster(&(*in)[i], &(*out)[i], c); err != nil {
return err
}
}
} else {
out.Items = nil
}
return nil
}
}
func DeepCopy_federation_ClusterSpec(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*ClusterSpec)
out := out.(*ClusterSpec)
if in.ServerAddressByClientCIDRs != nil {
in, out := &in.ServerAddressByClientCIDRs, &out.ServerAddressByClientCIDRs
*out = make([]ServerAddressByClientCIDR, len(*in))
for i := range *in {
(*out)[i] = (*in)[i]
}
} else {
out.ServerAddressByClientCIDRs = nil
}
if in.SecretRef != nil {
in, out := &in.SecretRef, &out.SecretRef
*out = new(api.LocalObjectReference)
**out = **in
} else {
out.SecretRef = nil
}
return nil
}
}
func DeepCopy_federation_ClusterStatus(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*ClusterStatus)
out := out.(*ClusterStatus)
if in.Conditions != nil {
in, out := &in.Conditions, &out.Conditions
*out = make([]ClusterCondition, len(*in))
for i := range *in {
if err := DeepCopy_federation_ClusterCondition(&(*in)[i], &(*out)[i], c); err != nil {
return err
}
}
} else {
out.Conditions = nil
}
if in.Zones != nil {
in, out := &in.Zones, &out.Zones
*out = make([]string, len(*in))
copy(*out, *in)
} else {
out.Zones = nil
}
out.Region = in.Region
return nil
}
}
func DeepCopy_federation_ServerAddressByClientCIDR(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*ServerAddressByClientCIDR)
out := out.(*ServerAddressByClientCIDR)
out.ClientCIDR = in.ClientCIDR
out.ServerAddress = in.ServerAddress
return nil
}
}
// +build !ignore_autogenerated
/*
Copyright 2016 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.
*/
// This file was autogenerated by deepcopy-gen. Do not edit it manually!
package v1beta1
import (
api "k8s.io/kubernetes/pkg/api"
v1 "k8s.io/kubernetes/pkg/api/v1"
conversion "k8s.io/kubernetes/pkg/conversion"
reflect "reflect"
)
func init() {
if err := api.Scheme.AddGeneratedDeepCopyFuncs(
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_Cluster, InType: reflect.TypeOf(func() *Cluster { var x *Cluster; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_ClusterCondition, InType: reflect.TypeOf(func() *ClusterCondition { var x *ClusterCondition; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_ClusterList, InType: reflect.TypeOf(func() *ClusterList { var x *ClusterList; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_ClusterSpec, InType: reflect.TypeOf(func() *ClusterSpec { var x *ClusterSpec; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_ClusterStatus, InType: reflect.TypeOf(func() *ClusterStatus { var x *ClusterStatus; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_ServerAddressByClientCIDR, InType: reflect.TypeOf(func() *ServerAddressByClientCIDR { var x *ServerAddressByClientCIDR; return x }())},
); err != nil {
// if one of the deep copy functions is malformed, detect it immediately.
panic(err)
}
}
func DeepCopy_v1beta1_Cluster(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*Cluster)
out := out.(*Cluster)
out.TypeMeta = in.TypeMeta
if err := v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
return err
}
if err := DeepCopy_v1beta1_ClusterSpec(&in.Spec, &out.Spec, c); err != nil {
return err
}
if err := DeepCopy_v1beta1_ClusterStatus(&in.Status, &out.Status, c); err != nil {
return err
}
return nil
}
}
func DeepCopy_v1beta1_ClusterCondition(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*ClusterCondition)
out := out.(*ClusterCondition)
out.Type = in.Type
out.Status = in.Status
out.LastProbeTime = in.LastProbeTime.DeepCopy()
out.LastTransitionTime = in.LastTransitionTime.DeepCopy()
out.Reason = in.Reason
out.Message = in.Message
return nil
}
}
func DeepCopy_v1beta1_ClusterList(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*ClusterList)
out := out.(*ClusterList)
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]Cluster, len(*in))
for i := range *in {
if err := DeepCopy_v1beta1_Cluster(&(*in)[i], &(*out)[i], c); err != nil {
return err
}
}
} else {
out.Items = nil
}
return nil
}
}
func DeepCopy_v1beta1_ClusterSpec(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*ClusterSpec)
out := out.(*ClusterSpec)
if in.ServerAddressByClientCIDRs != nil {
in, out := &in.ServerAddressByClientCIDRs, &out.ServerAddressByClientCIDRs
*out = make([]ServerAddressByClientCIDR, len(*in))
for i := range *in {
(*out)[i] = (*in)[i]
}
} else {
out.ServerAddressByClientCIDRs = nil
}
if in.SecretRef != nil {
in, out := &in.SecretRef, &out.SecretRef
*out = new(v1.LocalObjectReference)
**out = **in
} else {
out.SecretRef = nil
}
return nil
}
}
func DeepCopy_v1beta1_ClusterStatus(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*ClusterStatus)
out := out.(*ClusterStatus)
if in.Conditions != nil {
in, out := &in.Conditions, &out.Conditions
*out = make([]ClusterCondition, len(*in))
for i := range *in {
if err := DeepCopy_v1beta1_ClusterCondition(&(*in)[i], &(*out)[i], c); err != nil {
return err
}
}
} else {
out.Conditions = nil
}
if in.Zones != nil {
in, out := &in.Zones, &out.Zones
*out = make([]string, len(*in))
copy(*out, *in)
} else {
out.Zones = nil
}
out.Region = in.Region
return nil
}
}
func DeepCopy_v1beta1_ServerAddressByClientCIDR(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*ServerAddressByClientCIDR)
out := out.(*ServerAddressByClientCIDR)
out.ClientCIDR = in.ClientCIDR
out.ServerAddress = in.ServerAddress
return nil
}
}
...@@ -20,4 +20,8 @@ set -o pipefail ...@@ -20,4 +20,8 @@ set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
KUBE_COVER="" KUBE_RACE=" " "${KUBE_ROOT}/hack/test-go.sh" -- -test.run="^X" -benchtime=1s -bench=. -benchmem $@ make test \
WHAT="$*"
KUBE_COVER="" \
KUBE_RACE=" " \
KUBE_TEST_ARGS="-- -test.run='^X' -benchtime=1s -bench=. -benchmem" \
...@@ -40,7 +40,7 @@ runTests() { ...@@ -40,7 +40,7 @@ runTests() {
KUBE_TEST_ETCD_PREFIXES="registry" \ KUBE_TEST_ETCD_PREFIXES="registry" \
ETCD_CUSTOM_PREFIX="None" \ ETCD_CUSTOM_PREFIX="None" \
KUBE_TEST_ARGS="${ARGS}" \ KUBE_TEST_ARGS="${ARGS}" \
"${KUBE_ROOT}/hack/test-go.sh" test/integration make test WHAT=test/integration
cleanup cleanup
} }
......
...@@ -14,23 +14,18 @@ ...@@ -14,23 +14,18 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# This script sets up a go workspace locally and builds all for all appropriate # This script is a vestigial redirection. Please do not add "real" logic.
# platforms.
set -o errexit set -o errexit
set -o nounset set -o nounset
set -o pipefail set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
source "${KUBE_ROOT}/hack/lib/init.sh"
KUBE_BUILD_PLATFORMS=("${KUBE_SERVER_PLATFORMS[@]}") echo "NOTE: $0 has been replaced by 'make cross'"
kube::golang::build_binaries "${KUBE_SERVER_TARGETS[@]}" echo
echo "The equivalent of this invocation is: "
KUBE_BUILD_PLATFORMS=("${KUBE_CLIENT_PLATFORMS[@]}") echo " make cross"
kube::golang::build_binaries "${KUBE_CLIENT_TARGETS[@]}" echo
echo
KUBE_BUILD_PLATFORMS=("${KUBE_TEST_PLATFORMS[@]}") make --no-print-directory -C "${KUBE_ROOT}" cross
kube::golang::build_binaries "${KUBE_TEST_TARGETS[@]}"
kube::golang::place_bins
#!/bin/bash #!/bin/bash
# Copyright 2014 The Kubernetes Authors. # Copyright 2016 The Kubernetes Authors.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
...@@ -14,14 +14,24 @@ ...@@ -14,14 +14,24 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# This script sets up a go workspace locally and builds all go components. # This script is a vestigial redirection. Please do not add "real" logic.
set -o errexit set -o errexit
set -o nounset set -o nounset
set -o pipefail set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
source "${KUBE_ROOT}/hack/lib/init.sh"
kube::golang::build_binaries "$@" # For help output
kube::golang::place_bins ARGHELP=""
if [[ "$#" -gt 0 ]]; then
ARGHELP="WHAT='$@'"
fi
echo "NOTE: $0 has been replaced by 'make' or 'make all'"
echo
echo "The equivalent of this invocation is: "
echo " make ${ARGHELP}"
echo
echo
make --no-print-directory -C "${KUBE_ROOT}" all WHAT="$*"
...@@ -45,7 +45,7 @@ fi ...@@ -45,7 +45,7 @@ fi
kube::build::verify_prereqs kube::build::verify_prereqs
kube::build::build_image kube::build::build_image
kube::build::run_build_command hack/build-go.sh cmd/hyperkube kube::build::run_build_command make WHAT=cmd/hyperkube
REGISTRY="${KUBE_DOCKER_REGISTRY}/${KUBE_DOCKER_OWNER}" \ REGISTRY="${KUBE_DOCKER_REGISTRY}/${KUBE_DOCKER_OWNER}" \
VERSION="${KUBE_DOCKER_VERSION}" \ VERSION="${KUBE_DOCKER_VERSION}" \
......
...@@ -14,121 +14,30 @@ ...@@ -14,121 +14,30 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. # This script is a vestigial redirection. Please do not add "real" logic.
source "${KUBE_ROOT}/hack/lib/init.sh"
focus=${FOCUS:-""} set -o errexit
skip=${SKIP:-""} set -o nounset
report=${REPORT:-"/tmp/"} set -o pipefail
artifacts=${ARTIFACTS:-"/tmp/_artifacts"}
remote=${REMOTE:-"false"}
images=${IMAGES:-""}
hosts=${HOSTS:-""}
if [[ $hosts == "" && $images == "" ]]; then
images="e2e-node-containervm-v20160321-image"
fi
image_project=${IMAGE_PROJECT:-"kubernetes-node-e2e-images"}
instance_prefix=${INSTANCE_PREFIX:-"test"}
cleanup=${CLEANUP:-"true"}
delete_instances=${DELETE_INSTANCES:-"false"}
run_until_failure=${RUN_UNTIL_FAILURE:-"false"}
list_images=${LIST_IMAGES:-"false"}
if [[ $list_images == "true" ]]; then KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
gcloud compute images list --project="${image_project}" | grep "e2e-node"
exit 0
fi
ginkgo=$(kube::util::find-binary "ginkgo") # For help output
if [[ -z "${ginkgo}" ]]; then ARGHELP=""
echo "You do not appear to have ginkgo built. Try 'make WHAT=vendor/github.com/onsi/ginkgo/ginkgo'" if [[ -n "${FOCUS:-}" ]]; then
exit 1 ARGHELP="FOCUS='${FOCUS}' "
fi fi
if [[ -n "${SKIP:-}" ]]; then
if [ $remote = true ] ; then ARGHELP="${ARGHELP}SKIP='${SKIP}'"
# Setup the directory to copy test artifacts (logs, junit.xml, etc) from remote host to local host
if [ ! -d "${artifacts}" ]; then
echo "Creating artifacts directory at ${artifacts}"
mkdir -p ${artifacts}
fi
echo "Test artifacts will be written to ${artifacts}"
# Get the compute zone
zone=$(gcloud info --format='value(config.properties.compute.zone)')
if [[ $zone == "" ]]; then
echo "Could not find gcloud compute/zone when running:\ngcloud info --format='value(config.properties.compute.zone)'"
exit 1
fi
# Get the compute project
project=$(gcloud info --format='value(config.project)')
if [[ $project == "" ]]; then
echo "Could not find gcloud project when running:\ngcloud info --format='value(config.project)'"
exit 1
fi
# Check if any of the images specified already have running instances. If so reuse those instances
# by moving the IMAGE to a HOST
if [[ $images != "" ]]; then
IFS=',' read -ra IM <<< "$images"
images=""
for i in "${IM[@]}"; do
if [[ $(gcloud compute instances list "${instance_prefix}-$i" | grep $i) ]]; then
if [[ $hosts != "" ]]; then
hosts="$hosts,"
fi
echo "Reusing host ${instance_prefix}-$i"
hosts="${hosts}${instance_prefix}-${i}"
else
if [[ $images != "" ]]; then
images="$images,"
fi
images="$images$i"
fi
done
fi
# Parse the flags to pass to ginkgo
ginkgoflags=""
if [[ $focus != "" ]]; then
ginkgoflags="$ginkgoflags -focus=$focus "
fi
if [[ $skip != "" ]]; then
ginkgoflags="$ginkgoflags -skip=$skip "
fi
if [[ $run_until_failure != "" ]]; then
ginkgoflags="$ginkgoflags -untilItFails=$run_until_failure "
fi
# Output the configuration we will try to run
echo "Running tests remotely using"
echo "Project: $project"
echo "Image Project: $image_project"
echo "Compute/Zone: $zone"
echo "Images: $images"
echo "Hosts: $hosts"
echo "Ginkgo Flags: $ginkgoflags"
# Invoke the runner
go run test/e2e_node/runner/run_e2e.go --logtostderr --vmodule=*=2 --ssh-env="gce" \
--zone="$zone" --project="$project" \
--hosts="$hosts" --images="$images" --cleanup="$cleanup" \
--results-dir="$artifacts" --ginkgo-flags="$ginkgoflags" \
--image-project="$image_project" --instance-name-prefix="$instance_prefix" --setup-node="true" \
--delete-instances="$delete_instances"
exit $?
else
# Refresh sudo credentials if not running on GCE.
if ! ping -c 1 -q metadata.google.internal &> /dev/null; then
sudo -v || exit 1
fi
# Test using the host the script was run on
# Provided for backwards compatibility
"${ginkgo}" --focus=$focus --skip=$skip "${KUBE_ROOT}/test/e2e_node/" --report-dir=${report} \
-- --alsologtostderr --v 2 --node-name $(hostname) --disable-kubenet=true --build-services=true --start-services=true --stop-services=true
exit $?
fi fi
echo "NOTE: $0 has been replaced by 'make test-e2e-node'"
echo
echo "This script supports a number of parameters passed as environment variables."
echo "Please see the Makfile for more details."
echo
echo "The equivalent of this invocation is: "
echo " make test-e2e-node ${ARGHELP}"
echo
echo
make --no-print-directory -C "${KUBE_ROOT}" test-e2e-node FOCUS=${FOCUS:-} SKIP=${SKIP:-}
...@@ -27,12 +27,14 @@ source "${KUBE_ROOT}/hack/lib/init.sh" ...@@ -27,12 +27,14 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
kube::golang::setup_env kube::golang::setup_env
"${KUBE_ROOT}/hack/build-go.sh" \ BINS=(
cmd/gendocs \ cmd/gendocs
cmd/genkubedocs \ cmd/genkubedocs
cmd/genman \ cmd/genman
cmd/genyaml \ cmd/genyaml
federation/cmd/genfeddocs federation/cmd/genfeddocs
)
make -C "${KUBE_ROOT}" WHAT="${BINS[*]}"
kube::util::ensure-temp-dir kube::util::ensure-temp-dir
......
...@@ -41,5 +41,5 @@ export KUBE_JUNIT_REPORT_DIR=${WORKSPACE}/_artifacts ...@@ -41,5 +41,5 @@ export KUBE_JUNIT_REPORT_DIR=${WORKSPACE}/_artifacts
# Save the verbose stdout as well. # Save the verbose stdout as well.
export KUBE_KEEP_VERBOSE_TEST_OUTPUT=y export KUBE_KEEP_VERBOSE_TEST_OUTPUT=y
./hack/test-go.sh make test
./hack/test-integration.sh make test-integration
...@@ -52,10 +52,11 @@ export LOG_LEVEL=4 ...@@ -52,10 +52,11 @@ export LOG_LEVEL=4
cd /go/src/k8s.io/kubernetes cd /go/src/k8s.io/kubernetes
rm -rf Godeps/_workspace # Temporary until _workspace is fully obliterated rm -rf Godeps/_workspace # Temporary until _workspace is fully obliterated
make generated_files
go install ./cmd/... go install ./cmd/...
./hack/install-etcd.sh ./hack/install-etcd.sh
./hack/test-go.sh make test
./hack/test-cmd.sh make test-cmd
./hack/test-integration.sh make test-integration
./hack/test-update-storage-objects.sh ./hack/test-update-storage-objects.sh
...@@ -38,4 +38,4 @@ export LOG_LEVEL=4 ...@@ -38,4 +38,4 @@ export LOG_LEVEL=4
cd /go/src/k8s.io/kubernetes cd /go/src/k8s.io/kubernetes
./hack/install-etcd.sh ./hack/install-etcd.sh
./hack/verify-all.sh -v make verify VERBOSE=1
...@@ -34,4 +34,4 @@ export PATH=${GOPATH}/bin:${HOME}/third_party/etcd:/usr/local/go/bin:$PATH ...@@ -34,4 +34,4 @@ export PATH=${GOPATH}/bin:${HOME}/third_party/etcd:/usr/local/go/bin:$PATH
command -v etcd &>/dev/null || ./hack/install-etcd.sh command -v etcd &>/dev/null || ./hack/install-etcd.sh
go get -u github.com/tools/godep go get -u github.com/tools/godep
./hack/verify-all.sh -v make verify VERBOSE=1
...@@ -375,6 +375,8 @@ kube::golang::place_bins() { ...@@ -375,6 +375,8 @@ kube::golang::place_bins() {
local platform_src="/${platform//\//_}" local platform_src="/${platform//\//_}"
if [[ $platform == $host_platform ]]; then if [[ $platform == $host_platform ]]; then
platform_src="" platform_src=""
rm -f "${THIS_PLATFORM_BIN}"
ln -s "${KUBE_OUTPUT_BINPATH}/${platform}" "${THIS_PLATFORM_BIN}"
fi fi
local full_binpath_src="${KUBE_GOPATH}/bin${platform_src}" local full_binpath_src="${KUBE_GOPATH}/bin${platform_src}"
...@@ -615,7 +617,7 @@ kube::golang::build_binaries() { ...@@ -615,7 +617,7 @@ kube::golang::build_binaries() {
targets=("${KUBE_ALL_TARGETS[@]}") targets=("${KUBE_ALL_TARGETS[@]}")
fi fi
local -a platforms=("${KUBE_BUILD_PLATFORMS[@]:+${KUBE_BUILD_PLATFORMS[@]}}") local -a platforms=(${KUBE_BUILD_PLATFORMS:-})
if [[ ${#platforms[@]} -eq 0 ]]; then if [[ ${#platforms[@]} -eq 0 ]]; then
platforms=("${host_platform}") platforms=("${host_platform}")
fi fi
......
...@@ -29,6 +29,9 @@ KUBE_OUTPUT_BINPATH="${KUBE_OUTPUT}/bin" ...@@ -29,6 +29,9 @@ KUBE_OUTPUT_BINPATH="${KUBE_OUTPUT}/bin"
# the connections to localhost in scripts will time out # the connections to localhost in scripts will time out
export no_proxy=127.0.0.1,localhost export no_proxy=127.0.0.1,localhost
# This is a symlink to binaries for "this platform", e.g. build tools.
THIS_PLATFORM_BIN="${KUBE_ROOT}/_output/bin"
source "${KUBE_ROOT}/hack/lib/util.sh" source "${KUBE_ROOT}/hack/lib/util.sh"
source "${KUBE_ROOT}/cluster/lib/util.sh" source "${KUBE_ROOT}/cluster/lib/util.sh"
source "${KUBE_ROOT}/cluster/lib/logging.sh" source "${KUBE_ROOT}/cluster/lib/logging.sh"
......
...@@ -168,6 +168,7 @@ kube::util::find-binary() { ...@@ -168,6 +168,7 @@ kube::util::find-binary() {
local lookfor="${1}" local lookfor="${1}"
local host_platform="$(kube::util::host_platform)" local host_platform="$(kube::util::host_platform)"
local locations=( local locations=(
"${KUBE_ROOT}/_output/bin/${lookfor}"
"${KUBE_ROOT}/_output/dockerized/bin/${host_platform}/${lookfor}" "${KUBE_ROOT}/_output/dockerized/bin/${host_platform}/${lookfor}"
"${KUBE_ROOT}/_output/local/bin/${host_platform}/${lookfor}" "${KUBE_ROOT}/_output/local/bin/${host_platform}/${lookfor}"
"${KUBE_ROOT}/platforms/${host_platform}/${lookfor}" "${KUBE_ROOT}/platforms/${host_platform}/${lookfor}"
......
...@@ -78,9 +78,7 @@ do ...@@ -78,9 +78,7 @@ do
done done
if [ "x$GO_OUT" == "x" ]; then if [ "x$GO_OUT" == "x" ]; then
"${KUBE_ROOT}/hack/build-go.sh" \ make -C "${KUBE_ROOT}" WHAT="cmd/kubectl cmd/hyperkube"
cmd/kubectl \
cmd/hyperkube
else else
echo "skipped the build." echo "skipped the build."
fi fi
......
#!/bin/bash
# Copyright 2014 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.
# This script sets up a go workspace locally and builds all go components.
set -o errexit
set -o nounset
set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
source "${KUBE_ROOT}/hack/lib/init.sh"
kube::golang::build_binaries "$@"
kube::golang::place_bins
#!/bin/bash
# Copyright 2014 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.
# This script sets up a go workspace locally and builds all for all appropriate
# platforms.
set -o errexit
set -o nounset
set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
source "${KUBE_ROOT}/hack/lib/init.sh"
# NOTE: Using "${array[*]}" here is correct. [@] becomes distinct words (in
# bash parlance).
make all WHAT="${KUBE_SERVER_TARGETS[*]}" KUBE_BUILD_PLATFORMS="${KUBE_SERVER_PLATFORMS[*]}"
make all WHAT="${KUBE_CLIENT_TARGETS[*]}" KUBE_BUILD_PLATFORMS="${KUBE_CLIENT_PLATFORMS[*]}"
make all WHAT="${KUBE_TEST_TARGETS[*]}" KUBE_BUILD_PLATFORMS="${KUBE_TEST_PLATFORMS[*]}"
This source diff could not be displayed because it is too large. You can view the blob instead.
#!/bin/bash
# Copyright 2016 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.
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
source "${KUBE_ROOT}/hack/lib/init.sh"
focus=${FOCUS:-""}
skip=${SKIP:-""}
report=${REPORT:-"/tmp/"}
artifacts=${ARTIFACTS:-"/tmp/_artifacts"}
remote=${REMOTE:-"false"}
images=${IMAGES:-""}
hosts=${HOSTS:-""}
if [[ $hosts == "" && $images == "" ]]; then
images="e2e-node-containervm-v20160321-image"
fi
image_project=${IMAGE_PROJECT:-"kubernetes-node-e2e-images"}
instance_prefix=${INSTANCE_PREFIX:-"test"}
cleanup=${CLEANUP:-"true"}
delete_instances=${DELETE_INSTANCES:-"false"}
run_until_failure=${RUN_UNTIL_FAILURE:-"false"}
list_images=${LIST_IMAGES:-"false"}
if [[ $list_images == "true" ]]; then
gcloud compute images list --project="${image_project}" | grep "e2e-node"
exit 0
fi
ginkgo=$(kube::util::find-binary "ginkgo")
if [[ -z "${ginkgo}" ]]; then
echo "You do not appear to have ginkgo built. Try 'make WHAT=vendor/github.com/onsi/ginkgo/ginkgo'"
exit 1
fi
if [ $remote = true ] ; then
# Setup the directory to copy test artifacts (logs, junit.xml, etc) from remote host to local host
if [ ! -d "${artifacts}" ]; then
echo "Creating artifacts directory at ${artifacts}"
mkdir -p ${artifacts}
fi
echo "Test artifacts will be written to ${artifacts}"
# Get the compute zone
zone=$(gcloud info --format='value(config.properties.compute.zone)')
if [[ $zone == "" ]]; then
echo "Could not find gcloud compute/zone when running:\ngcloud info --format='value(config.properties.compute.zone)'"
exit 1
fi
# Get the compute project
project=$(gcloud info --format='value(config.project)')
if [[ $project == "" ]]; then
echo "Could not find gcloud project when running:\ngcloud info --format='value(config.project)'"
exit 1
fi
# Check if any of the images specified already have running instances. If so reuse those instances
# by moving the IMAGE to a HOST
if [[ $images != "" ]]; then
IFS=',' read -ra IM <<< "$images"
images=""
for i in "${IM[@]}"; do
if [[ $(gcloud compute instances list "${instance_prefix}-$i" | grep $i) ]]; then
if [[ $hosts != "" ]]; then
hosts="$hosts,"
fi
echo "Reusing host ${instance_prefix}-$i"
hosts="${hosts}${instance_prefix}-${i}"
else
if [[ $images != "" ]]; then
images="$images,"
fi
images="$images$i"
fi
done
fi
# Parse the flags to pass to ginkgo
ginkgoflags=""
if [[ $focus != "" ]]; then
ginkgoflags="$ginkgoflags -focus=$focus "
fi
if [[ $skip != "" ]]; then
ginkgoflags="$ginkgoflags -skip=$skip "
fi
if [[ $run_until_failure != "" ]]; then
ginkgoflags="$ginkgoflags -untilItFails=$run_until_failure "
fi
# Output the configuration we will try to run
echo "Running tests remotely using"
echo "Project: $project"
echo "Image Project: $image_project"
echo "Compute/Zone: $zone"
echo "Images: $images"
echo "Hosts: $hosts"
echo "Ginkgo Flags: $ginkgoflags"
# Invoke the runner
go run test/e2e_node/runner/run_e2e.go --logtostderr --vmodule=*=2 --ssh-env="gce" \
--zone="$zone" --project="$project" \
--hosts="$hosts" --images="$images" --cleanup="$cleanup" \
--results-dir="$artifacts" --ginkgo-flags="$ginkgoflags" \
--image-project="$image_project" --instance-name-prefix="$instance_prefix" --setup-node="true" \
--delete-instances="$delete_instances"
exit $?
else
# Refresh sudo credentials if not running on GCE.
if ! ping -c 1 -q metadata.google.internal &> /dev/null; then
sudo -v || exit 1
fi
# Test using the host the script was run on
# Provided for backwards compatibility
"${ginkgo}" --focus=$focus --skip=$skip "${KUBE_ROOT}/test/e2e_node/" --report-dir=${report} \
-- --alsologtostderr --v 2 --node-name $(hostname) --disable-kubenet=true --build-services=true --start-services=true --stop-services=true
exit $?
fi
#!/bin/bash
# Copyright 2014 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.
set -o errexit
set -o nounset
set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
source "${KUBE_ROOT}/hack/lib/init.sh"
# Lists of API Versions of each groups that should be tested, groups are
# separated by comma, lists are separated by semicolon. e.g.,
# "v1,compute/v1alpha1,experimental/v1alpha2;v1,compute/v2,experimental/v1alpha3"
# TODO: It's going to be:
# KUBE_TEST_API_VERSIONS=${KUBE_TEST_API_VERSIONS:-"v1,extensions/v1beta1"}
# FIXME: due to current implementation of a test client (see: pkg/api/testapi/testapi.go)
# ONLY the last version is tested in each group.
KUBE_TEST_API_VERSIONS=${KUBE_TEST_API_VERSIONS:-"v1,autoscaling/v1,batch/v1,apps/v1alpha1,policy/v1alpha1,extensions/v1beta1,rbac.authorization.k8s.io/v1alpha1,certificates/v1alpha1"}
# Give integration tests longer to run
# TODO: allow a larger value to be passed in
#KUBE_TIMEOUT=${KUBE_TIMEOUT:--timeout 240s}
KUBE_TIMEOUT="-timeout 600s"
KUBE_INTEGRATION_TEST_MAX_CONCURRENCY=${KUBE_INTEGRATION_TEST_MAX_CONCURRENCY:-"-1"}
LOG_LEVEL=${LOG_LEVEL:-2}
KUBE_TEST_ARGS=${KUBE_TEST_ARGS:-}
kube::test::find_integration_test_dirs() {
(
cd ${KUBE_ROOT}
find test/integration -name '*_test.go' -print0 \
| xargs -0n1 dirname \
| sort -u
)
}
cleanup() {
kube::log::status "Cleaning up etcd"
kube::etcd::cleanup
kube::log::status "Integration test cleanup complete"
}
runTests() {
kube::log::status "Starting etcd instance"
kube::etcd::start
kube::log::status "Running integration test cases"
# TODO: Re-enable race detection when we switch to a thread-safe etcd client
# KUBE_RACE="-race"
make -C "${KUBE_ROOT}" test \
WHAT="$(kube::test::find_integration_test_dirs | paste -sd' ')" \
KUBE_GOFLAGS="${KUBE_GOFLAGS:-} -tags 'integration no-docker'" \
KUBE_RACE="" \
KUBE_TIMEOUT="${KUBE_TIMEOUT}" \
KUBE_TEST_API_VERSIONS="$1"
cleanup
}
checkEtcdOnPath() {
kube::log::status "Checking etcd is on PATH"
which etcd && return
kube::log::status "Cannot find etcd, cannot run integration tests."
kube::log::status "Please see docs/devel/testing.md for instructions."
return 1
}
checkEtcdOnPath
# Run cleanup to stop etcd on interrupt or other kill signal.
trap cleanup EXIT
# If a test case is specified, just run once with v1 API version and exit
if [[ -n "${KUBE_TEST_ARGS}" ]]; then
runTests v1
fi
# Convert the CSV to an array of API versions to test
IFS=';' read -a apiVersions <<< "${KUBE_TEST_API_VERSIONS}"
for apiVersion in "${apiVersions[@]}"; do
runTests "${apiVersion}"
done
#!/bin/bash
# Copyright 2014 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.
set -o errexit
set -o nounset
set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
source "${KUBE_ROOT}/cluster/lib/util.sh"
if [ -n "${VERBOSE}" ]; then
SILENT=false
else
SILENT=true
fi
# Excluded checks are always skipped.
EXCLUDED_CHECKS=(
"verify-linkcheck.sh" # runs in separate Jenkins job once per day due to high network usage
)
function is-excluded {
if [[ $1 -ef "$KUBE_ROOT/hack/verify-all.sh" ]]; then
return
fi
for e in ${EXCLUDED_CHECKS[@]}; do
if [[ $1 -ef "$KUBE_ROOT/hack/$e" ]]; then
return
fi
done
return 1
}
function run-cmd {
if ${SILENT}; then
"$@" &> /dev/null
else
"$@"
fi
}
function run-checks {
local -r pattern=$1
local -r runner=$2
for t in $(ls ${pattern})
do
if is-excluded "${t}" ; then
echo "Skipping ${t}"
continue
fi
echo -e "Verifying ${t}"
local start=$(date +%s)
run-cmd "${runner}" "${t}" && tr=$? || tr=$?
local elapsed=$(($(date +%s) - ${start}))
if [[ ${tr} -eq 0 ]]; then
echo -e "${color_green}SUCCESS${color_norm} ${t}\t${elapsed}s"
else
echo -e "${color_red}FAILED${color_norm} ${t}\t${elapsed}s"
ret=1
fi
done
}
while getopts ":v" opt; do
case ${opt} in
v)
SILENT=false
;;
\?)
echo "Invalid flag: -${OPTARG}" >&2
exit 1
;;
esac
done
if ${SILENT} ; then
echo "Running in silent mode, run with -v if you want to see script logs."
fi
ret=0
run-checks "${KUBE_ROOT}/hack/verify-*.sh" bash
run-checks "${KUBE_ROOT}/hack/verify-*.py" python
exit ${ret}
# ex: ts=2 sw=2 et filetype=sh
#!/bin/bash
# Copyright 2016 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.
set -o errexit
set -o nounset
set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
source "${KUBE_ROOT}/hack/lib/init.sh"
cd "${KUBE_ROOT}"
# This is required before we run govet for the results to be correct.
# See https://github.com/golang/go/issues/16086 for details.
make generated_files
go install ./cmd/...
# Use eval to preserve embedded quoted strings.
eval "goflags=(${KUBE_GOFLAGS:-})"
# Filter out arguments that start with "-" and move them to goflags.
targets=()
for arg; do
if [[ "${arg}" == -* ]]; then
goflags+=("${arg}")
else
targets+=("${arg}")
fi
done
if [[ ${#targets[@]} -eq 0 ]]; then
# Do not run on third_party directories.
targets=$(go list ./... | egrep -v "/(third_party|vendor)/")
fi
go vet "${goflags[@]:+${goflags[@]}}" ${targets[@]}
This source diff could not be displayed because it is too large. You can view the blob instead.
#!/bin/bash #!/bin/bash
# Copyright 2014 The Kubernetes Authors. # Copyright 2016 The Kubernetes Authors.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
...@@ -14,80 +14,22 @@ ...@@ -14,80 +14,22 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# This script is a vestigial redirection. Please do not add "real" logic.
set -o errexit set -o errexit
set -o nounset set -o nounset
set -o pipefail set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
source "${KUBE_ROOT}/hack/lib/init.sh"
# Lists of API Versions of each groups that should be tested, groups are
# separated by comma, lists are separated by semicolon. e.g.,
# "v1,compute/v1alpha1,experimental/v1alpha2;v1,compute/v2,experimental/v1alpha3"
# TODO: It's going to be:
# KUBE_TEST_API_VERSIONS=${KUBE_TEST_API_VERSIONS:-"v1,extensions/v1beta1"}
# FIXME: due to current implementation of a test client (see: pkg/api/testapi/testapi.go)
# ONLY the last version is tested in each group.
KUBE_TEST_API_VERSIONS=${KUBE_TEST_API_VERSIONS:-"v1,autoscaling/v1,batch/v1,apps/v1alpha1,policy/v1alpha1,extensions/v1beta1,rbac.authorization.k8s.io/v1alpha1,certificates/v1alpha1"}
# Give integration tests longer to run
# TODO: allow a larger value to be passed in
#KUBE_TIMEOUT=${KUBE_TIMEOUT:--timeout 240s}
KUBE_TIMEOUT="-timeout 600s"
KUBE_INTEGRATION_TEST_MAX_CONCURRENCY=${KUBE_INTEGRATION_TEST_MAX_CONCURRENCY:-"-1"}
LOG_LEVEL=${LOG_LEVEL:-2}
KUBE_TEST_ARGS=${KUBE_TEST_ARGS:-}
kube::test::find_integration_test_dirs() {
(
cd ${KUBE_ROOT}
find test/integration -name '*_test.go' -print0 \
| xargs -0n1 dirname \
| sort -u
)
}
cleanup() {
kube::log::status "Cleaning up etcd"
kube::etcd::cleanup
kube::log::status "Integration test cleanup complete"
}
runTests() {
kube::log::status "Starting etcd instance"
kube::etcd::start
kube::log::status "Running integration test cases"
# TODO: Re-enable race detection when we switch to a thread-safe etcd client
# KUBE_RACE="-race"
KUBE_GOFLAGS="${KUBE_GOFLAGS:-} -tags 'integration no-docker'" \
KUBE_RACE="" \
KUBE_TIMEOUT="${KUBE_TIMEOUT}" \
KUBE_TEST_API_VERSIONS="$1" \
"${KUBE_ROOT}/hack/test-go.sh" $(kube::test::find_integration_test_dirs)
cleanup
}
checkEtcdOnPath() {
kube::log::status "Checking etcd is on PATH"
which etcd && return
kube::log::status "Cannot find etcd, cannot run integration tests."
kube::log::status "Please see docs/devel/testing.md for instructions."
return 1
}
checkEtcdOnPath
# Run cleanup to stop etcd on interrupt or other kill signal.
trap cleanup EXIT
# If a test case is specified, just run once with v1 API version and exit echo "NOTE: $0 has been replaced by 'make test-integration'"
if [[ -n "${KUBE_TEST_ARGS}" ]]; then echo
runTests v1 echo "The equivalent of this invocation is: "
fi echo " make test-integration"
echo
echo
echo make --no-print-directory -C "${KUBE_ROOT}" test-integration
echo
echo
make --no-print-directory -C "${KUBE_ROOT}" test-integration
# Convert the CSV to an array of API versions to test
IFS=';' read -a apiVersions <<< "${KUBE_TEST_API_VERSIONS}"
for apiVersion in "${apiVersions[@]}"; do
runTests "${apiVersion}"
done
...@@ -92,7 +92,7 @@ function cleanup() { ...@@ -92,7 +92,7 @@ function cleanup() {
trap cleanup EXIT SIGINT trap cleanup EXIT SIGINT
"${KUBE_ROOT}/hack/build-go.sh" cmd/kube-apiserver make -C "${KUBE_ROOT}" WHAT=cmd/kube-apiserver
kube::etcd::start kube::etcd::start
......
...@@ -117,6 +117,7 @@ if [[ -z ${haveindex} ]]; then ...@@ -117,6 +117,7 @@ if [[ -z ${haveindex} ]]; then
fi fi
echo "Building codecgen" echo "Building codecgen"
make generated_files
CODECGEN="${PWD}/codecgen_binary" CODECGEN="${PWD}/codecgen_binary"
go build -o "${CODECGEN}" ./vendor/github.com/ugorji/go/codec/codecgen go build -o "${CODECGEN}" ./vendor/github.com/ugorji/go/codec/codecgen
......
...@@ -25,15 +25,11 @@ kube::golang::setup_env ...@@ -25,15 +25,11 @@ kube::golang::setup_env
BUILD_TARGETS=( BUILD_TARGETS=(
cmd/libs/go2idl/client-gen cmd/libs/go2idl/client-gen
cmd/libs/go2idl/conversion-gen
cmd/libs/go2idl/deepcopy-gen
cmd/libs/go2idl/set-gen cmd/libs/go2idl/set-gen
) )
"${KUBE_ROOT}/hack/build-go.sh" ${BUILD_TARGETS[*]} make -C "${KUBE_ROOT}" WHAT="${BUILD_TARGETS[*]}"
clientgen=$(kube::util::find-binary "client-gen") clientgen=$(kube::util::find-binary "client-gen")
conversiongen=$(kube::util::find-binary "conversion-gen")
deepcopygen=$(kube::util::find-binary "deepcopy-gen")
setgen=$(kube::util::find-binary "set-gen") setgen=$(kube::util::find-binary "set-gen")
# Please do not add any logic to this shell script. Add logic to the go code # Please do not add any logic to this shell script. Add logic to the go code
...@@ -50,44 +46,3 @@ ${clientgen} --clientset-name=federation_release_1_4 --clientset-path=k8s.io/kub ...@@ -50,44 +46,3 @@ ${clientgen} --clientset-name=federation_release_1_4 --clientset-path=k8s.io/kub
${setgen} "$@" ${setgen} "$@"
# You may add additional calls of code generators like set-gen above. # You may add additional calls of code generators like set-gen above.
# 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.
ALL_K8S_TAG_FILES=$(
grep -l '^// \?+k8s:' $(
find . \
-not \( \
\( \
-path ./vendor -o \
-path ./_output -o \
-path ./.git \
\) -prune \
\) \
-type f -name \*.go \
| sed 's|^./||'
)
)
DEEP_COPY_DIRS=$(
grep -l '+k8s:deepcopy-gen=' ${ALL_K8S_TAG_FILES} \
| xargs dirname \
| sort -u
)
DEEPCOPY_INPUTS=$(
for d in ${DEEP_COPY_DIRS}; do
echo k8s.io/kubernetes/$d
done | paste -sd,
)
${deepcopygen} -i ${DEEPCOPY_INPUTS}
CONVERSION_DIRS=$(
grep '^// *+k8s:conversion-gen=' ${ALL_K8S_TAG_FILES} \
| cut -f1 -d: \
| xargs dirname \
| sort -u \
)
CONVERSION_INPUTS=$(
for d in ${CONVERSION_DIRS}; do
echo k8s.io/kubernetes/$d
done | paste -sd,
)
${conversiongen} -i ${CONVERSION_INPUTS}
...@@ -27,12 +27,14 @@ source "${KUBE_ROOT}/hack/lib/init.sh" ...@@ -27,12 +27,14 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
kube::golang::setup_env kube::golang::setup_env
"${KUBE_ROOT}/hack/build-go.sh" \ BINS=(
cmd/gendocs \ cmd/gendocs
cmd/genkubedocs \ cmd/genkubedocs
cmd/genman \ cmd/genman
cmd/genyaml \ cmd/genyaml
federation/cmd/genfeddocs federation/cmd/genfeddocs
)
make -C "${KUBE_ROOT}" WHAT="${BINS[*]}"
kube::util::ensure-temp-dir kube::util::ensure-temp-dir
......
...@@ -23,9 +23,11 @@ source "${KUBE_ROOT}/hack/lib/init.sh" ...@@ -23,9 +23,11 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
kube::golang::setup_env kube::golang::setup_env
hack/build-go.sh \ BINS=(
cmd/libs/go2idl/go-to-protobuf \ cmd/libs/go2idl/go-to-protobuf
cmd/libs/go2idl/go-to-protobuf/protoc-gen-gogo cmd/libs/go2idl/go-to-protobuf/protoc-gen-gogo
)
make -C "${KUBE_ROOT}" WHAT="${BINS[*]}"
if [[ -z "$(which protoc)" || "$(protoc --version)" != "libprotoc 3.0."* ]]; then if [[ -z "$(which protoc)" || "$(protoc --version)" != "libprotoc 3.0."* ]]; then
echo "Generating protobuf requires protoc 3.0.0-beta1 or newer. Please download and" echo "Generating protobuf requires protoc 3.0.0-beta1 or newer. Please download and"
......
...@@ -24,7 +24,10 @@ source "${KUBE_ROOT}/hack/lib/init.sh" ...@@ -24,7 +24,10 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
kube::golang::setup_env kube::golang::setup_env
hack/build-go.sh cmd/libs/go2idl/go-to-protobuf/protoc-gen-gogo BINS=(
cmd/libs/go2idl/go-to-protobuf/protoc-gen-gogo
)
make -C "${KUBE_ROOT}" WHAT="${BINS[*]}"
if [[ -z "$(which protoc)" || "$(protoc --version)" != "libprotoc 3.0."* ]]; then if [[ -z "$(which protoc)" || "$(protoc --version)" != "libprotoc 3.0."* ]]; then
echo "Generating protobuf requires protoc 3.0.0-beta1 or newer. Please download and" echo "Generating protobuf requires protoc 3.0.0-beta1 or newer. Please download and"
......
...@@ -37,13 +37,7 @@ function prereqs() { ...@@ -37,13 +37,7 @@ function prereqs() {
KUBE_BUILD_CONTAINER_NAME="kube-build-${KUBE_ROOT_HASH}" KUBE_BUILD_CONTAINER_NAME="kube-build-${KUBE_ROOT_HASH}"
KUBE_BUILD_DATA_CONTAINER_NAME="kube-build-data-${KUBE_ROOT_HASH}" KUBE_BUILD_DATA_CONTAINER_NAME="kube-build-data-${KUBE_ROOT_HASH}"
DOCKER_MOUNT_ARGS=( DOCKER_MOUNT_ARGS=(
--volume "${REPO_DIR:-${KUBE_ROOT}}/cluster:/go/src/${KUBE_GO_PACKAGE}/cluster" --volume "${REPO_DIR:-${KUBE_ROOT}}:/go/src/${KUBE_GO_PACKAGE}"
--volume "${REPO_DIR:-${KUBE_ROOT}}/cmd:/go/src/${KUBE_GO_PACKAGE}/cmd"
--volume "${REPO_DIR:-${KUBE_ROOT}}/vendor:/go/src/${KUBE_GO_PACKAGE}/vendor"
--volume "${REPO_DIR:-${KUBE_ROOT}}/hack:/go/src/${KUBE_GO_PACKAGE}/hack"
--volume "${REPO_DIR:-${KUBE_ROOT}}/pkg:/go/src/${KUBE_GO_PACKAGE}/pkg"
--volume "${REPO_DIR:-${KUBE_ROOT}}/federation:/go/src/${KUBE_GO_PACKAGE}/federation"
--volume "${REPO_DIR:-${KUBE_ROOT}}/third_party:/go/src/${KUBE_GO_PACKAGE}/third_party"
--volume /etc/localtime:/etc/localtime:ro --volume /etc/localtime:/etc/localtime:ro
--volumes-from "${KUBE_BUILD_DATA_CONTAINER_NAME}" --volumes-from "${KUBE_BUILD_DATA_CONTAINER_NAME}"
) )
......
...@@ -26,8 +26,7 @@ git_upstream=$(kube::util::git_upstream_remote_name) ...@@ -26,8 +26,7 @@ git_upstream=$(kube::util::git_upstream_remote_name)
kube::golang::setup_env kube::golang::setup_env
"${KUBE_ROOT}/hack/build-go.sh" \ make -C "${KUBE_ROOT}" WHAT=cmd/mungedocs
cmd/mungedocs
kube::util::ensure-temp-dir kube::util::ensure-temp-dir
......
...@@ -33,7 +33,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh" ...@@ -33,7 +33,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
kube::golang::setup_env kube::golang::setup_env
"${KUBE_ROOT}/hack/build-go.sh" cmd/kube-apiserver make -C "${KUBE_ROOT}" WHAT=cmd/kube-apiserver
function cleanup() function cleanup()
{ {
......
#!/bin/bash #!/bin/bash
# Copyright 2014 The Kubernetes Authors. # Copyright 2016 The Kubernetes Authors.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
...@@ -14,82 +14,24 @@ ...@@ -14,82 +14,24 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# This script is a vestigial redirection. Please do not add "real" logic.
set -o errexit set -o errexit
set -o nounset set -o nounset
set -o pipefail set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
source "${KUBE_ROOT}/cluster/lib/util.sh"
SILENT=true
# Excluded checks are always skipped.
EXCLUDED_CHECKS=(
"verify-linkcheck.sh" # runs in separate Jenkins job once per day due to high network usage
)
function is-excluded {
if [[ $1 -ef ${BASH_SOURCE} ]]; then
return
fi
for e in ${EXCLUDED_CHECKS[@]}; do
if [[ $1 -ef "$KUBE_ROOT/hack/$e" ]]; then
return
fi
done
return 1
}
function run-cmd {
if ${SILENT}; then
"$@" &> /dev/null
else
"$@"
fi
}
function run-checks { # For help output
local -r pattern=$1 ARGHELP=""
local -r runner=$2 if [[ -n "${KUBE_VERIFY_GIT_BRANCH:-}" ]]; then
ARGHELP="BRANCH=${KUBE_VERIFY_GIT_BRANCH}"
for t in $(ls ${pattern})
do
if is-excluded "${t}" ; then
echo "Skipping ${t}"
continue
fi
echo -e "Verifying ${t}"
local start=$(date +%s)
run-cmd "${runner}" "${t}" && tr=$? || tr=$?
local elapsed=$(($(date +%s) - ${start}))
if [[ ${tr} -eq 0 ]]; then
echo -e "${color_green}SUCCESS${color_norm} ${t}\t${elapsed}s"
else
echo -e "${color_red}FAILED${color_norm} ${t}\t${elapsed}s"
ret=1
fi
done
}
while getopts ":v" opt; do
case ${opt} in
v)
SILENT=false
;;
\?)
echo "Invalid flag: -${OPTARG}" >&2
exit 1
;;
esac
done
if ${SILENT} ; then
echo "Running in the silent mode, run with -v if you want to see script logs."
fi fi
ret=0 echo "NOTE: $0 has been replaced by 'make verify'"
run-checks "${KUBE_ROOT}/hack/verify-*.sh" bash echo
run-checks "${KUBE_ROOT}/hack/verify-*.py" python echo "The equivalent of this invocation is: "
exit ${ret} echo " make verify ${ARGHELP}"
echo
# ex: ts=2 sw=2 et filetype=sh echo
make --no-print-directory -C "${KUBE_ROOT}" verify BRANCH="${KUBE_VERIFY_GIT_BRANCH:-}"
...@@ -23,7 +23,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh" ...@@ -23,7 +23,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
kube::golang::setup_env kube::golang::setup_env
"${KUBE_ROOT}/hack/build-go.sh" cmd/genswaggertypedocs make -C "${KUBE_ROOT}" WHAT=cmd/genswaggertypedocs
# Find binary # Find binary
genswaggertypedocs=$(kube::util::find-binary "genswaggertypedocs") genswaggertypedocs=$(kube::util::find-binary "genswaggertypedocs")
......
...@@ -63,6 +63,8 @@ def get_all_files(rootdir): ...@@ -63,6 +63,8 @@ def get_all_files(rootdir):
dirs.remove('third_party') dirs.remove('third_party')
if '.git' in dirs: if '.git' in dirs:
dirs.remove('.git') dirs.remove('.git')
if '.make' in dirs:
dirs.remove('.make')
if 'exceptions.txt' in files: if 'exceptions.txt' in files:
files.remove('exceptions.txt') files.remove('exceptions.txt')
if 'known-flags.txt' in files: if 'known-flags.txt' in files:
......
...@@ -23,12 +23,14 @@ source "${KUBE_ROOT}/hack/lib/init.sh" ...@@ -23,12 +23,14 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
kube::golang::setup_env kube::golang::setup_env
"${KUBE_ROOT}/hack/build-go.sh" \ BINS=(
cmd/gendocs \ cmd/gendocs
cmd/genkubedocs \ cmd/genkubedocs
cmd/genman \ cmd/genman
cmd/genyaml \ cmd/genyaml
federation/cmd/genfeddocs federation/cmd/genfeddocs
)
make -C "${KUBE_ROOT}" WHAT="${BINS[*]}"
kube::util::ensure-temp-dir kube::util::ensure-temp-dir
......
...@@ -43,7 +43,7 @@ for APIROOT in ${APIROOTS}; do ...@@ -43,7 +43,7 @@ for APIROOT in ${APIROOTS}; do
TMP_APIROOT="${_tmp}/${APIROOT}" TMP_APIROOT="${_tmp}/${APIROOT}"
echo "diffing ${APIROOT} against freshly generated protobuf" echo "diffing ${APIROOT} against freshly generated protobuf"
ret=0 ret=0
diff -Naupr -I 'Auto generated by' "${KUBE_ROOT}/${APIROOT}" "${TMP_APIROOT}" || ret=$? diff -Naupr -I 'Auto generated by' -x 'zz_generated.*' "${KUBE_ROOT}/${APIROOT}" "${TMP_APIROOT}" || ret=$?
cp -a "${TMP_APIROOT}" "${KUBE_ROOT}/${APIROOT%/*}" cp -a "${TMP_APIROOT}" "${KUBE_ROOT}/${APIROOT%/*}"
if [[ $ret -eq 0 ]]; then if [[ $ret -eq 0 ]]; then
echo "${APIROOT} up to date." echo "${APIROOT} up to date."
......
...@@ -23,7 +23,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh" ...@@ -23,7 +23,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
kube::golang::setup_env kube::golang::setup_env
"${KUBE_ROOT}/hack/build-go.sh" cmd/genswaggertypedocs make -C "${KUBE_ROOT}" WHAT=cmd/genswaggertypedocs
# Find binary # Find binary
genswaggertypedocs=$(kube::util::find-binary "genswaggertypedocs") genswaggertypedocs=$(kube::util::find-binary "genswaggertypedocs")
...@@ -33,7 +33,7 @@ if [[ ! -x "$genswaggertypedocs" ]]; then ...@@ -33,7 +33,7 @@ if [[ ! -x "$genswaggertypedocs" ]]; then
echo "It looks as if you don't have a compiled genswaggertypedocs binary" echo "It looks as if you don't have a compiled genswaggertypedocs binary"
echo echo
echo "If you are running from a clone of the git repo, please run" echo "If you are running from a clone of the git repo, please run"
echo "'./hack/build-go.sh cmd/genswaggertypedocs'." echo "'make WHAT=cmd/genswaggertypedocs'."
} >&2 } >&2
exit 1 exit 1
fi fi
......
...@@ -14,36 +14,24 @@ ...@@ -14,36 +14,24 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# This script is a vestigial redirection. Please do not add "real" logic.
set -o errexit set -o errexit
set -o nounset set -o nounset
set -o pipefail set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
source "${KUBE_ROOT}/hack/lib/init.sh"
cd "${KUBE_ROOT}" # For help output
ARGHELP=""
# This is required before we run govet for the results to be correct. if [[ "$#" -gt 0 ]]; then
# See https://github.com/golang/go/issues/16086 for details. ARGHELP="WHAT='$@'"
go install ./cmd/...
# Use eval to preserve embedded quoted strings.
eval "goflags=(${KUBE_GOFLAGS:-})"
# Filter out arguments that start with "-" and move them to goflags.
targets=()
for arg; do
if [[ "${arg}" == -* ]]; then
goflags+=("${arg}")
else
targets+=("${arg}")
fi
done
if [[ ${#targets[@]} -eq 0 ]]; then
# Do not run on third_party directories.
targets=$(go list ./... | egrep -v "/(third_party|vendor)/")
fi fi
go vet "${goflags[@]:+${goflags[@]}}" ${targets[@]} echo "NOTE: $0 has been replaced by 'make vet'"
echo
echo "The equivalent of this invocation is: "
echo " make vet ${ARGHELP}"
echo
echo
make --no-print-directory -C "${KUBE_ROOT}" vet WHAT="$@"
...@@ -23,6 +23,6 @@ source "${KUBE_ROOT}/hack/lib/init.sh" ...@@ -23,6 +23,6 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
kube::golang::setup_env kube::golang::setup_env
"${KUBE_ROOT}/hack/build-go.sh" cmd/libs/go2idl/import-boss make -C "${KUBE_ROOT}" WHAT=cmd/libs/go2idl/import-boss
$(kube::util::find-binary "import-boss") --verify-only $(kube::util::find-binary "import-boss") --verify-only
...@@ -23,7 +23,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh" ...@@ -23,7 +23,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
kube::golang::setup_env kube::golang::setup_env
"${KUBE_ROOT}/hack/build-go.sh" cmd/linkcheck make -C "${KUBE_ROOT}" WHAT=cmd/linkcheck
linkcheck=$(kube::util::find-binary "linkcheck") linkcheck=$(kube::util::find-binary "linkcheck")
......
...@@ -26,8 +26,7 @@ git_upstream=$(kube::util::git_upstream_remote_name) ...@@ -26,8 +26,7 @@ git_upstream=$(kube::util::git_upstream_remote_name)
kube::golang::setup_env kube::golang::setup_env
"${KUBE_ROOT}/hack/build-go.sh" \ make -C "${KUBE_ROOT}/" WHAT=cmd/mungedocs
cmd/mungedocs
# Find binary # Find binary
mungedocs=$(kube::util::find-binary "mungedocs") mungedocs=$(kube::util::find-binary "mungedocs")
......
...@@ -23,7 +23,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh" ...@@ -23,7 +23,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
kube::golang::setup_env kube::golang::setup_env
"${KUBE_ROOT}/hack/build-go.sh" cmd/kube-apiserver make -C "${KUBE_ROOT}" WHAT=cmd/kube-apiserver
apiserver=$(kube::util::find-binary "kube-apiserver") apiserver=$(kube::util::find-binary "kube-apiserver")
......
...@@ -23,7 +23,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh" ...@@ -23,7 +23,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
kube::golang::setup_env kube::golang::setup_env
"${KUBE_ROOT}/hack/build-go.sh" cmd/hyperkube make -C "${KUBE_ROOT}" WHAT=cmd/hyperkube
# add other BADSYMBOLS here. # add other BADSYMBOLS here.
BADSYMBOLS=( BADSYMBOLS=(
......
...@@ -7,7 +7,7 @@ readonly green=$(tput bold; tput setaf 2) ...@@ -7,7 +7,7 @@ readonly green=$(tput bold; tput setaf 2)
exit_code=0 exit_code=0
echo -ne "Checking that it builds... " echo -ne "Checking that it builds... "
if ! OUT=$("hack/build-go.sh" 2>&1); then if ! OUT=$(make 2>&1); then
echo echo
echo "${red}${OUT}" echo "${red}${OUT}"
exit_code=1 exit_code=1
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -37,7 +37,7 @@ func (obj *ExtensionAPIObject) GetObjectKind() unversioned.ObjectKind { return & ...@@ -37,7 +37,7 @@ func (obj *ExtensionAPIObject) GetObjectKind() unversioned.ObjectKind { return &
func TestGetReference(t *testing.T) { func TestGetReference(t *testing.T) {
// when vendoring kube, if you don't force the set of registered versions (like this hack/test-go.sh does) // when vendoring kube, if you don't force the set of registered versions (like make test does)
// then you run into trouble because the types aren't registered in the scheme by anything. This does the // then you run into trouble because the types aren't registered in the scheme by anything. This does the
// register manually to allow unit test execution // register manually to allow unit test execution
if _, _, err := Scheme.ObjectKinds(&Pod{}); err != nil { if _, _, err := Scheme.ObjectKinds(&Pod{}); err != nil {
......
// +build !ignore_autogenerated
/*
Copyright 2016 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.
*/
// This file was autogenerated by deepcopy-gen. Do not edit it manually!
package unversioned
import (
conversion "k8s.io/kubernetes/pkg/conversion"
time "time"
)
func DeepCopy_unversioned_APIGroup(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*APIGroup)
out := out.(*APIGroup)
out.TypeMeta = in.TypeMeta
out.Name = in.Name
if in.Versions != nil {
in, out := &in.Versions, &out.Versions
*out = make([]GroupVersionForDiscovery, len(*in))
for i := range *in {
(*out)[i] = (*in)[i]
}
} else {
out.Versions = nil
}
out.PreferredVersion = in.PreferredVersion
if in.ServerAddressByClientCIDRs != nil {
in, out := &in.ServerAddressByClientCIDRs, &out.ServerAddressByClientCIDRs
*out = make([]ServerAddressByClientCIDR, len(*in))
for i := range *in {
(*out)[i] = (*in)[i]
}
} else {
out.ServerAddressByClientCIDRs = nil
}
return nil
}
}
func DeepCopy_unversioned_APIGroupList(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*APIGroupList)
out := out.(*APIGroupList)
out.TypeMeta = in.TypeMeta
if in.Groups != nil {
in, out := &in.Groups, &out.Groups
*out = make([]APIGroup, len(*in))
for i := range *in {
if err := DeepCopy_unversioned_APIGroup(&(*in)[i], &(*out)[i], c); err != nil {
return err
}
}
} else {
out.Groups = nil
}
return nil
}
}
func DeepCopy_unversioned_APIResource(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*APIResource)
out := out.(*APIResource)
out.Name = in.Name
out.Namespaced = in.Namespaced
out.Kind = in.Kind
return nil
}
}
func DeepCopy_unversioned_APIResourceList(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*APIResourceList)
out := out.(*APIResourceList)
out.TypeMeta = in.TypeMeta
out.GroupVersion = in.GroupVersion
if in.APIResources != nil {
in, out := &in.APIResources, &out.APIResources
*out = make([]APIResource, len(*in))
for i := range *in {
(*out)[i] = (*in)[i]
}
} else {
out.APIResources = nil
}
return nil
}
}
func DeepCopy_unversioned_APIVersions(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*APIVersions)
out := out.(*APIVersions)
out.TypeMeta = in.TypeMeta
if in.Versions != nil {
in, out := &in.Versions, &out.Versions
*out = make([]string, len(*in))
copy(*out, *in)
} else {
out.Versions = nil
}
if in.ServerAddressByClientCIDRs != nil {
in, out := &in.ServerAddressByClientCIDRs, &out.ServerAddressByClientCIDRs
*out = make([]ServerAddressByClientCIDR, len(*in))
for i := range *in {
(*out)[i] = (*in)[i]
}
} else {
out.ServerAddressByClientCIDRs = nil
}
return nil
}
}
func DeepCopy_unversioned_Duration(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*Duration)
out := out.(*Duration)
out.Duration = in.Duration
return nil
}
}
func DeepCopy_unversioned_ExportOptions(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*ExportOptions)
out := out.(*ExportOptions)
out.TypeMeta = in.TypeMeta
out.Export = in.Export
out.Exact = in.Exact
return nil
}
}
func DeepCopy_unversioned_GroupKind(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*GroupKind)
out := out.(*GroupKind)
out.Group = in.Group
out.Kind = in.Kind
return nil
}
}
func DeepCopy_unversioned_GroupResource(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*GroupResource)
out := out.(*GroupResource)
out.Group = in.Group
out.Resource = in.Resource
return nil
}
}
func DeepCopy_unversioned_GroupVersion(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*GroupVersion)
out := out.(*GroupVersion)
out.Group = in.Group
out.Version = in.Version
return nil
}
}
func DeepCopy_unversioned_GroupVersionForDiscovery(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*GroupVersionForDiscovery)
out := out.(*GroupVersionForDiscovery)
out.GroupVersion = in.GroupVersion
out.Version = in.Version
return nil
}
}
func DeepCopy_unversioned_GroupVersionKind(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*GroupVersionKind)
out := out.(*GroupVersionKind)
out.Group = in.Group
out.Version = in.Version
out.Kind = in.Kind
return nil
}
}
func DeepCopy_unversioned_GroupVersionResource(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*GroupVersionResource)
out := out.(*GroupVersionResource)
out.Group = in.Group
out.Version = in.Version
out.Resource = in.Resource
return nil
}
}
func DeepCopy_unversioned_LabelSelector(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*LabelSelector)
out := out.(*LabelSelector)
if in.MatchLabels != nil {
in, out := &in.MatchLabels, &out.MatchLabels
*out = make(map[string]string)
for key, val := range *in {
(*out)[key] = val
}
} else {
out.MatchLabels = nil
}
if in.MatchExpressions != nil {
in, out := &in.MatchExpressions, &out.MatchExpressions
*out = make([]LabelSelectorRequirement, len(*in))
for i := range *in {
if err := DeepCopy_unversioned_LabelSelectorRequirement(&(*in)[i], &(*out)[i], c); err != nil {
return err
}
}
} else {
out.MatchExpressions = nil
}
return nil
}
}
func DeepCopy_unversioned_LabelSelectorRequirement(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*LabelSelectorRequirement)
out := out.(*LabelSelectorRequirement)
out.Key = in.Key
out.Operator = in.Operator
if in.Values != nil {
in, out := &in.Values, &out.Values
*out = make([]string, len(*in))
copy(*out, *in)
} else {
out.Values = nil
}
return nil
}
}
func DeepCopy_unversioned_ListMeta(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*ListMeta)
out := out.(*ListMeta)
out.SelfLink = in.SelfLink
out.ResourceVersion = in.ResourceVersion
return nil
}
}
func DeepCopy_unversioned_Patch(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*Patch)
out := out.(*Patch)
_ = in
_ = out
return nil
}
}
func DeepCopy_unversioned_RootPaths(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*RootPaths)
out := out.(*RootPaths)
if in.Paths != nil {
in, out := &in.Paths, &out.Paths
*out = make([]string, len(*in))
copy(*out, *in)
} else {
out.Paths = nil
}
return nil
}
}
func DeepCopy_unversioned_ServerAddressByClientCIDR(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*ServerAddressByClientCIDR)
out := out.(*ServerAddressByClientCIDR)
out.ClientCIDR = in.ClientCIDR
out.ServerAddress = in.ServerAddress
return nil
}
}
func DeepCopy_unversioned_Status(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*Status)
out := out.(*Status)
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
out.Status = in.Status
out.Message = in.Message
out.Reason = in.Reason
if in.Details != nil {
in, out := &in.Details, &out.Details
*out = new(StatusDetails)
if err := DeepCopy_unversioned_StatusDetails(*in, *out, c); err != nil {
return err
}
} else {
out.Details = nil
}
out.Code = in.Code
return nil
}
}
func DeepCopy_unversioned_StatusCause(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*StatusCause)
out := out.(*StatusCause)
out.Type = in.Type
out.Message = in.Message
out.Field = in.Field
return nil
}
}
func DeepCopy_unversioned_StatusDetails(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*StatusDetails)
out := out.(*StatusDetails)
out.Name = in.Name
out.Group = in.Group
out.Kind = in.Kind
if in.Causes != nil {
in, out := &in.Causes, &out.Causes
*out = make([]StatusCause, len(*in))
for i := range *in {
(*out)[i] = (*in)[i]
}
} else {
out.Causes = nil
}
out.RetryAfterSeconds = in.RetryAfterSeconds
return nil
}
}
func DeepCopy_unversioned_Time(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*Time)
out := out.(*Time)
if newVal, err := c.DeepCopy(&in.Time); err != nil {
return err
} else {
out.Time = *newVal.(*time.Time)
}
return nil
}
}
func DeepCopy_unversioned_Timestamp(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*Timestamp)
out := out.(*Timestamp)
out.Seconds = in.Seconds
out.Nanos = in.Nanos
return nil
}
}
func DeepCopy_unversioned_TypeMeta(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*TypeMeta)
out := out.(*TypeMeta)
out.Kind = in.Kind
out.APIVersion = in.APIVersion
return nil
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
// +build !ignore_autogenerated
/*
Copyright 2016 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.
*/
// This file was autogenerated by deepcopy-gen. Do not edit it manually!
package apps
import (
api "k8s.io/kubernetes/pkg/api"
unversioned "k8s.io/kubernetes/pkg/api/unversioned"
conversion "k8s.io/kubernetes/pkg/conversion"
reflect "reflect"
)
func init() {
if err := api.Scheme.AddGeneratedDeepCopyFuncs(
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_apps_PetSet, InType: reflect.TypeOf(func() *PetSet { var x *PetSet; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_apps_PetSetList, InType: reflect.TypeOf(func() *PetSetList { var x *PetSetList; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_apps_PetSetSpec, InType: reflect.TypeOf(func() *PetSetSpec { var x *PetSetSpec; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_apps_PetSetStatus, InType: reflect.TypeOf(func() *PetSetStatus { var x *PetSetStatus; return x }())},
); err != nil {
// if one of the deep copy functions is malformed, detect it immediately.
panic(err)
}
}
func DeepCopy_apps_PetSet(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*PetSet)
out := out.(*PetSet)
out.TypeMeta = in.TypeMeta
if err := api.DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
return err
}
if err := DeepCopy_apps_PetSetSpec(&in.Spec, &out.Spec, c); err != nil {
return err
}
if err := DeepCopy_apps_PetSetStatus(&in.Status, &out.Status, c); err != nil {
return err
}
return nil
}
}
func DeepCopy_apps_PetSetList(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*PetSetList)
out := out.(*PetSetList)
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]PetSet, len(*in))
for i := range *in {
if err := DeepCopy_apps_PetSet(&(*in)[i], &(*out)[i], c); err != nil {
return err
}
}
} else {
out.Items = nil
}
return nil
}
}
func DeepCopy_apps_PetSetSpec(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*PetSetSpec)
out := out.(*PetSetSpec)
out.Replicas = in.Replicas
if in.Selector != nil {
in, out := &in.Selector, &out.Selector
*out = new(unversioned.LabelSelector)
if err := unversioned.DeepCopy_unversioned_LabelSelector(*in, *out, c); err != nil {
return err
}
} else {
out.Selector = nil
}
if err := api.DeepCopy_api_PodTemplateSpec(&in.Template, &out.Template, c); err != nil {
return err
}
if in.VolumeClaimTemplates != nil {
in, out := &in.VolumeClaimTemplates, &out.VolumeClaimTemplates
*out = make([]api.PersistentVolumeClaim, len(*in))
for i := range *in {
if err := api.DeepCopy_api_PersistentVolumeClaim(&(*in)[i], &(*out)[i], c); err != nil {
return err
}
}
} else {
out.VolumeClaimTemplates = nil
}
out.ServiceName = in.ServiceName
return nil
}
}
func DeepCopy_apps_PetSetStatus(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*PetSetStatus)
out := out.(*PetSetStatus)
if in.ObservedGeneration != nil {
in, out := &in.ObservedGeneration, &out.ObservedGeneration
*out = new(int64)
**out = **in
} else {
out.ObservedGeneration = nil
}
out.Replicas = in.Replicas
return nil
}
}
// +build !ignore_autogenerated
/*
Copyright 2016 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.
*/
// This file was autogenerated by conversion-gen. Do not edit it manually!
package v1alpha1
import (
api "k8s.io/kubernetes/pkg/api"
apps "k8s.io/kubernetes/pkg/apis/apps"
conversion "k8s.io/kubernetes/pkg/conversion"
)
func init() {
if err := api.Scheme.AddGeneratedConversionFuncs(
Convert_v1alpha1_PetSet_To_apps_PetSet,
Convert_apps_PetSet_To_v1alpha1_PetSet,
Convert_v1alpha1_PetSetList_To_apps_PetSetList,
Convert_apps_PetSetList_To_v1alpha1_PetSetList,
Convert_v1alpha1_PetSetSpec_To_apps_PetSetSpec,
Convert_apps_PetSetSpec_To_v1alpha1_PetSetSpec,
Convert_v1alpha1_PetSetStatus_To_apps_PetSetStatus,
Convert_apps_PetSetStatus_To_v1alpha1_PetSetStatus,
); err != nil {
// if one of the conversion functions is malformed, detect it immediately.
panic(err)
}
}
func autoConvert_v1alpha1_PetSet_To_apps_PetSet(in *PetSet, out *apps.PetSet, s conversion.Scope) error {
SetDefaults_PetSet(in)
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
return err
}
// TODO: Inefficient conversion - can we improve it?
if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
return err
}
if err := Convert_v1alpha1_PetSetSpec_To_apps_PetSetSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
if err := Convert_v1alpha1_PetSetStatus_To_apps_PetSetStatus(&in.Status, &out.Status, s); err != nil {
return err
}
return nil
}
func Convert_v1alpha1_PetSet_To_apps_PetSet(in *PetSet, out *apps.PetSet, s conversion.Scope) error {
return autoConvert_v1alpha1_PetSet_To_apps_PetSet(in, out, s)
}
func autoConvert_apps_PetSet_To_v1alpha1_PetSet(in *apps.PetSet, out *PetSet, s conversion.Scope) error {
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
return err
}
// TODO: Inefficient conversion - can we improve it?
if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
return err
}
if err := Convert_apps_PetSetSpec_To_v1alpha1_PetSetSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
if err := Convert_apps_PetSetStatus_To_v1alpha1_PetSetStatus(&in.Status, &out.Status, s); err != nil {
return err
}
return nil
}
func Convert_apps_PetSet_To_v1alpha1_PetSet(in *apps.PetSet, out *PetSet, s conversion.Scope) error {
return autoConvert_apps_PetSet_To_v1alpha1_PetSet(in, out, s)
}
func autoConvert_v1alpha1_PetSetList_To_apps_PetSetList(in *PetSetList, out *apps.PetSetList, s conversion.Scope) error {
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
return err
}
if err := api.Convert_unversioned_ListMeta_To_unversioned_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
return err
}
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]apps.PetSet, len(*in))
for i := range *in {
if err := Convert_v1alpha1_PetSet_To_apps_PetSet(&(*in)[i], &(*out)[i], s); err != nil {
return err
}
}
} else {
out.Items = nil
}
return nil
}
func Convert_v1alpha1_PetSetList_To_apps_PetSetList(in *PetSetList, out *apps.PetSetList, s conversion.Scope) error {
return autoConvert_v1alpha1_PetSetList_To_apps_PetSetList(in, out, s)
}
func autoConvert_apps_PetSetList_To_v1alpha1_PetSetList(in *apps.PetSetList, out *PetSetList, s conversion.Scope) error {
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
return err
}
if err := api.Convert_unversioned_ListMeta_To_unversioned_ListMeta(&in.ListMeta, &out.ListMeta, s); err != nil {
return err
}
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]PetSet, len(*in))
for i := range *in {
if err := Convert_apps_PetSet_To_v1alpha1_PetSet(&(*in)[i], &(*out)[i], s); err != nil {
return err
}
}
} else {
out.Items = nil
}
return nil
}
func Convert_apps_PetSetList_To_v1alpha1_PetSetList(in *apps.PetSetList, out *PetSetList, s conversion.Scope) error {
return autoConvert_apps_PetSetList_To_v1alpha1_PetSetList(in, out, s)
}
func autoConvert_v1alpha1_PetSetStatus_To_apps_PetSetStatus(in *PetSetStatus, out *apps.PetSetStatus, s conversion.Scope) error {
out.ObservedGeneration = in.ObservedGeneration
out.Replicas = int(in.Replicas)
return nil
}
func Convert_v1alpha1_PetSetStatus_To_apps_PetSetStatus(in *PetSetStatus, out *apps.PetSetStatus, s conversion.Scope) error {
return autoConvert_v1alpha1_PetSetStatus_To_apps_PetSetStatus(in, out, s)
}
func autoConvert_apps_PetSetStatus_To_v1alpha1_PetSetStatus(in *apps.PetSetStatus, out *PetSetStatus, s conversion.Scope) error {
out.ObservedGeneration = in.ObservedGeneration
out.Replicas = int32(in.Replicas)
return nil
}
func Convert_apps_PetSetStatus_To_v1alpha1_PetSetStatus(in *apps.PetSetStatus, out *PetSetStatus, s conversion.Scope) error {
return autoConvert_apps_PetSetStatus_To_v1alpha1_PetSetStatus(in, out, s)
}
// +build !ignore_autogenerated
/*
Copyright 2016 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.
*/
// This file was autogenerated by deepcopy-gen. Do not edit it manually!
package v1alpha1
import (
api "k8s.io/kubernetes/pkg/api"
unversioned "k8s.io/kubernetes/pkg/api/unversioned"
v1 "k8s.io/kubernetes/pkg/api/v1"
conversion "k8s.io/kubernetes/pkg/conversion"
reflect "reflect"
)
func init() {
if err := api.Scheme.AddGeneratedDeepCopyFuncs(
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_PetSet, InType: reflect.TypeOf(func() *PetSet { var x *PetSet; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_PetSetList, InType: reflect.TypeOf(func() *PetSetList { var x *PetSetList; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_PetSetSpec, InType: reflect.TypeOf(func() *PetSetSpec { var x *PetSetSpec; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_PetSetStatus, InType: reflect.TypeOf(func() *PetSetStatus { var x *PetSetStatus; return x }())},
); err != nil {
// if one of the deep copy functions is malformed, detect it immediately.
panic(err)
}
}
func DeepCopy_v1alpha1_PetSet(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*PetSet)
out := out.(*PetSet)
out.TypeMeta = in.TypeMeta
if err := v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
return err
}
if err := DeepCopy_v1alpha1_PetSetSpec(&in.Spec, &out.Spec, c); err != nil {
return err
}
if err := DeepCopy_v1alpha1_PetSetStatus(&in.Status, &out.Status, c); err != nil {
return err
}
return nil
}
}
func DeepCopy_v1alpha1_PetSetList(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*PetSetList)
out := out.(*PetSetList)
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]PetSet, len(*in))
for i := range *in {
if err := DeepCopy_v1alpha1_PetSet(&(*in)[i], &(*out)[i], c); err != nil {
return err
}
}
} else {
out.Items = nil
}
return nil
}
}
func DeepCopy_v1alpha1_PetSetSpec(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*PetSetSpec)
out := out.(*PetSetSpec)
if in.Replicas != nil {
in, out := &in.Replicas, &out.Replicas
*out = new(int32)
**out = **in
} else {
out.Replicas = nil
}
if in.Selector != nil {
in, out := &in.Selector, &out.Selector
*out = new(unversioned.LabelSelector)
if err := unversioned.DeepCopy_unversioned_LabelSelector(*in, *out, c); err != nil {
return err
}
} else {
out.Selector = nil
}
if err := v1.DeepCopy_v1_PodTemplateSpec(&in.Template, &out.Template, c); err != nil {
return err
}
if in.VolumeClaimTemplates != nil {
in, out := &in.VolumeClaimTemplates, &out.VolumeClaimTemplates
*out = make([]v1.PersistentVolumeClaim, len(*in))
for i := range *in {
if err := v1.DeepCopy_v1_PersistentVolumeClaim(&(*in)[i], &(*out)[i], c); err != nil {
return err
}
}
} else {
out.VolumeClaimTemplates = nil
}
out.ServiceName = in.ServiceName
return nil
}
}
func DeepCopy_v1alpha1_PetSetStatus(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*PetSetStatus)
out := out.(*PetSetStatus)
if in.ObservedGeneration != nil {
in, out := &in.ObservedGeneration, &out.ObservedGeneration
*out = new(int64)
**out = **in
} else {
out.ObservedGeneration = nil
}
out.Replicas = in.Replicas
return nil
}
}
// +build !ignore_autogenerated
/*
Copyright 2016 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.
*/
// This file was autogenerated by deepcopy-gen. Do not edit it manually!
package authentication
import (
api "k8s.io/kubernetes/pkg/api"
conversion "k8s.io/kubernetes/pkg/conversion"
reflect "reflect"
)
func init() {
if err := api.Scheme.AddGeneratedDeepCopyFuncs(
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_authenticationk8sio_TokenReview, InType: reflect.TypeOf(func() *TokenReview { var x *TokenReview; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_authenticationk8sio_TokenReviewSpec, InType: reflect.TypeOf(func() *TokenReviewSpec { var x *TokenReviewSpec; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_authenticationk8sio_TokenReviewStatus, InType: reflect.TypeOf(func() *TokenReviewStatus { var x *TokenReviewStatus; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_authenticationk8sio_UserInfo, InType: reflect.TypeOf(func() *UserInfo { var x *UserInfo; return x }())},
); err != nil {
// if one of the deep copy functions is malformed, detect it immediately.
panic(err)
}
}
func DeepCopy_authenticationk8sio_TokenReview(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*TokenReview)
out := out.(*TokenReview)
out.TypeMeta = in.TypeMeta
out.Spec = in.Spec
if err := DeepCopy_authenticationk8sio_TokenReviewStatus(&in.Status, &out.Status, c); err != nil {
return err
}
return nil
}
}
func DeepCopy_authenticationk8sio_TokenReviewSpec(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*TokenReviewSpec)
out := out.(*TokenReviewSpec)
out.Token = in.Token
return nil
}
}
func DeepCopy_authenticationk8sio_TokenReviewStatus(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*TokenReviewStatus)
out := out.(*TokenReviewStatus)
out.Authenticated = in.Authenticated
if err := DeepCopy_authenticationk8sio_UserInfo(&in.User, &out.User, c); err != nil {
return err
}
return nil
}
}
func DeepCopy_authenticationk8sio_UserInfo(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*UserInfo)
out := out.(*UserInfo)
out.Username = in.Username
out.UID = in.UID
if in.Groups != nil {
in, out := &in.Groups, &out.Groups
*out = make([]string, len(*in))
copy(*out, *in)
} else {
out.Groups = nil
}
if in.Extra != nil {
in, out := &in.Extra, &out.Extra
*out = make(map[string][]string)
for key, val := range *in {
if newVal, err := c.DeepCopy(&val); err != nil {
return err
} else {
(*out)[key] = *newVal.(*[]string)
}
}
} else {
out.Extra = nil
}
return nil
}
}
// +build !ignore_autogenerated
/*
Copyright 2016 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.
*/
// This file was autogenerated by conversion-gen. Do not edit it manually!
package v1beta1
import (
api "k8s.io/kubernetes/pkg/api"
authentication_k8s_io "k8s.io/kubernetes/pkg/apis/authentication.k8s.io"
conversion "k8s.io/kubernetes/pkg/conversion"
)
func init() {
if err := api.Scheme.AddGeneratedConversionFuncs(
Convert_v1beta1_TokenReview_To_authenticationk8sio_TokenReview,
Convert_authenticationk8sio_TokenReview_To_v1beta1_TokenReview,
Convert_v1beta1_TokenReviewSpec_To_authenticationk8sio_TokenReviewSpec,
Convert_authenticationk8sio_TokenReviewSpec_To_v1beta1_TokenReviewSpec,
Convert_v1beta1_TokenReviewStatus_To_authenticationk8sio_TokenReviewStatus,
Convert_authenticationk8sio_TokenReviewStatus_To_v1beta1_TokenReviewStatus,
Convert_v1beta1_UserInfo_To_authenticationk8sio_UserInfo,
Convert_authenticationk8sio_UserInfo_To_v1beta1_UserInfo,
); err != nil {
// if one of the conversion functions is malformed, detect it immediately.
panic(err)
}
}
func autoConvert_v1beta1_TokenReview_To_authenticationk8sio_TokenReview(in *TokenReview, out *authentication_k8s_io.TokenReview, s conversion.Scope) error {
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
return err
}
if err := Convert_v1beta1_TokenReviewSpec_To_authenticationk8sio_TokenReviewSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
if err := Convert_v1beta1_TokenReviewStatus_To_authenticationk8sio_TokenReviewStatus(&in.Status, &out.Status, s); err != nil {
return err
}
return nil
}
func Convert_v1beta1_TokenReview_To_authenticationk8sio_TokenReview(in *TokenReview, out *authentication_k8s_io.TokenReview, s conversion.Scope) error {
return autoConvert_v1beta1_TokenReview_To_authenticationk8sio_TokenReview(in, out, s)
}
func autoConvert_authenticationk8sio_TokenReview_To_v1beta1_TokenReview(in *authentication_k8s_io.TokenReview, out *TokenReview, s conversion.Scope) error {
if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
return err
}
if err := Convert_authenticationk8sio_TokenReviewSpec_To_v1beta1_TokenReviewSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
if err := Convert_authenticationk8sio_TokenReviewStatus_To_v1beta1_TokenReviewStatus(&in.Status, &out.Status, s); err != nil {
return err
}
return nil
}
func Convert_authenticationk8sio_TokenReview_To_v1beta1_TokenReview(in *authentication_k8s_io.TokenReview, out *TokenReview, s conversion.Scope) error {
return autoConvert_authenticationk8sio_TokenReview_To_v1beta1_TokenReview(in, out, s)
}
func autoConvert_v1beta1_TokenReviewSpec_To_authenticationk8sio_TokenReviewSpec(in *TokenReviewSpec, out *authentication_k8s_io.TokenReviewSpec, s conversion.Scope) error {
out.Token = in.Token
return nil
}
func Convert_v1beta1_TokenReviewSpec_To_authenticationk8sio_TokenReviewSpec(in *TokenReviewSpec, out *authentication_k8s_io.TokenReviewSpec, s conversion.Scope) error {
return autoConvert_v1beta1_TokenReviewSpec_To_authenticationk8sio_TokenReviewSpec(in, out, s)
}
func autoConvert_authenticationk8sio_TokenReviewSpec_To_v1beta1_TokenReviewSpec(in *authentication_k8s_io.TokenReviewSpec, out *TokenReviewSpec, s conversion.Scope) error {
out.Token = in.Token
return nil
}
func Convert_authenticationk8sio_TokenReviewSpec_To_v1beta1_TokenReviewSpec(in *authentication_k8s_io.TokenReviewSpec, out *TokenReviewSpec, s conversion.Scope) error {
return autoConvert_authenticationk8sio_TokenReviewSpec_To_v1beta1_TokenReviewSpec(in, out, s)
}
func autoConvert_v1beta1_TokenReviewStatus_To_authenticationk8sio_TokenReviewStatus(in *TokenReviewStatus, out *authentication_k8s_io.TokenReviewStatus, s conversion.Scope) error {
out.Authenticated = in.Authenticated
if err := Convert_v1beta1_UserInfo_To_authenticationk8sio_UserInfo(&in.User, &out.User, s); err != nil {
return err
}
return nil
}
func Convert_v1beta1_TokenReviewStatus_To_authenticationk8sio_TokenReviewStatus(in *TokenReviewStatus, out *authentication_k8s_io.TokenReviewStatus, s conversion.Scope) error {
return autoConvert_v1beta1_TokenReviewStatus_To_authenticationk8sio_TokenReviewStatus(in, out, s)
}
func autoConvert_authenticationk8sio_TokenReviewStatus_To_v1beta1_TokenReviewStatus(in *authentication_k8s_io.TokenReviewStatus, out *TokenReviewStatus, s conversion.Scope) error {
out.Authenticated = in.Authenticated
if err := Convert_authenticationk8sio_UserInfo_To_v1beta1_UserInfo(&in.User, &out.User, s); err != nil {
return err
}
return nil
}
func Convert_authenticationk8sio_TokenReviewStatus_To_v1beta1_TokenReviewStatus(in *authentication_k8s_io.TokenReviewStatus, out *TokenReviewStatus, s conversion.Scope) error {
return autoConvert_authenticationk8sio_TokenReviewStatus_To_v1beta1_TokenReviewStatus(in, out, s)
}
func autoConvert_v1beta1_UserInfo_To_authenticationk8sio_UserInfo(in *UserInfo, out *authentication_k8s_io.UserInfo, s conversion.Scope) error {
out.Username = in.Username
out.UID = in.UID
out.Groups = in.Groups
out.Extra = in.Extra
return nil
}
func Convert_v1beta1_UserInfo_To_authenticationk8sio_UserInfo(in *UserInfo, out *authentication_k8s_io.UserInfo, s conversion.Scope) error {
return autoConvert_v1beta1_UserInfo_To_authenticationk8sio_UserInfo(in, out, s)
}
func autoConvert_authenticationk8sio_UserInfo_To_v1beta1_UserInfo(in *authentication_k8s_io.UserInfo, out *UserInfo, s conversion.Scope) error {
out.Username = in.Username
out.UID = in.UID
out.Groups = in.Groups
out.Extra = in.Extra
return nil
}
func Convert_authenticationk8sio_UserInfo_To_v1beta1_UserInfo(in *authentication_k8s_io.UserInfo, out *UserInfo, s conversion.Scope) error {
return autoConvert_authenticationk8sio_UserInfo_To_v1beta1_UserInfo(in, out, s)
}
// +build !ignore_autogenerated
/*
Copyright 2016 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.
*/
// This file was autogenerated by deepcopy-gen. Do not edit it manually!
package v1beta1
import (
api "k8s.io/kubernetes/pkg/api"
conversion "k8s.io/kubernetes/pkg/conversion"
reflect "reflect"
)
func init() {
if err := api.Scheme.AddGeneratedDeepCopyFuncs(
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_TokenReview, InType: reflect.TypeOf(func() *TokenReview { var x *TokenReview; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_TokenReviewSpec, InType: reflect.TypeOf(func() *TokenReviewSpec { var x *TokenReviewSpec; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_TokenReviewStatus, InType: reflect.TypeOf(func() *TokenReviewStatus { var x *TokenReviewStatus; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_UserInfo, InType: reflect.TypeOf(func() *UserInfo { var x *UserInfo; return x }())},
); err != nil {
// if one of the deep copy functions is malformed, detect it immediately.
panic(err)
}
}
func DeepCopy_v1beta1_TokenReview(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*TokenReview)
out := out.(*TokenReview)
out.TypeMeta = in.TypeMeta
out.Spec = in.Spec
if err := DeepCopy_v1beta1_TokenReviewStatus(&in.Status, &out.Status, c); err != nil {
return err
}
return nil
}
}
func DeepCopy_v1beta1_TokenReviewSpec(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*TokenReviewSpec)
out := out.(*TokenReviewSpec)
out.Token = in.Token
return nil
}
}
func DeepCopy_v1beta1_TokenReviewStatus(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*TokenReviewStatus)
out := out.(*TokenReviewStatus)
out.Authenticated = in.Authenticated
if err := DeepCopy_v1beta1_UserInfo(&in.User, &out.User, c); err != nil {
return err
}
return nil
}
}
func DeepCopy_v1beta1_UserInfo(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*UserInfo)
out := out.(*UserInfo)
out.Username = in.Username
out.UID = in.UID
if in.Groups != nil {
in, out := &in.Groups, &out.Groups
*out = make([]string, len(*in))
copy(*out, *in)
} else {
out.Groups = nil
}
if in.Extra != nil {
in, out := &in.Extra, &out.Extra
*out = make(map[string][]string)
for key, val := range *in {
if newVal, err := c.DeepCopy(&val); err != nil {
return err
} else {
(*out)[key] = *newVal.(*[]string)
}
}
} else {
out.Extra = nil
}
return nil
}
}
// +build !ignore_autogenerated
/*
Copyright 2016 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.
*/
// This file was autogenerated by deepcopy-gen. Do not edit it manually!
package authorization
import (
api "k8s.io/kubernetes/pkg/api"
conversion "k8s.io/kubernetes/pkg/conversion"
reflect "reflect"
)
func init() {
if err := api.Scheme.AddGeneratedDeepCopyFuncs(
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_authorization_LocalSubjectAccessReview, InType: reflect.TypeOf(func() *LocalSubjectAccessReview { var x *LocalSubjectAccessReview; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_authorization_NonResourceAttributes, InType: reflect.TypeOf(func() *NonResourceAttributes { var x *NonResourceAttributes; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_authorization_ResourceAttributes, InType: reflect.TypeOf(func() *ResourceAttributes { var x *ResourceAttributes; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_authorization_SelfSubjectAccessReview, InType: reflect.TypeOf(func() *SelfSubjectAccessReview { var x *SelfSubjectAccessReview; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_authorization_SelfSubjectAccessReviewSpec, InType: reflect.TypeOf(func() *SelfSubjectAccessReviewSpec { var x *SelfSubjectAccessReviewSpec; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_authorization_SubjectAccessReview, InType: reflect.TypeOf(func() *SubjectAccessReview { var x *SubjectAccessReview; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_authorization_SubjectAccessReviewSpec, InType: reflect.TypeOf(func() *SubjectAccessReviewSpec { var x *SubjectAccessReviewSpec; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_authorization_SubjectAccessReviewStatus, InType: reflect.TypeOf(func() *SubjectAccessReviewStatus { var x *SubjectAccessReviewStatus; return x }())},
); err != nil {
// if one of the deep copy functions is malformed, detect it immediately.
panic(err)
}
}
func DeepCopy_authorization_LocalSubjectAccessReview(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*LocalSubjectAccessReview)
out := out.(*LocalSubjectAccessReview)
out.TypeMeta = in.TypeMeta
if err := DeepCopy_authorization_SubjectAccessReviewSpec(&in.Spec, &out.Spec, c); err != nil {
return err
}
out.Status = in.Status
return nil
}
}
func DeepCopy_authorization_NonResourceAttributes(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*NonResourceAttributes)
out := out.(*NonResourceAttributes)
out.Path = in.Path
out.Verb = in.Verb
return nil
}
}
func DeepCopy_authorization_ResourceAttributes(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*ResourceAttributes)
out := out.(*ResourceAttributes)
out.Namespace = in.Namespace
out.Verb = in.Verb
out.Group = in.Group
out.Version = in.Version
out.Resource = in.Resource
out.Subresource = in.Subresource
out.Name = in.Name
return nil
}
}
func DeepCopy_authorization_SelfSubjectAccessReview(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*SelfSubjectAccessReview)
out := out.(*SelfSubjectAccessReview)
out.TypeMeta = in.TypeMeta
if err := DeepCopy_authorization_SelfSubjectAccessReviewSpec(&in.Spec, &out.Spec, c); err != nil {
return err
}
out.Status = in.Status
return nil
}
}
func DeepCopy_authorization_SelfSubjectAccessReviewSpec(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*SelfSubjectAccessReviewSpec)
out := out.(*SelfSubjectAccessReviewSpec)
if in.ResourceAttributes != nil {
in, out := &in.ResourceAttributes, &out.ResourceAttributes
*out = new(ResourceAttributes)
**out = **in
} else {
out.ResourceAttributes = nil
}
if in.NonResourceAttributes != nil {
in, out := &in.NonResourceAttributes, &out.NonResourceAttributes
*out = new(NonResourceAttributes)
**out = **in
} else {
out.NonResourceAttributes = nil
}
return nil
}
}
func DeepCopy_authorization_SubjectAccessReview(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*SubjectAccessReview)
out := out.(*SubjectAccessReview)
out.TypeMeta = in.TypeMeta
if err := DeepCopy_authorization_SubjectAccessReviewSpec(&in.Spec, &out.Spec, c); err != nil {
return err
}
out.Status = in.Status
return nil
}
}
func DeepCopy_authorization_SubjectAccessReviewSpec(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*SubjectAccessReviewSpec)
out := out.(*SubjectAccessReviewSpec)
if in.ResourceAttributes != nil {
in, out := &in.ResourceAttributes, &out.ResourceAttributes
*out = new(ResourceAttributes)
**out = **in
} else {
out.ResourceAttributes = nil
}
if in.NonResourceAttributes != nil {
in, out := &in.NonResourceAttributes, &out.NonResourceAttributes
*out = new(NonResourceAttributes)
**out = **in
} else {
out.NonResourceAttributes = nil
}
out.User = in.User
if in.Groups != nil {
in, out := &in.Groups, &out.Groups
*out = make([]string, len(*in))
copy(*out, *in)
} else {
out.Groups = nil
}
if in.Extra != nil {
in, out := &in.Extra, &out.Extra
*out = make(map[string][]string)
for key, val := range *in {
if newVal, err := c.DeepCopy(&val); err != nil {
return err
} else {
(*out)[key] = *newVal.(*[]string)
}
}
} else {
out.Extra = nil
}
return nil
}
}
func DeepCopy_authorization_SubjectAccessReviewStatus(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*SubjectAccessReviewStatus)
out := out.(*SubjectAccessReviewStatus)
out.Allowed = in.Allowed
out.Reason = in.Reason
return nil
}
}
// +build !ignore_autogenerated
/*
Copyright 2016 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.
*/
// This file was autogenerated by deepcopy-gen. Do not edit it manually!
package v1beta1
import (
api "k8s.io/kubernetes/pkg/api"
conversion "k8s.io/kubernetes/pkg/conversion"
reflect "reflect"
)
func init() {
if err := api.Scheme.AddGeneratedDeepCopyFuncs(
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_LocalSubjectAccessReview, InType: reflect.TypeOf(func() *LocalSubjectAccessReview { var x *LocalSubjectAccessReview; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_NonResourceAttributes, InType: reflect.TypeOf(func() *NonResourceAttributes { var x *NonResourceAttributes; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_ResourceAttributes, InType: reflect.TypeOf(func() *ResourceAttributes { var x *ResourceAttributes; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_SelfSubjectAccessReview, InType: reflect.TypeOf(func() *SelfSubjectAccessReview { var x *SelfSubjectAccessReview; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_SelfSubjectAccessReviewSpec, InType: reflect.TypeOf(func() *SelfSubjectAccessReviewSpec { var x *SelfSubjectAccessReviewSpec; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_SubjectAccessReview, InType: reflect.TypeOf(func() *SubjectAccessReview { var x *SubjectAccessReview; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_SubjectAccessReviewSpec, InType: reflect.TypeOf(func() *SubjectAccessReviewSpec { var x *SubjectAccessReviewSpec; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_SubjectAccessReviewStatus, InType: reflect.TypeOf(func() *SubjectAccessReviewStatus { var x *SubjectAccessReviewStatus; return x }())},
); err != nil {
// if one of the deep copy functions is malformed, detect it immediately.
panic(err)
}
}
func DeepCopy_v1beta1_LocalSubjectAccessReview(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*LocalSubjectAccessReview)
out := out.(*LocalSubjectAccessReview)
out.TypeMeta = in.TypeMeta
if err := DeepCopy_v1beta1_SubjectAccessReviewSpec(&in.Spec, &out.Spec, c); err != nil {
return err
}
out.Status = in.Status
return nil
}
}
func DeepCopy_v1beta1_NonResourceAttributes(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*NonResourceAttributes)
out := out.(*NonResourceAttributes)
out.Path = in.Path
out.Verb = in.Verb
return nil
}
}
func DeepCopy_v1beta1_ResourceAttributes(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*ResourceAttributes)
out := out.(*ResourceAttributes)
out.Namespace = in.Namespace
out.Verb = in.Verb
out.Group = in.Group
out.Version = in.Version
out.Resource = in.Resource
out.Subresource = in.Subresource
out.Name = in.Name
return nil
}
}
func DeepCopy_v1beta1_SelfSubjectAccessReview(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*SelfSubjectAccessReview)
out := out.(*SelfSubjectAccessReview)
out.TypeMeta = in.TypeMeta
if err := DeepCopy_v1beta1_SelfSubjectAccessReviewSpec(&in.Spec, &out.Spec, c); err != nil {
return err
}
out.Status = in.Status
return nil
}
}
func DeepCopy_v1beta1_SelfSubjectAccessReviewSpec(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*SelfSubjectAccessReviewSpec)
out := out.(*SelfSubjectAccessReviewSpec)
if in.ResourceAttributes != nil {
in, out := &in.ResourceAttributes, &out.ResourceAttributes
*out = new(ResourceAttributes)
**out = **in
} else {
out.ResourceAttributes = nil
}
if in.NonResourceAttributes != nil {
in, out := &in.NonResourceAttributes, &out.NonResourceAttributes
*out = new(NonResourceAttributes)
**out = **in
} else {
out.NonResourceAttributes = nil
}
return nil
}
}
func DeepCopy_v1beta1_SubjectAccessReview(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*SubjectAccessReview)
out := out.(*SubjectAccessReview)
out.TypeMeta = in.TypeMeta
if err := DeepCopy_v1beta1_SubjectAccessReviewSpec(&in.Spec, &out.Spec, c); err != nil {
return err
}
out.Status = in.Status
return nil
}
}
func DeepCopy_v1beta1_SubjectAccessReviewSpec(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*SubjectAccessReviewSpec)
out := out.(*SubjectAccessReviewSpec)
if in.ResourceAttributes != nil {
in, out := &in.ResourceAttributes, &out.ResourceAttributes
*out = new(ResourceAttributes)
**out = **in
} else {
out.ResourceAttributes = nil
}
if in.NonResourceAttributes != nil {
in, out := &in.NonResourceAttributes, &out.NonResourceAttributes
*out = new(NonResourceAttributes)
**out = **in
} else {
out.NonResourceAttributes = nil
}
out.User = in.User
if in.Groups != nil {
in, out := &in.Groups, &out.Groups
*out = make([]string, len(*in))
copy(*out, *in)
} else {
out.Groups = nil
}
if in.Extra != nil {
in, out := &in.Extra, &out.Extra
*out = make(map[string][]string)
for key, val := range *in {
if newVal, err := c.DeepCopy(&val); err != nil {
return err
} else {
(*out)[key] = *newVal.(*[]string)
}
}
} else {
out.Extra = nil
}
return nil
}
}
func DeepCopy_v1beta1_SubjectAccessReviewStatus(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*SubjectAccessReviewStatus)
out := out.(*SubjectAccessReviewStatus)
out.Allowed = in.Allowed
out.Reason = in.Reason
return nil
}
}
// +build !ignore_autogenerated
/*
Copyright 2016 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.
*/
// This file was autogenerated by deepcopy-gen. Do not edit it manually!
package autoscaling
import (
api "k8s.io/kubernetes/pkg/api"
unversioned "k8s.io/kubernetes/pkg/api/unversioned"
conversion "k8s.io/kubernetes/pkg/conversion"
reflect "reflect"
)
func init() {
if err := api.Scheme.AddGeneratedDeepCopyFuncs(
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_autoscaling_CrossVersionObjectReference, InType: reflect.TypeOf(func() *CrossVersionObjectReference { var x *CrossVersionObjectReference; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_autoscaling_HorizontalPodAutoscaler, InType: reflect.TypeOf(func() *HorizontalPodAutoscaler { var x *HorizontalPodAutoscaler; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_autoscaling_HorizontalPodAutoscalerList, InType: reflect.TypeOf(func() *HorizontalPodAutoscalerList { var x *HorizontalPodAutoscalerList; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_autoscaling_HorizontalPodAutoscalerSpec, InType: reflect.TypeOf(func() *HorizontalPodAutoscalerSpec { var x *HorizontalPodAutoscalerSpec; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_autoscaling_HorizontalPodAutoscalerStatus, InType: reflect.TypeOf(func() *HorizontalPodAutoscalerStatus { var x *HorizontalPodAutoscalerStatus; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_autoscaling_Scale, InType: reflect.TypeOf(func() *Scale { var x *Scale; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_autoscaling_ScaleSpec, InType: reflect.TypeOf(func() *ScaleSpec { var x *ScaleSpec; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_autoscaling_ScaleStatus, InType: reflect.TypeOf(func() *ScaleStatus { var x *ScaleStatus; return x }())},
); err != nil {
// if one of the deep copy functions is malformed, detect it immediately.
panic(err)
}
}
func DeepCopy_autoscaling_CrossVersionObjectReference(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*CrossVersionObjectReference)
out := out.(*CrossVersionObjectReference)
out.Kind = in.Kind
out.Name = in.Name
out.APIVersion = in.APIVersion
return nil
}
}
func DeepCopy_autoscaling_HorizontalPodAutoscaler(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*HorizontalPodAutoscaler)
out := out.(*HorizontalPodAutoscaler)
out.TypeMeta = in.TypeMeta
if err := api.DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
return err
}
if err := DeepCopy_autoscaling_HorizontalPodAutoscalerSpec(&in.Spec, &out.Spec, c); err != nil {
return err
}
if err := DeepCopy_autoscaling_HorizontalPodAutoscalerStatus(&in.Status, &out.Status, c); err != nil {
return err
}
return nil
}
}
func DeepCopy_autoscaling_HorizontalPodAutoscalerList(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*HorizontalPodAutoscalerList)
out := out.(*HorizontalPodAutoscalerList)
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]HorizontalPodAutoscaler, len(*in))
for i := range *in {
if err := DeepCopy_autoscaling_HorizontalPodAutoscaler(&(*in)[i], &(*out)[i], c); err != nil {
return err
}
}
} else {
out.Items = nil
}
return nil
}
}
func DeepCopy_autoscaling_HorizontalPodAutoscalerSpec(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*HorizontalPodAutoscalerSpec)
out := out.(*HorizontalPodAutoscalerSpec)
out.ScaleTargetRef = in.ScaleTargetRef
if in.MinReplicas != nil {
in, out := &in.MinReplicas, &out.MinReplicas
*out = new(int32)
**out = **in
} else {
out.MinReplicas = nil
}
out.MaxReplicas = in.MaxReplicas
if in.TargetCPUUtilizationPercentage != nil {
in, out := &in.TargetCPUUtilizationPercentage, &out.TargetCPUUtilizationPercentage
*out = new(int32)
**out = **in
} else {
out.TargetCPUUtilizationPercentage = nil
}
return nil
}
}
func DeepCopy_autoscaling_HorizontalPodAutoscalerStatus(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*HorizontalPodAutoscalerStatus)
out := out.(*HorizontalPodAutoscalerStatus)
if in.ObservedGeneration != nil {
in, out := &in.ObservedGeneration, &out.ObservedGeneration
*out = new(int64)
**out = **in
} else {
out.ObservedGeneration = nil
}
if in.LastScaleTime != nil {
in, out := &in.LastScaleTime, &out.LastScaleTime
*out = new(unversioned.Time)
**out = (*in).DeepCopy()
} else {
out.LastScaleTime = nil
}
out.CurrentReplicas = in.CurrentReplicas
out.DesiredReplicas = in.DesiredReplicas
if in.CurrentCPUUtilizationPercentage != nil {
in, out := &in.CurrentCPUUtilizationPercentage, &out.CurrentCPUUtilizationPercentage
*out = new(int32)
**out = **in
} else {
out.CurrentCPUUtilizationPercentage = nil
}
return nil
}
}
func DeepCopy_autoscaling_Scale(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*Scale)
out := out.(*Scale)
out.TypeMeta = in.TypeMeta
if err := api.DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
return err
}
out.Spec = in.Spec
out.Status = in.Status
return nil
}
}
func DeepCopy_autoscaling_ScaleSpec(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*ScaleSpec)
out := out.(*ScaleSpec)
out.Replicas = in.Replicas
return nil
}
}
func DeepCopy_autoscaling_ScaleStatus(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*ScaleStatus)
out := out.(*ScaleStatus)
out.Replicas = in.Replicas
out.Selector = in.Selector
return nil
}
}
// +build !ignore_autogenerated
/*
Copyright 2016 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.
*/
// This file was autogenerated by deepcopy-gen. Do not edit it manually!
package v1
import (
api "k8s.io/kubernetes/pkg/api"
unversioned "k8s.io/kubernetes/pkg/api/unversioned"
api_v1 "k8s.io/kubernetes/pkg/api/v1"
conversion "k8s.io/kubernetes/pkg/conversion"
reflect "reflect"
)
func init() {
if err := api.Scheme.AddGeneratedDeepCopyFuncs(
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_CrossVersionObjectReference, InType: reflect.TypeOf(func() *CrossVersionObjectReference { var x *CrossVersionObjectReference; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_HorizontalPodAutoscaler, InType: reflect.TypeOf(func() *HorizontalPodAutoscaler { var x *HorizontalPodAutoscaler; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_HorizontalPodAutoscalerList, InType: reflect.TypeOf(func() *HorizontalPodAutoscalerList { var x *HorizontalPodAutoscalerList; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_HorizontalPodAutoscalerSpec, InType: reflect.TypeOf(func() *HorizontalPodAutoscalerSpec { var x *HorizontalPodAutoscalerSpec; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_HorizontalPodAutoscalerStatus, InType: reflect.TypeOf(func() *HorizontalPodAutoscalerStatus { var x *HorizontalPodAutoscalerStatus; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_Scale, InType: reflect.TypeOf(func() *Scale { var x *Scale; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ScaleSpec, InType: reflect.TypeOf(func() *ScaleSpec { var x *ScaleSpec; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ScaleStatus, InType: reflect.TypeOf(func() *ScaleStatus { var x *ScaleStatus; return x }())},
); err != nil {
// if one of the deep copy functions is malformed, detect it immediately.
panic(err)
}
}
func DeepCopy_v1_CrossVersionObjectReference(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*CrossVersionObjectReference)
out := out.(*CrossVersionObjectReference)
out.Kind = in.Kind
out.Name = in.Name
out.APIVersion = in.APIVersion
return nil
}
}
func DeepCopy_v1_HorizontalPodAutoscaler(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*HorizontalPodAutoscaler)
out := out.(*HorizontalPodAutoscaler)
out.TypeMeta = in.TypeMeta
if err := api_v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
return err
}
if err := DeepCopy_v1_HorizontalPodAutoscalerSpec(&in.Spec, &out.Spec, c); err != nil {
return err
}
if err := DeepCopy_v1_HorizontalPodAutoscalerStatus(&in.Status, &out.Status, c); err != nil {
return err
}
return nil
}
}
func DeepCopy_v1_HorizontalPodAutoscalerList(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*HorizontalPodAutoscalerList)
out := out.(*HorizontalPodAutoscalerList)
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]HorizontalPodAutoscaler, len(*in))
for i := range *in {
if err := DeepCopy_v1_HorizontalPodAutoscaler(&(*in)[i], &(*out)[i], c); err != nil {
return err
}
}
} else {
out.Items = nil
}
return nil
}
}
func DeepCopy_v1_HorizontalPodAutoscalerSpec(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*HorizontalPodAutoscalerSpec)
out := out.(*HorizontalPodAutoscalerSpec)
out.ScaleTargetRef = in.ScaleTargetRef
if in.MinReplicas != nil {
in, out := &in.MinReplicas, &out.MinReplicas
*out = new(int32)
**out = **in
} else {
out.MinReplicas = nil
}
out.MaxReplicas = in.MaxReplicas
if in.TargetCPUUtilizationPercentage != nil {
in, out := &in.TargetCPUUtilizationPercentage, &out.TargetCPUUtilizationPercentage
*out = new(int32)
**out = **in
} else {
out.TargetCPUUtilizationPercentage = nil
}
return nil
}
}
func DeepCopy_v1_HorizontalPodAutoscalerStatus(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*HorizontalPodAutoscalerStatus)
out := out.(*HorizontalPodAutoscalerStatus)
if in.ObservedGeneration != nil {
in, out := &in.ObservedGeneration, &out.ObservedGeneration
*out = new(int64)
**out = **in
} else {
out.ObservedGeneration = nil
}
if in.LastScaleTime != nil {
in, out := &in.LastScaleTime, &out.LastScaleTime
*out = new(unversioned.Time)
**out = (*in).DeepCopy()
} else {
out.LastScaleTime = nil
}
out.CurrentReplicas = in.CurrentReplicas
out.DesiredReplicas = in.DesiredReplicas
if in.CurrentCPUUtilizationPercentage != nil {
in, out := &in.CurrentCPUUtilizationPercentage, &out.CurrentCPUUtilizationPercentage
*out = new(int32)
**out = **in
} else {
out.CurrentCPUUtilizationPercentage = nil
}
return nil
}
}
func DeepCopy_v1_Scale(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*Scale)
out := out.(*Scale)
out.TypeMeta = in.TypeMeta
if err := api_v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
return err
}
out.Spec = in.Spec
out.Status = in.Status
return nil
}
}
func DeepCopy_v1_ScaleSpec(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*ScaleSpec)
out := out.(*ScaleSpec)
out.Replicas = in.Replicas
return nil
}
}
func DeepCopy_v1_ScaleStatus(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*ScaleStatus)
out := out.(*ScaleStatus)
out.Replicas = in.Replicas
out.Selector = in.Selector
return nil
}
}
// +build !ignore_autogenerated
/*
Copyright 2016 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.
*/
// This file was autogenerated by deepcopy-gen. Do not edit it manually!
package batch
import (
api "k8s.io/kubernetes/pkg/api"
unversioned "k8s.io/kubernetes/pkg/api/unversioned"
conversion "k8s.io/kubernetes/pkg/conversion"
reflect "reflect"
)
func init() {
if err := api.Scheme.AddGeneratedDeepCopyFuncs(
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_batch_Job, InType: reflect.TypeOf(func() *Job { var x *Job; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_batch_JobCondition, InType: reflect.TypeOf(func() *JobCondition { var x *JobCondition; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_batch_JobList, InType: reflect.TypeOf(func() *JobList { var x *JobList; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_batch_JobSpec, InType: reflect.TypeOf(func() *JobSpec { var x *JobSpec; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_batch_JobStatus, InType: reflect.TypeOf(func() *JobStatus { var x *JobStatus; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_batch_JobTemplate, InType: reflect.TypeOf(func() *JobTemplate { var x *JobTemplate; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_batch_JobTemplateSpec, InType: reflect.TypeOf(func() *JobTemplateSpec { var x *JobTemplateSpec; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_batch_ScheduledJob, InType: reflect.TypeOf(func() *ScheduledJob { var x *ScheduledJob; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_batch_ScheduledJobList, InType: reflect.TypeOf(func() *ScheduledJobList { var x *ScheduledJobList; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_batch_ScheduledJobSpec, InType: reflect.TypeOf(func() *ScheduledJobSpec { var x *ScheduledJobSpec; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_batch_ScheduledJobStatus, InType: reflect.TypeOf(func() *ScheduledJobStatus { var x *ScheduledJobStatus; return x }())},
); err != nil {
// if one of the deep copy functions is malformed, detect it immediately.
panic(err)
}
}
func DeepCopy_batch_Job(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*Job)
out := out.(*Job)
out.TypeMeta = in.TypeMeta
if err := api.DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
return err
}
if err := DeepCopy_batch_JobSpec(&in.Spec, &out.Spec, c); err != nil {
return err
}
if err := DeepCopy_batch_JobStatus(&in.Status, &out.Status, c); err != nil {
return err
}
return nil
}
}
func DeepCopy_batch_JobCondition(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*JobCondition)
out := out.(*JobCondition)
out.Type = in.Type
out.Status = in.Status
out.LastProbeTime = in.LastProbeTime.DeepCopy()
out.LastTransitionTime = in.LastTransitionTime.DeepCopy()
out.Reason = in.Reason
out.Message = in.Message
return nil
}
}
func DeepCopy_batch_JobList(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*JobList)
out := out.(*JobList)
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]Job, len(*in))
for i := range *in {
if err := DeepCopy_batch_Job(&(*in)[i], &(*out)[i], c); err != nil {
return err
}
}
} else {
out.Items = nil
}
return nil
}
}
func DeepCopy_batch_JobSpec(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*JobSpec)
out := out.(*JobSpec)
if in.Parallelism != nil {
in, out := &in.Parallelism, &out.Parallelism
*out = new(int32)
**out = **in
} else {
out.Parallelism = nil
}
if in.Completions != nil {
in, out := &in.Completions, &out.Completions
*out = new(int32)
**out = **in
} else {
out.Completions = nil
}
if in.ActiveDeadlineSeconds != nil {
in, out := &in.ActiveDeadlineSeconds, &out.ActiveDeadlineSeconds
*out = new(int64)
**out = **in
} else {
out.ActiveDeadlineSeconds = nil
}
if in.Selector != nil {
in, out := &in.Selector, &out.Selector
*out = new(unversioned.LabelSelector)
if err := unversioned.DeepCopy_unversioned_LabelSelector(*in, *out, c); err != nil {
return err
}
} else {
out.Selector = nil
}
if in.ManualSelector != nil {
in, out := &in.ManualSelector, &out.ManualSelector
*out = new(bool)
**out = **in
} else {
out.ManualSelector = nil
}
if err := api.DeepCopy_api_PodTemplateSpec(&in.Template, &out.Template, c); err != nil {
return err
}
return nil
}
}
func DeepCopy_batch_JobStatus(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*JobStatus)
out := out.(*JobStatus)
if in.Conditions != nil {
in, out := &in.Conditions, &out.Conditions
*out = make([]JobCondition, len(*in))
for i := range *in {
if err := DeepCopy_batch_JobCondition(&(*in)[i], &(*out)[i], c); err != nil {
return err
}
}
} else {
out.Conditions = nil
}
if in.StartTime != nil {
in, out := &in.StartTime, &out.StartTime
*out = new(unversioned.Time)
**out = (*in).DeepCopy()
} else {
out.StartTime = nil
}
if in.CompletionTime != nil {
in, out := &in.CompletionTime, &out.CompletionTime
*out = new(unversioned.Time)
**out = (*in).DeepCopy()
} else {
out.CompletionTime = nil
}
out.Active = in.Active
out.Succeeded = in.Succeeded
out.Failed = in.Failed
return nil
}
}
func DeepCopy_batch_JobTemplate(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*JobTemplate)
out := out.(*JobTemplate)
out.TypeMeta = in.TypeMeta
if err := api.DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
return err
}
if err := DeepCopy_batch_JobTemplateSpec(&in.Template, &out.Template, c); err != nil {
return err
}
return nil
}
}
func DeepCopy_batch_JobTemplateSpec(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*JobTemplateSpec)
out := out.(*JobTemplateSpec)
if err := api.DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
return err
}
if err := DeepCopy_batch_JobSpec(&in.Spec, &out.Spec, c); err != nil {
return err
}
return nil
}
}
func DeepCopy_batch_ScheduledJob(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*ScheduledJob)
out := out.(*ScheduledJob)
out.TypeMeta = in.TypeMeta
if err := api.DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
return err
}
if err := DeepCopy_batch_ScheduledJobSpec(&in.Spec, &out.Spec, c); err != nil {
return err
}
if err := DeepCopy_batch_ScheduledJobStatus(&in.Status, &out.Status, c); err != nil {
return err
}
return nil
}
}
func DeepCopy_batch_ScheduledJobList(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*ScheduledJobList)
out := out.(*ScheduledJobList)
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]ScheduledJob, len(*in))
for i := range *in {
if err := DeepCopy_batch_ScheduledJob(&(*in)[i], &(*out)[i], c); err != nil {
return err
}
}
} else {
out.Items = nil
}
return nil
}
}
func DeepCopy_batch_ScheduledJobSpec(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*ScheduledJobSpec)
out := out.(*ScheduledJobSpec)
out.Schedule = in.Schedule
if in.StartingDeadlineSeconds != nil {
in, out := &in.StartingDeadlineSeconds, &out.StartingDeadlineSeconds
*out = new(int64)
**out = **in
} else {
out.StartingDeadlineSeconds = nil
}
out.ConcurrencyPolicy = in.ConcurrencyPolicy
if in.Suspend != nil {
in, out := &in.Suspend, &out.Suspend
*out = new(bool)
**out = **in
} else {
out.Suspend = nil
}
if err := DeepCopy_batch_JobTemplateSpec(&in.JobTemplate, &out.JobTemplate, c); err != nil {
return err
}
return nil
}
}
func DeepCopy_batch_ScheduledJobStatus(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*ScheduledJobStatus)
out := out.(*ScheduledJobStatus)
if in.Active != nil {
in, out := &in.Active, &out.Active
*out = make([]api.ObjectReference, len(*in))
for i := range *in {
(*out)[i] = (*in)[i]
}
} else {
out.Active = nil
}
if in.LastScheduleTime != nil {
in, out := &in.LastScheduleTime, &out.LastScheduleTime
*out = new(unversioned.Time)
**out = (*in).DeepCopy()
} else {
out.LastScheduleTime = nil
}
return nil
}
}
// +build !ignore_autogenerated
/*
Copyright 2016 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.
*/
// This file was autogenerated by deepcopy-gen. Do not edit it manually!
package v1
import (
api "k8s.io/kubernetes/pkg/api"
unversioned "k8s.io/kubernetes/pkg/api/unversioned"
api_v1 "k8s.io/kubernetes/pkg/api/v1"
conversion "k8s.io/kubernetes/pkg/conversion"
reflect "reflect"
)
func init() {
if err := api.Scheme.AddGeneratedDeepCopyFuncs(
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_Job, InType: reflect.TypeOf(func() *Job { var x *Job; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_JobCondition, InType: reflect.TypeOf(func() *JobCondition { var x *JobCondition; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_JobList, InType: reflect.TypeOf(func() *JobList { var x *JobList; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_JobSpec, InType: reflect.TypeOf(func() *JobSpec { var x *JobSpec; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_JobStatus, InType: reflect.TypeOf(func() *JobStatus { var x *JobStatus; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_LabelSelector, InType: reflect.TypeOf(func() *LabelSelector { var x *LabelSelector; return x }())},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_LabelSelectorRequirement, InType: reflect.TypeOf(func() *LabelSelectorRequirement { var x *LabelSelectorRequirement; return x }())},
); err != nil {
// if one of the deep copy functions is malformed, detect it immediately.
panic(err)
}
}
func DeepCopy_v1_Job(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*Job)
out := out.(*Job)
out.TypeMeta = in.TypeMeta
if err := api_v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
return err
}
if err := DeepCopy_v1_JobSpec(&in.Spec, &out.Spec, c); err != nil {
return err
}
if err := DeepCopy_v1_JobStatus(&in.Status, &out.Status, c); err != nil {
return err
}
return nil
}
}
func DeepCopy_v1_JobCondition(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*JobCondition)
out := out.(*JobCondition)
out.Type = in.Type
out.Status = in.Status
out.LastProbeTime = in.LastProbeTime.DeepCopy()
out.LastTransitionTime = in.LastTransitionTime.DeepCopy()
out.Reason = in.Reason
out.Message = in.Message
return nil
}
}
func DeepCopy_v1_JobList(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*JobList)
out := out.(*JobList)
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]Job, len(*in))
for i := range *in {
if err := DeepCopy_v1_Job(&(*in)[i], &(*out)[i], c); err != nil {
return err
}
}
} else {
out.Items = nil
}
return nil
}
}
func DeepCopy_v1_JobSpec(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*JobSpec)
out := out.(*JobSpec)
if in.Parallelism != nil {
in, out := &in.Parallelism, &out.Parallelism
*out = new(int32)
**out = **in
} else {
out.Parallelism = nil
}
if in.Completions != nil {
in, out := &in.Completions, &out.Completions
*out = new(int32)
**out = **in
} else {
out.Completions = nil
}
if in.ActiveDeadlineSeconds != nil {
in, out := &in.ActiveDeadlineSeconds, &out.ActiveDeadlineSeconds
*out = new(int64)
**out = **in
} else {
out.ActiveDeadlineSeconds = nil
}
if in.Selector != nil {
in, out := &in.Selector, &out.Selector
*out = new(LabelSelector)
if err := DeepCopy_v1_LabelSelector(*in, *out, c); err != nil {
return err
}
} else {
out.Selector = nil
}
if in.ManualSelector != nil {
in, out := &in.ManualSelector, &out.ManualSelector
*out = new(bool)
**out = **in
} else {
out.ManualSelector = nil
}
if err := api_v1.DeepCopy_v1_PodTemplateSpec(&in.Template, &out.Template, c); err != nil {
return err
}
return nil
}
}
func DeepCopy_v1_JobStatus(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*JobStatus)
out := out.(*JobStatus)
if in.Conditions != nil {
in, out := &in.Conditions, &out.Conditions
*out = make([]JobCondition, len(*in))
for i := range *in {
if err := DeepCopy_v1_JobCondition(&(*in)[i], &(*out)[i], c); err != nil {
return err
}
}
} else {
out.Conditions = nil
}
if in.StartTime != nil {
in, out := &in.StartTime, &out.StartTime
*out = new(unversioned.Time)
**out = (*in).DeepCopy()
} else {
out.StartTime = nil
}
if in.CompletionTime != nil {
in, out := &in.CompletionTime, &out.CompletionTime
*out = new(unversioned.Time)
**out = (*in).DeepCopy()
} else {
out.CompletionTime = nil
}
out.Active = in.Active
out.Succeeded = in.Succeeded
out.Failed = in.Failed
return nil
}
}
func DeepCopy_v1_LabelSelector(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*LabelSelector)
out := out.(*LabelSelector)
if in.MatchLabels != nil {
in, out := &in.MatchLabels, &out.MatchLabels
*out = make(map[string]string)
for key, val := range *in {
(*out)[key] = val
}
} else {
out.MatchLabels = nil
}
if in.MatchExpressions != nil {
in, out := &in.MatchExpressions, &out.MatchExpressions
*out = make([]LabelSelectorRequirement, len(*in))
for i := range *in {
if err := DeepCopy_v1_LabelSelectorRequirement(&(*in)[i], &(*out)[i], c); err != nil {
return err
}
}
} else {
out.MatchExpressions = nil
}
return nil
}
}
func DeepCopy_v1_LabelSelectorRequirement(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*LabelSelectorRequirement)
out := out.(*LabelSelectorRequirement)
out.Key = in.Key
out.Operator = in.Operator
if in.Values != nil {
in, out := &in.Values, &out.Values
*out = make([]string, len(*in))
copy(*out, *in)
} else {
out.Values = nil
}
return nil
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment