From faeef5c4ae7068e507a9554252fb03605bd8c8b5 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Tue, 24 May 2016 08:40:44 -0700 Subject: [PATCH 01/18] Use make as the main build tool This allows us to start building real dependencies into Makefile. Leave old hack/* scripts in place but advise to use 'make'. There are a few rules that call things like 'go run' or 'build/*' that I left as-is for now. --- Makefile | 52 +- build/README.md | 7 +- build/release.sh | 4 +- cluster/azure-legacy/util.sh | 2 +- contrib/mesos/ci/test-integration.sh | 2 +- contrib/mesos/docs/ha.md | 2 +- docs/devel/adding-an-APIGroup.md | 4 +- docs/devel/development.md | 11 +- docs/devel/e2e-node-tests.md | 24 +- docs/devel/pull-requests.md | 6 +- docs/devel/releasing.md | 10 +- docs/devel/running-locally.md | 2 +- docs/devel/testing.md | 41 +- examples/kubectl-container/Makefile | 3 +- hack/benchmark-go.sh | 6 +- hack/benchmark-integration.sh | 2 +- hack/build-go.sh | 20 +- hack/dev-push-hyperkube.sh | 2 +- hack/e2e-node-test.sh | 135 +- hack/generate-docs.sh | 14 +- hack/jenkins/gotest.sh | 4 +- hack/jenkins/test-dockerized.sh | 6 +- hack/jenkins/verify-dockerized.sh | 2 +- hack/jenkins/verify.sh | 2 +- hack/local-up-cluster.sh | 4 +- hack/make-rules/build.sh | 27 + hack/make-rules/test-cmd.sh | 2374 ++++++++++++++++++ hack/make-rules/test-e2e-node.sh | 134 + hack/make-rules/test-integration.sh | 94 + hack/make-rules/test.sh | 282 +++ hack/make-rules/verify.sh | 99 + hack/make-rules/vet.sh | 48 + hack/test-cmd.sh | 2359 +---------------- hack/test-go.sh | 273 +- hack/test-integration.sh | 84 +- hack/test-update-storage-objects.sh | 2 +- hack/update-codegen.sh | 2 +- hack/update-generated-docs.sh | 14 +- hack/update-generated-protobuf-dockerized.sh | 8 +- hack/update-munge-docs.sh | 3 +- hack/update-swagger-spec.sh | 2 +- hack/verify-all.sh | 86 +- hack/verify-description.sh | 2 +- hack/verify-generated-docs.sh | 14 +- hack/verify-generated-swagger-docs.sh | 4 +- hack/verify-govet.sh | 36 +- hack/verify-import-boss.sh | 2 +- hack/verify-linkcheck.sh | 2 +- hack/verify-munge-docs.sh | 3 +- hack/verify-swagger-spec.sh | 2 +- hack/verify-symbols.sh | 2 +- hooks/pre-commit | 2 +- pkg/api/ref_test.go | 2 +- test/e2e_node/e2e_build.go | 3 +- 54 files changed, 3315 insertions(+), 3017 deletions(-) create mode 100755 hack/make-rules/build.sh create mode 100755 hack/make-rules/test-cmd.sh create mode 100755 hack/make-rules/test-e2e-node.sh create mode 100755 hack/make-rules/test-integration.sh create mode 100755 hack/make-rules/test.sh create mode 100755 hack/make-rules/verify.sh create mode 100755 hack/make-rules/vet.sh diff --git a/Makefile b/Makefile index c791e7ad288..713af5f0a90 100644 --- a/Makefile +++ b/Makefile @@ -42,7 +42,7 @@ export KUBE_GOLDFLAGS # make all # make all WHAT=cmd/kubelet GOFLAGS=-v all: - hack/build-go.sh $(WHAT) + @hack/make-rules/build.sh $(WHAT) .PHONY: all # Build ginkgo @@ -50,7 +50,7 @@ all: # Example: # make 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 # Runs all the presubmission verifications. @@ -62,7 +62,7 @@ ginkgo: # make verify # make verify BRANCH=branch_x verify: - KUBE_VERIFY_GIT_BRANCH=$(BRANCH) hack/verify-all.sh -v + @KUBE_VERIFY_GIT_BRANCH=$(BRANCH) hack/make-rules/verify.sh -v .PHONY: verify # Build and run tests. @@ -79,24 +79,24 @@ verify: # make test # make check WHAT=pkg/kubelet GOFLAGS=-v check test: - hack/test-go.sh $(WHAT) $(TESTS) + @hack/make-rules/test.sh $(WHAT) $(TESTS) .PHONY: check test # Build and run integration tests. # # Example: -# make test_integration -test_integration: - hack/test-integration.sh -.PHONY: test_integration test_integ +# make test-integration +test-integration: + @hack/make-rules/test-integration.sh +.PHONY: test-integration # Build and run end-to-end tests. # # Example: -# make test_e2e -test_e2e: - go run hack/e2e.go -v --build --up --test --down -.PHONY: test_e2e +# make test-e2e +test-e2e: ginkgo + @go run hack/e2e.go -v --build --up --test --down +.PHONY: test-e2e # Build and run node end-to-end tests. # @@ -116,12 +116,20 @@ test_e2e: # INSTANCE_PREFIX: for REMOTE=true only. Instances created from images will have the name "${INSTANCE_PREFIX}-${IMAGE_NAME}". Defaults to "test"/ # # Example: -# make test_e2e_node FOCUS=kubelet SKIP=container -# make test_e2e_node REMOTE=true DELETE_INSTANCES=true +# make test-e2e-node FOCUS=kubelet SKIP=container +# make test-e2e-node REMOTE=true DELETE_INSTANCES=true # Build and run tests. -test_e2e_node: ginkgo - hack/e2e-node-test.sh -.PHONY: test_e2e_node +test-e2e-node: ginkgo + @hack/make-rules/test-e2e-node.sh +.PHONY: test-e2e-node + +# Build and run cmdline tests. +# +# Example: +# make test-cmd +test-cmd: + @hack/make-rules/test-cmd.sh +.PHONY: test-cmd # Remove all build artifacts. # @@ -139,15 +147,12 @@ clean: # WHAT: Directory names to vet. All *.go files under these # directories will be vetted. If not specified, "everything" will be # 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: # make vet # make vet WHAT=pkg/kubelet vet: - hack/verify-govet.sh $(WHAT) $(TESTS) + @hack/make-rules/vet.sh $(WHAT) .PHONY: vet # Build a release @@ -155,7 +160,7 @@ vet: # Example: # make release release: - build/release.sh + @build/release.sh .PHONY: release # Build a release, but skip tests @@ -163,6 +168,5 @@ release: # Example: # make release-skip-tests release-skip-tests quick-release: - KUBE_RELEASE_RUN_TESTS=n KUBE_FASTBUILD=true build/release.sh + @KUBE_RELEASE_RUN_TESTS=n KUBE_FASTBUILD=true build/release.sh .PHONY: release-skip-tests quick-release - diff --git a/build/README.md b/build/README.md index 4040c157923..2c9a964295c 100644 --- a/build/README.md +++ b/build/README.md @@ -24,10 +24,11 @@ There is also early support for building Docker "run" containers The following scripts are found in the `build/` directory: * `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 hack/test-go.sh`: Run all unit tests - * `run.sh hack/test-integration.sh`: Run integration test + * `run.sh make test`: Run all unit tests + * `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`. * `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. diff --git a/build/release.sh b/build/release.sh index 2b2704b39dc..14856298698 100755 --- a/build/release.sh +++ b/build/release.sh @@ -33,8 +33,8 @@ kube::build::build_image kube::build::run_build_command hack/build-cross.sh if [[ $KUBE_RELEASE_RUN_TESTS =~ ^[yY]$ ]]; then - kube::build::run_build_command hack/test-go.sh - kube::build::run_build_command hack/test-integration.sh + kube::build::run_build_command make test + kube::build::run_build_command make test-integration fi if [[ "${FEDERATION:-}" == "true" ]];then diff --git a/cluster/azure-legacy/util.sh b/cluster/azure-legacy/util.sh index 010dde4d4ed..b2c7c434e1b 100644 --- a/cluster/azure-legacy/util.sh +++ b/cluster/azure-legacy/util.sh @@ -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. # diff --git a/contrib/mesos/ci/test-integration.sh b/contrib/mesos/ci/test-integration.sh index f356d30c725..d44865bf405 100755 --- a/contrib/mesos/ci/test-integration.sh +++ b/contrib/mesos/ci/test-integration.sh @@ -31,4 +31,4 @@ TEST_ARGS="$@" 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} diff --git a/contrib/mesos/docs/ha.md b/contrib/mesos/docs/ha.md index 491512ede09..9ddbce3a8da 100644 --- a/contrib/mesos/docs/ha.md +++ b/contrib/mesos/docs/ha.md @@ -155,7 +155,7 @@ K8SM_IMAGE_NAME=haih/k8sm git clone https://github.com/mesosphere/kubernetes cd kubernetes 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 .. sudo docker build -t $K8SM_IMAGE_NAME --no-cache . EOF diff --git a/docs/devel/adding-an-APIGroup.md b/docs/devel/adding-an-APIGroup.md index cefa8564144..f05009ddbaf 100644 --- a/docs/devel/adding-an-APIGroup.md +++ b/docs/devel/adding-an-APIGroup.md @@ -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 in tests through testapi.``; -2. Add your "group/version" to `KUBE_API_VERSIONS` and `KUBE_TEST_API_VERSIONS` -in hack/test-go.sh. +2. Add your "group/version" to `KUBE_TEST_API_VERSIONS` in + hack/make-rules/test.sh and hack/make-rules/test-integration.sh TODO: Add a troubleshooting section. diff --git a/docs/devel/development.md b/docs/devel/development.md index 82014e7cad6..4c00072e57b 100644 --- a/docs/devel/development.md +++ b/docs/devel/development.md @@ -71,11 +71,16 @@ up a GOPATH. To build Kubernetes using your local Go development environment (generate linux binaries): - hack/build-go.sh +```sh + make +``` + You may pass build options and packages to the script as necessary. To build binaries for all platforms: +```sh hack/build-cross.sh +``` ## Workflow @@ -314,8 +319,8 @@ Three basic commands let you run unit, integration and/or e2e tests: ```sh cd kubernetes -hack/test-go.sh # Run unit tests -hack/test-integration.sh # Run integration tests, requires etcd +make test # Run unit tests +make test-integration # Run integration tests, requires etcd go run hack/e2e.go -v --build --up --test --down # Run e2e tests ``` diff --git a/docs/devel/e2e-node-tests.md b/docs/devel/e2e-node-tests.md index 03ee4811f7c..f4713855235 100644 --- a/docs/devel/e2e-node-tests.md +++ b/docs/devel/e2e-node-tests.md @@ -57,7 +57,7 @@ Prerequisites: From the Kubernetes base directory, run: ```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: @@ -87,7 +87,7 @@ Prerequisites: Run: ```sh -make test_e2e_node REMOTE=true +make test-e2e-node REMOTE=true ``` This will: @@ -124,7 +124,7 @@ provided by the default image. List the available test images using gcloud. ```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. @@ -132,7 +132,7 @@ This will output a list of the available images for the default image project. Then run: ```sh -make test_e2e_node REMOTE=true IMAGES="" +make test-e2e-node REMOTE=true IMAGES="" ``` ## Run tests against a running GCE instance (not an image) @@ -140,7 +140,7 @@ make test_e2e_node REMOTE=true 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. ```sh -make test_e2e_node REMOTE=true HOSTS="" +make test-e2e-node REMOTE=true HOSTS="" ``` ## Delete instance after tests run @@ -148,7 +148,7 @@ make test_e2e_node REMOTE=true HOSTS="" This is useful if you want recreate the instance for each test run to trigger flakes related to starting the instance. ```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 @@ -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. ```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 @@ -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. ```sh -make test_e2e_node REMOTE=true IMAGE_PROJECT="" IMAGES="" +make test-e2e-node REMOTE=true IMAGE_PROJECT="" IMAGES="" ``` 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 test in parallel against different instances of the same image. ```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 @@ -186,13 +186,13 @@ make test_e2e_node REMOTE=true INSTANCE_PREFIX="my-prefix" To run tests matching a regex: ```sh -make test_e2e_node REMOTE=true FOCUS="" +make test-e2e-node REMOTE=true FOCUS="" ``` To run tests NOT matching a regex: ```sh -make test_e2e_node REMOTE=true SKIP="" +make test-e2e-node REMOTE=true SKIP="" ``` ## Run tests continually until they fail @@ -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.** ```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. diff --git a/docs/devel/pull-requests.md b/docs/devel/pull-requests.md index 2037b410e09..40705971f53 100644 --- a/docs/devel/pull-requests.md +++ b/docs/devel/pull-requests.md @@ -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: * Enable [pre-commit hooks](development.md#committing-changes-to-your-fork) and verify they pass. -* Verify `hack/verify-all.sh` passes. -* Verify `hack/test-go.sh` passes. -* Verify `hack/test-integration.sh` passes. +* Verify `make verify` passes. +* Verify `make test` passes. +* Verify `make test-integration.sh` passes. ## Release Notes diff --git a/docs/devel/releasing.md b/docs/devel/releasing.md index 2c8b5d00b0b..eb48f469721 100644 --- a/docs/devel/releasing.md +++ b/docs/devel/releasing.md @@ -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 authoritative source on how version injection works.* -Kubernetes may be built from either a git tree (using `hack/build-go.sh`) or -from a tarball (using either `hack/build-go.sh` or `go install`) or directly by -the Go native build system (using `go get`). +Kubernetes may be built from either a git tree or from a tarball. We use +`make` to encapsulate a number of build steps into a single command. This +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 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 to provide you with a SHA1. 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 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 diff --git a/docs/devel/running-locally.md b/docs/devel/running-locally.md index 517b12c8c70..0e56456ef85 100644 --- a/docs/devel/running-locally.md +++ b/docs/devel/running-locally.md @@ -170,7 +170,7 @@ You are running a single node setup. This has the limitation of only supporting ```sh cd kubernetes -hack/build-go.sh +make hack/local-up-cluster.sh ``` diff --git a/docs/devel/testing.md b/docs/devel/testing.md index dba01c10e9f..3d7fb452b3f 100644 --- a/docs/devel/testing.md +++ b/docs/devel/testing.md @@ -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 -The `hack/test-go.sh` script is the entrypoint for running the unit tests that -ensures that `GOPATH` is set up correctly. If you have `GOPATH` set up -correctly, you can also just use `go test` directly. +`make test` is the entrypoint for running the unit tests that ensures that +`GOPATH` is set up correctly. If you have `GOPATH` set up correctly, you can +also just use `go test` directly. ```sh cd kubernetes -hack/test-go.sh # Run all unit tests. +make test # Run all 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 ### Run unit tests from certain packages -The `hack/test-go.sh` script accepts packages as arguments; the -`k8s.io/kubernetes` prefix is added automatically to these: +`make test` accepts packages as arguments; the `k8s.io/kubernetes` prefix is +added automatically to these: ```sh -hack/test-go.sh pkg/api # run tests for pkg/api -hack/test-go.sh pkg/api pkg/kubelet # run tests for pkg/api and pkg/kubelet +make test WHAT=pkg/api # run tests for pkg/api +``` + +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: ```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 @@ -121,10 +126,10 @@ regular expression for the name of the test that should be run. ```sh # 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 -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 @@ -137,7 +142,7 @@ You can do this efficiently. ```sh # 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). @@ -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: ```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 @@ -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: ```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 @@ -224,14 +229,14 @@ for those internal etcd instances with the `TEST_ETCD_DIR` environment variable. ### 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 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. ```sh -hack/test-integration.sh # Run all integration tests. +make test-integration # Run all integration tests. ``` 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 ```sh # 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 diff --git a/examples/kubectl-container/Makefile b/examples/kubectl-container/Makefile index a414e4a5981..3383644f14c 100644 --- a/examples/kubectl-container/Makefile +++ b/examples/kubectl-container/Makefile @@ -23,7 +23,8 @@ GOARCH?=$(shell go env GOARCH) GOOS?=$(shell go env GOOS) 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 ./kubectl version -c | grep -o 'GitVersion:"[^"]*"' | cut -f 2 -d '"' > .tag diff --git a/hack/benchmark-go.sh b/hack/benchmark-go.sh index 7976d0b33c3..0cb3708fb00 100755 --- a/hack/benchmark-go.sh +++ b/hack/benchmark-go.sh @@ -20,4 +20,8 @@ set -o pipefail 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" \ diff --git a/hack/benchmark-integration.sh b/hack/benchmark-integration.sh index 2eb12f139bb..e08fdd04525 100755 --- a/hack/benchmark-integration.sh +++ b/hack/benchmark-integration.sh @@ -40,7 +40,7 @@ runTests() { KUBE_TEST_ETCD_PREFIXES="registry" \ ETCD_CUSTOM_PREFIX="None" \ KUBE_TEST_ARGS="${ARGS}" \ - "${KUBE_ROOT}/hack/test-go.sh" test/integration + make test WHAT=test/integration cleanup } diff --git a/hack/build-go.sh b/hack/build-go.sh index bbc7bd0847a..3dedf3a84f8 100755 --- a/hack/build-go.sh +++ b/hack/build-go.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2014 The Kubernetes Authors. +# 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. @@ -14,14 +14,24 @@ # 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. +# This script is a vestigial redirection. Please do not add "real" logic. 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 +# For help output +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="$*" diff --git a/hack/dev-push-hyperkube.sh b/hack/dev-push-hyperkube.sh index 0a592b93a59..2c7991c818d 100755 --- a/hack/dev-push-hyperkube.sh +++ b/hack/dev-push-hyperkube.sh @@ -45,7 +45,7 @@ fi kube::build::verify_prereqs 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}" \ VERSION="${KUBE_DOCKER_VERSION}" \ diff --git a/hack/e2e-node-test.sh b/hack/e2e-node-test.sh index 64238f5a40b..66dfdac25f4 100755 --- a/hack/e2e-node-test.sh +++ b/hack/e2e-node-test.sh @@ -14,121 +14,30 @@ # See the License for the specific language governing permissions and # limitations under the License. +# This script is a vestigial redirection. Please do not add "real" logic. + +set -o errexit +set -o nounset +set -o pipefail + 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" +# For help output +ARGHELP="" +if [[ -n "${FOCUS:-}" ]]; then + ARGHELP="FOCUS='${FOCUS}' " 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 +if [[ -n "${SKIP:-}" ]]; then + ARGHELP="${ARGHELP}SKIP='${SKIP}'" 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 +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:-} diff --git a/hack/generate-docs.sh b/hack/generate-docs.sh index 522146ac232..4a5f9a4f7ca 100755 --- a/hack/generate-docs.sh +++ b/hack/generate-docs.sh @@ -27,12 +27,14 @@ source "${KUBE_ROOT}/hack/lib/init.sh" kube::golang::setup_env -"${KUBE_ROOT}/hack/build-go.sh" \ - cmd/gendocs \ - cmd/genkubedocs \ - cmd/genman \ - cmd/genyaml \ - federation/cmd/genfeddocs +BINS=( + cmd/gendocs + cmd/genkubedocs + cmd/genman + cmd/genyaml + federation/cmd/genfeddocs +) +make -C "${KUBE_ROOT}" WHAT="${BINS[*]}" kube::util::ensure-temp-dir diff --git a/hack/jenkins/gotest.sh b/hack/jenkins/gotest.sh index fb9f40fcbcd..df9e6696d6f 100755 --- a/hack/jenkins/gotest.sh +++ b/hack/jenkins/gotest.sh @@ -41,5 +41,5 @@ export KUBE_JUNIT_REPORT_DIR=${WORKSPACE}/_artifacts # Save the verbose stdout as well. export KUBE_KEEP_VERBOSE_TEST_OUTPUT=y -./hack/test-go.sh -./hack/test-integration.sh +make test +make test-integration diff --git a/hack/jenkins/test-dockerized.sh b/hack/jenkins/test-dockerized.sh index de23fbc85e7..85317b84031 100755 --- a/hack/jenkins/test-dockerized.sh +++ b/hack/jenkins/test-dockerized.sh @@ -55,7 +55,7 @@ rm -rf Godeps/_workspace # Temporary until _workspace is fully obliterated go install ./cmd/... ./hack/install-etcd.sh -./hack/test-go.sh -./hack/test-cmd.sh -./hack/test-integration.sh +make test +make test-cmd +make test-integration ./hack/test-update-storage-objects.sh diff --git a/hack/jenkins/verify-dockerized.sh b/hack/jenkins/verify-dockerized.sh index f417b34ab7b..7532436fd7d 100755 --- a/hack/jenkins/verify-dockerized.sh +++ b/hack/jenkins/verify-dockerized.sh @@ -38,4 +38,4 @@ export LOG_LEVEL=4 cd /go/src/k8s.io/kubernetes ./hack/install-etcd.sh -./hack/verify-all.sh -v +make verify VERBOSE=1 diff --git a/hack/jenkins/verify.sh b/hack/jenkins/verify.sh index b9ccde02fd7..6eb931d80ea 100755 --- a/hack/jenkins/verify.sh +++ b/hack/jenkins/verify.sh @@ -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 go get -u github.com/tools/godep -./hack/verify-all.sh -v +make verify VERBOSE=1 diff --git a/hack/local-up-cluster.sh b/hack/local-up-cluster.sh index 213c8d6bb4c..aa99c6aaffc 100755 --- a/hack/local-up-cluster.sh +++ b/hack/local-up-cluster.sh @@ -78,9 +78,7 @@ do done if [ "x$GO_OUT" == "x" ]; then - "${KUBE_ROOT}/hack/build-go.sh" \ - cmd/kubectl \ - cmd/hyperkube + make -C "${KUBE_ROOT}" WHAT="cmd/kubectl cmd/hyperkube" else echo "skipped the build." fi diff --git a/hack/make-rules/build.sh b/hack/make-rules/build.sh new file mode 100755 index 00000000000..85f5cbe69e7 --- /dev/null +++ b/hack/make-rules/build.sh @@ -0,0 +1,27 @@ +#!/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 diff --git a/hack/make-rules/test-cmd.sh b/hack/make-rules/test-cmd.sh new file mode 100755 index 00000000000..b2c0334efe8 --- /dev/null +++ b/hack/make-rules/test-cmd.sh @@ -0,0 +1,2374 @@ +#!/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 command checks that the built commands can function together for +# simple scenarios. It does not require Docker. + +set -o errexit +set -o nounset +set -o pipefail + +KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../.. +source "${KUBE_ROOT}/hack/lib/init.sh" +source "${KUBE_ROOT}/hack/lib/test.sh" + +# Stops the running kubectl proxy, if there is one. +function stop-proxy() +{ + [[ -n "${PROXY_PORT-}" ]] && kube::log::status "Stopping proxy on port ${PROXY_PORT}" + [[ -n "${PROXY_PID-}" ]] && kill "${PROXY_PID}" 1>&2 2>/dev/null + [[ -n "${PROXY_PORT_FILE-}" ]] && rm -f ${PROXY_PORT_FILE} + PROXY_PID= + PROXY_PORT= + PROXY_PORT_FILE= +} + +# Starts "kubect proxy" to test the client proxy. $1: api_prefix +function start-proxy() +{ + stop-proxy + + PROXY_PORT_FILE=$(mktemp proxy-port.out.XXXXX) + kube::log::status "Starting kubectl proxy on random port; output file in ${PROXY_PORT_FILE}; args: ${1-}" + + + if [ $# -eq 0 ]; then + kubectl proxy --port=0 --www=. 1>${PROXY_PORT_FILE} 2>&1 & + else + kubectl proxy --port=0 --www=. --api-prefix="$1" 1>${PROXY_PORT_FILE} 2>&1 & + fi + PROXY_PID=$! + PROXY_PORT= + + local attempts=0 + while [[ -z ${PROXY_PORT} ]]; do + if (( ${attempts} > 9 )); then + kill "${PROXY_PID}" + kube::log::error_exit "Couldn't start proxy. Failed to read port after ${attempts} tries. Got: $(cat ${PROXY_PORT_FILE})" + fi + sleep .5 + kube::log::status "Attempt ${attempts} to read ${PROXY_PORT_FILE}..." + PROXY_PORT=$(sed 's/.*Starting to serve on 127.0.0.1:\([0-9]*\)$/\1/'< ${PROXY_PORT_FILE}) + attempts=$((attempts+1)) + done + + kube::log::status "kubectl proxy running on port ${PROXY_PORT}" + + # We try checking kubectl proxy 30 times with 1s delays to avoid occasional + # failures. + if [ $# -eq 0 ]; then + kube::util::wait_for_url "http://127.0.0.1:${PROXY_PORT}/healthz" "kubectl proxy" + else + kube::util::wait_for_url "http://127.0.0.1:${PROXY_PORT}/$1/healthz" "kubectl proxy --api-prefix=$1" + fi +} + +function cleanup() +{ + [[ -n "${APISERVER_PID-}" ]] && kill "${APISERVER_PID}" 1>&2 2>/dev/null + [[ -n "${CTLRMGR_PID-}" ]] && kill "${CTLRMGR_PID}" 1>&2 2>/dev/null + [[ -n "${KUBELET_PID-}" ]] && kill "${KUBELET_PID}" 1>&2 2>/dev/null + stop-proxy + + kube::etcd::cleanup + rm -rf "${KUBE_TEMP}" + + kube::log::status "Clean up complete" +} + +# Executes curl against the proxy. $1 is the path to use, $2 is the desired +# return code. Prints a helpful message on failure. +function check-curl-proxy-code() +{ + local status + local -r address=$1 + local -r desired=$2 + local -r full_address="${PROXY_HOST}:${PROXY_PORT}${address}" + status=$(curl -w "%{http_code}" --silent --output /dev/null "${full_address}") + if [ "${status}" == "${desired}" ]; then + return 0 + fi + echo "For address ${full_address}, got ${status} but wanted ${desired}" + return 1 +} + +# TODO: Remove this function when we do the retry inside the kubectl commands. See #15333. +function kubectl-with-retry() +{ + ERROR_FILE="${KUBE_TEMP}/kubectl-error" + preserve_err_file=${PRESERVE_ERR_FILE-false} + for count in $(seq 0 3); do + kubectl "$@" 2> ${ERROR_FILE} || true + if grep -q "the object has been modified" "${ERROR_FILE}"; then + kube::log::status "retry $1, error: $(cat ${ERROR_FILE})" + rm "${ERROR_FILE}" + sleep $((2**count)) + else + if [ "$preserve_err_file" != true ] ; then + rm "${ERROR_FILE}" + fi + break + fi + done +} + +kube::util::trap_add cleanup EXIT SIGINT +kube::util::ensure-temp-dir + +BINS=( + cmd/kubectl + cmd/kube-apiserver + cmd/kube-controller-manager +) +make -C "${KUBE_ROOT}" WHAT="${BINS[*]}" + +kube::etcd::start + +ETCD_HOST=${ETCD_HOST:-127.0.0.1} +ETCD_PORT=${ETCD_PORT:-4001} +API_PORT=${API_PORT:-8080} +API_HOST=${API_HOST:-127.0.0.1} +KUBELET_PORT=${KUBELET_PORT:-10250} +KUBELET_HEALTHZ_PORT=${KUBELET_HEALTHZ_PORT:-10248} +CTLRMGR_PORT=${CTLRMGR_PORT:-10252} +PROXY_HOST=127.0.0.1 # kubectl only serves on localhost. + +IMAGE_NGINX="gcr.io/google-containers/nginx:1.7.9" +IMAGE_DEPLOYMENT_R1="gcr.io/google-containers/nginx:test-cmd" # deployment-revision1.yaml +IMAGE_DEPLOYMENT_R2="$IMAGE_NGINX" # deployment-revision2.yaml +IMAGE_PERL="gcr.io/google-containers/perl" + +# ensure ~/.kube/config isn't loaded by tests +HOME="${KUBE_TEMP}" + +# Find a standard sed instance for use with edit scripts +SED=sed +if which gsed &>/dev/null; then + SED=gsed +fi +if ! ($SED --version 2>&1 | grep -q GNU); then + echo "!!! GNU sed is required. If on OS X, use 'brew install gnu-sed'." + exit 1 +fi + +# Check kubectl +kube::log::status "Running kubectl with no options" +"${KUBE_OUTPUT_HOSTBIN}/kubectl" + +# Only run kubelet on platforms it supports +if [[ "$(go env GOHOSTOS)" == "linux" ]]; then + +BINS=( + cmd/kubelet +) +make -C "${KUBE_ROOT}" WHAT="${BINS[*]}" + +kube::log::status "Starting kubelet in masterless mode" +"${KUBE_OUTPUT_HOSTBIN}/kubelet" \ + --really-crash-for-testing=true \ + --root-dir=/tmp/kubelet.$$ \ + --cert-dir="${TMPDIR:-/tmp/}" \ + --docker-endpoint="fake://" \ + --hostname-override="127.0.0.1" \ + --address="127.0.0.1" \ + --port="$KUBELET_PORT" \ + --healthz-port="${KUBELET_HEALTHZ_PORT}" 1>&2 & +KUBELET_PID=$! +kube::util::wait_for_url "http://127.0.0.1:${KUBELET_HEALTHZ_PORT}/healthz" "kubelet(masterless)" +kill ${KUBELET_PID} 1>&2 2>/dev/null + +kube::log::status "Starting kubelet in masterful mode" +"${KUBE_OUTPUT_HOSTBIN}/kubelet" \ + --really-crash-for-testing=true \ + --root-dir=/tmp/kubelet.$$ \ + --cert-dir="${TMPDIR:-/tmp/}" \ + --docker-endpoint="fake://" \ + --hostname-override="127.0.0.1" \ + --address="127.0.0.1" \ + --api-servers="${API_HOST}:${API_PORT}" \ + --port="$KUBELET_PORT" \ + --healthz-port="${KUBELET_HEALTHZ_PORT}" 1>&2 & +KUBELET_PID=$! + +kube::util::wait_for_url "http://127.0.0.1:${KUBELET_HEALTHZ_PORT}/healthz" "kubelet" + +fi + +# Start kube-apiserver +kube::log::status "Starting kube-apiserver" + +# Admission Controllers to invoke prior to persisting objects in cluster +ADMISSION_CONTROL="NamespaceLifecycle,LimitRanger,ResourceQuota" + +"${KUBE_OUTPUT_HOSTBIN}/kube-apiserver" \ + --address="127.0.0.1" \ + --public-address-override="127.0.0.1" \ + --port="${API_PORT}" \ + --admission-control="${ADMISSION_CONTROL}" \ + --etcd-servers="http://${ETCD_HOST}:${ETCD_PORT}" \ + --public-address-override="127.0.0.1" \ + --kubelet-port=${KUBELET_PORT} \ + --runtime-config=api/v1 \ + --storage-media-type="${KUBE_TEST_API_STORAGE_TYPE-}" \ + --cert-dir="${TMPDIR:-/tmp/}" \ + --service-cluster-ip-range="10.0.0.0/24" 1>&2 & +APISERVER_PID=$! + +kube::util::wait_for_url "http://127.0.0.1:${API_PORT}/healthz" "apiserver" + +# Start controller manager +kube::log::status "Starting controller-manager" +"${KUBE_OUTPUT_HOSTBIN}/kube-controller-manager" \ + --port="${CTLRMGR_PORT}" \ + --kube-api-content-type="${KUBE_TEST_API_TYPE-}" \ + --master="127.0.0.1:${API_PORT}" 1>&2 & +CTLRMGR_PID=$! + +kube::util::wait_for_url "http://127.0.0.1:${CTLRMGR_PORT}/healthz" "controller-manager" + +if [[ "$(go env GOHOSTOS)" == "linux" ]]; then + kube::util::wait_for_url "http://127.0.0.1:${API_PORT}/api/v1/nodes/127.0.0.1" "apiserver(nodes)" +else + # create a fake node + kubectl create -f - -s "http://127.0.0.1:${API_PORT}" << __EOF__ +{ + "kind": "Node", + "apiVersion": "v1", + "metadata": { + "name": "127.0.0.1" + }, + "status": { + "capacity": { + "memory": "1Gi" + } + } +} +__EOF__ +fi + +# Expose kubectl directly for readability +PATH="${KUBE_OUTPUT_HOSTBIN}":$PATH + +kube::log::status "Checking kubectl version" +kubectl version + +# TODO: we need to note down the current default namespace and set back to this +# namespace after the tests are done. +kubectl config view +CONTEXT="test" +kubectl config set-context "${CONTEXT}" +kubectl config use-context "${CONTEXT}" + +i=0 +create_and_use_new_namespace() { + i=$(($i+1)) + kubectl create namespace "namespace${i}" + kubectl config set-context "${CONTEXT}" --namespace="namespace${i}" +} + +runTests() { + version="$1" + echo "Testing api version: $1" + if [[ -z "${version}" ]]; then + kube_flags=( + -s "http://127.0.0.1:${API_PORT}" + --match-server-version + ) + [ "$(kubectl get nodes -o go-template='{{ .apiVersion }}' "${kube_flags[@]}")" == "v1" ] + else + kube_flags=( + -s "http://127.0.0.1:${API_PORT}" + --match-server-version + ) + [ "$(kubectl get nodes -o go-template='{{ .apiVersion }}' "${kube_flags[@]}")" == "${version}" ] + fi + id_field=".metadata.name" + labels_field=".metadata.labels" + annotations_field=".metadata.annotations" + service_selector_field=".spec.selector" + rc_replicas_field=".spec.replicas" + rc_status_replicas_field=".status.replicas" + rc_container_image_field=".spec.template.spec.containers" + rs_replicas_field=".spec.replicas" + port_field="(index .spec.ports 0).port" + port_name="(index .spec.ports 0).name" + second_port_field="(index .spec.ports 1).port" + second_port_name="(index .spec.ports 1).name" + image_field="(index .spec.containers 0).image" + hpa_min_field=".spec.minReplicas" + hpa_max_field=".spec.maxReplicas" + hpa_cpu_field=".spec.targetCPUUtilizationPercentage" + job_parallelism_field=".spec.parallelism" + deployment_replicas=".spec.replicas" + secret_data=".data" + secret_type=".type" + deployment_image_field="(index .spec.template.spec.containers 0).image" + deployment_second_image_field="(index .spec.template.spec.containers 1).image" + change_cause_annotation='.*kubernetes.io/change-cause.*' + + # Passing no arguments to create is an error + ! kubectl create + + ####################### + # kubectl config set # + ####################### + + kube::log::status "Testing kubectl(${version}:config set)" + + kubectl config set-cluster test-cluster --server="https://does-not-work" + + # Get the api cert and add a comment to avoid flag parsing problems + cert_data=$(echo "#Comment" && cat "${TMPDIR:-/tmp}/apiserver.crt") + + kubectl config set clusters.test-cluster.certificate-authority-data "$cert_data" --set-raw-bytes + r_writen=$(kubectl config view --raw -o jsonpath='{.clusters[?(@.name == "test-cluster")].cluster.certificate-authority-data}') + + encoded=$(echo -n "$cert_data" | base64) + kubectl config set clusters.test-cluster.certificate-authority-data "$encoded" + e_writen=$(kubectl config view --raw -o jsonpath='{.clusters[?(@.name == "test-cluster")].cluster.certificate-authority-data}') + + test "$e_writen" == "$r_writen" + + ####################### + # kubectl local proxy # + ####################### + + # Make sure the UI can be proxied + start-proxy + check-curl-proxy-code /ui 301 + check-curl-proxy-code /metrics 200 + check-curl-proxy-code /api/ui 404 + if [[ -n "${version}" ]]; then + check-curl-proxy-code /api/${version}/namespaces 200 + fi + check-curl-proxy-code /static/ 200 + stop-proxy + + # Make sure the in-development api is accessible by default + start-proxy + check-curl-proxy-code /apis 200 + check-curl-proxy-code /apis/extensions/ 200 + stop-proxy + + # Custom paths let you see everything. + start-proxy /custom + check-curl-proxy-code /custom/ui 301 + check-curl-proxy-code /custom/metrics 200 + if [[ -n "${version}" ]]; then + check-curl-proxy-code /custom/api/${version}/namespaces 200 + fi + stop-proxy + + ######################### + # RESTMapper evaluation # + ######################### + + kube::log::status "Testing RESTMapper" + + RESTMAPPER_ERROR_FILE="${KUBE_TEMP}/restmapper-error" + + ### Non-existent resource type should give a recognizeable error + # Pre-condition: None + # Command + kubectl get "${kube_flags[@]}" unknownresourcetype 2>${RESTMAPPER_ERROR_FILE} || true + if grep -q "the server doesn't have a resource type" "${RESTMAPPER_ERROR_FILE}"; then + kube::log::status "\"kubectl get unknownresourcetype\" returns error as expected: $(cat ${RESTMAPPER_ERROR_FILE})" + else + kube::log::status "\"kubectl get unknownresourcetype\" returns unexpected error or non-error: $(cat ${RESTMAPPER_ERROR_FILE})" + exit 1 + fi + rm "${RESTMAPPER_ERROR_FILE}" + # Post-condition: None + + ########################### + # POD creation / deletion # + ########################### + + kube::log::status "Testing kubectl(${version}:pods)" + + ### Create POD valid-pod from JSON + # Pre-condition: no POD exists + create_and_use_new_namespace + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' + # Command + kubectl create "${kube_flags[@]}" -f docs/admin/limitrange/valid-pod.yaml + # Post-condition: valid-pod POD is created + kubectl get "${kube_flags[@]}" pods -o json + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' + kube::test::get_object_assert 'pod valid-pod' "{{$id_field}}" 'valid-pod' + kube::test::get_object_assert 'pod/valid-pod' "{{$id_field}}" 'valid-pod' + kube::test::get_object_assert 'pods/valid-pod' "{{$id_field}}" 'valid-pod' + # Repeat above test using jsonpath template + kube::test::get_object_jsonpath_assert pods "{.items[*]$id_field}" 'valid-pod' + kube::test::get_object_jsonpath_assert 'pod valid-pod' "{$id_field}" 'valid-pod' + kube::test::get_object_jsonpath_assert 'pod/valid-pod' "{$id_field}" 'valid-pod' + kube::test::get_object_jsonpath_assert 'pods/valid-pod' "{$id_field}" 'valid-pod' + # Describe command should print detailed information + kube::test::describe_object_assert pods 'valid-pod' "Name:" "Image:" "Node:" "Labels:" "Status:" "Controllers" + # Describe command should print events information by default + kube::test::describe_object_events_assert pods 'valid-pod' + # Describe command should not print events information when show-events=false + kube::test::describe_object_events_assert pods 'valid-pod' false + # Describe command should print events information when show-events=true + kube::test::describe_object_events_assert pods 'valid-pod' true + # Describe command (resource only) should print detailed information + kube::test::describe_resource_assert pods "Name:" "Image:" "Node:" "Labels:" "Status:" "Controllers" + + # Describe command should print events information by default + kube::test::describe_resource_events_assert pods + # Describe command should not print events information when show-events=false + kube::test::describe_resource_events_assert pods false + # Describe command should print events information when show-events=true + kube::test::describe_resource_events_assert pods true + ### Validate Export ### + kube::test::get_object_assert 'pods/valid-pod' "{{.metadata.namespace}} {{.metadata.name}}" ' valid-pod' "--export=true" + + ### Dump current valid-pod POD + output_pod=$(kubectl get pod valid-pod -o yaml --output-version=v1 "${kube_flags[@]}") + + ### Delete POD valid-pod by id + # Pre-condition: valid-pod POD exists + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' + # Command + kubectl delete pod valid-pod "${kube_flags[@]}" --grace-period=0 + # Post-condition: valid-pod POD doesn't exist + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' + + ### Delete POD valid-pod by id with --now + # Pre-condition: valid-pod POD exists + kubectl create "${kube_flags[@]}" -f docs/admin/limitrange/valid-pod.yaml + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' + # Command + kubectl delete pod valid-pod "${kube_flags[@]}" --now + # Post-condition: valid-pod POD doesn't exist + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' + + ### Create POD valid-pod from dumped YAML + # Pre-condition: no POD exists + create_and_use_new_namespace + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' + # Command + echo "${output_pod}" | $SED '/namespace:/d' | kubectl create -f - "${kube_flags[@]}" + # Post-condition: valid-pod POD is created + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' + + ### Delete POD valid-pod from JSON + # Pre-condition: valid-pod POD exists + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' + # Command + kubectl delete -f docs/admin/limitrange/valid-pod.yaml "${kube_flags[@]}" --grace-period=0 + # Post-condition: valid-pod POD doesn't exist + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' + + ### Create POD valid-pod from JSON + # Pre-condition: no POD exists + create_and_use_new_namespace + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' + # Command + kubectl create -f docs/admin/limitrange/valid-pod.yaml "${kube_flags[@]}" + # Post-condition: valid-pod POD is created + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' + + ### Delete POD valid-pod with label + # Pre-condition: valid-pod POD exists + kube::test::get_object_assert "pods -l'name in (valid-pod)'" '{{range.items}}{{$id_field}}:{{end}}' 'valid-pod:' + # Command + kubectl delete pods -l'name in (valid-pod)' "${kube_flags[@]}" --grace-period=0 + # Post-condition: valid-pod POD doesn't exist + kube::test::get_object_assert "pods -l'name in (valid-pod)'" '{{range.items}}{{$id_field}}:{{end}}' '' + + ### Create POD valid-pod from YAML + # Pre-condition: no POD exists + create_and_use_new_namespace + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' + # Command + kubectl create -f docs/admin/limitrange/valid-pod.yaml "${kube_flags[@]}" + # Post-condition: valid-pod POD is created + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' + + ### Delete PODs with no parameter mustn't kill everything + # Pre-condition: valid-pod POD exists + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' + # Command + ! kubectl delete pods "${kube_flags[@]}" + # Post-condition: valid-pod POD exists + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' + + ### Delete PODs with --all and a label selector is not permitted + # Pre-condition: valid-pod POD exists + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' + # Command + ! kubectl delete --all pods -l'name in (valid-pod)' "${kube_flags[@]}" + # Post-condition: valid-pod POD exists + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' + + ### Delete all PODs + # Pre-condition: valid-pod POD exists + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' + # Command + kubectl delete --all pods "${kube_flags[@]}" --grace-period=0 # --all remove all the pods + # Post-condition: no POD exists + kube::test::get_object_assert "pods -l'name in (valid-pod)'" '{{range.items}}{{$id_field}}:{{end}}' '' + + # Detailed tests for describe pod output + ### Create a new namespace + # Pre-condition: the test-secrets namespace does not exist + kube::test::get_object_assert 'namespaces' '{{range.items}}{{ if eq $id_field \"test-kubectl-describe-pod\" }}found{{end}}{{end}}:' ':' + # Command + kubectl create namespace test-kubectl-describe-pod + # Post-condition: namespace 'test-secrets' is created. + kube::test::get_object_assert 'namespaces/test-kubectl-describe-pod' "{{$id_field}}" 'test-kubectl-describe-pod' + + ### Create a generic secret + # Pre-condition: no SECRET exists + kube::test::get_object_assert 'secrets --namespace=test-kubectl-describe-pod' "{{range.items}}{{$id_field}}:{{end}}" '' + # Command + kubectl create secret generic test-secret --from-literal=key-1=value1 --type=test-type --namespace=test-kubectl-describe-pod + # Post-condition: secret exists and has expected values + kube::test::get_object_assert 'secret/test-secret --namespace=test-kubectl-describe-pod' "{{$id_field}}" 'test-secret' + kube::test::get_object_assert 'secret/test-secret --namespace=test-kubectl-describe-pod' "{{$secret_type}}" 'test-type' + + ### Create a generic configmap + # Pre-condition: no CONFIGMAP exists + kube::test::get_object_assert 'configmaps --namespace=test-kubectl-describe-pod' "{{range.items}}{{$id_field}}:{{end}}" '' + # Command + kubectl create configmap test-configmap --from-literal=key-2=value2 --namespace=test-kubectl-describe-pod + # Post-condition: configmap exists and has expected values + kube::test::get_object_assert 'configmap/test-configmap --namespace=test-kubectl-describe-pod' "{{$id_field}}" 'test-configmap' + + # Create a pod that consumes secret, configmap, and downward API keys as envs + kube::test::get_object_assert 'pods --namespace=test-kubectl-describe-pod' "{{range.items}}{{$id_field}}:{{end}}" '' + kubectl create -f hack/testdata/pod-with-api-env.yaml --namespace=test-kubectl-describe-pod + + kube::test::describe_object_assert 'pods --namespace=test-kubectl-describe-pod' 'env-test-pod' "TEST_CMD_1" "" "TEST_CMD_2" "" "TEST_CMD_3" "env-test-pod (v1:metadata.name)" + # Describe command (resource only) should print detailed information about environment variables + kube::test::describe_resource_assert 'pods --namespace=test-kubectl-describe-pod' "TEST_CMD_1" "" "TEST_CMD_2" "" "TEST_CMD_3" "env-test-pod (v1:metadata.name)" + + # Clean-up + kubectl delete pod env-test-pod --namespace=test-kubectl-describe-pod + kubectl delete secret test-secret --namespace=test-kubectl-describe-pod + kubectl delete configmap test-configmap --namespace=test-kubectl-describe-pod + kubectl delete namespace test-kubectl-describe-pod + + ### Create two PODs + # Pre-condition: no POD exists + create_and_use_new_namespace + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' + # Command + kubectl create -f docs/admin/limitrange/valid-pod.yaml "${kube_flags[@]}" + kubectl create -f examples/storage/redis/redis-proxy.yaml "${kube_flags[@]}" + # Post-condition: valid-pod and redis-proxy PODs are created + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'redis-proxy:valid-pod:' + + ### Delete multiple PODs at once + # Pre-condition: valid-pod and redis-proxy PODs exist + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'redis-proxy:valid-pod:' + # Command + kubectl delete pods valid-pod redis-proxy "${kube_flags[@]}" --grace-period=0 # delete multiple pods at once + # Post-condition: no POD exists + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' + + ### Create valid-pod POD + # Pre-condition: no POD exists + create_and_use_new_namespace + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' + # Command + kubectl create -f docs/admin/limitrange/valid-pod.yaml "${kube_flags[@]}" + # Post-condition: valid-pod POD is created + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' + + ### Label the valid-pod POD + # Pre-condition: valid-pod is not labelled + kube::test::get_object_assert 'pod valid-pod' "{{range$labels_field}}{{.}}:{{end}}" 'valid-pod:' + # Command + kubectl label pods valid-pod new-name=new-valid-pod "${kube_flags[@]}" + # Post-condition: valid-pod is labelled + kube::test::get_object_assert 'pod valid-pod' "{{range$labels_field}}{{.}}:{{end}}" 'valid-pod:new-valid-pod:' + + ### Delete POD by label + # Pre-condition: valid-pod POD exists + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' + # Command + kubectl delete pods -lnew-name=new-valid-pod --grace-period=0 "${kube_flags[@]}" + # Post-condition: valid-pod POD doesn't exist + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' + + ### Create pod-with-precision POD + # Pre-condition: no POD is running + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' + # Command + kubectl create -f hack/testdata/pod-with-precision.json "${kube_flags[@]}" + # Post-condition: valid-pod POD is running + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'pod-with-precision:' + + ## Patch preserves precision + # Command + kubectl patch "${kube_flags[@]}" pod pod-with-precision -p='{"metadata":{"annotations":{"patchkey": "patchvalue"}}}' + # Post-condition: pod-with-precision POD has patched annotation + kube::test::get_object_assert 'pod pod-with-precision' "{{${annotations_field}.patchkey}}" 'patchvalue' + # Command + kubectl label pods pod-with-precision labelkey=labelvalue "${kube_flags[@]}" + # Post-condition: pod-with-precision POD has label + kube::test::get_object_assert 'pod pod-with-precision' "{{${labels_field}.labelkey}}" 'labelvalue' + # Command + kubectl annotate pods pod-with-precision annotatekey=annotatevalue "${kube_flags[@]}" + # Post-condition: pod-with-precision POD has annotation + kube::test::get_object_assert 'pod pod-with-precision' "{{${annotations_field}.annotatekey}}" 'annotatevalue' + # Cleanup + kubectl delete pod pod-with-precision "${kube_flags[@]}" + + ### Create valid-pod POD + # Pre-condition: no POD exists + create_and_use_new_namespace + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' + # Command + kubectl create -f docs/admin/limitrange/valid-pod.yaml "${kube_flags[@]}" + # Post-condition: valid-pod POD is created + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' + + ## Patch can modify a local object + kubectl patch --local -f pkg/api/validation/testdata/v1/validPod.yaml --patch='{"spec": {"restartPolicy":"Never"}}' -o jsonpath='{.spec.restartPolicy}' | grep -q "Never" + + ## Patch pod can change image + # Command + kubectl patch "${kube_flags[@]}" pod valid-pod --record -p='{"spec":{"containers":[{"name": "kubernetes-serve-hostname", "image": "nginx"}]}}' + # Post-condition: valid-pod POD has image nginx + kube::test::get_object_assert pods "{{range.items}}{{$image_field}}:{{end}}" 'nginx:' + # Post-condition: valid-pod has the record annotation + kube::test::get_object_assert pods "{{range.items}}{{$annotations_field}}:{{end}}" "${change_cause_annotation}" + # prove that patch can use different types + kubectl patch "${kube_flags[@]}" pod valid-pod --type="json" -p='[{"op": "replace", "path": "/spec/containers/0/image", "value":"nginx2"}]' + # Post-condition: valid-pod POD has image nginx + kube::test::get_object_assert pods "{{range.items}}{{$image_field}}:{{end}}" 'nginx2:' + # prove that patch can use different types + kubectl patch "${kube_flags[@]}" pod valid-pod --type="json" -p='[{"op": "replace", "path": "/spec/containers/0/image", "value":"nginx"}]' + # Post-condition: valid-pod POD has image nginx + kube::test::get_object_assert pods "{{range.items}}{{$image_field}}:{{end}}" 'nginx:' + # prove that yaml input works too + YAML_PATCH=$'spec:\n containers:\n - name: kubernetes-serve-hostname\n image: changed-with-yaml\n' + kubectl patch "${kube_flags[@]}" pod valid-pod -p="${YAML_PATCH}" + # Post-condition: valid-pod POD has image nginx + kube::test::get_object_assert pods "{{range.items}}{{$image_field}}:{{end}}" 'changed-with-yaml:' + ## Patch pod from JSON can change image + # Command + kubectl patch "${kube_flags[@]}" -f docs/admin/limitrange/valid-pod.yaml -p='{"spec":{"containers":[{"name": "kubernetes-serve-hostname", "image": "gcr.io/google_containers/pause-amd64:3.0"}]}}' + # Post-condition: valid-pod POD has image gcr.io/google_containers/pause-amd64:3.0 + kube::test::get_object_assert pods "{{range.items}}{{$image_field}}:{{end}}" 'gcr.io/google_containers/pause-amd64:3.0:' + + ## If resourceVersion is specified in the patch, it will be treated as a precondition, i.e., if the resourceVersion is different from that is stored in the server, the Patch should be rejected + ERROR_FILE="${KUBE_TEMP}/conflict-error" + ## If the resourceVersion is the same as the one stored in the server, the patch will be applied. + # Command + # Needs to retry because other party may change the resource. + for count in $(seq 0 3); do + resourceVersion=$(kubectl get "${kube_flags[@]}" pod valid-pod -o go-template='{{ .metadata.resourceVersion }}') + kubectl patch "${kube_flags[@]}" pod valid-pod -p='{"spec":{"containers":[{"name": "kubernetes-serve-hostname", "image": "nginx"}]},"metadata":{"resourceVersion":"'$resourceVersion'"}}' 2> "${ERROR_FILE}" || true + if grep -q "the object has been modified" "${ERROR_FILE}"; then + kube::log::status "retry $1, error: $(cat ${ERROR_FILE})" + rm "${ERROR_FILE}" + sleep $((2**count)) + else + rm "${ERROR_FILE}" + kube::test::get_object_assert pods "{{range.items}}{{$image_field}}:{{end}}" 'nginx:' + break + fi + done + + ## If the resourceVersion is the different from the one stored in the server, the patch will be rejected. + resourceVersion=$(kubectl get "${kube_flags[@]}" pod valid-pod -o go-template='{{ .metadata.resourceVersion }}') + ((resourceVersion+=100)) + # Command + kubectl patch "${kube_flags[@]}" pod valid-pod -p='{"spec":{"containers":[{"name": "kubernetes-serve-hostname", "image": "nginx"}]},"metadata":{"resourceVersion":"'$resourceVersion'"}}' 2> "${ERROR_FILE}" || true + # Post-condition: should get an error reporting the conflict + if grep -q "please apply your changes to the latest version and try again" "${ERROR_FILE}"; then + kube::log::status "\"kubectl patch with resourceVersion $resourceVersion\" returns error as expected: $(cat ${ERROR_FILE})" + else + kube::log::status "\"kubectl patch with resourceVersion $resourceVersion\" returns unexpected error or non-error: $(cat ${ERROR_FILE})" + exit 1 + fi + rm "${ERROR_FILE}" + + ## --force replace pod can change other field, e.g., spec.container.name + # Command + kubectl get "${kube_flags[@]}" pod valid-pod -o json | $SED 's/"kubernetes-serve-hostname"/"replaced-k8s-serve-hostname"/g' > /tmp/tmp-valid-pod.json + kubectl replace "${kube_flags[@]}" --force -f /tmp/tmp-valid-pod.json + # Post-condition: spec.container.name = "replaced-k8s-serve-hostname" + kube::test::get_object_assert 'pod valid-pod' "{{(index .spec.containers 0).name}}" 'replaced-k8s-serve-hostname' + #cleaning + rm /tmp/tmp-valid-pod.json + + ## replace of a cluster scoped resource can succeed + # Pre-condition: a node exists + kubectl create -f - "${kube_flags[@]}" << __EOF__ +{ + "kind": "Node", + "apiVersion": "v1", + "metadata": { + "name": "node-${version}-test" + } +} +__EOF__ + kubectl replace -f - "${kube_flags[@]}" << __EOF__ +{ + "kind": "Node", + "apiVersion": "v1", + "metadata": { + "name": "node-${version}-test", + "annotations": {"a":"b"} + } +} +__EOF__ + # Post-condition: the node command succeeds + kube::test::get_object_assert "node node-${version}-test" "{{.metadata.annotations.a}}" 'b' + kubectl delete node node-${version}-test "${kube_flags[@]}" + + ## kubectl edit can update the image field of a POD. tmp-editor.sh is a fake editor + echo -e "#!/bin/bash\n$SED -i \"s/nginx/gcr.io\/google_containers\/serve_hostname/g\" \$1" > /tmp/tmp-editor.sh + chmod +x /tmp/tmp-editor.sh + # Pre-condition: valid-pod POD has image nginx + kube::test::get_object_assert pods "{{range.items}}{{$image_field}}:{{end}}" 'nginx:' + EDITOR=/tmp/tmp-editor.sh kubectl edit "${kube_flags[@]}" pods/valid-pod + # Post-condition: valid-pod POD has image gcr.io/google_containers/serve_hostname + kube::test::get_object_assert pods "{{range.items}}{{$image_field}}:{{end}}" 'gcr.io/google_containers/serve_hostname:' + # cleaning + rm /tmp/tmp-editor.sh + + ## kubectl edit should work on Windows + [ "$(EDITOR=cat kubectl edit pod/valid-pod 2>&1 | grep 'Edit cancelled')" ] + [ "$(EDITOR=cat kubectl edit pod/valid-pod | grep 'name: valid-pod')" ] + [ "$(EDITOR=cat kubectl edit --windows-line-endings pod/valid-pod | file - | grep CRLF)" ] + [ ! "$(EDITOR=cat kubectl edit --windows-line-endings=false pod/valid-pod | file - | grep CRLF)" ] + + ### Overwriting an existing label is not permitted + # Pre-condition: name is valid-pod + kube::test::get_object_assert 'pod valid-pod' "{{${labels_field}.name}}" 'valid-pod' + # Command + ! kubectl label pods valid-pod name=valid-pod-super-sayan "${kube_flags[@]}" + # Post-condition: name is still valid-pod + kube::test::get_object_assert 'pod valid-pod' "{{${labels_field}.name}}" 'valid-pod' + + ### --overwrite must be used to overwrite existing label, can be applied to all resources + # Pre-condition: name is valid-pod + kube::test::get_object_assert 'pod valid-pod' "{{${labels_field}.name}}" 'valid-pod' + # Command + kubectl label --overwrite pods --all name=valid-pod-super-sayan "${kube_flags[@]}" + # Post-condition: name is valid-pod-super-sayan + kube::test::get_object_assert 'pod valid-pod' "{{${labels_field}.name}}" 'valid-pod-super-sayan' + + ### Delete POD by label + # Pre-condition: valid-pod POD exists + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' + # Command + kubectl delete pods -l'name in (valid-pod-super-sayan)' --grace-period=0 "${kube_flags[@]}" + # Post-condition: valid-pod POD doesn't exist + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' + + ### Create two PODs from 1 yaml file + # Pre-condition: no POD exists + create_and_use_new_namespace + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' + # Command + kubectl create -f docs/user-guide/multi-pod.yaml "${kube_flags[@]}" + # Post-condition: valid-pod and redis-proxy PODs exist + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'redis-master:redis-proxy:' + + ### Delete two PODs from 1 yaml file + # Pre-condition: redis-master and redis-proxy PODs exist + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'redis-master:redis-proxy:' + # Command + kubectl delete -f docs/user-guide/multi-pod.yaml "${kube_flags[@]}" + # Post-condition: no PODs exist + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' + + ## kubectl apply should update configuration annotations only if apply is already called + ## 1. kubectl create doesn't set the annotation + # Pre-Condition: no POD exists + create_and_use_new_namespace + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' + # Command: create a pod "test-pod" + kubectl create -f hack/testdata/pod.yaml "${kube_flags[@]}" + # Post-Condition: pod "test-pod" is created + kube::test::get_object_assert 'pods test-pod' "{{${labels_field}.name}}" 'test-pod-label' + # Post-Condition: pod "test-pod" doesn't have configuration annotation + ! [[ "$(kubectl get pods test-pod -o yaml "${kube_flags[@]}" | grep kubectl.kubernetes.io/last-applied-configuration)" ]] + ## 2. kubectl replace doesn't set the annotation + kubectl get pods test-pod -o yaml "${kube_flags[@]}" | $SED 's/test-pod-label/test-pod-replaced/g' > "${KUBE_TEMP}"/test-pod-replace.yaml + # Command: replace the pod "test-pod" + kubectl replace -f "${KUBE_TEMP}"/test-pod-replace.yaml "${kube_flags[@]}" + # Post-Condition: pod "test-pod" is replaced + kube::test::get_object_assert 'pods test-pod' "{{${labels_field}.name}}" 'test-pod-replaced' + # Post-Condition: pod "test-pod" doesn't have configuration annotation + ! [[ "$(kubectl get pods test-pod -o yaml "${kube_flags[@]}" | grep kubectl.kubernetes.io/last-applied-configuration)" ]] + ## 3. kubectl apply does set the annotation + # Command: apply the pod "test-pod" + kubectl apply -f hack/testdata/pod-apply.yaml "${kube_flags[@]}" + # Post-Condition: pod "test-pod" is applied + kube::test::get_object_assert 'pods test-pod' "{{${labels_field}.name}}" 'test-pod-applied' + # Post-Condition: pod "test-pod" has configuration annotation + [[ "$(kubectl get pods test-pod -o yaml "${kube_flags[@]}" | grep kubectl.kubernetes.io/last-applied-configuration)" ]] + kubectl get pods test-pod -o yaml "${kube_flags[@]}" | grep kubectl.kubernetes.io/last-applied-configuration > "${KUBE_TEMP}"/annotation-configuration + ## 4. kubectl replace updates an existing annotation + kubectl get pods test-pod -o yaml "${kube_flags[@]}" | $SED 's/test-pod-applied/test-pod-replaced/g' > "${KUBE_TEMP}"/test-pod-replace.yaml + # Command: replace the pod "test-pod" + kubectl replace -f "${KUBE_TEMP}"/test-pod-replace.yaml "${kube_flags[@]}" + # Post-Condition: pod "test-pod" is replaced + kube::test::get_object_assert 'pods test-pod' "{{${labels_field}.name}}" 'test-pod-replaced' + # Post-Condition: pod "test-pod" has configuration annotation, and it's updated (different from the annotation when it's applied) + [[ "$(kubectl get pods test-pod -o yaml "${kube_flags[@]}" | grep kubectl.kubernetes.io/last-applied-configuration)" ]] + kubectl get pods test-pod -o yaml "${kube_flags[@]}" | grep kubectl.kubernetes.io/last-applied-configuration > "${KUBE_TEMP}"/annotation-configuration-replaced + ! [[ $(diff -q "${KUBE_TEMP}"/annotation-configuration "${KUBE_TEMP}"/annotation-configuration-replaced > /dev/null) ]] + # Clean up + rm "${KUBE_TEMP}"/test-pod-replace.yaml "${KUBE_TEMP}"/annotation-configuration "${KUBE_TEMP}"/annotation-configuration-replaced + kubectl delete pods test-pod "${kube_flags[@]}" + + ## Configuration annotations should be set when --save-config is enabled + ## 1. kubectl create --save-config should generate configuration annotation + # Pre-Condition: no POD exists + create_and_use_new_namespace + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' + # Command: create a pod "test-pod" + kubectl create -f hack/testdata/pod.yaml --save-config "${kube_flags[@]}" + # Post-Condition: pod "test-pod" has configuration annotation + [[ "$(kubectl get pods test-pod -o yaml "${kube_flags[@]}" | grep kubectl.kubernetes.io/last-applied-configuration)" ]] + # Clean up + kubectl delete -f hack/testdata/pod.yaml "${kube_flags[@]}" + ## 2. kubectl edit --save-config should generate configuration annotation + # Pre-Condition: no POD exists, then create pod "test-pod", which shouldn't have configuration annotation + create_and_use_new_namespace + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' + kubectl create -f hack/testdata/pod.yaml "${kube_flags[@]}" + ! [[ "$(kubectl get pods test-pod -o yaml "${kube_flags[@]}" | grep kubectl.kubernetes.io/last-applied-configuration)" ]] + # Command: edit the pod "test-pod" + temp_editor="${KUBE_TEMP}/tmp-editor.sh" + echo -e "#!/bin/bash\n$SED -i \"s/test-pod-label/test-pod-label-edited/g\" \$@" > "${temp_editor}" + chmod +x "${temp_editor}" + EDITOR=${temp_editor} kubectl edit pod test-pod --save-config "${kube_flags[@]}" + # Post-Condition: pod "test-pod" has configuration annotation + [[ "$(kubectl get pods test-pod -o yaml "${kube_flags[@]}" | grep kubectl.kubernetes.io/last-applied-configuration)" ]] + # Clean up + kubectl delete -f hack/testdata/pod.yaml "${kube_flags[@]}" + ## 3. kubectl replace --save-config should generate configuration annotation + # Pre-Condition: no POD exists, then create pod "test-pod", which shouldn't have configuration annotation + create_and_use_new_namespace + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' + kubectl create -f hack/testdata/pod.yaml "${kube_flags[@]}" + ! [[ "$(kubectl get pods test-pod -o yaml "${kube_flags[@]}" | grep kubectl.kubernetes.io/last-applied-configuration)" ]] + # Command: replace the pod "test-pod" + kubectl replace -f hack/testdata/pod.yaml --save-config "${kube_flags[@]}" + # Post-Condition: pod "test-pod" has configuration annotation + [[ "$(kubectl get pods test-pod -o yaml "${kube_flags[@]}" | grep kubectl.kubernetes.io/last-applied-configuration)" ]] + # Clean up + kubectl delete -f hack/testdata/pod.yaml "${kube_flags[@]}" + ## 4. kubectl run --save-config should generate configuration annotation + # Pre-Condition: no RC exists + kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" '' + # Command: create the rc "nginx" with image nginx + kubectl run nginx "--image=$IMAGE_NGINX" --save-config --generator=run/v1 "${kube_flags[@]}" + # Post-Condition: rc "nginx" has configuration annotation + [[ "$(kubectl get rc nginx -o yaml "${kube_flags[@]}" | grep kubectl.kubernetes.io/last-applied-configuration)" ]] + ## 5. kubectl expose --save-config should generate configuration annotation + # Pre-Condition: no service exists + kube::test::get_object_assert svc "{{range.items}}{{$id_field}}:{{end}}" '' + # Command: expose the rc "nginx" + kubectl expose rc nginx --save-config --port=80 --target-port=8000 "${kube_flags[@]}" + # Post-Condition: service "nginx" has configuration annotation + [[ "$(kubectl get svc nginx -o yaml "${kube_flags[@]}" | grep kubectl.kubernetes.io/last-applied-configuration)" ]] + # Clean up + kubectl delete rc,svc nginx + ## 6. kubectl autoscale --save-config should generate configuration annotation + # Pre-Condition: no RC exists, then create the rc "frontend", which shouldn't have configuration annotation + kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" '' + kubectl create -f hack/testdata/frontend-controller.yaml "${kube_flags[@]}" + ! [[ "$(kubectl get rc frontend -o yaml "${kube_flags[@]}" | grep kubectl.kubernetes.io/last-applied-configuration)" ]] + # Command: autoscale rc "frontend" + kubectl autoscale -f hack/testdata/frontend-controller.yaml --save-config "${kube_flags[@]}" --max=2 + # Post-Condition: hpa "frontend" has configuration annotation + [[ "$(kubectl get hpa.v1beta1.extensions frontend -o yaml "${kube_flags[@]}" | grep kubectl.kubernetes.io/last-applied-configuration)" ]] + # Ensure we can interact with HPA objects in lists through both the extensions/v1beta1 and autoscaling/v1 APIs + output_message=$(kubectl get hpa -o=jsonpath='{.items[0].apiVersion}' 2>&1 "${kube_flags[@]}") + kube::test::if_has_string "${output_message}" 'autoscaling/v1' + output_message=$(kubectl get hpa.extensions -o=jsonpath='{.items[0].apiVersion}' 2>&1 "${kube_flags[@]}") + kube::test::if_has_string "${output_message}" 'extensions/v1beta1' + output_message=$(kubectl get hpa.autoscaling -o=jsonpath='{.items[0].apiVersion}' 2>&1 "${kube_flags[@]}") + kube::test::if_has_string "${output_message}" 'autoscaling/v1' + # Clean up + # Note that we should delete hpa first, otherwise it may fight with the rc reaper. + kubectl delete hpa frontend "${kube_flags[@]}" + kubectl delete rc frontend "${kube_flags[@]}" + + ## kubectl create should not panic on empty string lists in a template + ERROR_FILE="${KUBE_TEMP}/validation-error" + kubectl create -f hack/testdata/invalid-rc-with-empty-args.yaml "${kube_flags[@]}" 2> "${ERROR_FILE}" || true + # Post-condition: should get an error reporting the empty string + if grep -q "unexpected nil value for field" "${ERROR_FILE}"; then + kube::log::status "\"kubectl create with empty string list returns error as expected: $(cat ${ERROR_FILE})" + else + kube::log::status "\"kubectl create with empty string list returns unexpected error or non-error: $(cat ${ERROR_FILE})" + exit 1 + fi + rm "${ERROR_FILE}" + + ## kubectl apply should create the resource that doesn't exist yet + # Pre-Condition: no POD exists + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' + # Command: apply a pod "test-pod" (doesn't exist) should create this pod + kubectl apply -f hack/testdata/pod.yaml "${kube_flags[@]}" + # Post-Condition: pod "test-pod" is created + kube::test::get_object_assert 'pods test-pod' "{{${labels_field}.name}}" 'test-pod-label' + # Post-Condition: pod "test-pod" has configuration annotation + [[ "$(kubectl get pods test-pod -o yaml "${kube_flags[@]}" | grep kubectl.kubernetes.io/last-applied-configuration)" ]] + # Clean up + kubectl delete pods test-pod "${kube_flags[@]}" + + ## kubectl run should create deployments or jobs + # Pre-Condition: no Job exists + kube::test::get_object_assert jobs "{{range.items}}{{$id_field}}:{{end}}" '' + # Command + kubectl run pi --generator=job/v1beta1 "--image=$IMAGE_PERL" --restart=OnFailure -- perl -Mbignum=bpi -wle 'print bpi(20)' "${kube_flags[@]}" + # Post-Condition: Job "pi" is created + kube::test::get_object_assert jobs "{{range.items}}{{$id_field}}:{{end}}" 'pi:' + # Clean up + kubectl delete jobs pi "${kube_flags[@]}" + # Command + kubectl run pi --generator=job/v1 "--image=$IMAGE_PERL" --restart=OnFailure -- perl -Mbignum=bpi -wle 'print bpi(20)' "${kube_flags[@]}" + # Post-Condition: Job "pi" is created + kube::test::get_object_assert jobs "{{range.items}}{{$id_field}}:{{end}}" 'pi:' + # Clean up + kubectl delete jobs pi "${kube_flags[@]}" + # Post-condition: no pods exist. + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' + # Pre-Condition: no Deployment exists + kube::test::get_object_assert deployment "{{range.items}}{{$id_field}}:{{end}}" '' + # Command + kubectl run nginx "--image=$IMAGE_NGINX" --generator=deployment/v1beta1 "${kube_flags[@]}" + # Post-Condition: Deployment "nginx" is created + kube::test::get_object_assert deployment "{{range.items}}{{$id_field}}:{{end}}" 'nginx:' + # Clean up + kubectl delete deployment nginx "${kube_flags[@]}" + + ############### + # Kubectl get # + ############### + + ### Test retrieval of non-existing pods + # Pre-condition: no POD exists + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' + # Command + output_message=$(! kubectl get pods abc 2>&1 "${kube_flags[@]}") + # Post-condition: POD abc should error since it doesn't exist + kube::test::if_has_string "${output_message}" 'pods "abc" not found' + + ### Test retrieval of non-existing POD with output flag specified + # Pre-condition: no POD exists + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' + # Command + output_message=$(! kubectl get pods abc 2>&1 "${kube_flags[@]}" -o name) + # Post-condition: POD abc should error since it doesn't exist + kube::test::if_has_string "${output_message}" 'pods "abc" not found' + + ### Test retrieval of non-existing POD with json output flag specified + # Pre-condition: no POD exists + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' + # Command + output_message=$(! kubectl get pods abc 2>&1 "${kube_flags[@]}" -o json) + # Post-condition: POD abc should error since it doesn't exist + kube::test::if_has_string "${output_message}" 'pods "abc" not found' + # Post-condition: make sure we don't display an empty List + if kube::test::if_has_string "${output_message}" 'List'; then + echo 'Unexpected List output' + echo "${LINENO} $(basename $0)" + exit 1 + fi + + ##################################### + # Third Party Resources # + ##################################### + create_and_use_new_namespace + kubectl "${kube_flags[@]}" create -f - "${kube_flags[@]}" << __EOF__ +{ + "kind": "ThirdPartyResource", + "apiVersion": "extensions/v1beta1", + "metadata": { + "name": "foo.company.com" + }, + "versions": [ + { + "name": "v1" + } + ] +} +__EOF__ + + # Post-Condition: assertion object exist + kube::test::get_object_assert thirdpartyresources "{{range.items}}{{$id_field}}:{{end}}" 'foo.company.com:' + + kube::util::wait_for_url "http://127.0.0.1:${API_PORT}/apis/company.com/v1" "third party api" + + # Test that we can list this new third party resource + kube::test::get_object_assert foos "{{range.items}}{{$id_field}}:{{end}}" '' + + # Test that we can create a new resource of type Foo + kubectl "${kube_flags[@]}" create -f - "${kube_flags[@]}" << __EOF__ + { + "kind": "Foo", + "apiVersion": "company.com/v1", + "metadata": { + "name": "test" + }, + "some-field": "field1", + "other-field": "field2" +} +__EOF__ + + # Test that we can list this new third party resource + kube::test::get_object_assert foos "{{range.items}}{{$id_field}}:{{end}}" 'test:' + + # Delete the resource + kubectl "${kube_flags[@]}" delete foos test + + # Make sure it's gone + kube::test::get_object_assert foos "{{range.items}}{{$id_field}}:{{end}}" '' + + # teardown + kubectl delete thirdpartyresources foo.company.com "${kube_flags[@]}" + + ##################################### + # Recursive Resources via directory # + ##################################### + + ### Create multiple busybox PODs recursively from directory of YAML files + # Pre-condition: no POD exists + create_and_use_new_namespace + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' + # Command + output_message=$(! kubectl create -f hack/testdata/recursive/pod --recursive 2>&1 "${kube_flags[@]}") + # Post-condition: busybox0 & busybox1 PODs are created, and since busybox2 is malformed, it should error + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'busybox0:busybox1:' + kube::test::if_has_string "${output_message}" 'error validating data: kind not set' + + ## Edit multiple busybox PODs by updating the image field of multiple PODs recursively from a directory. tmp-editor.sh is a fake editor + # Pre-condition: busybox0 & busybox1 PODs exist + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'busybox0:busybox1:' + # Command + echo -e '#!/bin/bash\nsed -i "s/image: busybox/image: prom\/busybox/g" $1' > /tmp/tmp-editor.sh + chmod +x /tmp/tmp-editor.sh + output_message=$(! EDITOR=/tmp/tmp-editor.sh kubectl edit -f hack/testdata/recursive/pod --recursive 2>&1 "${kube_flags[@]}") + # Post-condition: busybox0 & busybox1 PODs are edited, and since busybox2 is malformed, it should error + kube::test::get_object_assert pods "{{range.items}}{{$image_field}}:{{end}}" 'prom/busybox:prom/busybox:' + kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" + # cleaning + rm /tmp/tmp-editor.sh + + ## Replace multiple busybox PODs recursively from directory of YAML files + # Pre-condition: busybox0 & busybox1 PODs exist + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'busybox0:busybox1:' + # Command + output_message=$(! kubectl replace -f hack/testdata/recursive/pod-modify --recursive 2>&1 "${kube_flags[@]}") + # Post-condition: busybox0 & busybox1 PODs are replaced, and since busybox2 is malformed, it should error + kube::test::get_object_assert pods "{{range.items}}{{${labels_field}.status}}:{{end}}" 'replaced:replaced:' + kube::test::if_has_string "${output_message}" 'error validating data: kind not set' + + ## Describe multiple busybox PODs recursively from directory of YAML files + # Pre-condition: busybox0 & busybox1 PODs exist + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'busybox0:busybox1:' + # Command + output_message=$(! kubectl describe -f hack/testdata/recursive/pod --recursive 2>&1 "${kube_flags[@]}") + # Post-condition: busybox0 & busybox1 PODs are described, and since busybox2 is malformed, it should error + kube::test::if_has_string "${output_message}" "app=busybox0" + kube::test::if_has_string "${output_message}" "app=busybox1" + kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" + + ## Annotate multiple busybox PODs recursively from directory of YAML files + # Pre-condition: busybox0 & busybox1 PODs exist + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'busybox0:busybox1:' + # Command + output_message=$(! kubectl annotate -f hack/testdata/recursive/pod annotatekey='annotatevalue' --recursive 2>&1 "${kube_flags[@]}") + # Post-condition: busybox0 & busybox1 PODs are annotated, and since busybox2 is malformed, it should error + kube::test::get_object_assert pods "{{range.items}}{{${annotations_field}.annotatekey}}:{{end}}" 'annotatevalue:annotatevalue:' + kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" + + ## Apply multiple busybox PODs recursively from directory of YAML files + # Pre-condition: busybox0 & busybox1 PODs exist + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'busybox0:busybox1:' + # Command + output_message=$(! kubectl apply -f hack/testdata/recursive/pod-modify --recursive 2>&1 "${kube_flags[@]}") + # Post-condition: busybox0 & busybox1 PODs are updated, and since busybox2 is malformed, it should error + kube::test::get_object_assert pods "{{range.items}}{{${labels_field}.status}}:{{end}}" 'replaced:replaced:' + kube::test::if_has_string "${output_message}" 'error validating data: kind not set' + + ## Convert multiple busybox PODs recursively from directory of YAML files + # Pre-condition: busybox0 & busybox1 PODs exist + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'busybox0:busybox1:' + # Command + output_message=$(! kubectl convert -f hack/testdata/recursive/pod --recursive 2>&1 "${kube_flags[@]}") + # Post-condition: busybox0 & busybox1 PODs are converted, and since busybox2 is malformed, it should error + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'busybox0:busybox1:' + kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" + + ## Get multiple busybox PODs recursively from directory of YAML files + # Pre-condition: busybox0 & busybox1 PODs exist + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'busybox0:busybox1:' + # Command + output_message=$(! kubectl get -f hack/testdata/recursive/pod --recursive 2>&1 "${kube_flags[@]}" -o go-template="{{range.items}}{{$id_field}}:{{end}}") + # Post-condition: busybox0 & busybox1 PODs are retrieved, but because busybox2 is malformed, it should not show up + kube::test::if_has_string "${output_message}" "busybox0:busybox1:" + kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" + + ## Label multiple busybox PODs recursively from directory of YAML files + # Pre-condition: busybox0 & busybox1 PODs exist + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'busybox0:busybox1:' + # Command + output_message=$(! kubectl label -f hack/testdata/recursive/pod mylabel='myvalue' --recursive 2>&1 "${kube_flags[@]}") + echo $output_message + # Post-condition: busybox0 & busybox1 PODs are labeled, but because busybox2 is malformed, it should not show up + kube::test::get_object_assert pods "{{range.items}}{{${labels_field}.mylabel}}:{{end}}" 'myvalue:myvalue:' + kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" + + ## Patch multiple busybox PODs recursively from directory of YAML files + # Pre-condition: busybox0 & busybox1 PODs exist + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'busybox0:busybox1:' + # Command + output_message=$(! kubectl patch -f hack/testdata/recursive/pod -p='{"spec":{"containers":[{"name":"busybox","image":"prom/busybox"}]}}' --recursive 2>&1 "${kube_flags[@]}") + echo $output_message + # Post-condition: busybox0 & busybox1 PODs are patched, but because busybox2 is malformed, it should not show up + kube::test::get_object_assert pods "{{range.items}}{{$image_field}}:{{end}}" 'prom/busybox:prom/busybox:' + kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" + + ### Delete multiple busybox PODs recursively from directory of YAML files + # Pre-condition: busybox0 & busybox1 PODs exist + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'busybox0:busybox1:' + # Command + output_message=$(! kubectl delete -f hack/testdata/recursive/pod --recursive --grace-period=0 2>&1 "${kube_flags[@]}") + # Post-condition: busybox0 & busybox1 PODs are deleted, and since busybox2 is malformed, it should error + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' + kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" + + ### Create replication controller recursively from directory of YAML files + # Pre-condition: no replication controller exists + kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" '' + # Command + ! kubectl create -f hack/testdata/recursive/rc --recursive "${kube_flags[@]}" + # Post-condition: frontend replication controller is created + kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" 'busybox0:busybox1:' + + ### Autoscale multiple replication controllers recursively from directory of YAML files + # Pre-condition: busybox0 & busybox1 replication controllers exist & 1 + # replica each + kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" 'busybox0:busybox1:' + kube::test::get_object_assert 'rc busybox0' "{{$rc_replicas_field}}" '1' + kube::test::get_object_assert 'rc busybox1' "{{$rc_replicas_field}}" '1' + # Command + output_message=$(! kubectl autoscale --min=1 --max=2 -f hack/testdata/recursive/rc --recursive 2>&1 "${kube_flags[@]}") + # Post-condition: busybox0 & busybox replication controllers are autoscaled + # with min. of 1 replica & max of 2 replicas, and since busybox2 is malformed, it should error + kube::test::get_object_assert 'hpa busybox0' "{{$hpa_min_field}} {{$hpa_max_field}} {{$hpa_cpu_field}}" '1 2 ' + kube::test::get_object_assert 'hpa busybox1' "{{$hpa_min_field}} {{$hpa_max_field}} {{$hpa_cpu_field}}" '1 2 ' + kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" + kubectl delete hpa busybox0 "${kube_flags[@]}" + kubectl delete hpa busybox1 "${kube_flags[@]}" + + ### Expose multiple replication controllers as service recursively from directory of YAML files + # Pre-condition: busybox0 & busybox1 replication controllers exist & 1 + # replica each + kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" 'busybox0:busybox1:' + kube::test::get_object_assert 'rc busybox0' "{{$rc_replicas_field}}" '1' + kube::test::get_object_assert 'rc busybox1' "{{$rc_replicas_field}}" '1' + # Command + output_message=$(! kubectl expose -f hack/testdata/recursive/rc --recursive --port=80 2>&1 "${kube_flags[@]}") + # Post-condition: service exists and the port is unnamed + kube::test::get_object_assert 'service busybox0' "{{$port_name}} {{$port_field}}" ' 80' + kube::test::get_object_assert 'service busybox1' "{{$port_name}} {{$port_field}}" ' 80' + kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" + + ### Scale multiple replication controllers recursively from directory of YAML files + # Pre-condition: busybox0 & busybox1 replication controllers exist & 1 + # replica each + kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" 'busybox0:busybox1:' + kube::test::get_object_assert 'rc busybox0' "{{$rc_replicas_field}}" '1' + kube::test::get_object_assert 'rc busybox1' "{{$rc_replicas_field}}" '1' + # Command + output_message=$(! kubectl scale --current-replicas=1 --replicas=2 -f hack/testdata/recursive/rc --recursive 2>&1 "${kube_flags[@]}") + # Post-condition: busybox0 & busybox1 replication controllers are scaled to 2 replicas, and since busybox2 is malformed, it should error + kube::test::get_object_assert 'rc busybox0' "{{$rc_replicas_field}}" '2' + kube::test::get_object_assert 'rc busybox1' "{{$rc_replicas_field}}" '2' + kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" + + ### Delete multiple busybox replication controllers recursively from directory of YAML files + # Pre-condition: busybox0 & busybox1 PODs exist + kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" 'busybox0:busybox1:' + # Command + output_message=$(! kubectl delete -f hack/testdata/recursive/rc --recursive --grace-period=0 2>&1 "${kube_flags[@]}") + # Post-condition: busybox0 & busybox1 replication controllers are deleted, and since busybox2 is malformed, it should error + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' + kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" + + ### Rollout on multiple deployments recursively + # Pre-condition: no deployments exist + kube::test::get_object_assert deployment "{{range.items}}{{$id_field}}:{{end}}" '' + # Command + # Create deployments (revision 1) recursively from directory of YAML files + ! kubectl create -f hack/testdata/recursive/deployment --recursive "${kube_flags[@]}" + kube::test::get_object_assert deployment "{{range.items}}{{$id_field}}:{{end}}" 'nginx0-deployment:nginx1-deployment:' + kube::test::get_object_assert deployment "{{range.items}}{{$deployment_image_field}}:{{end}}" "${IMAGE_NGINX}:${IMAGE_NGINX}:" + ## Rollback the deployments to revision 1 recursively + output_message=$(! kubectl rollout undo -f hack/testdata/recursive/deployment --recursive --to-revision=1 2>&1 "${kube_flags[@]}") + # Post-condition: nginx0 & nginx1 should be a no-op, and since nginx2 is malformed, it should error + kube::test::get_object_assert deployment "{{range.items}}{{$deployment_image_field}}:{{end}}" "${IMAGE_NGINX}:${IMAGE_NGINX}:" + kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" + ## Pause the deployments recursively + PRESERVE_ERR_FILE=true + kubectl-with-retry rollout pause -f hack/testdata/recursive/deployment --recursive "${kube_flags[@]}" + output_message=$(cat ${ERROR_FILE}) + # Post-condition: nginx0 & nginx1 should both have paused set to true, and since nginx2 is malformed, it should error + kube::test::get_object_assert deployment "{{range.items}}{{.spec.paused}}:{{end}}" "true:true:" + kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" + ## Resume the deployments recursively + kubectl-with-retry rollout resume -f hack/testdata/recursive/deployment --recursive "${kube_flags[@]}" + output_message=$(cat ${ERROR_FILE}) + # Post-condition: nginx0 & nginx1 should both have paused set to nothing, and since nginx2 is malformed, it should error + kube::test::get_object_assert deployment "{{range.items}}{{.spec.paused}}:{{end}}" "::" + kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" + ## Retrieve the rollout history of the deployments recursively + output_message=$(! kubectl rollout history -f hack/testdata/recursive/deployment --recursive 2>&1 "${kube_flags[@]}") + # Post-condition: nginx0 & nginx1 should both have a history, and since nginx2 is malformed, it should error + kube::test::if_has_string "${output_message}" "nginx0-deployment" + kube::test::if_has_string "${output_message}" "nginx1-deployment" + kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" + # Clean up + unset PRESERVE_ERR_FILE + rm "${ERROR_FILE}" + ! kubectl delete -f hack/testdata/recursive/deployment --recursive "${kube_flags[@]}" --grace-period=0 + sleep 1 + + ### Rollout on multiple replication controllers recursively - these tests ensure that rollouts cannot be performed on resources that don't support it + # Pre-condition: no replication controller exists + kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" '' + # Command + # Create replication controllers recursively from directory of YAML files + ! kubectl create -f hack/testdata/recursive/rc --recursive "${kube_flags[@]}" + kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" 'busybox0:busybox1:' + # Command + ## Attempt to rollback the replication controllers to revision 1 recursively + output_message=$(! kubectl rollout undo -f hack/testdata/recursive/rc --recursive --to-revision=1 2>&1 "${kube_flags[@]}") + # Post-condition: busybox0 & busybox1 should error as they are RC's, and since busybox2 is malformed, it should error + kube::test::if_has_string "${output_message}" 'no rollbacker has been implemented for {"" "ReplicationController"}' + kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" + ## Attempt to pause the replication controllers recursively + output_message=$(! kubectl rollout pause -f hack/testdata/recursive/rc --recursive 2>&1 "${kube_flags[@]}") + # Post-condition: busybox0 & busybox1 should error as they are RC's, and since busybox2 is malformed, it should error + kube::test::if_has_string "${output_message}" 'error when pausing "hack/testdata/recursive/rc/busybox.yaml' + kube::test::if_has_string "${output_message}" 'error when pausing "hack/testdata/recursive/rc/rc/busybox.yaml' + kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" + ## Attempt to resume the replication controllers recursively + output_message=$(! kubectl rollout resume -f hack/testdata/recursive/rc --recursive 2>&1 "${kube_flags[@]}") + # Post-condition: busybox0 & busybox1 should error as they are RC's, and since busybox2 is malformed, it should error + kube::test::if_has_string "${output_message}" 'error when resuming "hack/testdata/recursive/rc/busybox.yaml' + kube::test::if_has_string "${output_message}" 'error when resuming "hack/testdata/recursive/rc/rc/busybox.yaml' + kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" + # Clean up + ! kubectl delete -f hack/testdata/recursive/rc --recursive "${kube_flags[@]}" --grace-period=0 + sleep 1 + + ############## + # Namespaces # + ############## + + ### Create a new namespace + # Pre-condition: only the "default" namespace exists + # The Pre-condition doesn't hold anymore after we create and switch namespaces before creating pods with same name in the test. + # kube::test::get_object_assert namespaces "{{range.items}}{{$id_field}}:{{end}}" 'default:' + # Command + kubectl create namespace my-namespace + # Post-condition: namespace 'my-namespace' is created. + kube::test::get_object_assert 'namespaces/my-namespace' "{{$id_field}}" 'my-namespace' + # Clean up + kubectl delete namespace my-namespace + + ############## + # Pods in Namespaces # + ############## + + ### Create a new namespace + # Pre-condition: the other namespace does not exist + kube::test::get_object_assert 'namespaces' '{{range.items}}{{ if eq $id_field \"other\" }}found{{end}}{{end}}:' ':' + # Command + kubectl create namespace other + # Post-condition: namespace 'other' is created. + kube::test::get_object_assert 'namespaces/other' "{{$id_field}}" 'other' + + ### Create POD valid-pod in specific namespace + # Pre-condition: no POD exists + kube::test::get_object_assert 'pods --namespace=other' "{{range.items}}{{$id_field}}:{{end}}" '' + # Command + kubectl create "${kube_flags[@]}" --namespace=other -f docs/admin/limitrange/valid-pod.yaml + # Post-condition: valid-pod POD is created + kube::test::get_object_assert 'pods --namespace=other' "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' + + ### Delete POD valid-pod in specific namespace + # Pre-condition: valid-pod POD exists + kube::test::get_object_assert 'pods --namespace=other' "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' + # Command + kubectl delete "${kube_flags[@]}" pod --namespace=other valid-pod --grace-period=0 + # Post-condition: valid-pod POD doesn't exist + kube::test::get_object_assert 'pods --namespace=other' "{{range.items}}{{$id_field}}:{{end}}" '' + # Clean up + kubectl delete namespace other + + ############## + # Secrets # + ############## + + ### Create a new namespace + # Pre-condition: the test-secrets namespace does not exist + kube::test::get_object_assert 'namespaces' '{{range.items}}{{ if eq $id_field \"test-secrets\" }}found{{end}}{{end}}:' ':' + # Command + kubectl create namespace test-secrets + # Post-condition: namespace 'test-secrets' is created. + kube::test::get_object_assert 'namespaces/test-secrets' "{{$id_field}}" 'test-secrets' + + ### Create a generic secret in a specific namespace + # Pre-condition: no SECRET exists + kube::test::get_object_assert 'secrets --namespace=test-secrets' "{{range.items}}{{$id_field}}:{{end}}" '' + # Command + kubectl create secret generic test-secret --from-literal=key1=value1 --type=test-type --namespace=test-secrets + # Post-condition: secret exists and has expected values + kube::test::get_object_assert 'secret/test-secret --namespace=test-secrets' "{{$id_field}}" 'test-secret' + kube::test::get_object_assert 'secret/test-secret --namespace=test-secrets' "{{$secret_type}}" 'test-type' + [[ "$(kubectl get secret/test-secret --namespace=test-secrets -o yaml "${kube_flags[@]}" | grep 'key1: dmFsdWUx')" ]] + # Clean-up + kubectl delete secret test-secret --namespace=test-secrets + + ### Create a docker-registry secret in a specific namespace + # Pre-condition: no SECRET exists + kube::test::get_object_assert 'secrets --namespace=test-secrets' "{{range.items}}{{$id_field}}:{{end}}" '' + # Command + kubectl create secret docker-registry test-secret --docker-username=test-user --docker-password=test-password --docker-email='test-user@test.com' --namespace=test-secrets + # Post-condition: secret exists and has expected values + kube::test::get_object_assert 'secret/test-secret --namespace=test-secrets' "{{$id_field}}" 'test-secret' + kube::test::get_object_assert 'secret/test-secret --namespace=test-secrets' "{{$secret_type}}" 'kubernetes.io/dockercfg' + [[ "$(kubectl get secret/test-secret --namespace=test-secrets -o yaml "${kube_flags[@]}" | grep '.dockercfg:')" ]] + # Clean-up + kubectl delete secret test-secret --namespace=test-secrets + + ### Create a tls secret + # Pre-condition: no SECRET exists + kube::test::get_object_assert 'secrets --namespace=test-secrets' "{{range.items}}{{$id_field}}:{{end}}" '' + # Command + kubectl create secret tls test-secret --namespace=test-secrets --key=hack/testdata/tls.key --cert=hack/testdata/tls.crt + kube::test::get_object_assert 'secret/test-secret --namespace=test-secrets' "{{$id_field}}" 'test-secret' + kube::test::get_object_assert 'secret/test-secret --namespace=test-secrets' "{{$secret_type}}" 'kubernetes.io/tls' + # Clean-up + kubectl delete secret test-secret --namespace=test-secrets + + # Create a secret using stringData + kubectl create --namespace=test-secrets -f - "${kube_flags[@]}" << __EOF__ +{ + "kind": "Secret", + "apiVersion": "v1", + "metadata": { + "name": "secret-string-data" + }, + "data": { + "k1":"djE=", + "k2":"" + }, + "stringData": { + "k2":"v2" + } +} +__EOF__ + # Post-condition: secret-string-data secret is created with expected data, merged/overridden data from stringData, and a cleared stringData field + kube::test::get_object_assert 'secret/secret-string-data --namespace=test-secrets ' '{{.data}}' '.*k1:djE=.*' + kube::test::get_object_assert 'secret/secret-string-data --namespace=test-secrets ' '{{.data}}' '.*k2:djI=.*' + kube::test::get_object_assert 'secret/secret-string-data --namespace=test-secrets ' '{{.stringData}}' '' + # Clean up + kubectl delete secret secret-string-data --namespace=test-secrets + + ### Create a secret using output flags + # Pre-condition: no secret exists + kube::test::get_object_assert 'secrets --namespace=test-secrets' "{{range.items}}{{$id_field}}:{{end}}" '' + # Command + [[ "$(kubectl create secret generic test-secret --namespace=test-secrets --from-literal=key1=value1 --output=go-template --template=\"{{.metadata.name}}:\" | grep 'test-secret:')" ]] + ## Clean-up + kubectl delete secret test-secret --namespace=test-secrets + # Clean up + kubectl delete namespace test-secrets + + ###################### + # ConfigMap # + ###################### + + kubectl create -f docs/user-guide/configmap/configmap.yaml + kube::test::get_object_assert configmap "{{range.items}}{{$id_field}}{{end}}" 'test-configmap' + kubectl delete configmap test-configmap "${kube_flags[@]}" + + ### Create a new namespace + # Pre-condition: the test-configmaps namespace does not exist + kube::test::get_object_assert 'namespaces' '{{range.items}}{{ if eq $id_field \"test-configmaps\" }}found{{end}}{{end}}:' ':' + # Command + kubectl create namespace test-configmaps + # Post-condition: namespace 'test-configmaps' is created. + kube::test::get_object_assert 'namespaces/test-configmaps' "{{$id_field}}" 'test-configmaps' + + ### Create a generic configmap in a specific namespace + # Pre-condition: no configmaps namespace exists + kube::test::get_object_assert 'configmaps --namespace=test-configmaps' "{{range.items}}{{$id_field}}:{{end}}" '' + # Command + kubectl create configmap test-configmap --from-literal=key1=value1 --namespace=test-configmaps + # Post-condition: configmap exists and has expected values + kube::test::get_object_assert 'configmap/test-configmap --namespace=test-configmaps' "{{$id_field}}" 'test-configmap' + [[ "$(kubectl get configmap/test-configmap --namespace=test-configmaps -o yaml "${kube_flags[@]}" | grep 'key1: value1')" ]] + # Clean-up + kubectl delete configmap test-configmap --namespace=test-configmaps + kubectl delete namespace test-configmaps + + #################### + # Service Accounts # + #################### + + ### Create a new namespace + # Pre-condition: the test-service-accounts namespace does not exist + kube::test::get_object_assert 'namespaces' '{{range.items}}{{ if eq $id_field \"test-service-accounts\" }}found{{end}}{{end}}:' ':' + # Command + kubectl create namespace test-service-accounts + # Post-condition: namespace 'test-service-accounts' is created. + kube::test::get_object_assert 'namespaces/test-service-accounts' "{{$id_field}}" 'test-service-accounts' + + ### Create a service account in a specific namespace + # Command + kubectl create serviceaccount test-service-account --namespace=test-service-accounts + # Post-condition: secret exists and has expected values + kube::test::get_object_assert 'serviceaccount/test-service-account --namespace=test-service-accounts' "{{$id_field}}" 'test-service-account' + # Clean-up + kubectl delete serviceaccount test-service-account --namespace=test-service-accounts + # Clean up + kubectl delete namespace test-service-accounts + + ################# + # Pod templates # + ################# + + ### Create PODTEMPLATE + # Pre-condition: no PODTEMPLATE + kube::test::get_object_assert podtemplates "{{range.items}}{{.metadata.name}}:{{end}}" '' + # Command + kubectl create -f docs/user-guide/walkthrough/podtemplate.json "${kube_flags[@]}" + # Post-condition: nginx PODTEMPLATE is available + kube::test::get_object_assert podtemplates "{{range.items}}{{.metadata.name}}:{{end}}" 'nginx:' + + ### Printing pod templates works + kubectl get podtemplates "${kube_flags[@]}" + [[ "$(kubectl get podtemplates -o yaml "${kube_flags[@]}" | grep nginx)" ]] + + ### Delete nginx pod template by name + # Pre-condition: nginx pod template is available + kube::test::get_object_assert podtemplates "{{range.items}}{{.metadata.name}}:{{end}}" 'nginx:' + # Command + kubectl delete podtemplate nginx "${kube_flags[@]}" + # Post-condition: No templates exist + kube::test::get_object_assert podtemplate "{{range.items}}{{.metadata.name}}:{{end}}" '' + + + ############ + # Services # + ############ + # switch back to the default namespace + kubectl config set-context "${CONTEXT}" --namespace="" + kube::log::status "Testing kubectl(${version}:services)" + + ### Create redis-master service from JSON + # Pre-condition: Only the default kubernetes services exist + kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:' + # Command + kubectl create -f examples/guestbook/redis-master-service.yaml "${kube_flags[@]}" + # Post-condition: redis-master service exists + kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:redis-master:' + # Describe command should print detailed information + kube::test::describe_object_assert services 'redis-master' "Name:" "Labels:" "Selector:" "IP:" "Port:" "Endpoints:" "Session Affinity:" + # Describe command should print events information by default + kube::test::describe_object_events_assert services 'redis-master' + # Describe command should not print events information when show-events=false + kube::test::describe_object_events_assert services 'redis-master' false + # Describe command should print events information when show-events=true + kube::test::describe_object_events_assert services 'redis-master' true + # Describe command (resource only) should print detailed information + kube::test::describe_resource_assert services "Name:" "Labels:" "Selector:" "IP:" "Port:" "Endpoints:" "Session Affinity:" + # Describe command should print events information by default + kube::test::describe_resource_events_assert services + # Describe command should not print events information when show-events=false + kube::test::describe_resource_events_assert services false + # Describe command should print events information when show-events=true + kube::test::describe_resource_events_assert services true + + ### Dump current redis-master service + output_service=$(kubectl get service redis-master -o json --output-version=v1 "${kube_flags[@]}") + + ### Delete redis-master-service by id + # Pre-condition: redis-master service exists + kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:redis-master:' + # Command + kubectl delete service redis-master "${kube_flags[@]}" + # Post-condition: Only the default kubernetes services exist + kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:' + + ### Create redis-master-service from dumped JSON + # Pre-condition: Only the default kubernetes services exist + kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:' + # Command + echo "${output_service}" | kubectl create -f - "${kube_flags[@]}" + # Post-condition: redis-master service is created + kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:redis-master:' + + ### Create redis-master-${version}-test service + # Pre-condition: redis-master-service service exists + kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:redis-master:' + # Command + kubectl create -f - "${kube_flags[@]}" << __EOF__ +{ + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": "service-${version}-test" + }, + "spec": { + "ports": [ + { + "protocol": "TCP", + "port": 80, + "targetPort": 80 + } + ] + } +} +__EOF__ + # Post-condition: service-${version}-test service is created + kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:redis-master:service-.*-test:' + + ### Identity + kubectl get service "${kube_flags[@]}" service-${version}-test -o json | kubectl replace "${kube_flags[@]}" -f - + + ### Delete services by id + # Pre-condition: service-${version}-test exists + kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:redis-master:service-.*-test:' + # Command + kubectl delete service redis-master "${kube_flags[@]}" + kubectl delete service "service-${version}-test" "${kube_flags[@]}" + # Post-condition: Only the default kubernetes services exist + kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:' + + ### Create two services + # Pre-condition: Only the default kubernetes services exist + kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:' + # Command + kubectl create -f examples/guestbook/redis-master-service.yaml "${kube_flags[@]}" + kubectl create -f examples/guestbook/redis-slave-service.yaml "${kube_flags[@]}" + # Post-condition: redis-master and redis-slave services are created + kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:redis-master:redis-slave:' + + ### Custom columns can be specified + # Pre-condition: generate output using custom columns + output_message=$(kubectl get services -o=custom-columns=NAME:.metadata.name,RSRC:.metadata.resourceVersion 2>&1 "${kube_flags[@]}") + # Post-condition: should contain name column + kube::test::if_has_string "${output_message}" 'redis-master' + + ### Delete multiple services at once + # Pre-condition: redis-master and redis-slave services exist + kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:redis-master:redis-slave:' + # Command + kubectl delete services redis-master redis-slave "${kube_flags[@]}" # delete multiple services at once + # Post-condition: Only the default kubernetes services exist + kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:' + + + ########################### + # Replication controllers # + ########################### + + kube::log::status "Testing kubectl(${version}:replicationcontrollers)" + + ### Create and stop controller, make sure it doesn't leak pods + # Pre-condition: no replication controller exists + kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" '' + # Command + kubectl create -f hack/testdata/frontend-controller.yaml "${kube_flags[@]}" + kubectl delete rc frontend "${kube_flags[@]}" + # Post-condition: no pods from frontend controller + kube::test::get_object_assert 'pods -l "name=frontend"' "{{range.items}}{{$id_field}}:{{end}}" '' + + ### Create replication controller frontend from JSON + # Pre-condition: no replication controller exists + kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" '' + # Command + kubectl create -f hack/testdata/frontend-controller.yaml "${kube_flags[@]}" + # Post-condition: frontend replication controller is created + kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" 'frontend:' + # Describe command should print detailed information + kube::test::describe_object_assert rc 'frontend' "Name:" "Image(s):" "Labels:" "Selector:" "Replicas:" "Pods Status:" + # Describe command should print events information by default + kube::test::describe_object_events_assert rc 'frontend' + # Describe command should not print events information when show-events=false + kube::test::describe_object_events_assert rc 'frontend' false + # Describe command should print events information when show-events=true + kube::test::describe_object_events_assert rc 'frontend' true + # Describe command (resource only) should print detailed information + kube::test::describe_resource_assert rc "Name:" "Name:" "Image(s):" "Labels:" "Selector:" "Replicas:" "Pods Status:" + # Describe command should print events information by default + kube::test::describe_resource_events_assert rc + # Describe command should not print events information when show-events=false + kube::test::describe_resource_events_assert rc false + # Describe command should print events information when show-events=true + kube::test::describe_resource_events_assert rc true + + ### Scale replication controller frontend with current-replicas and replicas + # Pre-condition: 3 replicas + kube::test::get_object_assert 'rc frontend' "{{$rc_replicas_field}}" '3' + # Command + kubectl scale --current-replicas=3 --replicas=2 replicationcontrollers frontend "${kube_flags[@]}" + # Post-condition: 2 replicas + kube::test::get_object_assert 'rc frontend' "{{$rc_replicas_field}}" '2' + + ### Scale replication controller frontend with (wrong) current-replicas and replicas + # Pre-condition: 2 replicas + kube::test::get_object_assert 'rc frontend' "{{$rc_replicas_field}}" '2' + # Command + ! kubectl scale --current-replicas=3 --replicas=2 replicationcontrollers frontend "${kube_flags[@]}" + # Post-condition: nothing changed + kube::test::get_object_assert 'rc frontend' "{{$rc_replicas_field}}" '2' + + ### Scale replication controller frontend with replicas only + # Pre-condition: 2 replicas + kube::test::get_object_assert 'rc frontend' "{{$rc_replicas_field}}" '2' + # Command + kubectl scale --replicas=3 replicationcontrollers frontend "${kube_flags[@]}" + # Post-condition: 3 replicas + kube::test::get_object_assert 'rc frontend' "{{$rc_replicas_field}}" '3' + + ### Scale replication controller from JSON with replicas only + # Pre-condition: 3 replicas + kube::test::get_object_assert 'rc frontend' "{{$rc_replicas_field}}" '3' + # Command + kubectl scale --replicas=2 -f hack/testdata/frontend-controller.yaml "${kube_flags[@]}" + # Post-condition: 2 replicas + kube::test::get_object_assert 'rc frontend' "{{$rc_replicas_field}}" '2' + # Clean-up + kubectl delete rc frontend "${kube_flags[@]}" + + ### Scale multiple replication controllers + kubectl create -f examples/guestbook/legacy/redis-master-controller.yaml "${kube_flags[@]}" + kubectl create -f examples/guestbook/legacy/redis-slave-controller.yaml "${kube_flags[@]}" + # Command + kubectl scale rc/redis-master rc/redis-slave --replicas=4 "${kube_flags[@]}" + # Post-condition: 4 replicas each + kube::test::get_object_assert 'rc redis-master' "{{$rc_replicas_field}}" '4' + kube::test::get_object_assert 'rc redis-slave' "{{$rc_replicas_field}}" '4' + # Clean-up + kubectl delete rc redis-{master,slave} "${kube_flags[@]}" + + ### Scale a job + kubectl create -f docs/user-guide/job.yaml "${kube_flags[@]}" + # Command + kubectl scale --replicas=2 job/pi + # Post-condition: 2 replicas for pi + kube::test::get_object_assert 'job pi' "{{$job_parallelism_field}}" '2' + # Clean-up + kubectl delete job/pi "${kube_flags[@]}" + + ### Scale a deployment + kubectl create -f docs/user-guide/deployment.yaml "${kube_flags[@]}" + # Command + kubectl scale --current-replicas=3 --replicas=1 deployment/nginx-deployment + # Post-condition: 1 replica for nginx-deployment + kube::test::get_object_assert 'deployment nginx-deployment' "{{$deployment_replicas}}" '1' + # Clean-up + kubectl delete deployment/nginx-deployment "${kube_flags[@]}" + + ### Expose a deployment as a service + kubectl create -f docs/user-guide/deployment.yaml "${kube_flags[@]}" + # Pre-condition: 3 replicas + kube::test::get_object_assert 'deployment nginx-deployment' "{{$deployment_replicas}}" '3' + # Command + kubectl expose deployment/nginx-deployment + # Post-condition: service exists and exposes deployment port (80) + kube::test::get_object_assert 'service nginx-deployment' "{{$port_field}}" '80' + # Clean-up + kubectl delete deployment/nginx-deployment service/nginx-deployment "${kube_flags[@]}" + + ### Expose replication controller as service + kubectl create -f hack/testdata/frontend-controller.yaml "${kube_flags[@]}" + # Pre-condition: 3 replicas + kube::test::get_object_assert 'rc frontend' "{{$rc_replicas_field}}" '3' + # Command + kubectl expose rc frontend --port=80 "${kube_flags[@]}" + # Post-condition: service exists and the port is unnamed + kube::test::get_object_assert 'service frontend' "{{$port_name}} {{$port_field}}" ' 80' + # Command + kubectl expose service frontend --port=443 --name=frontend-2 "${kube_flags[@]}" + # Post-condition: service exists and the port is unnamed + kube::test::get_object_assert 'service frontend-2' "{{$port_name}} {{$port_field}}" ' 443' + # Command + kubectl create -f docs/admin/limitrange/valid-pod.yaml "${kube_flags[@]}" + kubectl expose pod valid-pod --port=444 --name=frontend-3 "${kube_flags[@]}" + # Post-condition: service exists and the port is unnamed + kube::test::get_object_assert 'service frontend-3' "{{$port_name}} {{$port_field}}" ' 444' + # Create a service using service/v1 generator + kubectl expose rc frontend --port=80 --name=frontend-4 --generator=service/v1 "${kube_flags[@]}" + # Post-condition: service exists and the port is named default. + kube::test::get_object_assert 'service frontend-4' "{{$port_name}} {{$port_field}}" 'default 80' + # Verify that expose service works without specifying a port. + kubectl expose service frontend --name=frontend-5 "${kube_flags[@]}" + # Post-condition: service exists with the same port as the original service. + kube::test::get_object_assert 'service frontend-5' "{{$port_field}}" '80' + # Cleanup services + kubectl delete pod valid-pod "${kube_flags[@]}" + kubectl delete service frontend{,-2,-3,-4,-5} "${kube_flags[@]}" + + ### Expose negative invalid resource test + # Pre-condition: don't need + # Command + output_message=$(! kubectl expose nodes 127.0.0.1 2>&1 "${kube_flags[@]}") + # Post-condition: the error message has "cannot expose" string + kube::test::if_has_string "${output_message}" 'cannot expose' + + ### Try to generate a service with invalid name (exceeding maximum valid size) + # Pre-condition: use --name flag + output_message=$(! kubectl expose -f hack/testdata/pod-with-large-name.yaml --name=invalid-large-service-name --port=8081 2>&1 "${kube_flags[@]}") + # Post-condition: should fail due to invalid name + kube::test::if_has_string "${output_message}" 'metadata.name: Invalid value' + # Pre-condition: default run without --name flag; should succeed by truncating the inherited name + output_message=$(kubectl expose -f hack/testdata/pod-with-large-name.yaml --port=8081 2>&1 "${kube_flags[@]}") + # Post-condition: inherited name from pod has been truncated + kube::test::if_has_string "${output_message}" '\"kubernetes-serve-hostnam\" exposed' + # Clean-up + kubectl delete svc kubernetes-serve-hostnam "${kube_flags[@]}" + + ### Expose multiport object as a new service + # Pre-condition: don't use --port flag + output_message=$(kubectl expose -f docs/admin/high-availability/etcd.yaml --selector=test=etcd 2>&1 "${kube_flags[@]}") + # Post-condition: expose succeeded + kube::test::if_has_string "${output_message}" '\"etcd-server\" exposed' + # Post-condition: generated service has both ports from the exposed pod + kube::test::get_object_assert 'service etcd-server' "{{$port_name}} {{$port_field}}" 'port-1 2380' + kube::test::get_object_assert 'service etcd-server' "{{$second_port_name}} {{$second_port_field}}" 'port-2 4001' + # Clean-up + kubectl delete svc etcd-server "${kube_flags[@]}" + + ### Delete replication controller with id + # Pre-condition: frontend replication controller exists + kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" 'frontend:' + # Command + kubectl delete rc frontend "${kube_flags[@]}" + # Post-condition: no replication controller exists + kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" '' + + ### Create two replication controllers + # Pre-condition: no replication controller exists + kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" '' + # Command + kubectl create -f hack/testdata/frontend-controller.yaml "${kube_flags[@]}" + kubectl create -f examples/guestbook/legacy/redis-slave-controller.yaml "${kube_flags[@]}" + # Post-condition: frontend and redis-slave + kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" 'frontend:redis-slave:' + + ### Delete multiple controllers at once + # Pre-condition: frontend and redis-slave + kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" 'frontend:redis-slave:' + # Command + kubectl delete rc frontend redis-slave "${kube_flags[@]}" # delete multiple controllers at once + # Post-condition: no replication controller exists + kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" '' + + ### Auto scale replication controller + # Pre-condition: no replication controller exists + kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" '' + # Command + kubectl create -f hack/testdata/frontend-controller.yaml "${kube_flags[@]}" + kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" 'frontend:' + # autoscale 1~2 pods, CPU utilization 70%, rc specified by file + kubectl autoscale -f hack/testdata/frontend-controller.yaml "${kube_flags[@]}" --max=2 --cpu-percent=70 + kube::test::get_object_assert 'hpa frontend' "{{$hpa_min_field}} {{$hpa_max_field}} {{$hpa_cpu_field}}" '1 2 70' + kubectl delete hpa frontend "${kube_flags[@]}" + # autoscale 1~2 pods, CPU utilization 70%, rc specified by file, using old generator + kubectl autoscale -f hack/testdata/frontend-controller.yaml "${kube_flags[@]}" --max=2 --cpu-percent=70 --generator=horizontalpodautoscaler/v1beta1 + kube::test::get_object_assert 'hpa frontend' "{{$hpa_min_field}} {{$hpa_max_field}} {{$hpa_cpu_field}}" '1 2 70' + kubectl delete hpa frontend "${kube_flags[@]}" + # autoscale 2~3 pods, no CPU utilization specified, rc specified by name + kubectl autoscale rc frontend "${kube_flags[@]}" --min=2 --max=3 + kube::test::get_object_assert 'hpa frontend' "{{$hpa_min_field}} {{$hpa_max_field}} {{$hpa_cpu_field}}" '2 3 ' + kubectl delete hpa frontend "${kube_flags[@]}" + # autoscale 2~3 pods, no CPU utilization specified, rc specified by name, using old generator + kubectl autoscale rc frontend "${kube_flags[@]}" --min=2 --max=3 --generator=horizontalpodautoscaler/v1beta1 + kube::test::get_object_assert 'hpa frontend' "{{$hpa_min_field}} {{$hpa_max_field}} {{$hpa_cpu_field}}" '2 3 ' + kubectl delete hpa frontend "${kube_flags[@]}" + # autoscale without specifying --max should fail + ! kubectl autoscale rc frontend "${kube_flags[@]}" + # Clean up + kubectl delete rc frontend "${kube_flags[@]}" + + + ###################### + # Deployments # + ###################### + + ### Auto scale deployment + # Pre-condition: no deployment exists + kube::test::get_object_assert deployment "{{range.items}}{{$id_field}}:{{end}}" '' + # Command + kubectl create -f docs/user-guide/deployment.yaml "${kube_flags[@]}" + kube::test::get_object_assert deployment "{{range.items}}{{$id_field}}:{{end}}" 'nginx-deployment:' + # autoscale 2~3 pods, no CPU utilization specified + kubectl-with-retry autoscale deployment nginx-deployment "${kube_flags[@]}" --min=2 --max=3 + kube::test::get_object_assert 'hpa nginx-deployment' "{{$hpa_min_field}} {{$hpa_max_field}} {{$hpa_cpu_field}}" '2 3 ' + # Clean up + # Note that we should delete hpa first, otherwise it may fight with the deployment reaper. + kubectl delete hpa nginx-deployment "${kube_flags[@]}" + kubectl delete deployment.extensions nginx-deployment "${kube_flags[@]}" + + ### Rollback a deployment + # Pre-condition: no deployment exists + kube::test::get_object_assert deployment "{{range.items}}{{$id_field}}:{{end}}" '' + # Command + # Create a deployment (revision 1) + kubectl create -f hack/testdata/deployment-revision1.yaml "${kube_flags[@]}" + kube::test::get_object_assert deployment "{{range.items}}{{$id_field}}:{{end}}" 'nginx:' + kube::test::get_object_assert deployment "{{range.items}}{{$deployment_image_field}}:{{end}}" "${IMAGE_DEPLOYMENT_R1}:" + # Rollback to revision 1 - should be no-op + kubectl rollout undo deployment nginx --to-revision=1 "${kube_flags[@]}" + kube::test::get_object_assert deployment "{{range.items}}{{$deployment_image_field}}:{{end}}" "${IMAGE_DEPLOYMENT_R1}:" + # Update the deployment (revision 2) + kubectl apply -f hack/testdata/deployment-revision2.yaml "${kube_flags[@]}" + kube::test::get_object_assert deployment.extensions "{{range.items}}{{$deployment_image_field}}:{{end}}" "${IMAGE_DEPLOYMENT_R2}:" + # Rollback to revision 1 + kubectl rollout undo deployment nginx --to-revision=1 "${kube_flags[@]}" + sleep 1 + kube::test::get_object_assert deployment "{{range.items}}{{$deployment_image_field}}:{{end}}" "${IMAGE_DEPLOYMENT_R1}:" + # Rollback to revision 1000000 - should be no-op + kubectl rollout undo deployment nginx --to-revision=1000000 "${kube_flags[@]}" + kube::test::get_object_assert deployment "{{range.items}}{{$deployment_image_field}}:{{end}}" "${IMAGE_DEPLOYMENT_R1}:" + # Rollback to last revision + kubectl rollout undo deployment nginx "${kube_flags[@]}" + sleep 1 + kube::test::get_object_assert deployment "{{range.items}}{{$deployment_image_field}}:{{end}}" "${IMAGE_DEPLOYMENT_R2}:" + # Pause the deployment + kubectl-with-retry rollout pause deployment nginx "${kube_flags[@]}" + # A paused deployment cannot be rolled back + ! kubectl rollout undo deployment nginx "${kube_flags[@]}" + # Resume the deployment + kubectl-with-retry rollout resume deployment nginx "${kube_flags[@]}" + # The resumed deployment can now be rolled back + kubectl rollout undo deployment nginx "${kube_flags[@]}" + # Clean up + kubectl delete deployment nginx "${kube_flags[@]}" + + ### Set image of a deployment + # Pre-condition: no deployment exists + kube::test::get_object_assert deployment "{{range.items}}{{$id_field}}:{{end}}" '' + # Create a deployment + kubectl create -f hack/testdata/deployment-multicontainer.yaml "${kube_flags[@]}" + kube::test::get_object_assert deployment "{{range.items}}{{$id_field}}:{{end}}" 'nginx-deployment:' + kube::test::get_object_assert deployment "{{range.items}}{{$deployment_image_field}}:{{end}}" "${IMAGE_DEPLOYMENT_R1}:" + kube::test::get_object_assert deployment "{{range.items}}{{$deployment_second_image_field}}:{{end}}" "${IMAGE_PERL}:" + # Set the deployment's image + kubectl set image deployment nginx-deployment nginx="${IMAGE_DEPLOYMENT_R2}" "${kube_flags[@]}" + kube::test::get_object_assert deployment "{{range.items}}{{$deployment_image_field}}:{{end}}" "${IMAGE_DEPLOYMENT_R2}:" + kube::test::get_object_assert deployment "{{range.items}}{{$deployment_second_image_field}}:{{end}}" "${IMAGE_PERL}:" + # Set non-existing container should fail + ! kubectl set image deployment nginx-deployment redis=redis "${kube_flags[@]}" + # Set image of deployments without specifying name + kubectl set image deployments --all nginx="${IMAGE_DEPLOYMENT_R1}" "${kube_flags[@]}" + kube::test::get_object_assert deployment "{{range.items}}{{$deployment_image_field}}:{{end}}" "${IMAGE_DEPLOYMENT_R1}:" + kube::test::get_object_assert deployment "{{range.items}}{{$deployment_second_image_field}}:{{end}}" "${IMAGE_PERL}:" + # Set image of a deployment specified by file + kubectl set image -f hack/testdata/deployment-multicontainer.yaml nginx="${IMAGE_DEPLOYMENT_R2}" "${kube_flags[@]}" + kube::test::get_object_assert deployment "{{range.items}}{{$deployment_image_field}}:{{end}}" "${IMAGE_DEPLOYMENT_R2}:" + kube::test::get_object_assert deployment "{{range.items}}{{$deployment_second_image_field}}:{{end}}" "${IMAGE_PERL}:" + # Set image of a local file without talking to the server + kubectl set image -f hack/testdata/deployment-multicontainer.yaml nginx="${IMAGE_DEPLOYMENT_R1}" "${kube_flags[@]}" --local -o yaml + kube::test::get_object_assert deployment "{{range.items}}{{$deployment_image_field}}:{{end}}" "${IMAGE_DEPLOYMENT_R2}:" + kube::test::get_object_assert deployment "{{range.items}}{{$deployment_second_image_field}}:{{end}}" "${IMAGE_PERL}:" + # Set image of all containers of the deployment + kubectl set image deployment nginx-deployment "*"="${IMAGE_DEPLOYMENT_R1}" "${kube_flags[@]}" + kube::test::get_object_assert deployment "{{range.items}}{{$deployment_image_field}}:{{end}}" "${IMAGE_DEPLOYMENT_R1}:" + kube::test::get_object_assert deployment "{{range.items}}{{$deployment_second_image_field}}:{{end}}" "${IMAGE_DEPLOYMENT_R1}:" + # Clean up + kubectl delete deployment nginx-deployment "${kube_flags[@]}" + + + ###################### + # Replica Sets # + ###################### + + kube::log::status "Testing kubectl(${version}:replicasets)" + + ### Create and stop a replica set, make sure it doesn't leak pods + # Pre-condition: no replica set exists + kube::test::get_object_assert rs "{{range.items}}{{$id_field}}:{{end}}" '' + # Command + kubectl create -f hack/testdata/frontend-replicaset.yaml "${kube_flags[@]}" + kubectl delete rs frontend "${kube_flags[@]}" + # Post-condition: no pods from frontend replica set + kube::test::get_object_assert 'pods -l "tier=frontend"' "{{range.items}}{{$id_field}}:{{end}}" '' + + ### Create replica set frontend from YAML + # Pre-condition: no replica set exists + kube::test::get_object_assert rs "{{range.items}}{{$id_field}}:{{end}}" '' + # Command + kubectl create -f hack/testdata/frontend-replicaset.yaml "${kube_flags[@]}" + # Post-condition: frontend replica set is created + kube::test::get_object_assert rs "{{range.items}}{{$id_field}}:{{end}}" 'frontend:' + # Describe command should print detailed information + kube::test::describe_object_assert rs 'frontend' "Name:" "Image(s):" "Labels:" "Selector:" "Replicas:" "Pods Status:" + # Describe command should print events information by default + kube::test::describe_object_events_assert rs 'frontend' + # Describe command should not print events information when show-events=false + kube::test::describe_object_events_assert rs 'frontend' false + # Describe command should print events information when show-events=true + kube::test::describe_object_events_assert rs 'frontend' true + # Describe command (resource only) should print detailed information + kube::test::describe_resource_assert rs "Name:" "Name:" "Image(s):" "Labels:" "Selector:" "Replicas:" "Pods Status:" + # Describe command should print events information by default + kube::test::describe_resource_events_assert rs + # Describe command should not print events information when show-events=false + kube::test::describe_resource_events_assert rs false + # Describe command should print events information when show-events=true + kube::test::describe_resource_events_assert rs true + + ### Scale replica set frontend with current-replicas and replicas + # Pre-condition: 3 replicas + kube::test::get_object_assert 'rs frontend' "{{$rs_replicas_field}}" '3' + # Command + kubectl scale --current-replicas=3 --replicas=2 replicasets frontend "${kube_flags[@]}" + # Post-condition: 2 replicas + kube::test::get_object_assert 'rs frontend' "{{$rs_replicas_field}}" '2' + # Clean-up + kubectl delete rs frontend "${kube_flags[@]}" + + ### Expose replica set as service + kubectl create -f hack/testdata/frontend-replicaset.yaml "${kube_flags[@]}" + # Pre-condition: 3 replicas + kube::test::get_object_assert 'rs frontend' "{{$rs_replicas_field}}" '3' + # Command + kubectl expose rs frontend --port=80 "${kube_flags[@]}" + # Post-condition: service exists and the port is unnamed + kube::test::get_object_assert 'service frontend' "{{$port_name}} {{$port_field}}" ' 80' + # Create a service using service/v1 generator + kubectl expose rs frontend --port=80 --name=frontend-2 --generator=service/v1 "${kube_flags[@]}" + # Post-condition: service exists and the port is named default. + kube::test::get_object_assert 'service frontend-2' "{{$port_name}} {{$port_field}}" 'default 80' + # Cleanup services + kubectl delete service frontend{,-2} "${kube_flags[@]}" + + ### Delete replica set with id + # Pre-condition: frontend replica set exists + kube::test::get_object_assert rs "{{range.items}}{{$id_field}}:{{end}}" 'frontend:' + # Command + kubectl delete rs frontend "${kube_flags[@]}" + # Post-condition: no replica set exists + kube::test::get_object_assert rs "{{range.items}}{{$id_field}}:{{end}}" '' + + ### Create two replica sets + # Pre-condition: no replica set exists + kube::test::get_object_assert rs "{{range.items}}{{$id_field}}:{{end}}" '' + # Command + kubectl create -f hack/testdata/frontend-replicaset.yaml "${kube_flags[@]}" + kubectl create -f hack/testdata/redis-slave-replicaset.yaml "${kube_flags[@]}" + # Post-condition: frontend and redis-slave + kube::test::get_object_assert rs "{{range.items}}{{$id_field}}:{{end}}" 'frontend:redis-slave:' + + ### Delete multiple replica sets at once + # Pre-condition: frontend and redis-slave + kube::test::get_object_assert rs "{{range.items}}{{$id_field}}:{{end}}" 'frontend:redis-slave:' + # Command + kubectl delete rs frontend redis-slave "${kube_flags[@]}" # delete multiple replica sets at once + # Post-condition: no replica set exists + kube::test::get_object_assert rs "{{range.items}}{{$id_field}}:{{end}}" '' + + ### Auto scale replica set + # Pre-condition: no replica set exists + kube::test::get_object_assert rs "{{range.items}}{{$id_field}}:{{end}}" '' + # Command + kubectl create -f hack/testdata/frontend-replicaset.yaml "${kube_flags[@]}" + kube::test::get_object_assert rs "{{range.items}}{{$id_field}}:{{end}}" 'frontend:' + # autoscale 1~2 pods, CPU utilization 70%, replica set specified by file + kubectl autoscale -f hack/testdata/frontend-replicaset.yaml "${kube_flags[@]}" --max=2 --cpu-percent=70 + kube::test::get_object_assert 'hpa frontend' "{{$hpa_min_field}} {{$hpa_max_field}} {{$hpa_cpu_field}}" '1 2 70' + kubectl delete hpa frontend "${kube_flags[@]}" + # autoscale 2~3 pods, no CPU utilization specified, replica set specified by name + kubectl autoscale rs frontend "${kube_flags[@]}" --min=2 --max=3 + kube::test::get_object_assert 'hpa frontend' "{{$hpa_min_field}} {{$hpa_max_field}} {{$hpa_cpu_field}}" '2 3 ' + kubectl delete hpa frontend "${kube_flags[@]}" + # autoscale without specifying --max should fail + ! kubectl autoscale rs frontend "${kube_flags[@]}" + # Clean up + kubectl delete rs frontend "${kube_flags[@]}" + + + ###################### + # Lists # + ###################### + + kube::log::status "Testing kubectl(${version}:lists)" + + ### Create a List with objects from multiple versions + # Command + kubectl create -f hack/testdata/list.yaml "${kube_flags[@]}" + + ### Delete the List with objects from multiple versions + # Command + kubectl delete service/list-service-test deployment/list-deployment-test + + + ###################### + # Multiple Resources # + ###################### + + kube::log::status "Testing kubectl(${version}:multiple resources)" + + FILES="hack/testdata/multi-resource-yaml + hack/testdata/multi-resource-list + hack/testdata/multi-resource-json + hack/testdata/multi-resource-rclist + hack/testdata/multi-resource-svclist" + YAML=".yaml" + JSON=".json" + for file in $FILES; do + if [ -f $file$YAML ] + then + file=$file$YAML + replace_file="${file%.yaml}-modify.yaml" + else + file=$file$JSON + replace_file="${file%.json}-modify.json" + fi + + has_svc=true + has_rc=true + two_rcs=false + two_svcs=false + if [[ "${file}" == *rclist* ]]; then + has_svc=false + two_rcs=true + fi + if [[ "${file}" == *svclist* ]]; then + has_rc=false + two_svcs=true + fi + + ### Create, get, describe, replace, label, annotate, and then delete service nginxsvc and replication controller my-nginx from 5 types of files: + ### 1) YAML, separated by ---; 2) JSON, with a List type; 3) JSON, with JSON object concatenation + ### 4) JSON, with a ReplicationControllerList type; 5) JSON, with a ServiceList type + echo "Testing with file ${file} and replace with file ${replace_file}" + # Pre-condition: no service (other than default kubernetes services) or replication controller exists + kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:' + kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" '' + # Command + kubectl create -f "${file}" "${kube_flags[@]}" + # Post-condition: mock service (and mock2) exists + if [ "$has_svc" = true ]; then + if [ "$two_svcs" = true ]; then + kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:mock:mock2:' + else + kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:mock:' + fi + fi + # Post-condition: mock rc (and mock2) exists + if [ "$has_rc" = true ]; then + if [ "$two_rcs" = true ]; then + kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" 'mock:mock2:' + else + kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" 'mock:' + fi + fi + # Command + kubectl get -f "${file}" "${kube_flags[@]}" + # Command: watching multiple resources should return "not supported" error + WATCH_ERROR_FILE="${KUBE_TEMP}/kubectl-watch-error" + kubectl get -f "${file}" "${kube_flags[@]}" "--watch" 2> ${WATCH_ERROR_FILE} || true + if ! grep -q "watch is only supported on individual resources and resource collections" "${WATCH_ERROR_FILE}"; then + kube::log::error_exit "kubectl watch multiple resource returns unexpected error or non-error: $(cat ${WATCH_ERROR_FILE})" "1" + fi + kubectl describe -f "${file}" "${kube_flags[@]}" + # Command + kubectl replace -f $replace_file --force --cascade "${kube_flags[@]}" + # Post-condition: mock service (and mock2) and mock rc (and mock2) are replaced + if [ "$has_svc" = true ]; then + kube::test::get_object_assert 'services mock' "{{${labels_field}.status}}" 'replaced' + if [ "$two_svcs" = true ]; then + kube::test::get_object_assert 'services mock2' "{{${labels_field}.status}}" 'replaced' + fi + fi + if [ "$has_rc" = true ]; then + kube::test::get_object_assert 'rc mock' "{{${labels_field}.status}}" 'replaced' + if [ "$two_rcs" = true ]; then + kube::test::get_object_assert 'rc mock2' "{{${labels_field}.status}}" 'replaced' + fi + fi + # Command: kubectl edit multiple resources + temp_editor="${KUBE_TEMP}/tmp-editor.sh" + echo -e "#!/bin/bash\n$SED -i \"s/status\:\ replaced/status\:\ edited/g\" \$@" > "${temp_editor}" + chmod +x "${temp_editor}" + EDITOR="${temp_editor}" kubectl edit "${kube_flags[@]}" -f "${file}" + # Post-condition: mock service (and mock2) and mock rc (and mock2) are edited + if [ "$has_svc" = true ]; then + kube::test::get_object_assert 'services mock' "{{${labels_field}.status}}" 'edited' + if [ "$two_svcs" = true ]; then + kube::test::get_object_assert 'services mock2' "{{${labels_field}.status}}" 'edited' + fi + fi + if [ "$has_rc" = true ]; then + kube::test::get_object_assert 'rc mock' "{{${labels_field}.status}}" 'edited' + if [ "$two_rcs" = true ]; then + kube::test::get_object_assert 'rc mock2' "{{${labels_field}.status}}" 'edited' + fi + fi + # cleaning + rm "${temp_editor}" + # Command + # We need to set --overwrite, because otherwise, if the first attempt to run "kubectl label" + # fails on some, but not all, of the resources, retries will fail because it tries to modify + # existing labels. + kubectl-with-retry label -f $file labeled=true --overwrite "${kube_flags[@]}" + # Post-condition: mock service and mock rc (and mock2) are labeled + if [ "$has_svc" = true ]; then + kube::test::get_object_assert 'services mock' "{{${labels_field}.labeled}}" 'true' + if [ "$two_svcs" = true ]; then + kube::test::get_object_assert 'services mock2' "{{${labels_field}.labeled}}" 'true' + fi + fi + if [ "$has_rc" = true ]; then + kube::test::get_object_assert 'rc mock' "{{${labels_field}.labeled}}" 'true' + if [ "$two_rcs" = true ]; then + kube::test::get_object_assert 'rc mock2' "{{${labels_field}.labeled}}" 'true' + fi + fi + # Command + # Command + # We need to set --overwrite, because otherwise, if the first attempt to run "kubectl annotate" + # fails on some, but not all, of the resources, retries will fail because it tries to modify + # existing annotations. + kubectl-with-retry annotate -f $file annotated=true --overwrite "${kube_flags[@]}" + # Post-condition: mock service (and mock2) and mock rc (and mock2) are annotated + if [ "$has_svc" = true ]; then + kube::test::get_object_assert 'services mock' "{{${annotations_field}.annotated}}" 'true' + if [ "$two_svcs" = true ]; then + kube::test::get_object_assert 'services mock2' "{{${annotations_field}.annotated}}" 'true' + fi + fi + if [ "$has_rc" = true ]; then + kube::test::get_object_assert 'rc mock' "{{${annotations_field}.annotated}}" 'true' + if [ "$two_rcs" = true ]; then + kube::test::get_object_assert 'rc mock2' "{{${annotations_field}.annotated}}" 'true' + fi + fi + # Cleanup resources created + kubectl delete -f "${file}" "${kube_flags[@]}" + done + + ############################# + # Multiple Resources via URL# + ############################# + + # Pre-condition: no service (other than default kubernetes services) or replication controller exists + kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:' + kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" '' + + # Command + kubectl create -f https://raw.githubusercontent.com/kubernetes/kubernetes/master/hack/testdata/multi-resource-yaml.yaml "${kube_flags[@]}" + + # Post-condition: service(mock) and rc(mock) exist + kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:mock:' + kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" 'mock:' + + # Clean up + kubectl delete -f https://raw.githubusercontent.com/kubernetes/kubernetes/master/hack/testdata/multi-resource-yaml.yaml "${kube_flags[@]}" + + # Post-condition: no service (other than default kubernetes services) or replication controller exists + kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:' + kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" '' + + + ###################### + # Persistent Volumes # + ###################### + + ### Create and delete persistent volume examples + # Pre-condition: no persistent volumes currently exist + kube::test::get_object_assert pv "{{range.items}}{{$id_field}}:{{end}}" '' + # Command + kubectl create -f docs/user-guide/persistent-volumes/volumes/local-01.yaml "${kube_flags[@]}" + kube::test::get_object_assert pv "{{range.items}}{{$id_field}}:{{end}}" 'pv0001:' + kubectl delete pv pv0001 "${kube_flags[@]}" + kubectl create -f docs/user-guide/persistent-volumes/volumes/local-02.yaml "${kube_flags[@]}" + kube::test::get_object_assert pv "{{range.items}}{{$id_field}}:{{end}}" 'pv0002:' + kubectl delete pv pv0002 "${kube_flags[@]}" + kubectl create -f docs/user-guide/persistent-volumes/volumes/gce.yaml "${kube_flags[@]}" + kube::test::get_object_assert pv "{{range.items}}{{$id_field}}:{{end}}" 'pv0003:' + kubectl delete pv pv0003 "${kube_flags[@]}" + # Post-condition: no PVs + kube::test::get_object_assert pv "{{range.items}}{{$id_field}}:{{end}}" '' + + ############################ + # Persistent Volume Claims # + ############################ + + ### Create and delete persistent volume claim examples + # Pre-condition: no persistent volume claims currently exist + kube::test::get_object_assert pvc "{{range.items}}{{$id_field}}:{{end}}" '' + # Command + kubectl create -f docs/user-guide/persistent-volumes/claims/claim-01.yaml "${kube_flags[@]}" + kube::test::get_object_assert pvc "{{range.items}}{{$id_field}}:{{end}}" 'myclaim-1:' + kubectl delete pvc myclaim-1 "${kube_flags[@]}" + + kubectl create -f docs/user-guide/persistent-volumes/claims/claim-02.yaml "${kube_flags[@]}" + kube::test::get_object_assert pvc "{{range.items}}{{$id_field}}:{{end}}" 'myclaim-2:' + kubectl delete pvc myclaim-2 "${kube_flags[@]}" + + kubectl create -f docs/user-guide/persistent-volumes/claims/claim-03.json "${kube_flags[@]}" + kube::test::get_object_assert pvc "{{range.items}}{{$id_field}}:{{end}}" 'myclaim-3:' + kubectl delete pvc myclaim-3 "${kube_flags[@]}" + # Post-condition: no PVCs + kube::test::get_object_assert pvc "{{range.items}}{{$id_field}}:{{end}}" '' + + + + ######### + # Nodes # + ######### + + kube::log::status "Testing kubectl(${version}:nodes)" + + kube::test::get_object_assert nodes "{{range.items}}{{$id_field}}:{{end}}" '127.0.0.1:' + + kube::test::describe_object_assert nodes "127.0.0.1" "Name:" "Labels:" "CreationTimestamp:" "Conditions:" "Addresses:" "Capacity:" "Pods:" + # Describe command should print events information by default + kube::test::describe_object_events_assert nodes "127.0.0.1" + # Describe command should not print events information when show-events=false + kube::test::describe_object_events_assert nodes "127.0.0.1" false + # Describe command should print events information when show-events=true + kube::test::describe_object_events_assert nodes "127.0.0.1" true + # Describe command (resource only) should print detailed information + kube::test::describe_resource_assert nodes "Name:" "Labels:" "CreationTimestamp:" "Conditions:" "Addresses:" "Capacity:" "Pods:" + # Describe command should print events information by default + kube::test::describe_resource_events_assert nodes + # Describe command should not print events information when show-events=false + kube::test::describe_resource_events_assert nodes false + # Describe command should print events information when show-events=true + kube::test::describe_resource_events_assert nodes true + + ### kubectl patch update can mark node unschedulable + # Pre-condition: node is schedulable + kube::test::get_object_assert "nodes 127.0.0.1" "{{.spec.unschedulable}}" '' + kubectl patch "${kube_flags[@]}" nodes "127.0.0.1" -p='{"spec":{"unschedulable":true}}' + # Post-condition: node is unschedulable + kube::test::get_object_assert "nodes 127.0.0.1" "{{.spec.unschedulable}}" 'true' + kubectl patch "${kube_flags[@]}" nodes "127.0.0.1" -p='{"spec":{"unschedulable":null}}' + # Post-condition: node is schedulable + kube::test::get_object_assert "nodes 127.0.0.1" "{{.spec.unschedulable}}" '' + + + ##################### + # Retrieve multiple # + ##################### + + kube::log::status "Testing kubectl(${version}:multiget)" + kube::test::get_object_assert 'nodes/127.0.0.1 service/kubernetes' "{{range.items}}{{$id_field}}:{{end}}" '127.0.0.1:kubernetes:' + + + ##################### + # Resource aliasing # + ##################### + + kube::log::status "Testing resource aliasing" + kubectl create -f examples/storage/cassandra/cassandra-controller.yaml "${kube_flags[@]}" + kubectl create -f examples/storage/cassandra/cassandra-service.yaml "${kube_flags[@]}" + + object="all -l'app=cassandra'" + request="{{range.items}}{{range .metadata.labels}}{{.}}:{{end}}{{end}}" + + # all 4 cassandra's might not be in the request immediately... + kube::test::get_object_assert "$object" "$request" 'cassandra:cassandra:cassandra:cassandra:' || \ + kube::test::get_object_assert "$object" "$request" 'cassandra:cassandra:cassandra:' || \ + kube::test::get_object_assert "$object" "$request" 'cassandra:cassandra:' + + kubectl delete all -l app=cassandra "${kube_flags[@]}" + + ########### + # Explain # + ########### + + kube::log::status "Testing kubectl(${version}:explain)" + kubectl explain pods + # shortcuts work + kubectl explain po + kubectl explain po.status.message + + + ########### + # Swagger # + ########### + + if [[ -n "${version}" ]]; then + # Verify schema + file="${KUBE_TEMP}/schema-${version}.json" + curl -s "http://127.0.0.1:${API_PORT}/swaggerapi/api/${version}" > "${file}" + [[ "$(grep "list of returned" "${file}")" ]] + [[ "$(grep "List of pods" "${file}")" ]] + [[ "$(grep "Watch for changes to the described resources" "${file}")" ]] + fi + + ##################### + # Kubectl --sort-by # + ##################### + + ### sort-by should not panic if no pod exists + # Pre-condition: no POD exists + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' + # Command + kubectl get pods --sort-by="{metadata.name}" + kubectl get pods --sort-by="{metadata.creationTimestamp}" + + ############################ + # Kubectl --all-namespaces # + ############################ + + # Pre-condition: the "default" namespace exists + kube::test::get_object_assert namespaces "{{range.items}}{{if eq $id_field \\\"default\\\"}}{{$id_field}}:{{end}}{{end}}" 'default:' + + ### Create POD + # Pre-condition: no POD exists + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' + # Command + kubectl create "${kube_flags[@]}" -f docs/admin/limitrange/valid-pod.yaml + # Post-condition: valid-pod is created + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' + + ### Verify a specific namespace is ignored when all-namespaces is provided + # Command + kubectl get pods --all-namespaces --namespace=default + + ### Clean up + # Pre-condition: valid-pod exists + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' + # Command + kubectl delete "${kube_flags[@]}" pod valid-pod --grace-period=0 + # Post-condition: valid-pod doesn't exist + kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' + + kube::test::clear_all +} + +runTests "v1" + +kube::log::status "TEST PASSED" diff --git a/hack/make-rules/test-e2e-node.sh b/hack/make-rules/test-e2e-node.sh new file mode 100755 index 00000000000..147e1ce7186 --- /dev/null +++ b/hack/make-rules/test-e2e-node.sh @@ -0,0 +1,134 @@ +#!/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 diff --git a/hack/make-rules/test-integration.sh b/hack/make-rules/test-integration.sh new file mode 100755 index 00000000000..f594ef99afc --- /dev/null +++ b/hack/make-rules/test-integration.sh @@ -0,0 +1,94 @@ +#!/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 diff --git a/hack/make-rules/test.sh b/hack/make-rules/test.sh new file mode 100755 index 00000000000..28a412ddfee --- /dev/null +++ b/hack/make-rules/test.sh @@ -0,0 +1,282 @@ +#!/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" + +kube::golang::setup_env + +kube::test::find_dirs() { + ( + cd ${KUBE_ROOT} + find . -not \( \ + \( \ + -path './_artifacts/*' \ + -o -path './_output/*' \ + -o -path './_gopath/*' \ + -o -path './contrib/podex/*' \ + -o -path './output/*' \ + -o -path './release/*' \ + -o -path './target/*' \ + -o -path './test/e2e/*' \ + -o -path './test/e2e_node/*' \ + -o -path './test/integration/*' \ + -o -path './test/component/scheduler/perf/*' \ + -o -path './third_party/*'\ + -o -path './vendor/*'\ + \) -prune \ + \) -name '*_test.go' -print0 | xargs -0n1 dirname | sed 's|^\./||' | sort -u + ) +} + +KUBE_TIMEOUT=${KUBE_TIMEOUT:--timeout 120s} +KUBE_COVER=${KUBE_COVER:-n} # set to 'y' to enable coverage collection +KUBE_COVERMODE=${KUBE_COVERMODE:-atomic} +# How many 'go test' instances to run simultaneously when running tests in +# coverage mode. +KUBE_COVERPROCS=${KUBE_COVERPROCS:-4} +KUBE_RACE=${KUBE_RACE:-} # use KUBE_RACE="-race" to enable race testing +# Set to the goveralls binary path to report coverage results to Coveralls.io. +KUBE_GOVERALLS_BIN=${KUBE_GOVERALLS_BIN:-} +# 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" +# 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,batch/v2alpha1,extensions/v1beta1,apps/v1alpha1,federation/v1beta1,policy/v1alpha1,rbac.authorization.k8s.io/v1alpha1,certificates/v1alpha1"} +# once we have multiple group supports +# Create a junit-style XML test report in this directory if set. +KUBE_JUNIT_REPORT_DIR=${KUBE_JUNIT_REPORT_DIR:-} +# Set to 'y' to keep the verbose stdout from tests when KUBE_JUNIT_REPORT_DIR is +# set. +KUBE_KEEP_VERBOSE_TEST_OUTPUT=${KUBE_KEEP_VERBOSE_TEST_OUTPUT:-n} + +kube::test::usage() { + kube::log::usage_from_stdin < : number of parallel workers, must be >= 1 +EOF +} + +isnum() { + [[ "$1" =~ ^[0-9]+$ ]] +} + +PARALLEL="${PARALLEL:-1}" +while getopts "hp:i:" opt ; do + case $opt in + h) + kube::test::usage + exit 0 + ;; + p) + PARALLEL="$OPTARG" + if ! isnum "${PARALLEL}" || [[ "${PARALLEL}" -le 0 ]]; then + kube::log::usage "'$0': argument to -p must be numeric and greater than 0" + kube::test::usage + exit 1 + fi + ;; + i) + kube::log::usage "'$0': use GOFLAGS='-count '" + kube::test::usage + exit 1 + ;; + ?) + kube::test::usage + exit 1 + ;; + :) + kube::log::usage "Option -$OPTARG " + kube::test::usage + exit 1 + ;; + esac +done +shift $((OPTIND - 1)) + +# Use eval to preserve embedded quoted strings. +eval "goflags=(${KUBE_GOFLAGS:-})" +eval "testargs=(${KUBE_TEST_ARGS:-})" + +# Used to filter verbose test output. +go_test_grep_pattern=".*" + +# The go-junit-report tool needs full test case information to produce a +# meaningful report. +if [[ -n "${KUBE_JUNIT_REPORT_DIR}" ]] ; then + goflags+=(-v) + # Show only summary lines by matching lines like "status package/test" + go_test_grep_pattern="^[^[:space:]]\+[[:space:]]\+[^[:space:]]\+/[^[[:space:]]\+" +fi + +# Filter out arguments that start with "-" and move them to goflags. +testcases=() +for arg; do + if [[ "${arg}" == -* ]]; then + goflags+=("${arg}") + else + testcases+=("${arg}") + fi +done +if [[ ${#testcases[@]} -eq 0 ]]; then + testcases=($(kube::test::find_dirs)) +fi +set -- "${testcases[@]+${testcases[@]}}" + +junitFilenamePrefix() { + if [[ -z "${KUBE_JUNIT_REPORT_DIR}" ]]; then + echo "" + return + fi + mkdir -p "${KUBE_JUNIT_REPORT_DIR}" + local KUBE_TEST_API_NO_SLASH="${KUBE_TEST_API//\//-}" + echo "${KUBE_JUNIT_REPORT_DIR}/junit_${KUBE_TEST_API_NO_SLASH}_$(kube::util::sortable_date)" +} + +produceJUnitXMLReport() { + local -r junit_filename_prefix=$1 + if [[ -z "${junit_filename_prefix}" ]]; then + return + fi + + local test_stdout_filenames + local junit_xml_filename + test_stdout_filenames=$(ls ${junit_filename_prefix}*.stdout) + junit_xml_filename="${junit_filename_prefix}.xml" + if ! command -v go-junit-report >/dev/null 2>&1; then + kube::log::error "go-junit-report not found; please install with " \ + "go get -u github.com/jstemmer/go-junit-report" + return + fi + cat ${test_stdout_filenames} | go-junit-report > "${junit_xml_filename}" + if [[ ! ${KUBE_KEEP_VERBOSE_TEST_OUTPUT} =~ ^[yY]$ ]]; then + rm ${test_stdout_filenames} + fi + kube::log::status "Saved JUnit XML test report to ${junit_xml_filename}" +} + +runTests() { + local junit_filename_prefix + junit_filename_prefix=$(junitFilenamePrefix) + + # If we're not collecting coverage, run all requested tests with one 'go test' + # command, which is much faster. + if [[ ! ${KUBE_COVER} =~ ^[yY]$ ]]; then + kube::log::status "Running tests without code coverage" + go test "${goflags[@]:+${goflags[@]}}" \ + ${KUBE_RACE} ${KUBE_TIMEOUT} "${@+${@/#/${KUBE_GO_PACKAGE}/}}" \ + "${testargs[@]:+${testargs[@]}}" \ + | tee ${junit_filename_prefix:+"${junit_filename_prefix}.stdout"} \ + | grep "${go_test_grep_pattern}" && rc=$? || rc=$? + produceJUnitXMLReport "${junit_filename_prefix}" + return ${rc} + fi + + # Create coverage report directories. + cover_report_dir="/tmp/k8s_coverage/${KUBE_TEST_API}/$(kube::util::sortable_date)" + cover_profile="coverage.out" # Name for each individual coverage profile + kube::log::status "Saving coverage output in '${cover_report_dir}'" + mkdir -p "${@+${@/#/${cover_report_dir}/}}" + + # Run all specified tests, collecting coverage results. Go currently doesn't + # support collecting coverage across multiple packages at once, so we must issue + # separate 'go test' commands for each package and then combine at the end. + # To speed things up considerably, we can at least use xargs -P to run multiple + # 'go test' commands at once. + # To properly parse the test results if generating a JUnit test report, we + # must make sure the output from PARALLEL runs is not mixed. To achieve this, + # we spawn a subshell for each PARALLEL process, redirecting the output to + # separate files. + # cmd/libs/go2idl/generator is fragile when run under coverage, so ignore it for now. + # see: https://github.com/kubernetes/kubernetes/issues/24967 + printf "%s\n" "${@}" | grep -v "cmd/libs/go2idl/generator"| xargs -I{} -n1 -P${KUBE_COVERPROCS} \ + bash -c "set -o pipefail; _pkg=\"{}\"; _pkg_out=\${_pkg//\//_}; \ + go test ${goflags[@]:+${goflags[@]}} \ + ${KUBE_RACE} \ + ${KUBE_TIMEOUT} \ + -cover -covermode=\"${KUBE_COVERMODE}\" \ + -coverprofile=\"${cover_report_dir}/\${_pkg}/${cover_profile}\" \ + \"${KUBE_GO_PACKAGE}/\${_pkg}\" \ + ${testargs[@]:+${testargs[@]}} \ + | tee ${junit_filename_prefix:+\"${junit_filename_prefix}-\$_pkg_out.stdout\"} \ + | grep \"${go_test_grep_pattern}\"" \ + && test_result=$? || test_result=$? + + produceJUnitXMLReport "${junit_filename_prefix}" + + COMBINED_COVER_PROFILE="${cover_report_dir}/combined-coverage.out" + { + # The combined coverage profile needs to start with a line indicating which + # coverage mode was used (set, count, or atomic). This line is included in + # each of the coverage profiles generated when running 'go test -cover', but + # we strip these lines out when combining so that there's only one. + echo "mode: ${KUBE_COVERMODE}" + + # Include all coverage reach data in the combined profile, but exclude the + # 'mode' lines, as there should be only one. + for x in `find "${cover_report_dir}" -name "${cover_profile}"`; do + cat $x | grep -h -v "^mode:" || true + done + } >"${COMBINED_COVER_PROFILE}" + + coverage_html_file="${cover_report_dir}/combined-coverage.html" + go tool cover -html="${COMBINED_COVER_PROFILE}" -o="${coverage_html_file}" + kube::log::status "Combined coverage report: ${coverage_html_file}" + + return ${test_result} +} + +reportCoverageToCoveralls() { + if [[ ${KUBE_COVER} =~ ^[yY]$ ]] && [[ -x "${KUBE_GOVERALLS_BIN}" ]]; then + kube::log::status "Reporting coverage results to Coveralls for service ${CI_NAME:-}" + ${KUBE_GOVERALLS_BIN} -coverprofile="${COMBINED_COVER_PROFILE}" \ + ${CI_NAME:+"-service=${CI_NAME}"} \ + ${COVERALLS_REPO_TOKEN:+"-repotoken=${COVERALLS_REPO_TOKEN}"} \ + || true + fi +} + +checkFDs() { + # several unittests panic when httptest cannot open more sockets + # due to the low default files limit on OS X. Warn about low limit. + local fileslimit="$(ulimit -n)" + if [[ $fileslimit -lt 1000 ]]; then + echo "WARNING: ulimit -n (files) should be at least 1000, is $fileslimit, may cause test failure"; + fi +} + +checkFDs + +# Convert the CSVs to arrays. +IFS=';' read -a apiVersions <<< "${KUBE_TEST_API_VERSIONS}" +apiVersionsCount=${#apiVersions[@]} +for (( i=0; i<${apiVersionsCount}; i++ )); do + apiVersion=${apiVersions[i]} + echo "Running tests for APIVersion: $apiVersion" + # KUBE_TEST_API sets the version of each group to be tested. + KUBE_TEST_API="${apiVersion}" runTests "$@" +done + +# We might run the tests for multiple versions, but we want to report only +# one of them to coveralls. Here we report coverage from the last run. +reportCoverageToCoveralls diff --git a/hack/make-rules/verify.sh b/hack/make-rules/verify.sh new file mode 100755 index 00000000000..a1b138128e9 --- /dev/null +++ b/hack/make-rules/verify.sh @@ -0,0 +1,99 @@ +#!/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 diff --git a/hack/make-rules/vet.sh b/hack/make-rules/vet.sh new file mode 100755 index 00000000000..2c0c329fd8e --- /dev/null +++ b/hack/make-rules/vet.sh @@ -0,0 +1,48 @@ +#!/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. +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[@]} diff --git a/hack/test-cmd.sh b/hack/test-cmd.sh index b51705eaa7d..f4e5abeb0af 100755 --- a/hack/test-cmd.sh +++ b/hack/test-cmd.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2014 The Kubernetes Authors. +# 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. @@ -14,2357 +14,24 @@ # See the License for the specific language governing permissions and # limitations under the License. -# This command checks that the built commands can function together for -# simple scenarios. It does not require Docker. +# This script is a vestigial redirection. Please do not add "real" logic. set -o errexit set -o nounset set -o pipefail KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. -source "${KUBE_ROOT}/hack/lib/init.sh" -source "${KUBE_ROOT}/hack/lib/test.sh" -# Stops the running kubectl proxy, if there is one. -function stop-proxy() -{ - [[ -n "${PROXY_PORT-}" ]] && kube::log::status "Stopping proxy on port ${PROXY_PORT}" - [[ -n "${PROXY_PID-}" ]] && kill "${PROXY_PID}" 1>&2 2>/dev/null - [[ -n "${PROXY_PORT_FILE-}" ]] && rm -f ${PROXY_PORT_FILE} - PROXY_PID= - PROXY_PORT= - PROXY_PORT_FILE= -} - -# Starts "kubect proxy" to test the client proxy. $1: api_prefix -function start-proxy() -{ - stop-proxy - - PROXY_PORT_FILE=$(mktemp proxy-port.out.XXXXX) - kube::log::status "Starting kubectl proxy on random port; output file in ${PROXY_PORT_FILE}; args: ${1-}" - - - if [ $# -eq 0 ]; then - kubectl proxy --port=0 --www=. 1>${PROXY_PORT_FILE} 2>&1 & - else - kubectl proxy --port=0 --www=. --api-prefix="$1" 1>${PROXY_PORT_FILE} 2>&1 & - fi - PROXY_PID=$! - PROXY_PORT= - - local attempts=0 - while [[ -z ${PROXY_PORT} ]]; do - if (( ${attempts} > 9 )); then - kill "${PROXY_PID}" - kube::log::error_exit "Couldn't start proxy. Failed to read port after ${attempts} tries. Got: $(cat ${PROXY_PORT_FILE})" - fi - sleep .5 - kube::log::status "Attempt ${attempts} to read ${PROXY_PORT_FILE}..." - PROXY_PORT=$(sed 's/.*Starting to serve on 127.0.0.1:\([0-9]*\)$/\1/'< ${PROXY_PORT_FILE}) - attempts=$((attempts+1)) - done - - kube::log::status "kubectl proxy running on port ${PROXY_PORT}" - - # We try checking kubectl proxy 30 times with 1s delays to avoid occasional - # failures. - if [ $# -eq 0 ]; then - kube::util::wait_for_url "http://127.0.0.1:${PROXY_PORT}/healthz" "kubectl proxy" - else - kube::util::wait_for_url "http://127.0.0.1:${PROXY_PORT}/$1/healthz" "kubectl proxy --api-prefix=$1" - fi -} - -function cleanup() -{ - [[ -n "${APISERVER_PID-}" ]] && kill "${APISERVER_PID}" 1>&2 2>/dev/null - [[ -n "${CTLRMGR_PID-}" ]] && kill "${CTLRMGR_PID}" 1>&2 2>/dev/null - [[ -n "${KUBELET_PID-}" ]] && kill "${KUBELET_PID}" 1>&2 2>/dev/null - stop-proxy - - kube::etcd::cleanup - rm -rf "${KUBE_TEMP}" - - kube::log::status "Clean up complete" -} - -# Executes curl against the proxy. $1 is the path to use, $2 is the desired -# return code. Prints a helpful message on failure. -function check-curl-proxy-code() -{ - local status - local -r address=$1 - local -r desired=$2 - local -r full_address="${PROXY_HOST}:${PROXY_PORT}${address}" - status=$(curl -w "%{http_code}" --silent --output /dev/null "${full_address}") - if [ "${status}" == "${desired}" ]; then - return 0 - fi - echo "For address ${full_address}, got ${status} but wanted ${desired}" - return 1 -} - -# TODO: Remove this function when we do the retry inside the kubectl commands. See #15333. -function kubectl-with-retry() -{ - ERROR_FILE="${KUBE_TEMP}/kubectl-error" - preserve_err_file=${PRESERVE_ERR_FILE-false} - for count in $(seq 0 3); do - kubectl "$@" 2> ${ERROR_FILE} || true - if grep -q "the object has been modified" "${ERROR_FILE}"; then - kube::log::status "retry $1, error: $(cat ${ERROR_FILE})" - rm "${ERROR_FILE}" - sleep $((2**count)) - else - if [ "$preserve_err_file" != true ] ; then - rm "${ERROR_FILE}" - fi - break - fi - done -} - -kube::util::trap_add cleanup EXIT SIGINT -kube::util::ensure-temp-dir - -"${KUBE_ROOT}/hack/build-go.sh" \ - cmd/kubectl \ - cmd/kube-apiserver \ - cmd/kube-controller-manager - -kube::etcd::start - -ETCD_HOST=${ETCD_HOST:-127.0.0.1} -ETCD_PORT=${ETCD_PORT:-4001} -API_PORT=${API_PORT:-8080} -API_HOST=${API_HOST:-127.0.0.1} -KUBELET_PORT=${KUBELET_PORT:-10250} -KUBELET_HEALTHZ_PORT=${KUBELET_HEALTHZ_PORT:-10248} -CTLRMGR_PORT=${CTLRMGR_PORT:-10252} -PROXY_HOST=127.0.0.1 # kubectl only serves on localhost. - -IMAGE_NGINX="gcr.io/google-containers/nginx:1.7.9" -IMAGE_DEPLOYMENT_R1="gcr.io/google-containers/nginx:test-cmd" # deployment-revision1.yaml -IMAGE_DEPLOYMENT_R2="$IMAGE_NGINX" # deployment-revision2.yaml -IMAGE_PERL="gcr.io/google-containers/perl" - -# ensure ~/.kube/config isn't loaded by tests -HOME="${KUBE_TEMP}" - -# Find a standard sed instance for use with edit scripts -SED=sed -if which gsed &>/dev/null; then - SED=gsed -fi -if ! ($SED --version 2>&1 | grep -q GNU); then - echo "!!! GNU sed is required. If on OS X, use 'brew install gnu-sed'." - exit 1 +# For help output +ARGHELP="" +if [[ "$#" -gt 0 ]]; then + ARGHELP="" fi -# Check kubectl -kube::log::status "Running kubectl with no options" -"${KUBE_OUTPUT_HOSTBIN}/kubectl" - -# Only run kubelet on platforms it supports -if [[ "$(go env GOHOSTOS)" == "linux" ]]; then - -"${KUBE_ROOT}/hack/build-go.sh" \ - cmd/kubelet - -kube::log::status "Starting kubelet in masterless mode" -"${KUBE_OUTPUT_HOSTBIN}/kubelet" \ - --really-crash-for-testing=true \ - --root-dir=/tmp/kubelet.$$ \ - --cert-dir="${TMPDIR:-/tmp/}" \ - --docker-endpoint="fake://" \ - --hostname-override="127.0.0.1" \ - --address="127.0.0.1" \ - --port="$KUBELET_PORT" \ - --healthz-port="${KUBELET_HEALTHZ_PORT}" 1>&2 & -KUBELET_PID=$! -kube::util::wait_for_url "http://127.0.0.1:${KUBELET_HEALTHZ_PORT}/healthz" "kubelet(masterless)" -kill ${KUBELET_PID} 1>&2 2>/dev/null - -kube::log::status "Starting kubelet in masterful mode" -"${KUBE_OUTPUT_HOSTBIN}/kubelet" \ - --really-crash-for-testing=true \ - --root-dir=/tmp/kubelet.$$ \ - --cert-dir="${TMPDIR:-/tmp/}" \ - --docker-endpoint="fake://" \ - --hostname-override="127.0.0.1" \ - --address="127.0.0.1" \ - --api-servers="${API_HOST}:${API_PORT}" \ - --port="$KUBELET_PORT" \ - --healthz-port="${KUBELET_HEALTHZ_PORT}" 1>&2 & -KUBELET_PID=$! - -kube::util::wait_for_url "http://127.0.0.1:${KUBELET_HEALTHZ_PORT}/healthz" "kubelet" - -fi - -# Start kube-apiserver -kube::log::status "Starting kube-apiserver" - -# Admission Controllers to invoke prior to persisting objects in cluster -ADMISSION_CONTROL="NamespaceLifecycle,LimitRanger,ResourceQuota" - -"${KUBE_OUTPUT_HOSTBIN}/kube-apiserver" \ - --address="127.0.0.1" \ - --public-address-override="127.0.0.1" \ - --port="${API_PORT}" \ - --admission-control="${ADMISSION_CONTROL}" \ - --etcd-servers="http://${ETCD_HOST}:${ETCD_PORT}" \ - --public-address-override="127.0.0.1" \ - --kubelet-port=${KUBELET_PORT} \ - --runtime-config=api/v1 \ - --storage-media-type="${KUBE_TEST_API_STORAGE_TYPE-}" \ - --cert-dir="${TMPDIR:-/tmp/}" \ - --service-cluster-ip-range="10.0.0.0/24" 1>&2 & -APISERVER_PID=$! - -kube::util::wait_for_url "http://127.0.0.1:${API_PORT}/healthz" "apiserver" - -# Start controller manager -kube::log::status "Starting controller-manager" -"${KUBE_OUTPUT_HOSTBIN}/kube-controller-manager" \ - --port="${CTLRMGR_PORT}" \ - --kube-api-content-type="${KUBE_TEST_API_TYPE-}" \ - --master="127.0.0.1:${API_PORT}" 1>&2 & -CTLRMGR_PID=$! - -kube::util::wait_for_url "http://127.0.0.1:${CTLRMGR_PORT}/healthz" "controller-manager" - -if [[ "$(go env GOHOSTOS)" == "linux" ]]; then - kube::util::wait_for_url "http://127.0.0.1:${API_PORT}/api/v1/nodes/127.0.0.1" "apiserver(nodes)" -else - # create a fake node - kubectl create -f - -s "http://127.0.0.1:${API_PORT}" << __EOF__ -{ - "kind": "Node", - "apiVersion": "v1", - "metadata": { - "name": "127.0.0.1" - }, - "status": { - "capacity": { - "memory": "1Gi" - } - } -} -__EOF__ -fi - -# Expose kubectl directly for readability -PATH="${KUBE_OUTPUT_HOSTBIN}":$PATH - -kube::log::status "Checking kubectl version" -kubectl version - -# TODO: we need to note down the current default namespace and set back to this -# namespace after the tests are done. -kubectl config view -CONTEXT="test" -kubectl config set-context "${CONTEXT}" -kubectl config use-context "${CONTEXT}" - -i=0 -create_and_use_new_namespace() { - i=$(($i+1)) - kubectl create namespace "namespace${i}" - kubectl config set-context "${CONTEXT}" --namespace="namespace${i}" -} - -runTests() { - version="$1" - echo "Testing api version: $1" - if [[ -z "${version}" ]]; then - kube_flags=( - -s "http://127.0.0.1:${API_PORT}" - --match-server-version - ) - [ "$(kubectl get nodes -o go-template='{{ .apiVersion }}' "${kube_flags[@]}")" == "v1" ] - else - kube_flags=( - -s "http://127.0.0.1:${API_PORT}" - --match-server-version - ) - [ "$(kubectl get nodes -o go-template='{{ .apiVersion }}' "${kube_flags[@]}")" == "${version}" ] - fi - id_field=".metadata.name" - labels_field=".metadata.labels" - annotations_field=".metadata.annotations" - service_selector_field=".spec.selector" - rc_replicas_field=".spec.replicas" - rc_status_replicas_field=".status.replicas" - rc_container_image_field=".spec.template.spec.containers" - rs_replicas_field=".spec.replicas" - port_field="(index .spec.ports 0).port" - port_name="(index .spec.ports 0).name" - second_port_field="(index .spec.ports 1).port" - second_port_name="(index .spec.ports 1).name" - image_field="(index .spec.containers 0).image" - hpa_min_field=".spec.minReplicas" - hpa_max_field=".spec.maxReplicas" - hpa_cpu_field=".spec.targetCPUUtilizationPercentage" - job_parallelism_field=".spec.parallelism" - deployment_replicas=".spec.replicas" - secret_data=".data" - secret_type=".type" - deployment_image_field="(index .spec.template.spec.containers 0).image" - deployment_second_image_field="(index .spec.template.spec.containers 1).image" - change_cause_annotation='.*kubernetes.io/change-cause.*' - - # Passing no arguments to create is an error - ! kubectl create - - ####################### - # kubectl config set # - ####################### - - kube::log::status "Testing kubectl(${version}:config set)" - - kubectl config set-cluster test-cluster --server="https://does-not-work" - - # Get the api cert and add a comment to avoid flag parsing problems - cert_data=$(echo "#Comment" && cat "${TMPDIR:-/tmp}/apiserver.crt") - - kubectl config set clusters.test-cluster.certificate-authority-data "$cert_data" --set-raw-bytes - r_writen=$(kubectl config view --raw -o jsonpath='{.clusters[?(@.name == "test-cluster")].cluster.certificate-authority-data}') - - encoded=$(echo -n "$cert_data" | base64) - kubectl config set clusters.test-cluster.certificate-authority-data "$encoded" - e_writen=$(kubectl config view --raw -o jsonpath='{.clusters[?(@.name == "test-cluster")].cluster.certificate-authority-data}') - - test "$e_writen" == "$r_writen" - - ####################### - # kubectl local proxy # - ####################### - - # Make sure the UI can be proxied - start-proxy - check-curl-proxy-code /ui 301 - check-curl-proxy-code /metrics 200 - check-curl-proxy-code /api/ui 404 - if [[ -n "${version}" ]]; then - check-curl-proxy-code /api/${version}/namespaces 200 - fi - check-curl-proxy-code /static/ 200 - stop-proxy - - # Make sure the in-development api is accessible by default - start-proxy - check-curl-proxy-code /apis 200 - check-curl-proxy-code /apis/extensions/ 200 - stop-proxy - - # Custom paths let you see everything. - start-proxy /custom - check-curl-proxy-code /custom/ui 301 - check-curl-proxy-code /custom/metrics 200 - if [[ -n "${version}" ]]; then - check-curl-proxy-code /custom/api/${version}/namespaces 200 - fi - stop-proxy - - ######################### - # RESTMapper evaluation # - ######################### - - kube::log::status "Testing RESTMapper" - - RESTMAPPER_ERROR_FILE="${KUBE_TEMP}/restmapper-error" - - ### Non-existent resource type should give a recognizeable error - # Pre-condition: None - # Command - kubectl get "${kube_flags[@]}" unknownresourcetype 2>${RESTMAPPER_ERROR_FILE} || true - if grep -q "the server doesn't have a resource type" "${RESTMAPPER_ERROR_FILE}"; then - kube::log::status "\"kubectl get unknownresourcetype\" returns error as expected: $(cat ${RESTMAPPER_ERROR_FILE})" - else - kube::log::status "\"kubectl get unknownresourcetype\" returns unexpected error or non-error: $(cat ${RESTMAPPER_ERROR_FILE})" - exit 1 - fi - rm "${RESTMAPPER_ERROR_FILE}" - # Post-condition: None - - ########################### - # POD creation / deletion # - ########################### - - kube::log::status "Testing kubectl(${version}:pods)" - - ### Create POD valid-pod from JSON - # Pre-condition: no POD exists - create_and_use_new_namespace - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' - # Command - kubectl create "${kube_flags[@]}" -f docs/admin/limitrange/valid-pod.yaml - # Post-condition: valid-pod POD is created - kubectl get "${kube_flags[@]}" pods -o json - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' - kube::test::get_object_assert 'pod valid-pod' "{{$id_field}}" 'valid-pod' - kube::test::get_object_assert 'pod/valid-pod' "{{$id_field}}" 'valid-pod' - kube::test::get_object_assert 'pods/valid-pod' "{{$id_field}}" 'valid-pod' - # Repeat above test using jsonpath template - kube::test::get_object_jsonpath_assert pods "{.items[*]$id_field}" 'valid-pod' - kube::test::get_object_jsonpath_assert 'pod valid-pod' "{$id_field}" 'valid-pod' - kube::test::get_object_jsonpath_assert 'pod/valid-pod' "{$id_field}" 'valid-pod' - kube::test::get_object_jsonpath_assert 'pods/valid-pod' "{$id_field}" 'valid-pod' - # Describe command should print detailed information - kube::test::describe_object_assert pods 'valid-pod' "Name:" "Image:" "Node:" "Labels:" "Status:" "Controllers" - # Describe command should print events information by default - kube::test::describe_object_events_assert pods 'valid-pod' - # Describe command should not print events information when show-events=false - kube::test::describe_object_events_assert pods 'valid-pod' false - # Describe command should print events information when show-events=true - kube::test::describe_object_events_assert pods 'valid-pod' true - # Describe command (resource only) should print detailed information - kube::test::describe_resource_assert pods "Name:" "Image:" "Node:" "Labels:" "Status:" "Controllers" - - # Describe command should print events information by default - kube::test::describe_resource_events_assert pods - # Describe command should not print events information when show-events=false - kube::test::describe_resource_events_assert pods false - # Describe command should print events information when show-events=true - kube::test::describe_resource_events_assert pods true - ### Validate Export ### - kube::test::get_object_assert 'pods/valid-pod' "{{.metadata.namespace}} {{.metadata.name}}" ' valid-pod' "--export=true" - - ### Dump current valid-pod POD - output_pod=$(kubectl get pod valid-pod -o yaml --output-version=v1 "${kube_flags[@]}") - - ### Delete POD valid-pod by id - # Pre-condition: valid-pod POD exists - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' - # Command - kubectl delete pod valid-pod "${kube_flags[@]}" --grace-period=0 - # Post-condition: valid-pod POD doesn't exist - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' - - ### Delete POD valid-pod by id with --now - # Pre-condition: valid-pod POD exists - kubectl create "${kube_flags[@]}" -f docs/admin/limitrange/valid-pod.yaml - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' - # Command - kubectl delete pod valid-pod "${kube_flags[@]}" --now - # Post-condition: valid-pod POD doesn't exist - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' - - ### Create POD valid-pod from dumped YAML - # Pre-condition: no POD exists - create_and_use_new_namespace - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' - # Command - echo "${output_pod}" | $SED '/namespace:/d' | kubectl create -f - "${kube_flags[@]}" - # Post-condition: valid-pod POD is created - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' - - ### Delete POD valid-pod from JSON - # Pre-condition: valid-pod POD exists - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' - # Command - kubectl delete -f docs/admin/limitrange/valid-pod.yaml "${kube_flags[@]}" --grace-period=0 - # Post-condition: valid-pod POD doesn't exist - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' - - ### Create POD valid-pod from JSON - # Pre-condition: no POD exists - create_and_use_new_namespace - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' - # Command - kubectl create -f docs/admin/limitrange/valid-pod.yaml "${kube_flags[@]}" - # Post-condition: valid-pod POD is created - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' - - ### Delete POD valid-pod with label - # Pre-condition: valid-pod POD exists - kube::test::get_object_assert "pods -l'name in (valid-pod)'" '{{range.items}}{{$id_field}}:{{end}}' 'valid-pod:' - # Command - kubectl delete pods -l'name in (valid-pod)' "${kube_flags[@]}" --grace-period=0 - # Post-condition: valid-pod POD doesn't exist - kube::test::get_object_assert "pods -l'name in (valid-pod)'" '{{range.items}}{{$id_field}}:{{end}}' '' - - ### Create POD valid-pod from YAML - # Pre-condition: no POD exists - create_and_use_new_namespace - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' - # Command - kubectl create -f docs/admin/limitrange/valid-pod.yaml "${kube_flags[@]}" - # Post-condition: valid-pod POD is created - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' - - ### Delete PODs with no parameter mustn't kill everything - # Pre-condition: valid-pod POD exists - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' - # Command - ! kubectl delete pods "${kube_flags[@]}" - # Post-condition: valid-pod POD exists - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' - - ### Delete PODs with --all and a label selector is not permitted - # Pre-condition: valid-pod POD exists - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' - # Command - ! kubectl delete --all pods -l'name in (valid-pod)' "${kube_flags[@]}" - # Post-condition: valid-pod POD exists - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' - - ### Delete all PODs - # Pre-condition: valid-pod POD exists - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' - # Command - kubectl delete --all pods "${kube_flags[@]}" --grace-period=0 # --all remove all the pods - # Post-condition: no POD exists - kube::test::get_object_assert "pods -l'name in (valid-pod)'" '{{range.items}}{{$id_field}}:{{end}}' '' - - # Detailed tests for describe pod output - ### Create a new namespace - # Pre-condition: the test-secrets namespace does not exist - kube::test::get_object_assert 'namespaces' '{{range.items}}{{ if eq $id_field \"test-kubectl-describe-pod\" }}found{{end}}{{end}}:' ':' - # Command - kubectl create namespace test-kubectl-describe-pod - # Post-condition: namespace 'test-secrets' is created. - kube::test::get_object_assert 'namespaces/test-kubectl-describe-pod' "{{$id_field}}" 'test-kubectl-describe-pod' - - ### Create a generic secret - # Pre-condition: no SECRET exists - kube::test::get_object_assert 'secrets --namespace=test-kubectl-describe-pod' "{{range.items}}{{$id_field}}:{{end}}" '' - # Command - kubectl create secret generic test-secret --from-literal=key-1=value1 --type=test-type --namespace=test-kubectl-describe-pod - # Post-condition: secret exists and has expected values - kube::test::get_object_assert 'secret/test-secret --namespace=test-kubectl-describe-pod' "{{$id_field}}" 'test-secret' - kube::test::get_object_assert 'secret/test-secret --namespace=test-kubectl-describe-pod' "{{$secret_type}}" 'test-type' - - ### Create a generic configmap - # Pre-condition: no CONFIGMAP exists - kube::test::get_object_assert 'configmaps --namespace=test-kubectl-describe-pod' "{{range.items}}{{$id_field}}:{{end}}" '' - # Command - kubectl create configmap test-configmap --from-literal=key-2=value2 --namespace=test-kubectl-describe-pod - # Post-condition: configmap exists and has expected values - kube::test::get_object_assert 'configmap/test-configmap --namespace=test-kubectl-describe-pod' "{{$id_field}}" 'test-configmap' - - # Create a pod that consumes secret, configmap, and downward API keys as envs - kube::test::get_object_assert 'pods --namespace=test-kubectl-describe-pod' "{{range.items}}{{$id_field}}:{{end}}" '' - kubectl create -f hack/testdata/pod-with-api-env.yaml --namespace=test-kubectl-describe-pod - - kube::test::describe_object_assert 'pods --namespace=test-kubectl-describe-pod' 'env-test-pod' "TEST_CMD_1" "" "TEST_CMD_2" "" "TEST_CMD_3" "env-test-pod (v1:metadata.name)" - # Describe command (resource only) should print detailed information about environment variables - kube::test::describe_resource_assert 'pods --namespace=test-kubectl-describe-pod' "TEST_CMD_1" "" "TEST_CMD_2" "" "TEST_CMD_3" "env-test-pod (v1:metadata.name)" - - # Clean-up - kubectl delete pod env-test-pod --namespace=test-kubectl-describe-pod - kubectl delete secret test-secret --namespace=test-kubectl-describe-pod - kubectl delete configmap test-configmap --namespace=test-kubectl-describe-pod - kubectl delete namespace test-kubectl-describe-pod - - ### Create two PODs - # Pre-condition: no POD exists - create_and_use_new_namespace - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' - # Command - kubectl create -f docs/admin/limitrange/valid-pod.yaml "${kube_flags[@]}" - kubectl create -f examples/storage/redis/redis-proxy.yaml "${kube_flags[@]}" - # Post-condition: valid-pod and redis-proxy PODs are created - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'redis-proxy:valid-pod:' - - ### Delete multiple PODs at once - # Pre-condition: valid-pod and redis-proxy PODs exist - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'redis-proxy:valid-pod:' - # Command - kubectl delete pods valid-pod redis-proxy "${kube_flags[@]}" --grace-period=0 # delete multiple pods at once - # Post-condition: no POD exists - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' - - ### Create valid-pod POD - # Pre-condition: no POD exists - create_and_use_new_namespace - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' - # Command - kubectl create -f docs/admin/limitrange/valid-pod.yaml "${kube_flags[@]}" - # Post-condition: valid-pod POD is created - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' - - ### Label the valid-pod POD - # Pre-condition: valid-pod is not labelled - kube::test::get_object_assert 'pod valid-pod' "{{range$labels_field}}{{.}}:{{end}}" 'valid-pod:' - # Command - kubectl label pods valid-pod new-name=new-valid-pod "${kube_flags[@]}" - # Post-condition: valid-pod is labelled - kube::test::get_object_assert 'pod valid-pod' "{{range$labels_field}}{{.}}:{{end}}" 'valid-pod:new-valid-pod:' - - ### Delete POD by label - # Pre-condition: valid-pod POD exists - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' - # Command - kubectl delete pods -lnew-name=new-valid-pod --grace-period=0 "${kube_flags[@]}" - # Post-condition: valid-pod POD doesn't exist - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' - - ### Create pod-with-precision POD - # Pre-condition: no POD is running - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' - # Command - kubectl create -f hack/testdata/pod-with-precision.json "${kube_flags[@]}" - # Post-condition: valid-pod POD is running - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'pod-with-precision:' - - ## Patch preserves precision - # Command - kubectl patch "${kube_flags[@]}" pod pod-with-precision -p='{"metadata":{"annotations":{"patchkey": "patchvalue"}}}' - # Post-condition: pod-with-precision POD has patched annotation - kube::test::get_object_assert 'pod pod-with-precision' "{{${annotations_field}.patchkey}}" 'patchvalue' - # Command - kubectl label pods pod-with-precision labelkey=labelvalue "${kube_flags[@]}" - # Post-condition: pod-with-precision POD has label - kube::test::get_object_assert 'pod pod-with-precision' "{{${labels_field}.labelkey}}" 'labelvalue' - # Command - kubectl annotate pods pod-with-precision annotatekey=annotatevalue "${kube_flags[@]}" - # Post-condition: pod-with-precision POD has annotation - kube::test::get_object_assert 'pod pod-with-precision' "{{${annotations_field}.annotatekey}}" 'annotatevalue' - # Cleanup - kubectl delete pod pod-with-precision "${kube_flags[@]}" - - ### Create valid-pod POD - # Pre-condition: no POD exists - create_and_use_new_namespace - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' - # Command - kubectl create -f docs/admin/limitrange/valid-pod.yaml "${kube_flags[@]}" - # Post-condition: valid-pod POD is created - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' - - ## Patch can modify a local object - kubectl patch --local -f pkg/api/validation/testdata/v1/validPod.yaml --patch='{"spec": {"restartPolicy":"Never"}}' -o jsonpath='{.spec.restartPolicy}' | grep -q "Never" - - ## Patch pod can change image - # Command - kubectl patch "${kube_flags[@]}" pod valid-pod --record -p='{"spec":{"containers":[{"name": "kubernetes-serve-hostname", "image": "nginx"}]}}' - # Post-condition: valid-pod POD has image nginx - kube::test::get_object_assert pods "{{range.items}}{{$image_field}}:{{end}}" 'nginx:' - # Post-condition: valid-pod has the record annotation - kube::test::get_object_assert pods "{{range.items}}{{$annotations_field}}:{{end}}" "${change_cause_annotation}" - # prove that patch can use different types - kubectl patch "${kube_flags[@]}" pod valid-pod --type="json" -p='[{"op": "replace", "path": "/spec/containers/0/image", "value":"nginx2"}]' - # Post-condition: valid-pod POD has image nginx - kube::test::get_object_assert pods "{{range.items}}{{$image_field}}:{{end}}" 'nginx2:' - # prove that patch can use different types - kubectl patch "${kube_flags[@]}" pod valid-pod --type="json" -p='[{"op": "replace", "path": "/spec/containers/0/image", "value":"nginx"}]' - # Post-condition: valid-pod POD has image nginx - kube::test::get_object_assert pods "{{range.items}}{{$image_field}}:{{end}}" 'nginx:' - # prove that yaml input works too - YAML_PATCH=$'spec:\n containers:\n - name: kubernetes-serve-hostname\n image: changed-with-yaml\n' - kubectl patch "${kube_flags[@]}" pod valid-pod -p="${YAML_PATCH}" - # Post-condition: valid-pod POD has image nginx - kube::test::get_object_assert pods "{{range.items}}{{$image_field}}:{{end}}" 'changed-with-yaml:' - ## Patch pod from JSON can change image - # Command - kubectl patch "${kube_flags[@]}" -f docs/admin/limitrange/valid-pod.yaml -p='{"spec":{"containers":[{"name": "kubernetes-serve-hostname", "image": "gcr.io/google_containers/pause-amd64:3.0"}]}}' - # Post-condition: valid-pod POD has image gcr.io/google_containers/pause-amd64:3.0 - kube::test::get_object_assert pods "{{range.items}}{{$image_field}}:{{end}}" 'gcr.io/google_containers/pause-amd64:3.0:' - - ## If resourceVersion is specified in the patch, it will be treated as a precondition, i.e., if the resourceVersion is different from that is stored in the server, the Patch should be rejected - ERROR_FILE="${KUBE_TEMP}/conflict-error" - ## If the resourceVersion is the same as the one stored in the server, the patch will be applied. - # Command - # Needs to retry because other party may change the resource. - for count in $(seq 0 3); do - resourceVersion=$(kubectl get "${kube_flags[@]}" pod valid-pod -o go-template='{{ .metadata.resourceVersion }}') - kubectl patch "${kube_flags[@]}" pod valid-pod -p='{"spec":{"containers":[{"name": "kubernetes-serve-hostname", "image": "nginx"}]},"metadata":{"resourceVersion":"'$resourceVersion'"}}' 2> "${ERROR_FILE}" || true - if grep -q "the object has been modified" "${ERROR_FILE}"; then - kube::log::status "retry $1, error: $(cat ${ERROR_FILE})" - rm "${ERROR_FILE}" - sleep $((2**count)) - else - rm "${ERROR_FILE}" - kube::test::get_object_assert pods "{{range.items}}{{$image_field}}:{{end}}" 'nginx:' - break - fi - done - - ## If the resourceVersion is the different from the one stored in the server, the patch will be rejected. - resourceVersion=$(kubectl get "${kube_flags[@]}" pod valid-pod -o go-template='{{ .metadata.resourceVersion }}') - ((resourceVersion+=100)) - # Command - kubectl patch "${kube_flags[@]}" pod valid-pod -p='{"spec":{"containers":[{"name": "kubernetes-serve-hostname", "image": "nginx"}]},"metadata":{"resourceVersion":"'$resourceVersion'"}}' 2> "${ERROR_FILE}" || true - # Post-condition: should get an error reporting the conflict - if grep -q "please apply your changes to the latest version and try again" "${ERROR_FILE}"; then - kube::log::status "\"kubectl patch with resourceVersion $resourceVersion\" returns error as expected: $(cat ${ERROR_FILE})" - else - kube::log::status "\"kubectl patch with resourceVersion $resourceVersion\" returns unexpected error or non-error: $(cat ${ERROR_FILE})" - exit 1 - fi - rm "${ERROR_FILE}" - - ## --force replace pod can change other field, e.g., spec.container.name - # Command - kubectl get "${kube_flags[@]}" pod valid-pod -o json | $SED 's/"kubernetes-serve-hostname"/"replaced-k8s-serve-hostname"/g' > /tmp/tmp-valid-pod.json - kubectl replace "${kube_flags[@]}" --force -f /tmp/tmp-valid-pod.json - # Post-condition: spec.container.name = "replaced-k8s-serve-hostname" - kube::test::get_object_assert 'pod valid-pod' "{{(index .spec.containers 0).name}}" 'replaced-k8s-serve-hostname' - #cleaning - rm /tmp/tmp-valid-pod.json - - ## replace of a cluster scoped resource can succeed - # Pre-condition: a node exists - kubectl create -f - "${kube_flags[@]}" << __EOF__ -{ - "kind": "Node", - "apiVersion": "v1", - "metadata": { - "name": "node-${version}-test" - } -} -__EOF__ - kubectl replace -f - "${kube_flags[@]}" << __EOF__ -{ - "kind": "Node", - "apiVersion": "v1", - "metadata": { - "name": "node-${version}-test", - "annotations": {"a":"b"} - } -} -__EOF__ - # Post-condition: the node command succeeds - kube::test::get_object_assert "node node-${version}-test" "{{.metadata.annotations.a}}" 'b' - kubectl delete node node-${version}-test "${kube_flags[@]}" - - ## kubectl edit can update the image field of a POD. tmp-editor.sh is a fake editor - echo -e "#!/bin/bash\n$SED -i \"s/nginx/gcr.io\/google_containers\/serve_hostname/g\" \$1" > /tmp/tmp-editor.sh - chmod +x /tmp/tmp-editor.sh - # Pre-condition: valid-pod POD has image nginx - kube::test::get_object_assert pods "{{range.items}}{{$image_field}}:{{end}}" 'nginx:' - EDITOR=/tmp/tmp-editor.sh kubectl edit "${kube_flags[@]}" pods/valid-pod - # Post-condition: valid-pod POD has image gcr.io/google_containers/serve_hostname - kube::test::get_object_assert pods "{{range.items}}{{$image_field}}:{{end}}" 'gcr.io/google_containers/serve_hostname:' - # cleaning - rm /tmp/tmp-editor.sh - - ## kubectl edit should work on Windows - [ "$(EDITOR=cat kubectl edit pod/valid-pod 2>&1 | grep 'Edit cancelled')" ] - [ "$(EDITOR=cat kubectl edit pod/valid-pod | grep 'name: valid-pod')" ] - [ "$(EDITOR=cat kubectl edit --windows-line-endings pod/valid-pod | file - | grep CRLF)" ] - [ ! "$(EDITOR=cat kubectl edit --windows-line-endings=false pod/valid-pod | file - | grep CRLF)" ] - - ### Overwriting an existing label is not permitted - # Pre-condition: name is valid-pod - kube::test::get_object_assert 'pod valid-pod' "{{${labels_field}.name}}" 'valid-pod' - # Command - ! kubectl label pods valid-pod name=valid-pod-super-sayan "${kube_flags[@]}" - # Post-condition: name is still valid-pod - kube::test::get_object_assert 'pod valid-pod' "{{${labels_field}.name}}" 'valid-pod' - - ### --overwrite must be used to overwrite existing label, can be applied to all resources - # Pre-condition: name is valid-pod - kube::test::get_object_assert 'pod valid-pod' "{{${labels_field}.name}}" 'valid-pod' - # Command - kubectl label --overwrite pods --all name=valid-pod-super-sayan "${kube_flags[@]}" - # Post-condition: name is valid-pod-super-sayan - kube::test::get_object_assert 'pod valid-pod' "{{${labels_field}.name}}" 'valid-pod-super-sayan' - - ### Delete POD by label - # Pre-condition: valid-pod POD exists - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' - # Command - kubectl delete pods -l'name in (valid-pod-super-sayan)' --grace-period=0 "${kube_flags[@]}" - # Post-condition: valid-pod POD doesn't exist - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' - - ### Create two PODs from 1 yaml file - # Pre-condition: no POD exists - create_and_use_new_namespace - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' - # Command - kubectl create -f docs/user-guide/multi-pod.yaml "${kube_flags[@]}" - # Post-condition: valid-pod and redis-proxy PODs exist - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'redis-master:redis-proxy:' - - ### Delete two PODs from 1 yaml file - # Pre-condition: redis-master and redis-proxy PODs exist - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'redis-master:redis-proxy:' - # Command - kubectl delete -f docs/user-guide/multi-pod.yaml "${kube_flags[@]}" - # Post-condition: no PODs exist - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' - - ## kubectl apply should update configuration annotations only if apply is already called - ## 1. kubectl create doesn't set the annotation - # Pre-Condition: no POD exists - create_and_use_new_namespace - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' - # Command: create a pod "test-pod" - kubectl create -f hack/testdata/pod.yaml "${kube_flags[@]}" - # Post-Condition: pod "test-pod" is created - kube::test::get_object_assert 'pods test-pod' "{{${labels_field}.name}}" 'test-pod-label' - # Post-Condition: pod "test-pod" doesn't have configuration annotation - ! [[ "$(kubectl get pods test-pod -o yaml "${kube_flags[@]}" | grep kubectl.kubernetes.io/last-applied-configuration)" ]] - ## 2. kubectl replace doesn't set the annotation - kubectl get pods test-pod -o yaml "${kube_flags[@]}" | $SED 's/test-pod-label/test-pod-replaced/g' > "${KUBE_TEMP}"/test-pod-replace.yaml - # Command: replace the pod "test-pod" - kubectl replace -f "${KUBE_TEMP}"/test-pod-replace.yaml "${kube_flags[@]}" - # Post-Condition: pod "test-pod" is replaced - kube::test::get_object_assert 'pods test-pod' "{{${labels_field}.name}}" 'test-pod-replaced' - # Post-Condition: pod "test-pod" doesn't have configuration annotation - ! [[ "$(kubectl get pods test-pod -o yaml "${kube_flags[@]}" | grep kubectl.kubernetes.io/last-applied-configuration)" ]] - ## 3. kubectl apply does set the annotation - # Command: apply the pod "test-pod" - kubectl apply -f hack/testdata/pod-apply.yaml "${kube_flags[@]}" - # Post-Condition: pod "test-pod" is applied - kube::test::get_object_assert 'pods test-pod' "{{${labels_field}.name}}" 'test-pod-applied' - # Post-Condition: pod "test-pod" has configuration annotation - [[ "$(kubectl get pods test-pod -o yaml "${kube_flags[@]}" | grep kubectl.kubernetes.io/last-applied-configuration)" ]] - kubectl get pods test-pod -o yaml "${kube_flags[@]}" | grep kubectl.kubernetes.io/last-applied-configuration > "${KUBE_TEMP}"/annotation-configuration - ## 4. kubectl replace updates an existing annotation - kubectl get pods test-pod -o yaml "${kube_flags[@]}" | $SED 's/test-pod-applied/test-pod-replaced/g' > "${KUBE_TEMP}"/test-pod-replace.yaml - # Command: replace the pod "test-pod" - kubectl replace -f "${KUBE_TEMP}"/test-pod-replace.yaml "${kube_flags[@]}" - # Post-Condition: pod "test-pod" is replaced - kube::test::get_object_assert 'pods test-pod' "{{${labels_field}.name}}" 'test-pod-replaced' - # Post-Condition: pod "test-pod" has configuration annotation, and it's updated (different from the annotation when it's applied) - [[ "$(kubectl get pods test-pod -o yaml "${kube_flags[@]}" | grep kubectl.kubernetes.io/last-applied-configuration)" ]] - kubectl get pods test-pod -o yaml "${kube_flags[@]}" | grep kubectl.kubernetes.io/last-applied-configuration > "${KUBE_TEMP}"/annotation-configuration-replaced - ! [[ $(diff -q "${KUBE_TEMP}"/annotation-configuration "${KUBE_TEMP}"/annotation-configuration-replaced > /dev/null) ]] - # Clean up - rm "${KUBE_TEMP}"/test-pod-replace.yaml "${KUBE_TEMP}"/annotation-configuration "${KUBE_TEMP}"/annotation-configuration-replaced - kubectl delete pods test-pod "${kube_flags[@]}" - - ## Configuration annotations should be set when --save-config is enabled - ## 1. kubectl create --save-config should generate configuration annotation - # Pre-Condition: no POD exists - create_and_use_new_namespace - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' - # Command: create a pod "test-pod" - kubectl create -f hack/testdata/pod.yaml --save-config "${kube_flags[@]}" - # Post-Condition: pod "test-pod" has configuration annotation - [[ "$(kubectl get pods test-pod -o yaml "${kube_flags[@]}" | grep kubectl.kubernetes.io/last-applied-configuration)" ]] - # Clean up - kubectl delete -f hack/testdata/pod.yaml "${kube_flags[@]}" - ## 2. kubectl edit --save-config should generate configuration annotation - # Pre-Condition: no POD exists, then create pod "test-pod", which shouldn't have configuration annotation - create_and_use_new_namespace - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' - kubectl create -f hack/testdata/pod.yaml "${kube_flags[@]}" - ! [[ "$(kubectl get pods test-pod -o yaml "${kube_flags[@]}" | grep kubectl.kubernetes.io/last-applied-configuration)" ]] - # Command: edit the pod "test-pod" - temp_editor="${KUBE_TEMP}/tmp-editor.sh" - echo -e "#!/bin/bash\n$SED -i \"s/test-pod-label/test-pod-label-edited/g\" \$@" > "${temp_editor}" - chmod +x "${temp_editor}" - EDITOR=${temp_editor} kubectl edit pod test-pod --save-config "${kube_flags[@]}" - # Post-Condition: pod "test-pod" has configuration annotation - [[ "$(kubectl get pods test-pod -o yaml "${kube_flags[@]}" | grep kubectl.kubernetes.io/last-applied-configuration)" ]] - # Clean up - kubectl delete -f hack/testdata/pod.yaml "${kube_flags[@]}" - ## 3. kubectl replace --save-config should generate configuration annotation - # Pre-Condition: no POD exists, then create pod "test-pod", which shouldn't have configuration annotation - create_and_use_new_namespace - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' - kubectl create -f hack/testdata/pod.yaml "${kube_flags[@]}" - ! [[ "$(kubectl get pods test-pod -o yaml "${kube_flags[@]}" | grep kubectl.kubernetes.io/last-applied-configuration)" ]] - # Command: replace the pod "test-pod" - kubectl replace -f hack/testdata/pod.yaml --save-config "${kube_flags[@]}" - # Post-Condition: pod "test-pod" has configuration annotation - [[ "$(kubectl get pods test-pod -o yaml "${kube_flags[@]}" | grep kubectl.kubernetes.io/last-applied-configuration)" ]] - # Clean up - kubectl delete -f hack/testdata/pod.yaml "${kube_flags[@]}" - ## 4. kubectl run --save-config should generate configuration annotation - # Pre-Condition: no RC exists - kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" '' - # Command: create the rc "nginx" with image nginx - kubectl run nginx "--image=$IMAGE_NGINX" --save-config --generator=run/v1 "${kube_flags[@]}" - # Post-Condition: rc "nginx" has configuration annotation - [[ "$(kubectl get rc nginx -o yaml "${kube_flags[@]}" | grep kubectl.kubernetes.io/last-applied-configuration)" ]] - ## 5. kubectl expose --save-config should generate configuration annotation - # Pre-Condition: no service exists - kube::test::get_object_assert svc "{{range.items}}{{$id_field}}:{{end}}" '' - # Command: expose the rc "nginx" - kubectl expose rc nginx --save-config --port=80 --target-port=8000 "${kube_flags[@]}" - # Post-Condition: service "nginx" has configuration annotation - [[ "$(kubectl get svc nginx -o yaml "${kube_flags[@]}" | grep kubectl.kubernetes.io/last-applied-configuration)" ]] - # Clean up - kubectl delete rc,svc nginx - ## 6. kubectl autoscale --save-config should generate configuration annotation - # Pre-Condition: no RC exists, then create the rc "frontend", which shouldn't have configuration annotation - kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" '' - kubectl create -f hack/testdata/frontend-controller.yaml "${kube_flags[@]}" - ! [[ "$(kubectl get rc frontend -o yaml "${kube_flags[@]}" | grep kubectl.kubernetes.io/last-applied-configuration)" ]] - # Command: autoscale rc "frontend" - kubectl autoscale -f hack/testdata/frontend-controller.yaml --save-config "${kube_flags[@]}" --max=2 - # Post-Condition: hpa "frontend" has configuration annotation - [[ "$(kubectl get hpa.v1beta1.extensions frontend -o yaml "${kube_flags[@]}" | grep kubectl.kubernetes.io/last-applied-configuration)" ]] - # Ensure we can interact with HPA objects in lists through both the extensions/v1beta1 and autoscaling/v1 APIs - output_message=$(kubectl get hpa -o=jsonpath='{.items[0].apiVersion}' 2>&1 "${kube_flags[@]}") - kube::test::if_has_string "${output_message}" 'autoscaling/v1' - output_message=$(kubectl get hpa.extensions -o=jsonpath='{.items[0].apiVersion}' 2>&1 "${kube_flags[@]}") - kube::test::if_has_string "${output_message}" 'extensions/v1beta1' - output_message=$(kubectl get hpa.autoscaling -o=jsonpath='{.items[0].apiVersion}' 2>&1 "${kube_flags[@]}") - kube::test::if_has_string "${output_message}" 'autoscaling/v1' - # Clean up - # Note that we should delete hpa first, otherwise it may fight with the rc reaper. - kubectl delete hpa frontend "${kube_flags[@]}" - kubectl delete rc frontend "${kube_flags[@]}" - - ## kubectl create should not panic on empty string lists in a template - ERROR_FILE="${KUBE_TEMP}/validation-error" - kubectl create -f hack/testdata/invalid-rc-with-empty-args.yaml "${kube_flags[@]}" 2> "${ERROR_FILE}" || true - # Post-condition: should get an error reporting the empty string - if grep -q "unexpected nil value for field" "${ERROR_FILE}"; then - kube::log::status "\"kubectl create with empty string list returns error as expected: $(cat ${ERROR_FILE})" - else - kube::log::status "\"kubectl create with empty string list returns unexpected error or non-error: $(cat ${ERROR_FILE})" - exit 1 - fi - rm "${ERROR_FILE}" - - ## kubectl apply should create the resource that doesn't exist yet - # Pre-Condition: no POD exists - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' - # Command: apply a pod "test-pod" (doesn't exist) should create this pod - kubectl apply -f hack/testdata/pod.yaml "${kube_flags[@]}" - # Post-Condition: pod "test-pod" is created - kube::test::get_object_assert 'pods test-pod' "{{${labels_field}.name}}" 'test-pod-label' - # Post-Condition: pod "test-pod" has configuration annotation - [[ "$(kubectl get pods test-pod -o yaml "${kube_flags[@]}" | grep kubectl.kubernetes.io/last-applied-configuration)" ]] - # Clean up - kubectl delete pods test-pod "${kube_flags[@]}" - - ## kubectl run should create deployments or jobs - # Pre-Condition: no Job exists - kube::test::get_object_assert jobs "{{range.items}}{{$id_field}}:{{end}}" '' - # Command - kubectl run pi --generator=job/v1beta1 "--image=$IMAGE_PERL" --restart=OnFailure -- perl -Mbignum=bpi -wle 'print bpi(20)' "${kube_flags[@]}" - # Post-Condition: Job "pi" is created - kube::test::get_object_assert jobs "{{range.items}}{{$id_field}}:{{end}}" 'pi:' - # Clean up - kubectl delete jobs pi "${kube_flags[@]}" - # Command - kubectl run pi --generator=job/v1 "--image=$IMAGE_PERL" --restart=OnFailure -- perl -Mbignum=bpi -wle 'print bpi(20)' "${kube_flags[@]}" - # Post-Condition: Job "pi" is created - kube::test::get_object_assert jobs "{{range.items}}{{$id_field}}:{{end}}" 'pi:' - # Clean up - kubectl delete jobs pi "${kube_flags[@]}" - # Post-condition: no pods exist. - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' - # Pre-Condition: no Deployment exists - kube::test::get_object_assert deployment "{{range.items}}{{$id_field}}:{{end}}" '' - # Command - kubectl run nginx "--image=$IMAGE_NGINX" --generator=deployment/v1beta1 "${kube_flags[@]}" - # Post-Condition: Deployment "nginx" is created - kube::test::get_object_assert deployment "{{range.items}}{{$id_field}}:{{end}}" 'nginx:' - # Clean up - kubectl delete deployment nginx "${kube_flags[@]}" - - ############### - # Kubectl get # - ############### - - ### Test retrieval of non-existing pods - # Pre-condition: no POD exists - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' - # Command - output_message=$(! kubectl get pods abc 2>&1 "${kube_flags[@]}") - # Post-condition: POD abc should error since it doesn't exist - kube::test::if_has_string "${output_message}" 'pods "abc" not found' - - ### Test retrieval of non-existing POD with output flag specified - # Pre-condition: no POD exists - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' - # Command - output_message=$(! kubectl get pods abc 2>&1 "${kube_flags[@]}" -o name) - # Post-condition: POD abc should error since it doesn't exist - kube::test::if_has_string "${output_message}" 'pods "abc" not found' - - ### Test retrieval of non-existing POD with json output flag specified - # Pre-condition: no POD exists - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' - # Command - output_message=$(! kubectl get pods abc 2>&1 "${kube_flags[@]}" -o json) - # Post-condition: POD abc should error since it doesn't exist - kube::test::if_has_string "${output_message}" 'pods "abc" not found' - # Post-condition: make sure we don't display an empty List - if kube::test::if_has_string "${output_message}" 'List'; then - echo 'Unexpected List output' - echo "${LINENO} $(basename $0)" - exit 1 - fi - - ##################################### - # Third Party Resources # - ##################################### - create_and_use_new_namespace - kubectl "${kube_flags[@]}" create -f - "${kube_flags[@]}" << __EOF__ -{ - "kind": "ThirdPartyResource", - "apiVersion": "extensions/v1beta1", - "metadata": { - "name": "foo.company.com" - }, - "versions": [ - { - "name": "v1" - } - ] -} -__EOF__ - - # Post-Condition: assertion object exist - kube::test::get_object_assert thirdpartyresources "{{range.items}}{{$id_field}}:{{end}}" 'foo.company.com:' - - kube::util::wait_for_url "http://127.0.0.1:${API_PORT}/apis/company.com/v1" "third party api" - - # Test that we can list this new third party resource - kube::test::get_object_assert foos "{{range.items}}{{$id_field}}:{{end}}" '' - - # Test that we can create a new resource of type Foo - kubectl "${kube_flags[@]}" create -f - "${kube_flags[@]}" << __EOF__ - { - "kind": "Foo", - "apiVersion": "company.com/v1", - "metadata": { - "name": "test" - }, - "some-field": "field1", - "other-field": "field2" -} -__EOF__ - - # Test that we can list this new third party resource - kube::test::get_object_assert foos "{{range.items}}{{$id_field}}:{{end}}" 'test:' - - # Delete the resource - kubectl "${kube_flags[@]}" delete foos test - - # Make sure it's gone - kube::test::get_object_assert foos "{{range.items}}{{$id_field}}:{{end}}" '' - - # teardown - kubectl delete thirdpartyresources foo.company.com "${kube_flags[@]}" - - ##################################### - # Recursive Resources via directory # - ##################################### - - ### Create multiple busybox PODs recursively from directory of YAML files - # Pre-condition: no POD exists - create_and_use_new_namespace - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' - # Command - output_message=$(! kubectl create -f hack/testdata/recursive/pod --recursive 2>&1 "${kube_flags[@]}") - # Post-condition: busybox0 & busybox1 PODs are created, and since busybox2 is malformed, it should error - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'busybox0:busybox1:' - kube::test::if_has_string "${output_message}" 'error validating data: kind not set' - - ## Edit multiple busybox PODs by updating the image field of multiple PODs recursively from a directory. tmp-editor.sh is a fake editor - # Pre-condition: busybox0 & busybox1 PODs exist - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'busybox0:busybox1:' - # Command - echo -e '#!/bin/bash\nsed -i "s/image: busybox/image: prom\/busybox/g" $1' > /tmp/tmp-editor.sh - chmod +x /tmp/tmp-editor.sh - output_message=$(! EDITOR=/tmp/tmp-editor.sh kubectl edit -f hack/testdata/recursive/pod --recursive 2>&1 "${kube_flags[@]}") - # Post-condition: busybox0 & busybox1 PODs are edited, and since busybox2 is malformed, it should error - kube::test::get_object_assert pods "{{range.items}}{{$image_field}}:{{end}}" 'prom/busybox:prom/busybox:' - kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" - # cleaning - rm /tmp/tmp-editor.sh - - ## Replace multiple busybox PODs recursively from directory of YAML files - # Pre-condition: busybox0 & busybox1 PODs exist - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'busybox0:busybox1:' - # Command - output_message=$(! kubectl replace -f hack/testdata/recursive/pod-modify --recursive 2>&1 "${kube_flags[@]}") - # Post-condition: busybox0 & busybox1 PODs are replaced, and since busybox2 is malformed, it should error - kube::test::get_object_assert pods "{{range.items}}{{${labels_field}.status}}:{{end}}" 'replaced:replaced:' - kube::test::if_has_string "${output_message}" 'error validating data: kind not set' - - ## Describe multiple busybox PODs recursively from directory of YAML files - # Pre-condition: busybox0 & busybox1 PODs exist - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'busybox0:busybox1:' - # Command - output_message=$(! kubectl describe -f hack/testdata/recursive/pod --recursive 2>&1 "${kube_flags[@]}") - # Post-condition: busybox0 & busybox1 PODs are described, and since busybox2 is malformed, it should error - kube::test::if_has_string "${output_message}" "app=busybox0" - kube::test::if_has_string "${output_message}" "app=busybox1" - kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" - - ## Annotate multiple busybox PODs recursively from directory of YAML files - # Pre-condition: busybox0 & busybox1 PODs exist - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'busybox0:busybox1:' - # Command - output_message=$(! kubectl annotate -f hack/testdata/recursive/pod annotatekey='annotatevalue' --recursive 2>&1 "${kube_flags[@]}") - # Post-condition: busybox0 & busybox1 PODs are annotated, and since busybox2 is malformed, it should error - kube::test::get_object_assert pods "{{range.items}}{{${annotations_field}.annotatekey}}:{{end}}" 'annotatevalue:annotatevalue:' - kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" - - ## Apply multiple busybox PODs recursively from directory of YAML files - # Pre-condition: busybox0 & busybox1 PODs exist - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'busybox0:busybox1:' - # Command - output_message=$(! kubectl apply -f hack/testdata/recursive/pod-modify --recursive 2>&1 "${kube_flags[@]}") - # Post-condition: busybox0 & busybox1 PODs are updated, and since busybox2 is malformed, it should error - kube::test::get_object_assert pods "{{range.items}}{{${labels_field}.status}}:{{end}}" 'replaced:replaced:' - kube::test::if_has_string "${output_message}" 'error validating data: kind not set' - - ## Convert multiple busybox PODs recursively from directory of YAML files - # Pre-condition: busybox0 & busybox1 PODs exist - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'busybox0:busybox1:' - # Command - output_message=$(! kubectl convert -f hack/testdata/recursive/pod --recursive 2>&1 "${kube_flags[@]}") - # Post-condition: busybox0 & busybox1 PODs are converted, and since busybox2 is malformed, it should error - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'busybox0:busybox1:' - kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" - - ## Get multiple busybox PODs recursively from directory of YAML files - # Pre-condition: busybox0 & busybox1 PODs exist - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'busybox0:busybox1:' - # Command - output_message=$(! kubectl get -f hack/testdata/recursive/pod --recursive 2>&1 "${kube_flags[@]}" -o go-template="{{range.items}}{{$id_field}}:{{end}}") - # Post-condition: busybox0 & busybox1 PODs are retrieved, but because busybox2 is malformed, it should not show up - kube::test::if_has_string "${output_message}" "busybox0:busybox1:" - kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" - - ## Label multiple busybox PODs recursively from directory of YAML files - # Pre-condition: busybox0 & busybox1 PODs exist - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'busybox0:busybox1:' - # Command - output_message=$(! kubectl label -f hack/testdata/recursive/pod mylabel='myvalue' --recursive 2>&1 "${kube_flags[@]}") - echo $output_message - # Post-condition: busybox0 & busybox1 PODs are labeled, but because busybox2 is malformed, it should not show up - kube::test::get_object_assert pods "{{range.items}}{{${labels_field}.mylabel}}:{{end}}" 'myvalue:myvalue:' - kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" - - ## Patch multiple busybox PODs recursively from directory of YAML files - # Pre-condition: busybox0 & busybox1 PODs exist - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'busybox0:busybox1:' - # Command - output_message=$(! kubectl patch -f hack/testdata/recursive/pod -p='{"spec":{"containers":[{"name":"busybox","image":"prom/busybox"}]}}' --recursive 2>&1 "${kube_flags[@]}") - echo $output_message - # Post-condition: busybox0 & busybox1 PODs are patched, but because busybox2 is malformed, it should not show up - kube::test::get_object_assert pods "{{range.items}}{{$image_field}}:{{end}}" 'prom/busybox:prom/busybox:' - kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" - - ### Delete multiple busybox PODs recursively from directory of YAML files - # Pre-condition: busybox0 & busybox1 PODs exist - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'busybox0:busybox1:' - # Command - output_message=$(! kubectl delete -f hack/testdata/recursive/pod --recursive --grace-period=0 2>&1 "${kube_flags[@]}") - # Post-condition: busybox0 & busybox1 PODs are deleted, and since busybox2 is malformed, it should error - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' - kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" - - ### Create replication controller recursively from directory of YAML files - # Pre-condition: no replication controller exists - kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" '' - # Command - ! kubectl create -f hack/testdata/recursive/rc --recursive "${kube_flags[@]}" - # Post-condition: frontend replication controller is created - kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" 'busybox0:busybox1:' - - ### Autoscale multiple replication controllers recursively from directory of YAML files - # Pre-condition: busybox0 & busybox1 replication controllers exist & 1 - # replica each - kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" 'busybox0:busybox1:' - kube::test::get_object_assert 'rc busybox0' "{{$rc_replicas_field}}" '1' - kube::test::get_object_assert 'rc busybox1' "{{$rc_replicas_field}}" '1' - # Command - output_message=$(! kubectl autoscale --min=1 --max=2 -f hack/testdata/recursive/rc --recursive 2>&1 "${kube_flags[@]}") - # Post-condition: busybox0 & busybox replication controllers are autoscaled - # with min. of 1 replica & max of 2 replicas, and since busybox2 is malformed, it should error - kube::test::get_object_assert 'hpa busybox0' "{{$hpa_min_field}} {{$hpa_max_field}} {{$hpa_cpu_field}}" '1 2 ' - kube::test::get_object_assert 'hpa busybox1' "{{$hpa_min_field}} {{$hpa_max_field}} {{$hpa_cpu_field}}" '1 2 ' - kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" - kubectl delete hpa busybox0 "${kube_flags[@]}" - kubectl delete hpa busybox1 "${kube_flags[@]}" - - ### Expose multiple replication controllers as service recursively from directory of YAML files - # Pre-condition: busybox0 & busybox1 replication controllers exist & 1 - # replica each - kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" 'busybox0:busybox1:' - kube::test::get_object_assert 'rc busybox0' "{{$rc_replicas_field}}" '1' - kube::test::get_object_assert 'rc busybox1' "{{$rc_replicas_field}}" '1' - # Command - output_message=$(! kubectl expose -f hack/testdata/recursive/rc --recursive --port=80 2>&1 "${kube_flags[@]}") - # Post-condition: service exists and the port is unnamed - kube::test::get_object_assert 'service busybox0' "{{$port_name}} {{$port_field}}" ' 80' - kube::test::get_object_assert 'service busybox1' "{{$port_name}} {{$port_field}}" ' 80' - kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" - - ### Scale multiple replication controllers recursively from directory of YAML files - # Pre-condition: busybox0 & busybox1 replication controllers exist & 1 - # replica each - kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" 'busybox0:busybox1:' - kube::test::get_object_assert 'rc busybox0' "{{$rc_replicas_field}}" '1' - kube::test::get_object_assert 'rc busybox1' "{{$rc_replicas_field}}" '1' - # Command - output_message=$(! kubectl scale --current-replicas=1 --replicas=2 -f hack/testdata/recursive/rc --recursive 2>&1 "${kube_flags[@]}") - # Post-condition: busybox0 & busybox1 replication controllers are scaled to 2 replicas, and since busybox2 is malformed, it should error - kube::test::get_object_assert 'rc busybox0' "{{$rc_replicas_field}}" '2' - kube::test::get_object_assert 'rc busybox1' "{{$rc_replicas_field}}" '2' - kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" - - ### Delete multiple busybox replication controllers recursively from directory of YAML files - # Pre-condition: busybox0 & busybox1 PODs exist - kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" 'busybox0:busybox1:' - # Command - output_message=$(! kubectl delete -f hack/testdata/recursive/rc --recursive --grace-period=0 2>&1 "${kube_flags[@]}") - # Post-condition: busybox0 & busybox1 replication controllers are deleted, and since busybox2 is malformed, it should error - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' - kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" - - ### Rollout on multiple deployments recursively - # Pre-condition: no deployments exist - kube::test::get_object_assert deployment "{{range.items}}{{$id_field}}:{{end}}" '' - # Command - # Create deployments (revision 1) recursively from directory of YAML files - ! kubectl create -f hack/testdata/recursive/deployment --recursive "${kube_flags[@]}" - kube::test::get_object_assert deployment "{{range.items}}{{$id_field}}:{{end}}" 'nginx0-deployment:nginx1-deployment:' - kube::test::get_object_assert deployment "{{range.items}}{{$deployment_image_field}}:{{end}}" "${IMAGE_NGINX}:${IMAGE_NGINX}:" - ## Rollback the deployments to revision 1 recursively - output_message=$(! kubectl rollout undo -f hack/testdata/recursive/deployment --recursive --to-revision=1 2>&1 "${kube_flags[@]}") - # Post-condition: nginx0 & nginx1 should be a no-op, and since nginx2 is malformed, it should error - kube::test::get_object_assert deployment "{{range.items}}{{$deployment_image_field}}:{{end}}" "${IMAGE_NGINX}:${IMAGE_NGINX}:" - kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" - ## Pause the deployments recursively - PRESERVE_ERR_FILE=true - kubectl-with-retry rollout pause -f hack/testdata/recursive/deployment --recursive "${kube_flags[@]}" - output_message=$(cat ${ERROR_FILE}) - # Post-condition: nginx0 & nginx1 should both have paused set to true, and since nginx2 is malformed, it should error - kube::test::get_object_assert deployment "{{range.items}}{{.spec.paused}}:{{end}}" "true:true:" - kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" - ## Resume the deployments recursively - kubectl-with-retry rollout resume -f hack/testdata/recursive/deployment --recursive "${kube_flags[@]}" - output_message=$(cat ${ERROR_FILE}) - # Post-condition: nginx0 & nginx1 should both have paused set to nothing, and since nginx2 is malformed, it should error - kube::test::get_object_assert deployment "{{range.items}}{{.spec.paused}}:{{end}}" "::" - kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" - ## Retrieve the rollout history of the deployments recursively - output_message=$(! kubectl rollout history -f hack/testdata/recursive/deployment --recursive 2>&1 "${kube_flags[@]}") - # Post-condition: nginx0 & nginx1 should both have a history, and since nginx2 is malformed, it should error - kube::test::if_has_string "${output_message}" "nginx0-deployment" - kube::test::if_has_string "${output_message}" "nginx1-deployment" - kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" - # Clean up - unset PRESERVE_ERR_FILE - rm "${ERROR_FILE}" - ! kubectl delete -f hack/testdata/recursive/deployment --recursive "${kube_flags[@]}" --grace-period=0 - sleep 1 - - ### Rollout on multiple replication controllers recursively - these tests ensure that rollouts cannot be performed on resources that don't support it - # Pre-condition: no replication controller exists - kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" '' - # Command - # Create replication controllers recursively from directory of YAML files - ! kubectl create -f hack/testdata/recursive/rc --recursive "${kube_flags[@]}" - kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" 'busybox0:busybox1:' - # Command - ## Attempt to rollback the replication controllers to revision 1 recursively - output_message=$(! kubectl rollout undo -f hack/testdata/recursive/rc --recursive --to-revision=1 2>&1 "${kube_flags[@]}") - # Post-condition: busybox0 & busybox1 should error as they are RC's, and since busybox2 is malformed, it should error - kube::test::if_has_string "${output_message}" 'no rollbacker has been implemented for {"" "ReplicationController"}' - kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" - ## Attempt to pause the replication controllers recursively - output_message=$(! kubectl rollout pause -f hack/testdata/recursive/rc --recursive 2>&1 "${kube_flags[@]}") - # Post-condition: busybox0 & busybox1 should error as they are RC's, and since busybox2 is malformed, it should error - kube::test::if_has_string "${output_message}" 'error when pausing "hack/testdata/recursive/rc/busybox.yaml' - kube::test::if_has_string "${output_message}" 'error when pausing "hack/testdata/recursive/rc/rc/busybox.yaml' - kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" - ## Attempt to resume the replication controllers recursively - output_message=$(! kubectl rollout resume -f hack/testdata/recursive/rc --recursive 2>&1 "${kube_flags[@]}") - # Post-condition: busybox0 & busybox1 should error as they are RC's, and since busybox2 is malformed, it should error - kube::test::if_has_string "${output_message}" 'error when resuming "hack/testdata/recursive/rc/busybox.yaml' - kube::test::if_has_string "${output_message}" 'error when resuming "hack/testdata/recursive/rc/rc/busybox.yaml' - kube::test::if_has_string "${output_message}" "Object 'Kind' is missing" - # Clean up - ! kubectl delete -f hack/testdata/recursive/rc --recursive "${kube_flags[@]}" --grace-period=0 - sleep 1 - - ############## - # Namespaces # - ############## - - ### Create a new namespace - # Pre-condition: only the "default" namespace exists - # The Pre-condition doesn't hold anymore after we create and switch namespaces before creating pods with same name in the test. - # kube::test::get_object_assert namespaces "{{range.items}}{{$id_field}}:{{end}}" 'default:' - # Command - kubectl create namespace my-namespace - # Post-condition: namespace 'my-namespace' is created. - kube::test::get_object_assert 'namespaces/my-namespace' "{{$id_field}}" 'my-namespace' - # Clean up - kubectl delete namespace my-namespace - - ############## - # Pods in Namespaces # - ############## - - ### Create a new namespace - # Pre-condition: the other namespace does not exist - kube::test::get_object_assert 'namespaces' '{{range.items}}{{ if eq $id_field \"other\" }}found{{end}}{{end}}:' ':' - # Command - kubectl create namespace other - # Post-condition: namespace 'other' is created. - kube::test::get_object_assert 'namespaces/other' "{{$id_field}}" 'other' - - ### Create POD valid-pod in specific namespace - # Pre-condition: no POD exists - kube::test::get_object_assert 'pods --namespace=other' "{{range.items}}{{$id_field}}:{{end}}" '' - # Command - kubectl create "${kube_flags[@]}" --namespace=other -f docs/admin/limitrange/valid-pod.yaml - # Post-condition: valid-pod POD is created - kube::test::get_object_assert 'pods --namespace=other' "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' - - ### Delete POD valid-pod in specific namespace - # Pre-condition: valid-pod POD exists - kube::test::get_object_assert 'pods --namespace=other' "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' - # Command - kubectl delete "${kube_flags[@]}" pod --namespace=other valid-pod --grace-period=0 - # Post-condition: valid-pod POD doesn't exist - kube::test::get_object_assert 'pods --namespace=other' "{{range.items}}{{$id_field}}:{{end}}" '' - # Clean up - kubectl delete namespace other - - ############## - # Secrets # - ############## - - ### Create a new namespace - # Pre-condition: the test-secrets namespace does not exist - kube::test::get_object_assert 'namespaces' '{{range.items}}{{ if eq $id_field \"test-secrets\" }}found{{end}}{{end}}:' ':' - # Command - kubectl create namespace test-secrets - # Post-condition: namespace 'test-secrets' is created. - kube::test::get_object_assert 'namespaces/test-secrets' "{{$id_field}}" 'test-secrets' - - ### Create a generic secret in a specific namespace - # Pre-condition: no SECRET exists - kube::test::get_object_assert 'secrets --namespace=test-secrets' "{{range.items}}{{$id_field}}:{{end}}" '' - # Command - kubectl create secret generic test-secret --from-literal=key1=value1 --type=test-type --namespace=test-secrets - # Post-condition: secret exists and has expected values - kube::test::get_object_assert 'secret/test-secret --namespace=test-secrets' "{{$id_field}}" 'test-secret' - kube::test::get_object_assert 'secret/test-secret --namespace=test-secrets' "{{$secret_type}}" 'test-type' - [[ "$(kubectl get secret/test-secret --namespace=test-secrets -o yaml "${kube_flags[@]}" | grep 'key1: dmFsdWUx')" ]] - # Clean-up - kubectl delete secret test-secret --namespace=test-secrets - - ### Create a docker-registry secret in a specific namespace - # Pre-condition: no SECRET exists - kube::test::get_object_assert 'secrets --namespace=test-secrets' "{{range.items}}{{$id_field}}:{{end}}" '' - # Command - kubectl create secret docker-registry test-secret --docker-username=test-user --docker-password=test-password --docker-email='test-user@test.com' --namespace=test-secrets - # Post-condition: secret exists and has expected values - kube::test::get_object_assert 'secret/test-secret --namespace=test-secrets' "{{$id_field}}" 'test-secret' - kube::test::get_object_assert 'secret/test-secret --namespace=test-secrets' "{{$secret_type}}" 'kubernetes.io/dockercfg' - [[ "$(kubectl get secret/test-secret --namespace=test-secrets -o yaml "${kube_flags[@]}" | grep '.dockercfg:')" ]] - # Clean-up - kubectl delete secret test-secret --namespace=test-secrets - - ### Create a tls secret - # Pre-condition: no SECRET exists - kube::test::get_object_assert 'secrets --namespace=test-secrets' "{{range.items}}{{$id_field}}:{{end}}" '' - # Command - kubectl create secret tls test-secret --namespace=test-secrets --key=hack/testdata/tls.key --cert=hack/testdata/tls.crt - kube::test::get_object_assert 'secret/test-secret --namespace=test-secrets' "{{$id_field}}" 'test-secret' - kube::test::get_object_assert 'secret/test-secret --namespace=test-secrets' "{{$secret_type}}" 'kubernetes.io/tls' - # Clean-up - kubectl delete secret test-secret --namespace=test-secrets - - # Create a secret using stringData - kubectl create --namespace=test-secrets -f - "${kube_flags[@]}" << __EOF__ -{ - "kind": "Secret", - "apiVersion": "v1", - "metadata": { - "name": "secret-string-data" - }, - "data": { - "k1":"djE=", - "k2":"" - }, - "stringData": { - "k2":"v2" - } -} -__EOF__ - # Post-condition: secret-string-data secret is created with expected data, merged/overridden data from stringData, and a cleared stringData field - kube::test::get_object_assert 'secret/secret-string-data --namespace=test-secrets ' '{{.data}}' '.*k1:djE=.*' - kube::test::get_object_assert 'secret/secret-string-data --namespace=test-secrets ' '{{.data}}' '.*k2:djI=.*' - kube::test::get_object_assert 'secret/secret-string-data --namespace=test-secrets ' '{{.stringData}}' '' - # Clean up - kubectl delete secret secret-string-data --namespace=test-secrets - - ### Create a secret using output flags - # Pre-condition: no secret exists - kube::test::get_object_assert 'secrets --namespace=test-secrets' "{{range.items}}{{$id_field}}:{{end}}" '' - # Command - [[ "$(kubectl create secret generic test-secret --namespace=test-secrets --from-literal=key1=value1 --output=go-template --template=\"{{.metadata.name}}:\" | grep 'test-secret:')" ]] - ## Clean-up - kubectl delete secret test-secret --namespace=test-secrets - # Clean up - kubectl delete namespace test-secrets - - ###################### - # ConfigMap # - ###################### - - kubectl create -f docs/user-guide/configmap/configmap.yaml - kube::test::get_object_assert configmap "{{range.items}}{{$id_field}}{{end}}" 'test-configmap' - kubectl delete configmap test-configmap "${kube_flags[@]}" - - ### Create a new namespace - # Pre-condition: the test-configmaps namespace does not exist - kube::test::get_object_assert 'namespaces' '{{range.items}}{{ if eq $id_field \"test-configmaps\" }}found{{end}}{{end}}:' ':' - # Command - kubectl create namespace test-configmaps - # Post-condition: namespace 'test-configmaps' is created. - kube::test::get_object_assert 'namespaces/test-configmaps' "{{$id_field}}" 'test-configmaps' - - ### Create a generic configmap in a specific namespace - # Pre-condition: no configmaps namespace exists - kube::test::get_object_assert 'configmaps --namespace=test-configmaps' "{{range.items}}{{$id_field}}:{{end}}" '' - # Command - kubectl create configmap test-configmap --from-literal=key1=value1 --namespace=test-configmaps - # Post-condition: configmap exists and has expected values - kube::test::get_object_assert 'configmap/test-configmap --namespace=test-configmaps' "{{$id_field}}" 'test-configmap' - [[ "$(kubectl get configmap/test-configmap --namespace=test-configmaps -o yaml "${kube_flags[@]}" | grep 'key1: value1')" ]] - # Clean-up - kubectl delete configmap test-configmap --namespace=test-configmaps - kubectl delete namespace test-configmaps - - #################### - # Service Accounts # - #################### - - ### Create a new namespace - # Pre-condition: the test-service-accounts namespace does not exist - kube::test::get_object_assert 'namespaces' '{{range.items}}{{ if eq $id_field \"test-service-accounts\" }}found{{end}}{{end}}:' ':' - # Command - kubectl create namespace test-service-accounts - # Post-condition: namespace 'test-service-accounts' is created. - kube::test::get_object_assert 'namespaces/test-service-accounts' "{{$id_field}}" 'test-service-accounts' - - ### Create a service account in a specific namespace - # Command - kubectl create serviceaccount test-service-account --namespace=test-service-accounts - # Post-condition: secret exists and has expected values - kube::test::get_object_assert 'serviceaccount/test-service-account --namespace=test-service-accounts' "{{$id_field}}" 'test-service-account' - # Clean-up - kubectl delete serviceaccount test-service-account --namespace=test-service-accounts - # Clean up - kubectl delete namespace test-service-accounts - - ################# - # Pod templates # - ################# - - ### Create PODTEMPLATE - # Pre-condition: no PODTEMPLATE - kube::test::get_object_assert podtemplates "{{range.items}}{{.metadata.name}}:{{end}}" '' - # Command - kubectl create -f docs/user-guide/walkthrough/podtemplate.json "${kube_flags[@]}" - # Post-condition: nginx PODTEMPLATE is available - kube::test::get_object_assert podtemplates "{{range.items}}{{.metadata.name}}:{{end}}" 'nginx:' - - ### Printing pod templates works - kubectl get podtemplates "${kube_flags[@]}" - [[ "$(kubectl get podtemplates -o yaml "${kube_flags[@]}" | grep nginx)" ]] - - ### Delete nginx pod template by name - # Pre-condition: nginx pod template is available - kube::test::get_object_assert podtemplates "{{range.items}}{{.metadata.name}}:{{end}}" 'nginx:' - # Command - kubectl delete podtemplate nginx "${kube_flags[@]}" - # Post-condition: No templates exist - kube::test::get_object_assert podtemplate "{{range.items}}{{.metadata.name}}:{{end}}" '' - - - ############ - # Services # - ############ - # switch back to the default namespace - kubectl config set-context "${CONTEXT}" --namespace="" - kube::log::status "Testing kubectl(${version}:services)" - - ### Create redis-master service from JSON - # Pre-condition: Only the default kubernetes services exist - kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:' - # Command - kubectl create -f examples/guestbook/redis-master-service.yaml "${kube_flags[@]}" - # Post-condition: redis-master service exists - kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:redis-master:' - # Describe command should print detailed information - kube::test::describe_object_assert services 'redis-master' "Name:" "Labels:" "Selector:" "IP:" "Port:" "Endpoints:" "Session Affinity:" - # Describe command should print events information by default - kube::test::describe_object_events_assert services 'redis-master' - # Describe command should not print events information when show-events=false - kube::test::describe_object_events_assert services 'redis-master' false - # Describe command should print events information when show-events=true - kube::test::describe_object_events_assert services 'redis-master' true - # Describe command (resource only) should print detailed information - kube::test::describe_resource_assert services "Name:" "Labels:" "Selector:" "IP:" "Port:" "Endpoints:" "Session Affinity:" - # Describe command should print events information by default - kube::test::describe_resource_events_assert services - # Describe command should not print events information when show-events=false - kube::test::describe_resource_events_assert services false - # Describe command should print events information when show-events=true - kube::test::describe_resource_events_assert services true - - ### Dump current redis-master service - output_service=$(kubectl get service redis-master -o json --output-version=v1 "${kube_flags[@]}") - - ### Delete redis-master-service by id - # Pre-condition: redis-master service exists - kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:redis-master:' - # Command - kubectl delete service redis-master "${kube_flags[@]}" - # Post-condition: Only the default kubernetes services exist - kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:' - - ### Create redis-master-service from dumped JSON - # Pre-condition: Only the default kubernetes services exist - kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:' - # Command - echo "${output_service}" | kubectl create -f - "${kube_flags[@]}" - # Post-condition: redis-master service is created - kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:redis-master:' - - ### Create redis-master-${version}-test service - # Pre-condition: redis-master-service service exists - kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:redis-master:' - # Command - kubectl create -f - "${kube_flags[@]}" << __EOF__ -{ - "kind": "Service", - "apiVersion": "v1", - "metadata": { - "name": "service-${version}-test" - }, - "spec": { - "ports": [ - { - "protocol": "TCP", - "port": 80, - "targetPort": 80 - } - ] - } -} -__EOF__ - # Post-condition: service-${version}-test service is created - kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:redis-master:service-.*-test:' - - ### Identity - kubectl get service "${kube_flags[@]}" service-${version}-test -o json | kubectl replace "${kube_flags[@]}" -f - - - ### Delete services by id - # Pre-condition: service-${version}-test exists - kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:redis-master:service-.*-test:' - # Command - kubectl delete service redis-master "${kube_flags[@]}" - kubectl delete service "service-${version}-test" "${kube_flags[@]}" - # Post-condition: Only the default kubernetes services exist - kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:' - - ### Create two services - # Pre-condition: Only the default kubernetes services exist - kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:' - # Command - kubectl create -f examples/guestbook/redis-master-service.yaml "${kube_flags[@]}" - kubectl create -f examples/guestbook/redis-slave-service.yaml "${kube_flags[@]}" - # Post-condition: redis-master and redis-slave services are created - kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:redis-master:redis-slave:' - - ### Custom columns can be specified - # Pre-condition: generate output using custom columns - output_message=$(kubectl get services -o=custom-columns=NAME:.metadata.name,RSRC:.metadata.resourceVersion 2>&1 "${kube_flags[@]}") - # Post-condition: should contain name column - kube::test::if_has_string "${output_message}" 'redis-master' - - ### Delete multiple services at once - # Pre-condition: redis-master and redis-slave services exist - kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:redis-master:redis-slave:' - # Command - kubectl delete services redis-master redis-slave "${kube_flags[@]}" # delete multiple services at once - # Post-condition: Only the default kubernetes services exist - kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:' - - - ########################### - # Replication controllers # - ########################### - - kube::log::status "Testing kubectl(${version}:replicationcontrollers)" - - ### Create and stop controller, make sure it doesn't leak pods - # Pre-condition: no replication controller exists - kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" '' - # Command - kubectl create -f hack/testdata/frontend-controller.yaml "${kube_flags[@]}" - kubectl delete rc frontend "${kube_flags[@]}" - # Post-condition: no pods from frontend controller - kube::test::get_object_assert 'pods -l "name=frontend"' "{{range.items}}{{$id_field}}:{{end}}" '' - - ### Create replication controller frontend from JSON - # Pre-condition: no replication controller exists - kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" '' - # Command - kubectl create -f hack/testdata/frontend-controller.yaml "${kube_flags[@]}" - # Post-condition: frontend replication controller is created - kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" 'frontend:' - # Describe command should print detailed information - kube::test::describe_object_assert rc 'frontend' "Name:" "Image(s):" "Labels:" "Selector:" "Replicas:" "Pods Status:" - # Describe command should print events information by default - kube::test::describe_object_events_assert rc 'frontend' - # Describe command should not print events information when show-events=false - kube::test::describe_object_events_assert rc 'frontend' false - # Describe command should print events information when show-events=true - kube::test::describe_object_events_assert rc 'frontend' true - # Describe command (resource only) should print detailed information - kube::test::describe_resource_assert rc "Name:" "Name:" "Image(s):" "Labels:" "Selector:" "Replicas:" "Pods Status:" - # Describe command should print events information by default - kube::test::describe_resource_events_assert rc - # Describe command should not print events information when show-events=false - kube::test::describe_resource_events_assert rc false - # Describe command should print events information when show-events=true - kube::test::describe_resource_events_assert rc true - - ### Scale replication controller frontend with current-replicas and replicas - # Pre-condition: 3 replicas - kube::test::get_object_assert 'rc frontend' "{{$rc_replicas_field}}" '3' - # Command - kubectl scale --current-replicas=3 --replicas=2 replicationcontrollers frontend "${kube_flags[@]}" - # Post-condition: 2 replicas - kube::test::get_object_assert 'rc frontend' "{{$rc_replicas_field}}" '2' - - ### Scale replication controller frontend with (wrong) current-replicas and replicas - # Pre-condition: 2 replicas - kube::test::get_object_assert 'rc frontend' "{{$rc_replicas_field}}" '2' - # Command - ! kubectl scale --current-replicas=3 --replicas=2 replicationcontrollers frontend "${kube_flags[@]}" - # Post-condition: nothing changed - kube::test::get_object_assert 'rc frontend' "{{$rc_replicas_field}}" '2' - - ### Scale replication controller frontend with replicas only - # Pre-condition: 2 replicas - kube::test::get_object_assert 'rc frontend' "{{$rc_replicas_field}}" '2' - # Command - kubectl scale --replicas=3 replicationcontrollers frontend "${kube_flags[@]}" - # Post-condition: 3 replicas - kube::test::get_object_assert 'rc frontend' "{{$rc_replicas_field}}" '3' - - ### Scale replication controller from JSON with replicas only - # Pre-condition: 3 replicas - kube::test::get_object_assert 'rc frontend' "{{$rc_replicas_field}}" '3' - # Command - kubectl scale --replicas=2 -f hack/testdata/frontend-controller.yaml "${kube_flags[@]}" - # Post-condition: 2 replicas - kube::test::get_object_assert 'rc frontend' "{{$rc_replicas_field}}" '2' - # Clean-up - kubectl delete rc frontend "${kube_flags[@]}" - - ### Scale multiple replication controllers - kubectl create -f examples/guestbook/legacy/redis-master-controller.yaml "${kube_flags[@]}" - kubectl create -f examples/guestbook/legacy/redis-slave-controller.yaml "${kube_flags[@]}" - # Command - kubectl scale rc/redis-master rc/redis-slave --replicas=4 "${kube_flags[@]}" - # Post-condition: 4 replicas each - kube::test::get_object_assert 'rc redis-master' "{{$rc_replicas_field}}" '4' - kube::test::get_object_assert 'rc redis-slave' "{{$rc_replicas_field}}" '4' - # Clean-up - kubectl delete rc redis-{master,slave} "${kube_flags[@]}" - - ### Scale a job - kubectl create -f docs/user-guide/job.yaml "${kube_flags[@]}" - # Command - kubectl scale --replicas=2 job/pi - # Post-condition: 2 replicas for pi - kube::test::get_object_assert 'job pi' "{{$job_parallelism_field}}" '2' - # Clean-up - kubectl delete job/pi "${kube_flags[@]}" - - ### Scale a deployment - kubectl create -f docs/user-guide/deployment.yaml "${kube_flags[@]}" - # Command - kubectl scale --current-replicas=3 --replicas=1 deployment/nginx-deployment - # Post-condition: 1 replica for nginx-deployment - kube::test::get_object_assert 'deployment nginx-deployment' "{{$deployment_replicas}}" '1' - # Clean-up - kubectl delete deployment/nginx-deployment "${kube_flags[@]}" - - ### Expose a deployment as a service - kubectl create -f docs/user-guide/deployment.yaml "${kube_flags[@]}" - # Pre-condition: 3 replicas - kube::test::get_object_assert 'deployment nginx-deployment' "{{$deployment_replicas}}" '3' - # Command - kubectl expose deployment/nginx-deployment - # Post-condition: service exists and exposes deployment port (80) - kube::test::get_object_assert 'service nginx-deployment' "{{$port_field}}" '80' - # Clean-up - kubectl delete deployment/nginx-deployment service/nginx-deployment "${kube_flags[@]}" - - ### Expose replication controller as service - kubectl create -f hack/testdata/frontend-controller.yaml "${kube_flags[@]}" - # Pre-condition: 3 replicas - kube::test::get_object_assert 'rc frontend' "{{$rc_replicas_field}}" '3' - # Command - kubectl expose rc frontend --port=80 "${kube_flags[@]}" - # Post-condition: service exists and the port is unnamed - kube::test::get_object_assert 'service frontend' "{{$port_name}} {{$port_field}}" ' 80' - # Command - kubectl expose service frontend --port=443 --name=frontend-2 "${kube_flags[@]}" - # Post-condition: service exists and the port is unnamed - kube::test::get_object_assert 'service frontend-2' "{{$port_name}} {{$port_field}}" ' 443' - # Command - kubectl create -f docs/admin/limitrange/valid-pod.yaml "${kube_flags[@]}" - kubectl expose pod valid-pod --port=444 --name=frontend-3 "${kube_flags[@]}" - # Post-condition: service exists and the port is unnamed - kube::test::get_object_assert 'service frontend-3' "{{$port_name}} {{$port_field}}" ' 444' - # Create a service using service/v1 generator - kubectl expose rc frontend --port=80 --name=frontend-4 --generator=service/v1 "${kube_flags[@]}" - # Post-condition: service exists and the port is named default. - kube::test::get_object_assert 'service frontend-4' "{{$port_name}} {{$port_field}}" 'default 80' - # Verify that expose service works without specifying a port. - kubectl expose service frontend --name=frontend-5 "${kube_flags[@]}" - # Post-condition: service exists with the same port as the original service. - kube::test::get_object_assert 'service frontend-5' "{{$port_field}}" '80' - # Cleanup services - kubectl delete pod valid-pod "${kube_flags[@]}" - kubectl delete service frontend{,-2,-3,-4,-5} "${kube_flags[@]}" - - ### Expose negative invalid resource test - # Pre-condition: don't need - # Command - output_message=$(! kubectl expose nodes 127.0.0.1 2>&1 "${kube_flags[@]}") - # Post-condition: the error message has "cannot expose" string - kube::test::if_has_string "${output_message}" 'cannot expose' - - ### Try to generate a service with invalid name (exceeding maximum valid size) - # Pre-condition: use --name flag - output_message=$(! kubectl expose -f hack/testdata/pod-with-large-name.yaml --name=invalid-large-service-name --port=8081 2>&1 "${kube_flags[@]}") - # Post-condition: should fail due to invalid name - kube::test::if_has_string "${output_message}" 'metadata.name: Invalid value' - # Pre-condition: default run without --name flag; should succeed by truncating the inherited name - output_message=$(kubectl expose -f hack/testdata/pod-with-large-name.yaml --port=8081 2>&1 "${kube_flags[@]}") - # Post-condition: inherited name from pod has been truncated - kube::test::if_has_string "${output_message}" '\"kubernetes-serve-hostnam\" exposed' - # Clean-up - kubectl delete svc kubernetes-serve-hostnam "${kube_flags[@]}" - - ### Expose multiport object as a new service - # Pre-condition: don't use --port flag - output_message=$(kubectl expose -f docs/admin/high-availability/etcd.yaml --selector=test=etcd 2>&1 "${kube_flags[@]}") - # Post-condition: expose succeeded - kube::test::if_has_string "${output_message}" '\"etcd-server\" exposed' - # Post-condition: generated service has both ports from the exposed pod - kube::test::get_object_assert 'service etcd-server' "{{$port_name}} {{$port_field}}" 'port-1 2380' - kube::test::get_object_assert 'service etcd-server' "{{$second_port_name}} {{$second_port_field}}" 'port-2 4001' - # Clean-up - kubectl delete svc etcd-server "${kube_flags[@]}" - - ### Delete replication controller with id - # Pre-condition: frontend replication controller exists - kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" 'frontend:' - # Command - kubectl delete rc frontend "${kube_flags[@]}" - # Post-condition: no replication controller exists - kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" '' - - ### Create two replication controllers - # Pre-condition: no replication controller exists - kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" '' - # Command - kubectl create -f hack/testdata/frontend-controller.yaml "${kube_flags[@]}" - kubectl create -f examples/guestbook/legacy/redis-slave-controller.yaml "${kube_flags[@]}" - # Post-condition: frontend and redis-slave - kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" 'frontend:redis-slave:' - - ### Delete multiple controllers at once - # Pre-condition: frontend and redis-slave - kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" 'frontend:redis-slave:' - # Command - kubectl delete rc frontend redis-slave "${kube_flags[@]}" # delete multiple controllers at once - # Post-condition: no replication controller exists - kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" '' - - ### Auto scale replication controller - # Pre-condition: no replication controller exists - kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" '' - # Command - kubectl create -f hack/testdata/frontend-controller.yaml "${kube_flags[@]}" - kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" 'frontend:' - # autoscale 1~2 pods, CPU utilization 70%, rc specified by file - kubectl autoscale -f hack/testdata/frontend-controller.yaml "${kube_flags[@]}" --max=2 --cpu-percent=70 - kube::test::get_object_assert 'hpa frontend' "{{$hpa_min_field}} {{$hpa_max_field}} {{$hpa_cpu_field}}" '1 2 70' - kubectl delete hpa frontend "${kube_flags[@]}" - # autoscale 1~2 pods, CPU utilization 70%, rc specified by file, using old generator - kubectl autoscale -f hack/testdata/frontend-controller.yaml "${kube_flags[@]}" --max=2 --cpu-percent=70 --generator=horizontalpodautoscaler/v1beta1 - kube::test::get_object_assert 'hpa frontend' "{{$hpa_min_field}} {{$hpa_max_field}} {{$hpa_cpu_field}}" '1 2 70' - kubectl delete hpa frontend "${kube_flags[@]}" - # autoscale 2~3 pods, no CPU utilization specified, rc specified by name - kubectl autoscale rc frontend "${kube_flags[@]}" --min=2 --max=3 - kube::test::get_object_assert 'hpa frontend' "{{$hpa_min_field}} {{$hpa_max_field}} {{$hpa_cpu_field}}" '2 3 ' - kubectl delete hpa frontend "${kube_flags[@]}" - # autoscale 2~3 pods, no CPU utilization specified, rc specified by name, using old generator - kubectl autoscale rc frontend "${kube_flags[@]}" --min=2 --max=3 --generator=horizontalpodautoscaler/v1beta1 - kube::test::get_object_assert 'hpa frontend' "{{$hpa_min_field}} {{$hpa_max_field}} {{$hpa_cpu_field}}" '2 3 ' - kubectl delete hpa frontend "${kube_flags[@]}" - # autoscale without specifying --max should fail - ! kubectl autoscale rc frontend "${kube_flags[@]}" - # Clean up - kubectl delete rc frontend "${kube_flags[@]}" - - - ###################### - # Deployments # - ###################### - - ### Auto scale deployment - # Pre-condition: no deployment exists - kube::test::get_object_assert deployment "{{range.items}}{{$id_field}}:{{end}}" '' - # Command - kubectl create -f docs/user-guide/deployment.yaml "${kube_flags[@]}" - kube::test::get_object_assert deployment "{{range.items}}{{$id_field}}:{{end}}" 'nginx-deployment:' - # autoscale 2~3 pods, no CPU utilization specified - kubectl-with-retry autoscale deployment nginx-deployment "${kube_flags[@]}" --min=2 --max=3 - kube::test::get_object_assert 'hpa nginx-deployment' "{{$hpa_min_field}} {{$hpa_max_field}} {{$hpa_cpu_field}}" '2 3 ' - # Clean up - # Note that we should delete hpa first, otherwise it may fight with the deployment reaper. - kubectl delete hpa nginx-deployment "${kube_flags[@]}" - kubectl delete deployment.extensions nginx-deployment "${kube_flags[@]}" - - ### Rollback a deployment - # Pre-condition: no deployment exists - kube::test::get_object_assert deployment "{{range.items}}{{$id_field}}:{{end}}" '' - # Command - # Create a deployment (revision 1) - kubectl create -f hack/testdata/deployment-revision1.yaml "${kube_flags[@]}" - kube::test::get_object_assert deployment "{{range.items}}{{$id_field}}:{{end}}" 'nginx:' - kube::test::get_object_assert deployment "{{range.items}}{{$deployment_image_field}}:{{end}}" "${IMAGE_DEPLOYMENT_R1}:" - # Rollback to revision 1 - should be no-op - kubectl rollout undo deployment nginx --to-revision=1 "${kube_flags[@]}" - kube::test::get_object_assert deployment "{{range.items}}{{$deployment_image_field}}:{{end}}" "${IMAGE_DEPLOYMENT_R1}:" - # Update the deployment (revision 2) - kubectl apply -f hack/testdata/deployment-revision2.yaml "${kube_flags[@]}" - kube::test::get_object_assert deployment.extensions "{{range.items}}{{$deployment_image_field}}:{{end}}" "${IMAGE_DEPLOYMENT_R2}:" - # Rollback to revision 1 - kubectl rollout undo deployment nginx --to-revision=1 "${kube_flags[@]}" - sleep 1 - kube::test::get_object_assert deployment "{{range.items}}{{$deployment_image_field}}:{{end}}" "${IMAGE_DEPLOYMENT_R1}:" - # Rollback to revision 1000000 - should be no-op - kubectl rollout undo deployment nginx --to-revision=1000000 "${kube_flags[@]}" - kube::test::get_object_assert deployment "{{range.items}}{{$deployment_image_field}}:{{end}}" "${IMAGE_DEPLOYMENT_R1}:" - # Rollback to last revision - kubectl rollout undo deployment nginx "${kube_flags[@]}" - sleep 1 - kube::test::get_object_assert deployment "{{range.items}}{{$deployment_image_field}}:{{end}}" "${IMAGE_DEPLOYMENT_R2}:" - # Pause the deployment - kubectl-with-retry rollout pause deployment nginx "${kube_flags[@]}" - # A paused deployment cannot be rolled back - ! kubectl rollout undo deployment nginx "${kube_flags[@]}" - # Resume the deployment - kubectl-with-retry rollout resume deployment nginx "${kube_flags[@]}" - # The resumed deployment can now be rolled back - kubectl rollout undo deployment nginx "${kube_flags[@]}" - # Clean up - kubectl delete deployment nginx "${kube_flags[@]}" - - ### Set image of a deployment - # Pre-condition: no deployment exists - kube::test::get_object_assert deployment "{{range.items}}{{$id_field}}:{{end}}" '' - # Create a deployment - kubectl create -f hack/testdata/deployment-multicontainer.yaml "${kube_flags[@]}" - kube::test::get_object_assert deployment "{{range.items}}{{$id_field}}:{{end}}" 'nginx-deployment:' - kube::test::get_object_assert deployment "{{range.items}}{{$deployment_image_field}}:{{end}}" "${IMAGE_DEPLOYMENT_R1}:" - kube::test::get_object_assert deployment "{{range.items}}{{$deployment_second_image_field}}:{{end}}" "${IMAGE_PERL}:" - # Set the deployment's image - kubectl set image deployment nginx-deployment nginx="${IMAGE_DEPLOYMENT_R2}" "${kube_flags[@]}" - kube::test::get_object_assert deployment "{{range.items}}{{$deployment_image_field}}:{{end}}" "${IMAGE_DEPLOYMENT_R2}:" - kube::test::get_object_assert deployment "{{range.items}}{{$deployment_second_image_field}}:{{end}}" "${IMAGE_PERL}:" - # Set non-existing container should fail - ! kubectl set image deployment nginx-deployment redis=redis "${kube_flags[@]}" - # Set image of deployments without specifying name - kubectl set image deployments --all nginx="${IMAGE_DEPLOYMENT_R1}" "${kube_flags[@]}" - kube::test::get_object_assert deployment "{{range.items}}{{$deployment_image_field}}:{{end}}" "${IMAGE_DEPLOYMENT_R1}:" - kube::test::get_object_assert deployment "{{range.items}}{{$deployment_second_image_field}}:{{end}}" "${IMAGE_PERL}:" - # Set image of a deployment specified by file - kubectl set image -f hack/testdata/deployment-multicontainer.yaml nginx="${IMAGE_DEPLOYMENT_R2}" "${kube_flags[@]}" - kube::test::get_object_assert deployment "{{range.items}}{{$deployment_image_field}}:{{end}}" "${IMAGE_DEPLOYMENT_R2}:" - kube::test::get_object_assert deployment "{{range.items}}{{$deployment_second_image_field}}:{{end}}" "${IMAGE_PERL}:" - # Set image of a local file without talking to the server - kubectl set image -f hack/testdata/deployment-multicontainer.yaml nginx="${IMAGE_DEPLOYMENT_R1}" "${kube_flags[@]}" --local -o yaml - kube::test::get_object_assert deployment "{{range.items}}{{$deployment_image_field}}:{{end}}" "${IMAGE_DEPLOYMENT_R2}:" - kube::test::get_object_assert deployment "{{range.items}}{{$deployment_second_image_field}}:{{end}}" "${IMAGE_PERL}:" - # Set image of all containers of the deployment - kubectl set image deployment nginx-deployment "*"="${IMAGE_DEPLOYMENT_R1}" "${kube_flags[@]}" - kube::test::get_object_assert deployment "{{range.items}}{{$deployment_image_field}}:{{end}}" "${IMAGE_DEPLOYMENT_R1}:" - kube::test::get_object_assert deployment "{{range.items}}{{$deployment_second_image_field}}:{{end}}" "${IMAGE_DEPLOYMENT_R1}:" - # Clean up - kubectl delete deployment nginx-deployment "${kube_flags[@]}" - - - ###################### - # Replica Sets # - ###################### - - kube::log::status "Testing kubectl(${version}:replicasets)" - - ### Create and stop a replica set, make sure it doesn't leak pods - # Pre-condition: no replica set exists - kube::test::get_object_assert rs "{{range.items}}{{$id_field}}:{{end}}" '' - # Command - kubectl create -f hack/testdata/frontend-replicaset.yaml "${kube_flags[@]}" - kubectl delete rs frontend "${kube_flags[@]}" - # Post-condition: no pods from frontend replica set - kube::test::get_object_assert 'pods -l "tier=frontend"' "{{range.items}}{{$id_field}}:{{end}}" '' - - ### Create replica set frontend from YAML - # Pre-condition: no replica set exists - kube::test::get_object_assert rs "{{range.items}}{{$id_field}}:{{end}}" '' - # Command - kubectl create -f hack/testdata/frontend-replicaset.yaml "${kube_flags[@]}" - # Post-condition: frontend replica set is created - kube::test::get_object_assert rs "{{range.items}}{{$id_field}}:{{end}}" 'frontend:' - # Describe command should print detailed information - kube::test::describe_object_assert rs 'frontend' "Name:" "Image(s):" "Labels:" "Selector:" "Replicas:" "Pods Status:" - # Describe command should print events information by default - kube::test::describe_object_events_assert rs 'frontend' - # Describe command should not print events information when show-events=false - kube::test::describe_object_events_assert rs 'frontend' false - # Describe command should print events information when show-events=true - kube::test::describe_object_events_assert rs 'frontend' true - # Describe command (resource only) should print detailed information - kube::test::describe_resource_assert rs "Name:" "Name:" "Image(s):" "Labels:" "Selector:" "Replicas:" "Pods Status:" - # Describe command should print events information by default - kube::test::describe_resource_events_assert rs - # Describe command should not print events information when show-events=false - kube::test::describe_resource_events_assert rs false - # Describe command should print events information when show-events=true - kube::test::describe_resource_events_assert rs true - - ### Scale replica set frontend with current-replicas and replicas - # Pre-condition: 3 replicas - kube::test::get_object_assert 'rs frontend' "{{$rs_replicas_field}}" '3' - # Command - kubectl scale --current-replicas=3 --replicas=2 replicasets frontend "${kube_flags[@]}" - # Post-condition: 2 replicas - kube::test::get_object_assert 'rs frontend' "{{$rs_replicas_field}}" '2' - # Clean-up - kubectl delete rs frontend "${kube_flags[@]}" - - ### Expose replica set as service - kubectl create -f hack/testdata/frontend-replicaset.yaml "${kube_flags[@]}" - # Pre-condition: 3 replicas - kube::test::get_object_assert 'rs frontend' "{{$rs_replicas_field}}" '3' - # Command - kubectl expose rs frontend --port=80 "${kube_flags[@]}" - # Post-condition: service exists and the port is unnamed - kube::test::get_object_assert 'service frontend' "{{$port_name}} {{$port_field}}" ' 80' - # Create a service using service/v1 generator - kubectl expose rs frontend --port=80 --name=frontend-2 --generator=service/v1 "${kube_flags[@]}" - # Post-condition: service exists and the port is named default. - kube::test::get_object_assert 'service frontend-2' "{{$port_name}} {{$port_field}}" 'default 80' - # Cleanup services - kubectl delete service frontend{,-2} "${kube_flags[@]}" - - ### Delete replica set with id - # Pre-condition: frontend replica set exists - kube::test::get_object_assert rs "{{range.items}}{{$id_field}}:{{end}}" 'frontend:' - # Command - kubectl delete rs frontend "${kube_flags[@]}" - # Post-condition: no replica set exists - kube::test::get_object_assert rs "{{range.items}}{{$id_field}}:{{end}}" '' - - ### Create two replica sets - # Pre-condition: no replica set exists - kube::test::get_object_assert rs "{{range.items}}{{$id_field}}:{{end}}" '' - # Command - kubectl create -f hack/testdata/frontend-replicaset.yaml "${kube_flags[@]}" - kubectl create -f hack/testdata/redis-slave-replicaset.yaml "${kube_flags[@]}" - # Post-condition: frontend and redis-slave - kube::test::get_object_assert rs "{{range.items}}{{$id_field}}:{{end}}" 'frontend:redis-slave:' - - ### Delete multiple replica sets at once - # Pre-condition: frontend and redis-slave - kube::test::get_object_assert rs "{{range.items}}{{$id_field}}:{{end}}" 'frontend:redis-slave:' - # Command - kubectl delete rs frontend redis-slave "${kube_flags[@]}" # delete multiple replica sets at once - # Post-condition: no replica set exists - kube::test::get_object_assert rs "{{range.items}}{{$id_field}}:{{end}}" '' - - ### Auto scale replica set - # Pre-condition: no replica set exists - kube::test::get_object_assert rs "{{range.items}}{{$id_field}}:{{end}}" '' - # Command - kubectl create -f hack/testdata/frontend-replicaset.yaml "${kube_flags[@]}" - kube::test::get_object_assert rs "{{range.items}}{{$id_field}}:{{end}}" 'frontend:' - # autoscale 1~2 pods, CPU utilization 70%, replica set specified by file - kubectl autoscale -f hack/testdata/frontend-replicaset.yaml "${kube_flags[@]}" --max=2 --cpu-percent=70 - kube::test::get_object_assert 'hpa frontend' "{{$hpa_min_field}} {{$hpa_max_field}} {{$hpa_cpu_field}}" '1 2 70' - kubectl delete hpa frontend "${kube_flags[@]}" - # autoscale 2~3 pods, no CPU utilization specified, replica set specified by name - kubectl autoscale rs frontend "${kube_flags[@]}" --min=2 --max=3 - kube::test::get_object_assert 'hpa frontend' "{{$hpa_min_field}} {{$hpa_max_field}} {{$hpa_cpu_field}}" '2 3 ' - kubectl delete hpa frontend "${kube_flags[@]}" - # autoscale without specifying --max should fail - ! kubectl autoscale rs frontend "${kube_flags[@]}" - # Clean up - kubectl delete rs frontend "${kube_flags[@]}" - - - ###################### - # Lists # - ###################### - - kube::log::status "Testing kubectl(${version}:lists)" - - ### Create a List with objects from multiple versions - # Command - kubectl create -f hack/testdata/list.yaml "${kube_flags[@]}" - - ### Delete the List with objects from multiple versions - # Command - kubectl delete service/list-service-test deployment/list-deployment-test - - - ###################### - # Multiple Resources # - ###################### - - kube::log::status "Testing kubectl(${version}:multiple resources)" - - FILES="hack/testdata/multi-resource-yaml - hack/testdata/multi-resource-list - hack/testdata/multi-resource-json - hack/testdata/multi-resource-rclist - hack/testdata/multi-resource-svclist" - YAML=".yaml" - JSON=".json" - for file in $FILES; do - if [ -f $file$YAML ] - then - file=$file$YAML - replace_file="${file%.yaml}-modify.yaml" - else - file=$file$JSON - replace_file="${file%.json}-modify.json" - fi - - has_svc=true - has_rc=true - two_rcs=false - two_svcs=false - if [[ "${file}" == *rclist* ]]; then - has_svc=false - two_rcs=true - fi - if [[ "${file}" == *svclist* ]]; then - has_rc=false - two_svcs=true - fi - - ### Create, get, describe, replace, label, annotate, and then delete service nginxsvc and replication controller my-nginx from 5 types of files: - ### 1) YAML, separated by ---; 2) JSON, with a List type; 3) JSON, with JSON object concatenation - ### 4) JSON, with a ReplicationControllerList type; 5) JSON, with a ServiceList type - echo "Testing with file ${file} and replace with file ${replace_file}" - # Pre-condition: no service (other than default kubernetes services) or replication controller exists - kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:' - kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" '' - # Command - kubectl create -f "${file}" "${kube_flags[@]}" - # Post-condition: mock service (and mock2) exists - if [ "$has_svc" = true ]; then - if [ "$two_svcs" = true ]; then - kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:mock:mock2:' - else - kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:mock:' - fi - fi - # Post-condition: mock rc (and mock2) exists - if [ "$has_rc" = true ]; then - if [ "$two_rcs" = true ]; then - kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" 'mock:mock2:' - else - kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" 'mock:' - fi - fi - # Command - kubectl get -f "${file}" "${kube_flags[@]}" - # Command: watching multiple resources should return "not supported" error - WATCH_ERROR_FILE="${KUBE_TEMP}/kubectl-watch-error" - kubectl get -f "${file}" "${kube_flags[@]}" "--watch" 2> ${WATCH_ERROR_FILE} || true - if ! grep -q "watch is only supported on individual resources and resource collections" "${WATCH_ERROR_FILE}"; then - kube::log::error_exit "kubectl watch multiple resource returns unexpected error or non-error: $(cat ${WATCH_ERROR_FILE})" "1" - fi - kubectl describe -f "${file}" "${kube_flags[@]}" - # Command - kubectl replace -f $replace_file --force --cascade "${kube_flags[@]}" - # Post-condition: mock service (and mock2) and mock rc (and mock2) are replaced - if [ "$has_svc" = true ]; then - kube::test::get_object_assert 'services mock' "{{${labels_field}.status}}" 'replaced' - if [ "$two_svcs" = true ]; then - kube::test::get_object_assert 'services mock2' "{{${labels_field}.status}}" 'replaced' - fi - fi - if [ "$has_rc" = true ]; then - kube::test::get_object_assert 'rc mock' "{{${labels_field}.status}}" 'replaced' - if [ "$two_rcs" = true ]; then - kube::test::get_object_assert 'rc mock2' "{{${labels_field}.status}}" 'replaced' - fi - fi - # Command: kubectl edit multiple resources - temp_editor="${KUBE_TEMP}/tmp-editor.sh" - echo -e "#!/bin/bash\n$SED -i \"s/status\:\ replaced/status\:\ edited/g\" \$@" > "${temp_editor}" - chmod +x "${temp_editor}" - EDITOR="${temp_editor}" kubectl edit "${kube_flags[@]}" -f "${file}" - # Post-condition: mock service (and mock2) and mock rc (and mock2) are edited - if [ "$has_svc" = true ]; then - kube::test::get_object_assert 'services mock' "{{${labels_field}.status}}" 'edited' - if [ "$two_svcs" = true ]; then - kube::test::get_object_assert 'services mock2' "{{${labels_field}.status}}" 'edited' - fi - fi - if [ "$has_rc" = true ]; then - kube::test::get_object_assert 'rc mock' "{{${labels_field}.status}}" 'edited' - if [ "$two_rcs" = true ]; then - kube::test::get_object_assert 'rc mock2' "{{${labels_field}.status}}" 'edited' - fi - fi - # cleaning - rm "${temp_editor}" - # Command - # We need to set --overwrite, because otherwise, if the first attempt to run "kubectl label" - # fails on some, but not all, of the resources, retries will fail because it tries to modify - # existing labels. - kubectl-with-retry label -f $file labeled=true --overwrite "${kube_flags[@]}" - # Post-condition: mock service and mock rc (and mock2) are labeled - if [ "$has_svc" = true ]; then - kube::test::get_object_assert 'services mock' "{{${labels_field}.labeled}}" 'true' - if [ "$two_svcs" = true ]; then - kube::test::get_object_assert 'services mock2' "{{${labels_field}.labeled}}" 'true' - fi - fi - if [ "$has_rc" = true ]; then - kube::test::get_object_assert 'rc mock' "{{${labels_field}.labeled}}" 'true' - if [ "$two_rcs" = true ]; then - kube::test::get_object_assert 'rc mock2' "{{${labels_field}.labeled}}" 'true' - fi - fi - # Command - # Command - # We need to set --overwrite, because otherwise, if the first attempt to run "kubectl annotate" - # fails on some, but not all, of the resources, retries will fail because it tries to modify - # existing annotations. - kubectl-with-retry annotate -f $file annotated=true --overwrite "${kube_flags[@]}" - # Post-condition: mock service (and mock2) and mock rc (and mock2) are annotated - if [ "$has_svc" = true ]; then - kube::test::get_object_assert 'services mock' "{{${annotations_field}.annotated}}" 'true' - if [ "$two_svcs" = true ]; then - kube::test::get_object_assert 'services mock2' "{{${annotations_field}.annotated}}" 'true' - fi - fi - if [ "$has_rc" = true ]; then - kube::test::get_object_assert 'rc mock' "{{${annotations_field}.annotated}}" 'true' - if [ "$two_rcs" = true ]; then - kube::test::get_object_assert 'rc mock2' "{{${annotations_field}.annotated}}" 'true' - fi - fi - # Cleanup resources created - kubectl delete -f "${file}" "${kube_flags[@]}" - done - - ############################# - # Multiple Resources via URL# - ############################# - - # Pre-condition: no service (other than default kubernetes services) or replication controller exists - kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:' - kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" '' - - # Command - kubectl create -f https://raw.githubusercontent.com/kubernetes/kubernetes/master/hack/testdata/multi-resource-yaml.yaml "${kube_flags[@]}" - - # Post-condition: service(mock) and rc(mock) exist - kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:mock:' - kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" 'mock:' - - # Clean up - kubectl delete -f https://raw.githubusercontent.com/kubernetes/kubernetes/master/hack/testdata/multi-resource-yaml.yaml "${kube_flags[@]}" - - # Post-condition: no service (other than default kubernetes services) or replication controller exists - kube::test::get_object_assert services "{{range.items}}{{$id_field}}:{{end}}" 'kubernetes:' - kube::test::get_object_assert rc "{{range.items}}{{$id_field}}:{{end}}" '' - - - ###################### - # Persistent Volumes # - ###################### - - ### Create and delete persistent volume examples - # Pre-condition: no persistent volumes currently exist - kube::test::get_object_assert pv "{{range.items}}{{$id_field}}:{{end}}" '' - # Command - kubectl create -f docs/user-guide/persistent-volumes/volumes/local-01.yaml "${kube_flags[@]}" - kube::test::get_object_assert pv "{{range.items}}{{$id_field}}:{{end}}" 'pv0001:' - kubectl delete pv pv0001 "${kube_flags[@]}" - kubectl create -f docs/user-guide/persistent-volumes/volumes/local-02.yaml "${kube_flags[@]}" - kube::test::get_object_assert pv "{{range.items}}{{$id_field}}:{{end}}" 'pv0002:' - kubectl delete pv pv0002 "${kube_flags[@]}" - kubectl create -f docs/user-guide/persistent-volumes/volumes/gce.yaml "${kube_flags[@]}" - kube::test::get_object_assert pv "{{range.items}}{{$id_field}}:{{end}}" 'pv0003:' - kubectl delete pv pv0003 "${kube_flags[@]}" - # Post-condition: no PVs - kube::test::get_object_assert pv "{{range.items}}{{$id_field}}:{{end}}" '' - - ############################ - # Persistent Volume Claims # - ############################ - - ### Create and delete persistent volume claim examples - # Pre-condition: no persistent volume claims currently exist - kube::test::get_object_assert pvc "{{range.items}}{{$id_field}}:{{end}}" '' - # Command - kubectl create -f docs/user-guide/persistent-volumes/claims/claim-01.yaml "${kube_flags[@]}" - kube::test::get_object_assert pvc "{{range.items}}{{$id_field}}:{{end}}" 'myclaim-1:' - kubectl delete pvc myclaim-1 "${kube_flags[@]}" - - kubectl create -f docs/user-guide/persistent-volumes/claims/claim-02.yaml "${kube_flags[@]}" - kube::test::get_object_assert pvc "{{range.items}}{{$id_field}}:{{end}}" 'myclaim-2:' - kubectl delete pvc myclaim-2 "${kube_flags[@]}" - - kubectl create -f docs/user-guide/persistent-volumes/claims/claim-03.json "${kube_flags[@]}" - kube::test::get_object_assert pvc "{{range.items}}{{$id_field}}:{{end}}" 'myclaim-3:' - kubectl delete pvc myclaim-3 "${kube_flags[@]}" - # Post-condition: no PVCs - kube::test::get_object_assert pvc "{{range.items}}{{$id_field}}:{{end}}" '' - - - - ######### - # Nodes # - ######### - - kube::log::status "Testing kubectl(${version}:nodes)" - - kube::test::get_object_assert nodes "{{range.items}}{{$id_field}}:{{end}}" '127.0.0.1:' - - kube::test::describe_object_assert nodes "127.0.0.1" "Name:" "Labels:" "CreationTimestamp:" "Conditions:" "Addresses:" "Capacity:" "Pods:" - # Describe command should print events information by default - kube::test::describe_object_events_assert nodes "127.0.0.1" - # Describe command should not print events information when show-events=false - kube::test::describe_object_events_assert nodes "127.0.0.1" false - # Describe command should print events information when show-events=true - kube::test::describe_object_events_assert nodes "127.0.0.1" true - # Describe command (resource only) should print detailed information - kube::test::describe_resource_assert nodes "Name:" "Labels:" "CreationTimestamp:" "Conditions:" "Addresses:" "Capacity:" "Pods:" - # Describe command should print events information by default - kube::test::describe_resource_events_assert nodes - # Describe command should not print events information when show-events=false - kube::test::describe_resource_events_assert nodes false - # Describe command should print events information when show-events=true - kube::test::describe_resource_events_assert nodes true - - ### kubectl patch update can mark node unschedulable - # Pre-condition: node is schedulable - kube::test::get_object_assert "nodes 127.0.0.1" "{{.spec.unschedulable}}" '' - kubectl patch "${kube_flags[@]}" nodes "127.0.0.1" -p='{"spec":{"unschedulable":true}}' - # Post-condition: node is unschedulable - kube::test::get_object_assert "nodes 127.0.0.1" "{{.spec.unschedulable}}" 'true' - kubectl patch "${kube_flags[@]}" nodes "127.0.0.1" -p='{"spec":{"unschedulable":null}}' - # Post-condition: node is schedulable - kube::test::get_object_assert "nodes 127.0.0.1" "{{.spec.unschedulable}}" '' - - - ##################### - # Retrieve multiple # - ##################### - - kube::log::status "Testing kubectl(${version}:multiget)" - kube::test::get_object_assert 'nodes/127.0.0.1 service/kubernetes' "{{range.items}}{{$id_field}}:{{end}}" '127.0.0.1:kubernetes:' - - - ##################### - # Resource aliasing # - ##################### - - kube::log::status "Testing resource aliasing" - kubectl create -f examples/storage/cassandra/cassandra-controller.yaml "${kube_flags[@]}" - kubectl create -f examples/storage/cassandra/cassandra-service.yaml "${kube_flags[@]}" - - object="all -l'app=cassandra'" - request="{{range.items}}{{range .metadata.labels}}{{.}}:{{end}}{{end}}" - - # all 4 cassandra's might not be in the request immediately... - kube::test::get_object_assert "$object" "$request" 'cassandra:cassandra:cassandra:cassandra:' || \ - kube::test::get_object_assert "$object" "$request" 'cassandra:cassandra:cassandra:' || \ - kube::test::get_object_assert "$object" "$request" 'cassandra:cassandra:' - - kubectl delete all -l app=cassandra "${kube_flags[@]}" - - ########### - # Explain # - ########### - - kube::log::status "Testing kubectl(${version}:explain)" - kubectl explain pods - # shortcuts work - kubectl explain po - kubectl explain po.status.message - - - ########### - # Swagger # - ########### - - if [[ -n "${version}" ]]; then - # Verify schema - file="${KUBE_TEMP}/schema-${version}.json" - curl -s "http://127.0.0.1:${API_PORT}/swaggerapi/api/${version}" > "${file}" - [[ "$(grep "list of returned" "${file}")" ]] - [[ "$(grep "List of pods" "${file}")" ]] - [[ "$(grep "Watch for changes to the described resources" "${file}")" ]] - fi - - ##################### - # Kubectl --sort-by # - ##################### - - ### sort-by should not panic if no pod exists - # Pre-condition: no POD exists - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' - # Command - kubectl get pods --sort-by="{metadata.name}" - kubectl get pods --sort-by="{metadata.creationTimestamp}" - - ############################ - # Kubectl --all-namespaces # - ############################ - - # Pre-condition: the "default" namespace exists - kube::test::get_object_assert namespaces "{{range.items}}{{if eq $id_field \\\"default\\\"}}{{$id_field}}:{{end}}{{end}}" 'default:' - - ### Create POD - # Pre-condition: no POD exists - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' - # Command - kubectl create "${kube_flags[@]}" -f docs/admin/limitrange/valid-pod.yaml - # Post-condition: valid-pod is created - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' - - ### Verify a specific namespace is ignored when all-namespaces is provided - # Command - kubectl get pods --all-namespaces --namespace=default - - ### Clean up - # Pre-condition: valid-pod exists - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' - # Command - kubectl delete "${kube_flags[@]}" pod valid-pod --grace-period=0 - # Post-condition: valid-pod doesn't exist - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' - - kube::test::clear_all -} - -runTests "v1" - -kube::log::status "TEST PASSED" +echo "NOTE: $0 has been replaced by 'make test-cmd'" +echo +echo "The equivalent of this invocation is: " +echo " make test-cmd ${ARGHELP}" +echo +echo +make --no-print-directory -C "${KUBE_ROOT}" test-cmd diff --git a/hack/test-go.sh b/hack/test-go.sh index 635445b2883..a1e4e92189a 100755 --- a/hack/test-go.sh +++ b/hack/test-go.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2014 The Kubernetes Authors. +# 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. @@ -14,269 +14,24 @@ # See the License for the specific language governing permissions and # limitations under the License. +# This script is a vestigial redirection. Please do not add "real" logic. + set -o errexit set -o nounset set -o pipefail KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. -source "${KUBE_ROOT}/hack/lib/init.sh" -kube::golang::setup_env - -kube::test::find_dirs() { - ( - cd ${KUBE_ROOT} - find . -not \( \ - \( \ - -path './_artifacts/*' \ - -o -path './_output/*' \ - -o -path './_gopath/*' \ - -o -path './contrib/podex/*' \ - -o -path './output/*' \ - -o -path './release/*' \ - -o -path './target/*' \ - -o -path './test/e2e/*' \ - -o -path './test/e2e_node/*' \ - -o -path './test/integration/*' \ - -o -path './test/component/scheduler/perf/*' \ - -o -path './third_party/*'\ - -o -path './vendor/*'\ - \) -prune \ - \) -name '*_test.go' -print0 | xargs -0n1 dirname | sed 's|^\./||' | sort -u - ) -} - -KUBE_TIMEOUT=${KUBE_TIMEOUT:--timeout 120s} -KUBE_COVER=${KUBE_COVER:-n} # set to 'y' to enable coverage collection -KUBE_COVERMODE=${KUBE_COVERMODE:-atomic} -# How many 'go test' instances to run simultaneously when running tests in -# coverage mode. -KUBE_COVERPROCS=${KUBE_COVERPROCS:-4} -KUBE_RACE=${KUBE_RACE:-} # use KUBE_RACE="-race" to enable race testing -# Set to the goveralls binary path to report coverage results to Coveralls.io. -KUBE_GOVERALLS_BIN=${KUBE_GOVERALLS_BIN:-} -# 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" -# 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,batch/v2alpha1,extensions/v1beta1,apps/v1alpha1,federation/v1beta1,policy/v1alpha1,rbac.authorization.k8s.io/v1alpha1,certificates/v1alpha1"} -# once we have multiple group supports -# Create a junit-style XML test report in this directory if set. -KUBE_JUNIT_REPORT_DIR=${KUBE_JUNIT_REPORT_DIR:-} -# Set to 'y' to keep the verbose stdout from tests when KUBE_JUNIT_REPORT_DIR is -# set. -KUBE_KEEP_VERBOSE_TEST_OUTPUT=${KUBE_KEEP_VERBOSE_TEST_OUTPUT:-n} - -kube::test::usage() { - kube::log::usage_from_stdin < : number of parallel workers, must be >= 1 -EOF -} - -isnum() { - [[ "$1" =~ ^[0-9]+$ ]] -} - -parallel=1 -while getopts "hp:i:" opt ; do - case $opt in - h) - kube::test::usage - exit 0 - ;; - p) - parallel="$OPTARG" - if ! isnum "${parallel}" || [[ "${parallel}" -le 0 ]]; then - kube::log::usage "'$0': argument to -p must be numeric and greater than 0" - kube::test::usage - exit 1 - fi - ;; - i) - kube::log::usage "'$0': use GOFLAGS='-count '" - kube::test::usage - exit 1 - ;; - ?) - kube::test::usage - exit 1 - ;; - :) - kube::log::usage "Option -$OPTARG " - kube::test::usage - exit 1 - ;; - esac -done -shift $((OPTIND - 1)) - -# Use eval to preserve embedded quoted strings. -eval "goflags=(${KUBE_GOFLAGS:-})" -eval "testargs=(${KUBE_TEST_ARGS:-})" - -# Used to filter verbose test output. -go_test_grep_pattern=".*" - -# The go-junit-report tool needs full test case information to produce a -# meaningful report. -if [[ -n "${KUBE_JUNIT_REPORT_DIR}" ]] ; then - goflags+=(-v) - # Show only summary lines by matching lines like "status package/test" - go_test_grep_pattern="^[^[:space:]]\+[[:space:]]\+[^[:space:]]\+/[^[[:space:]]\+" +# For help output +ARGHELP="" +if [[ "$#" -gt 0 ]]; then + ARGHELP="WHAT='$@'" fi -# Filter out arguments that start with "-" and move them to goflags. -testcases=() -for arg; do - if [[ "${arg}" == -* ]]; then - goflags+=("${arg}") - else - testcases+=("${arg}") - fi -done -if [[ ${#testcases[@]} -eq 0 ]]; then - testcases=($(kube::test::find_dirs)) -fi -set -- "${testcases[@]+${testcases[@]}}" - -junitFilenamePrefix() { - if [[ -z "${KUBE_JUNIT_REPORT_DIR}" ]]; then - echo "" - return - fi - mkdir -p "${KUBE_JUNIT_REPORT_DIR}" - local KUBE_TEST_API_NO_SLASH="${KUBE_TEST_API//\//-}" - echo "${KUBE_JUNIT_REPORT_DIR}/junit_${KUBE_TEST_API_NO_SLASH}_$(kube::util::sortable_date)" -} - -produceJUnitXMLReport() { - local -r junit_filename_prefix=$1 - if [[ -z "${junit_filename_prefix}" ]]; then - return - fi - - local test_stdout_filenames - local junit_xml_filename - test_stdout_filenames=$(ls ${junit_filename_prefix}*.stdout) - junit_xml_filename="${junit_filename_prefix}.xml" - if ! command -v go-junit-report >/dev/null 2>&1; then - kube::log::error "go-junit-report not found; please install with " \ - "go get -u github.com/jstemmer/go-junit-report" - return - fi - cat ${test_stdout_filenames} | go-junit-report > "${junit_xml_filename}" - if [[ ! ${KUBE_KEEP_VERBOSE_TEST_OUTPUT} =~ ^[yY]$ ]]; then - rm ${test_stdout_filenames} - fi - kube::log::status "Saved JUnit XML test report to ${junit_xml_filename}" -} - -runTests() { - local junit_filename_prefix - junit_filename_prefix=$(junitFilenamePrefix) - - # If we're not collecting coverage, run all requested tests with one 'go test' - # command, which is much faster. - if [[ ! ${KUBE_COVER} =~ ^[yY]$ ]]; then - kube::log::status "Running tests without code coverage" - go test "${goflags[@]:+${goflags[@]}}" \ - ${KUBE_RACE} ${KUBE_TIMEOUT} "${@+${@/#/${KUBE_GO_PACKAGE}/}}" \ - "${testargs[@]:+${testargs[@]}}" \ - | tee ${junit_filename_prefix:+"${junit_filename_prefix}.stdout"} \ - | grep "${go_test_grep_pattern}" && rc=$? || rc=$? - produceJUnitXMLReport "${junit_filename_prefix}" - return ${rc} - fi - - # Create coverage report directories. - cover_report_dir="/tmp/k8s_coverage/${KUBE_TEST_API}/$(kube::util::sortable_date)" - cover_profile="coverage.out" # Name for each individual coverage profile - kube::log::status "Saving coverage output in '${cover_report_dir}'" - mkdir -p "${@+${@/#/${cover_report_dir}/}}" - - # Run all specified tests, collecting coverage results. Go currently doesn't - # support collecting coverage across multiple packages at once, so we must issue - # separate 'go test' commands for each package and then combine at the end. - # To speed things up considerably, we can at least use xargs -P to run multiple - # 'go test' commands at once. - # To properly parse the test results if generating a JUnit test report, we - # must make sure the output from parallel runs is not mixed. To achieve this, - # we spawn a subshell for each parallel process, redirecting the output to - # separate files. - # cmd/libs/go2idl/generator is fragile when run under coverage, so ignore it for now. - # see: https://github.com/kubernetes/kubernetes/issues/24967 - printf "%s\n" "${@}" | grep -v "cmd/libs/go2idl/generator"| xargs -I{} -n1 -P${KUBE_COVERPROCS} \ - bash -c "set -o pipefail; _pkg=\"{}\"; _pkg_out=\${_pkg//\//_}; \ - go test ${goflags[@]:+${goflags[@]}} \ - ${KUBE_RACE} \ - ${KUBE_TIMEOUT} \ - -cover -covermode=\"${KUBE_COVERMODE}\" \ - -coverprofile=\"${cover_report_dir}/\${_pkg}/${cover_profile}\" \ - \"${KUBE_GO_PACKAGE}/\${_pkg}\" \ - ${testargs[@]:+${testargs[@]}} \ - | tee ${junit_filename_prefix:+\"${junit_filename_prefix}-\$_pkg_out.stdout\"} \ - | grep \"${go_test_grep_pattern}\"" \ - && test_result=$? || test_result=$? - - produceJUnitXMLReport "${junit_filename_prefix}" - - COMBINED_COVER_PROFILE="${cover_report_dir}/combined-coverage.out" - { - # The combined coverage profile needs to start with a line indicating which - # coverage mode was used (set, count, or atomic). This line is included in - # each of the coverage profiles generated when running 'go test -cover', but - # we strip these lines out when combining so that there's only one. - echo "mode: ${KUBE_COVERMODE}" - - # Include all coverage reach data in the combined profile, but exclude the - # 'mode' lines, as there should be only one. - for x in `find "${cover_report_dir}" -name "${cover_profile}"`; do - cat $x | grep -h -v "^mode:" || true - done - } >"${COMBINED_COVER_PROFILE}" - - coverage_html_file="${cover_report_dir}/combined-coverage.html" - go tool cover -html="${COMBINED_COVER_PROFILE}" -o="${coverage_html_file}" - kube::log::status "Combined coverage report: ${coverage_html_file}" - - return ${test_result} -} - -reportCoverageToCoveralls() { - if [[ ${KUBE_COVER} =~ ^[yY]$ ]] && [[ -x "${KUBE_GOVERALLS_BIN}" ]]; then - kube::log::status "Reporting coverage results to Coveralls for service ${CI_NAME:-}" - ${KUBE_GOVERALLS_BIN} -coverprofile="${COMBINED_COVER_PROFILE}" \ - ${CI_NAME:+"-service=${CI_NAME}"} \ - ${COVERALLS_REPO_TOKEN:+"-repotoken=${COVERALLS_REPO_TOKEN}"} \ - || true - fi -} - -checkFDs() { - # several unittests panic when httptest cannot open more sockets - # due to the low default files limit on OS X. Warn about low limit. - local fileslimit="$(ulimit -n)" - if [[ $fileslimit -lt 1000 ]]; then - echo "WARNING: ulimit -n (files) should be at least 1000, is $fileslimit, may cause test failure"; - fi -} - -checkFDs - -# Convert the CSVs to arrays. -IFS=';' read -a apiVersions <<< "${KUBE_TEST_API_VERSIONS}" -apiVersionsCount=${#apiVersions[@]} -for (( i=0; i<${apiVersionsCount}; i++ )); do - apiVersion=${apiVersions[i]} - echo "Running tests for APIVersion: $apiVersion" - # KUBE_TEST_API sets the version of each group to be tested. - KUBE_TEST_API="${apiVersion}" runTests "$@" -done - -# We might run the tests for multiple versions, but we want to report only -# one of them to coveralls. Here we report coverage from the last run. -reportCoverageToCoveralls +echo "NOTE: $0 has been replaced by 'make test'" +echo +echo "The equivalent of this invocation is: " +echo " make test ${ARGHELP}" +echo +echo +make --no-print-directory -C "${KUBE_ROOT}" test WHAT="$*" diff --git a/hack/test-integration.sh b/hack/test-integration.sh index eb882a43777..766e4a0c81a 100755 --- a/hack/test-integration.sh +++ b/hack/test-integration.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2014 The Kubernetes Authors. +# 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. @@ -14,80 +14,22 @@ # See the License for the specific language governing permissions and # limitations under the License. +# This script is a vestigial redirection. Please do not add "real" logic. + 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:-} +echo "NOTE: $0 has been replaced by 'make test-integration'" +echo +echo "The equivalent of this invocation is: " +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 -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 -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 diff --git a/hack/test-update-storage-objects.sh b/hack/test-update-storage-objects.sh index a51d2642918..1213a04b7bd 100755 --- a/hack/test-update-storage-objects.sh +++ b/hack/test-update-storage-objects.sh @@ -92,7 +92,7 @@ function cleanup() { trap cleanup EXIT SIGINT -"${KUBE_ROOT}/hack/build-go.sh" cmd/kube-apiserver +make -C "${KUBE_ROOT}" WHAT=cmd/kube-apiserver kube::etcd::start diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index 2eba4de2f27..9f6a4e1533e 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -29,7 +29,7 @@ BUILD_TARGETS=( cmd/libs/go2idl/deepcopy-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") conversiongen=$(kube::util::find-binary "conversion-gen") diff --git a/hack/update-generated-docs.sh b/hack/update-generated-docs.sh index f42c0f3c6ee..457b4a4c327 100755 --- a/hack/update-generated-docs.sh +++ b/hack/update-generated-docs.sh @@ -27,12 +27,14 @@ source "${KUBE_ROOT}/hack/lib/init.sh" kube::golang::setup_env -"${KUBE_ROOT}/hack/build-go.sh" \ - cmd/gendocs \ - cmd/genkubedocs \ - cmd/genman \ - cmd/genyaml \ - federation/cmd/genfeddocs +BINS=( + cmd/gendocs + cmd/genkubedocs + cmd/genman + cmd/genyaml + federation/cmd/genfeddocs +) +make -C "${KUBE_ROOT}" WHAT="${BINS[*]}" kube::util::ensure-temp-dir diff --git a/hack/update-generated-protobuf-dockerized.sh b/hack/update-generated-protobuf-dockerized.sh index 447bf271462..5cb379d370b 100755 --- a/hack/update-generated-protobuf-dockerized.sh +++ b/hack/update-generated-protobuf-dockerized.sh @@ -23,9 +23,11 @@ source "${KUBE_ROOT}/hack/lib/init.sh" kube::golang::setup_env -hack/build-go.sh \ - cmd/libs/go2idl/go-to-protobuf \ - cmd/libs/go2idl/go-to-protobuf/protoc-gen-gogo +BINS=( + cmd/libs/go2idl/go-to-protobuf + 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 echo "Generating protobuf requires protoc 3.0.0-beta1 or newer. Please download and" diff --git a/hack/update-munge-docs.sh b/hack/update-munge-docs.sh index 2c1dec561a7..1bc71c690bb 100755 --- a/hack/update-munge-docs.sh +++ b/hack/update-munge-docs.sh @@ -26,8 +26,7 @@ git_upstream=$(kube::util::git_upstream_remote_name) kube::golang::setup_env -"${KUBE_ROOT}/hack/build-go.sh" \ - cmd/mungedocs +make -C "${KUBE_ROOT}" WHAT=cmd/mungedocs kube::util::ensure-temp-dir diff --git a/hack/update-swagger-spec.sh b/hack/update-swagger-spec.sh index ec4d65eac01..ea888bcb54b 100755 --- a/hack/update-swagger-spec.sh +++ b/hack/update-swagger-spec.sh @@ -33,7 +33,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh" kube::golang::setup_env -"${KUBE_ROOT}/hack/build-go.sh" cmd/kube-apiserver +make -C "${KUBE_ROOT}" WHAT=cmd/kube-apiserver function cleanup() { diff --git a/hack/verify-all.sh b/hack/verify-all.sh index fc0630c48af..45a9a571e13 100755 --- a/hack/verify-all.sh +++ b/hack/verify-all.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2014 The Kubernetes Authors. +# 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. @@ -14,82 +14,24 @@ # See the License for the specific language governing permissions and # limitations under the License. +# This script is a vestigial redirection. Please do not add "real" logic. + set -o errexit set -o nounset set -o pipefail 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 { - 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 the silent mode, run with -v if you want to see script logs." +# For help output +ARGHELP="" +if [[ -n "${KUBE_VERIFY_GIT_BRANCH:-}" ]]; then + ARGHELP="BRANCH=${KUBE_VERIFY_GIT_BRANCH}" 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 +echo "NOTE: $0 has been replaced by 'make verify'" +echo +echo "The equivalent of this invocation is: " +echo " make verify ${ARGHELP}" +echo +echo +make --no-print-directory -C "${KUBE_ROOT}" verify BRANCH="${KUBE_VERIFY_GIT_BRANCH:-}" diff --git a/hack/verify-description.sh b/hack/verify-description.sh index 8bcbb0d65f9..8fca1b2fc85 100755 --- a/hack/verify-description.sh +++ b/hack/verify-description.sh @@ -23,7 +23,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh" kube::golang::setup_env -"${KUBE_ROOT}/hack/build-go.sh" cmd/genswaggertypedocs +make -C "${KUBE_ROOT}" WHAT=cmd/genswaggertypedocs # Find binary genswaggertypedocs=$(kube::util::find-binary "genswaggertypedocs") diff --git a/hack/verify-generated-docs.sh b/hack/verify-generated-docs.sh index b543a501663..8ca70334c87 100755 --- a/hack/verify-generated-docs.sh +++ b/hack/verify-generated-docs.sh @@ -23,12 +23,14 @@ source "${KUBE_ROOT}/hack/lib/init.sh" kube::golang::setup_env -"${KUBE_ROOT}/hack/build-go.sh" \ - cmd/gendocs \ - cmd/genkubedocs \ - cmd/genman \ - cmd/genyaml \ - federation/cmd/genfeddocs +BINS=( + cmd/gendocs + cmd/genkubedocs + cmd/genman + cmd/genyaml + federation/cmd/genfeddocs +) +make -C "${KUBE_ROOT}" WHAT="${BINS[*]}" kube::util::ensure-temp-dir diff --git a/hack/verify-generated-swagger-docs.sh b/hack/verify-generated-swagger-docs.sh index 8bbd7671595..0212689e64d 100755 --- a/hack/verify-generated-swagger-docs.sh +++ b/hack/verify-generated-swagger-docs.sh @@ -23,7 +23,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh" kube::golang::setup_env -"${KUBE_ROOT}/hack/build-go.sh" cmd/genswaggertypedocs +make -C "${KUBE_ROOT}" WHAT=cmd/genswaggertypedocs # Find binary genswaggertypedocs=$(kube::util::find-binary "genswaggertypedocs") @@ -33,7 +33,7 @@ if [[ ! -x "$genswaggertypedocs" ]]; then echo "It looks as if you don't have a compiled genswaggertypedocs binary" echo 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 exit 1 fi diff --git a/hack/verify-govet.sh b/hack/verify-govet.sh index ab1c1457283..13e3c4b39db 100755 --- a/hack/verify-govet.sh +++ b/hack/verify-govet.sh @@ -14,36 +14,24 @@ # See the License for the specific language governing permissions and # limitations under the License. +# This script is a vestigial redirection. Please do not add "real" logic. 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. -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)/") +# For help output +ARGHELP="" +if [[ "$#" -gt 0 ]]; then + ARGHELP="WHAT='$@'" 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="$@" diff --git a/hack/verify-import-boss.sh b/hack/verify-import-boss.sh index cb6a3106952..635556d85da 100755 --- a/hack/verify-import-boss.sh +++ b/hack/verify-import-boss.sh @@ -23,6 +23,6 @@ source "${KUBE_ROOT}/hack/lib/init.sh" 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 diff --git a/hack/verify-linkcheck.sh b/hack/verify-linkcheck.sh index 7ec986617fe..69427f3ba3f 100755 --- a/hack/verify-linkcheck.sh +++ b/hack/verify-linkcheck.sh @@ -23,7 +23,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh" 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") diff --git a/hack/verify-munge-docs.sh b/hack/verify-munge-docs.sh index 69555680e9e..b242a8b6274 100755 --- a/hack/verify-munge-docs.sh +++ b/hack/verify-munge-docs.sh @@ -26,8 +26,7 @@ git_upstream=$(kube::util::git_upstream_remote_name) kube::golang::setup_env -"${KUBE_ROOT}/hack/build-go.sh" \ - cmd/mungedocs +make -C "${KUBE_ROOT}/" WHAT=cmd/mungedocs # Find binary mungedocs=$(kube::util::find-binary "mungedocs") diff --git a/hack/verify-swagger-spec.sh b/hack/verify-swagger-spec.sh index 2477882743f..c4035353388 100755 --- a/hack/verify-swagger-spec.sh +++ b/hack/verify-swagger-spec.sh @@ -23,7 +23,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh" 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") diff --git a/hack/verify-symbols.sh b/hack/verify-symbols.sh index f398d9ff09d..43d865cef87 100755 --- a/hack/verify-symbols.sh +++ b/hack/verify-symbols.sh @@ -23,7 +23,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh" kube::golang::setup_env -"${KUBE_ROOT}/hack/build-go.sh" cmd/hyperkube +make -C "${KUBE_ROOT}" WHAT=cmd/hyperkube # add other BADSYMBOLS here. BADSYMBOLS=( diff --git a/hooks/pre-commit b/hooks/pre-commit index 600f21afc9e..bd4cbe53bc1 100755 --- a/hooks/pre-commit +++ b/hooks/pre-commit @@ -7,7 +7,7 @@ readonly green=$(tput bold; tput setaf 2) exit_code=0 echo -ne "Checking that it builds... " -if ! OUT=$("hack/build-go.sh" 2>&1); then +if ! OUT=$(make 2>&1); then echo echo "${red}${OUT}" exit_code=1 diff --git a/pkg/api/ref_test.go b/pkg/api/ref_test.go index 82f26c11b60..8860fd5ac15 100644 --- a/pkg/api/ref_test.go +++ b/pkg/api/ref_test.go @@ -37,7 +37,7 @@ func (obj *ExtensionAPIObject) GetObjectKind() unversioned.ObjectKind { return & 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 // register manually to allow unit test execution if _, _, err := Scheme.ObjectKinds(&Pod{}); err != nil { diff --git a/test/e2e_node/e2e_build.go b/test/e2e_node/e2e_build.go index 9f1672fcdbd..769d03269e8 100644 --- a/test/e2e_node/e2e_build.go +++ b/test/e2e_node/e2e_build.go @@ -43,7 +43,8 @@ func buildGo() { if err != nil { glog.Fatalf("Failed to locate kubernetes root directory %v.", err) } - cmd := exec.Command(filepath.Join(k8sRoot, "hack/build-go.sh"), buildTargets...) + targets := strings.Join(buildTargets, " ") + cmd := exec.Command("make", "-C", k8sRoot, fmt.Sprintf("WHAT=%s", targets)) cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr err = cmd.Run() From 881e21c2d5efcddca900e4020bbdc2d7e3779ea6 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Mon, 30 May 2016 20:35:16 -0700 Subject: [PATCH 02/18] Link _output/bin/ to real binaries for this arch This makes followup commits easier wrt finding binaries during build. --- build/build-image/Dockerfile | 6 +++++- build/common.sh | 5 +++++ cluster/kubectl.sh | 1 + hack/lib/golang.sh | 2 ++ hack/lib/init.sh | 3 +++ hack/lib/util.sh | 1 + 6 files changed, 17 insertions(+), 1 deletion(-) diff --git a/build/build-image/Dockerfile b/build/build-image/Dockerfile index 9cf839dabfe..f754cf734e8 100644 --- a/build/build-image/Dockerfile +++ b/build/build-image/Dockerfile @@ -25,7 +25,11 @@ RUN chmod -R a+rwx /usr/local/go/pkg # of operations. ENV HOME /go/src/k8s.io/kubernetes 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 ADD kube-version-defs /kube-version-defs diff --git a/build/common.sh b/build/common.sh index dd1764e7f41..194cd882f36 100755 --- a/build/common.sh +++ b/build/common.sh @@ -64,6 +64,9 @@ readonly LOCAL_OUTPUT_BINPATH="${LOCAL_OUTPUT_SUBPATH}/bin" readonly LOCAL_OUTPUT_GOPATH="${LOCAL_OUTPUT_SUBPATH}/go" 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 REMOTE_OUTPUT_ROOT="/go/src/${KUBE_GO_PACKAGE}/_output" @@ -672,6 +675,8 @@ function kube::build::copy_output() { kube::log::status "Syncing back _output/dockerized/bin directory from remote Docker" rm -rf "${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}" "${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 diff --git a/cluster/kubectl.sh b/cluster/kubectl.sh index a8758412ab7..8280badff8a 100755 --- a/cluster/kubectl.sh +++ b/cluster/kubectl.sh @@ -85,6 +85,7 @@ esac # to find the latest one. if [[ -z "${KUBECTL_PATH:-}" ]]; then locations=( + "${KUBE_ROOT}/_output/bin/kubectl" "${KUBE_ROOT}/_output/dockerized/bin/${host_os}/${host_arch}/kubectl" "${KUBE_ROOT}/_output/local/bin/${host_os}/${host_arch}/kubectl" "${KUBE_ROOT}/platforms/${host_os}/${host_arch}/kubectl" diff --git a/hack/lib/golang.sh b/hack/lib/golang.sh index 1c88348651a..e08b895d87a 100755 --- a/hack/lib/golang.sh +++ b/hack/lib/golang.sh @@ -375,6 +375,8 @@ kube::golang::place_bins() { local platform_src="/${platform//\//_}" if [[ $platform == $host_platform ]]; then platform_src="" + rm -f "${THIS_PLATFORM_BIN}" + ln -s "${KUBE_OUTPUT_BINPATH}/${platform}" "${THIS_PLATFORM_BIN}" fi local full_binpath_src="${KUBE_GOPATH}/bin${platform_src}" diff --git a/hack/lib/init.sh b/hack/lib/init.sh index 60baa0b742a..78744e23fc8 100644 --- a/hack/lib/init.sh +++ b/hack/lib/init.sh @@ -29,6 +29,9 @@ KUBE_OUTPUT_BINPATH="${KUBE_OUTPUT}/bin" # the connections to localhost in scripts will time out 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}/cluster/lib/util.sh" source "${KUBE_ROOT}/cluster/lib/logging.sh" diff --git a/hack/lib/util.sh b/hack/lib/util.sh index 794cd41cd35..529c823bea7 100755 --- a/hack/lib/util.sh +++ b/hack/lib/util.sh @@ -168,6 +168,7 @@ kube::util::find-binary() { local lookfor="${1}" local host_platform="$(kube::util::host_platform)" local locations=( + "${KUBE_ROOT}/_output/bin/${lookfor}" "${KUBE_ROOT}/_output/dockerized/bin/${host_platform}/${lookfor}" "${KUBE_ROOT}/_output/local/bin/${host_platform}/${lookfor}" "${KUBE_ROOT}/platforms/${host_platform}/${lookfor}" From 58441e8775fe3594181d0263d4f7ac5bf07fe96d Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Fri, 20 May 2016 11:23:06 -0700 Subject: [PATCH 03/18] Don't check in generated deep-copy code This mostly takes the previously checked in files and removes them, and moves the generation to be on-demand instead of manual. Manually verified no change in generated output. --- .gitignore | 3 + Makefile | 92 +- cmd/libs/go2idl/deepcopy-gen/main.go | 4 +- .../apis/federation/deep_copy_generated.go | 155 - .../federation/v1beta1/deep_copy_generated.go | 156 - hack/update-codegen.sh | 14 - hack/verify-generated-protobuf.sh | 2 +- pkg/api/deep_copy_generated.go | 3555 ----------------- pkg/api/unversioned/deep_copy_generated.go | 390 -- pkg/api/v1/deep_copy_generated.go | 3521 ---------------- pkg/apis/apps/deep_copy_generated.go | 128 - pkg/apis/apps/v1alpha1/deep_copy_generated.go | 135 - .../deep_copy_generated.go | 103 - .../v1beta1/deep_copy_generated.go | 103 - pkg/apis/authorization/deep_copy_generated.go | 182 - .../v1beta1/deep_copy_generated.go | 182 - pkg/apis/autoscaling/deep_copy_generated.go | 182 - .../autoscaling/v1/deep_copy_generated.go | 183 - pkg/apis/batch/deep_copy_generated.go | 303 -- pkg/apis/batch/v1/deep_copy_generated.go | 226 -- .../batch/v2alpha1/deep_copy_generated.go | 351 -- pkg/apis/certificates/deep_copy_generated.go | 141 - .../v1alpha1/deep_copy_generated.go | 142 - .../componentconfig/deep_copy_generated.go | 336 -- .../v1alpha1/deep_copy_generated.go | 123 - pkg/apis/extensions/deep_copy_generated.go | 1076 ----- .../extensions/v1beta1/deep_copy_generated.go | 1447 ------- pkg/apis/policy/deep_copy_generated.go | 107 - .../policy/v1alpha1/deep_copy_generated.go | 108 - pkg/apis/rbac/deep_copy_generated.go | 282 -- pkg/apis/rbac/v1alpha1/deep_copy_generated.go | 279 -- pkg/runtime/deep_copy_generated.go | 75 - 32 files changed, 89 insertions(+), 13997 deletions(-) delete mode 100644 federation/apis/federation/deep_copy_generated.go delete mode 100644 federation/apis/federation/v1beta1/deep_copy_generated.go delete mode 100644 pkg/api/deep_copy_generated.go delete mode 100644 pkg/api/unversioned/deep_copy_generated.go delete mode 100644 pkg/api/v1/deep_copy_generated.go delete mode 100644 pkg/apis/apps/deep_copy_generated.go delete mode 100644 pkg/apis/apps/v1alpha1/deep_copy_generated.go delete mode 100644 pkg/apis/authentication.k8s.io/deep_copy_generated.go delete mode 100644 pkg/apis/authentication.k8s.io/v1beta1/deep_copy_generated.go delete mode 100644 pkg/apis/authorization/deep_copy_generated.go delete mode 100644 pkg/apis/authorization/v1beta1/deep_copy_generated.go delete mode 100644 pkg/apis/autoscaling/deep_copy_generated.go delete mode 100644 pkg/apis/autoscaling/v1/deep_copy_generated.go delete mode 100644 pkg/apis/batch/deep_copy_generated.go delete mode 100644 pkg/apis/batch/v1/deep_copy_generated.go delete mode 100644 pkg/apis/batch/v2alpha1/deep_copy_generated.go delete mode 100644 pkg/apis/certificates/deep_copy_generated.go delete mode 100644 pkg/apis/certificates/v1alpha1/deep_copy_generated.go delete mode 100644 pkg/apis/componentconfig/deep_copy_generated.go delete mode 100644 pkg/apis/componentconfig/v1alpha1/deep_copy_generated.go delete mode 100644 pkg/apis/extensions/deep_copy_generated.go delete mode 100644 pkg/apis/extensions/v1beta1/deep_copy_generated.go delete mode 100644 pkg/apis/policy/deep_copy_generated.go delete mode 100644 pkg/apis/policy/v1alpha1/deep_copy_generated.go delete mode 100644 pkg/apis/rbac/deep_copy_generated.go delete mode 100644 pkg/apis/rbac/v1alpha1/deep_copy_generated.go delete mode 100644 pkg/runtime/deep_copy_generated.go diff --git a/.gitignore b/.gitignore index 54e05fb6d1e..399fe07d63a 100644 --- a/.gitignore +++ b/.gitignore @@ -97,3 +97,6 @@ network_closure.sh # Downloaded kubernetes binary release tar ball kubernetes.tar.gz + +# generated files in any directory +zz_generated.* diff --git a/Makefile b/Makefile index 713af5f0a90..d6734094482 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,9 @@ # clean: Clean up. OUT_DIR = _output +BIN_DIR := $(OUT_DIR)/bin +PRJ_SRC_PATH := k8s.io/kubernetes +GENERATED_FILE_PREFIX := zz_generated. KUBE_GOFLAGS = $(GOFLAGS) export KUBE_GOFLAGS @@ -41,8 +44,7 @@ export KUBE_GOLDFLAGS # make # make all # make all WHAT=cmd/kubelet GOFLAGS=-v -all: - @hack/make-rules/build.sh $(WHAT) +all: gen_deepcopy build .PHONY: all # Build ginkgo @@ -53,6 +55,11 @@ ginkgo: hack/make-rules/build.sh vendor/github.com/onsi/ginkgo/ginkgo .PHONY: ginkgo +# This is a helper to break circular dependencies. +build: + @hack/make-rules/build.sh $(WHAT) +.PHONY: build + # Runs all the presubmission verifications. # # Args: @@ -78,7 +85,7 @@ verify: # make check # make test # make check WHAT=pkg/kubelet GOFLAGS=-v -check test: +check test: gen_deepcopy @hack/make-rules/test.sh $(WHAT) $(TESTS) .PHONY: check test @@ -86,7 +93,7 @@ check test: # # Example: # make test-integration -test-integration: +test-integration: gen_deepcopy @hack/make-rules/test-integration.sh .PHONY: test-integration @@ -94,7 +101,7 @@ test-integration: # # Example: # make test-e2e -test-e2e: ginkgo +test-e2e: ginkgo gen_deepcopy @go run hack/e2e.go -v --build --up --test --down .PHONY: test-e2e @@ -119,7 +126,7 @@ test-e2e: ginkgo # make test-e2e-node FOCUS=kubelet SKIP=container # make test-e2e-node REMOTE=true DELETE_INSTANCES=true # Build and run tests. -test-e2e-node: ginkgo +test-e2e-node: ginkgo gen_deepcopy @hack/make-rules/test-e2e-node.sh .PHONY: test-e2e-node @@ -138,6 +145,7 @@ test-cmd: clean: build/make-clean.sh rm -rf $(OUT_DIR) + find . -type f -name $(GENERATED_FILE_PREFIX)\* | xargs rm -f rm -rf Godeps/_workspace # Just until we are sure it is gone .PHONY: clean @@ -159,7 +167,7 @@ vet: # # Example: # make release -release: +release: gen_deepcopy @build/release.sh .PHONY: release @@ -167,6 +175,74 @@ release: # # Example: # make release-skip-tests -release-skip-tests quick-release: +release-skip-tests quick-release: gen_deepcopy @KUBE_RELEASE_RUN_TESTS=n KUBE_FASTBUILD=true build/release.sh .PHONY: release-skip-tests quick-release + +# +# Code-generation logic. +# + +# 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 := $(shell \ + find . \ + -not \( \ + \( \ + -path ./vendor -o \ + -path ./$(OUT_DIR) -o \ + -path ./.git \ + \) -prune \ + \) \ + -type f -name \*.go | xargs grep -l '^// \?+k8s:' \ + ) + +# +# Deep-copy generation +# +# Any package that wants deep-copy functions generated must include a +# comment-tag in column 0 of one file of the form: +# // +k8s:deepcopy-gen= +# +# The may be one of: +# generate: generate deep-copy functions into the package +# register: generate deep-copy functions and register them with a +# scheme + +# Find all the directories that request deep-copy generation. +DEEP_COPY_DIRS := $(shell \ + grep -l '+k8s:deepcopy-gen=' $(ALL_K8S_TAG_FILES) \ + | xargs dirname \ + | sort -u \ +) + +# The result file, in each pkg, of deep-copy generation. +DEEP_COPY_BASENAME := $(GENERATED_FILE_PREFIX)deep_copy +DEEP_COPY_FILENAME := $(DEEP_COPY_BASENAME).go + +# Unfortunately there's not a good way to use Go's build tools to check +# if a binary needs to be rebuilt. We just have to try it. +gen_deepcopy: + @$(MAKE) -s build WHAT=cmd/libs/go2idl/deepcopy-gen + @$(MAKE) -s $(addsuffix /$(DEEP_COPY_FILENAME), $(DEEP_COPY_DIRS)) + +# For each dir in DEEP_COPY_DIRS, this generates a statement of the form: +# path/to/dir/$(DEEP_COPY_FILENAME): +# +# Note that this is a deps-only statement, not a full rule (see below). +# This has to be done in a distinct step because wildcards don't seem to work +# in static pattern rules. +# +# The '$(eval)' is needed because this has a different RHS for each LHS, and +# would otherwise produce results that make can't parse. +$(foreach dir, $(DEEP_COPY_DIRS), \ + $(eval $(dir)/$(DEEP_COPY_FILENAME): $(shell ls $(dir)/*.go | grep -v $(GENERATED_FILE_PREFIX)))) + +# For each dir in DEEP_COPY_DIRS, handle deep-copy generation. +# This has to be done in two steps because wildcards don't seem to work in +# static pattern rules. +$(addsuffix /$(DEEP_COPY_FILENAME), $(DEEP_COPY_DIRS)): + $(BIN_DIR)/deepcopy-gen \ + -i $(PRJ_SRC_PATH)/$$(dirname $@) \ + --bounding-dirs $(PRJ_SRC_PATH) \ + -O $(DEEP_COPY_BASENAME) diff --git a/cmd/libs/go2idl/deepcopy-gen/main.go b/cmd/libs/go2idl/deepcopy-gen/main.go index 39927b8a655..b89580d4d3f 100644 --- a/cmd/libs/go2idl/deepcopy-gen/main.go +++ b/cmd/libs/go2idl/deepcopy-gen/main.go @@ -62,9 +62,7 @@ func main() { arguments.OutputFileBaseName = "deep_copy_generated" // Custom args. - customArgs := &generators.CustomArgs{ - BoundingDirs: []string{"k8s.io/kubernetes"}, - } + customArgs := &generators.CustomArgs{} 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.") arguments.CustomArgs = customArgs diff --git a/federation/apis/federation/deep_copy_generated.go b/federation/apis/federation/deep_copy_generated.go deleted file mode 100644 index b9aeb78c4ab..00000000000 --- a/federation/apis/federation/deep_copy_generated.go +++ /dev/null @@ -1,155 +0,0 @@ -// +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 - } -} diff --git a/federation/apis/federation/v1beta1/deep_copy_generated.go b/federation/apis/federation/v1beta1/deep_copy_generated.go deleted file mode 100644 index 484051ce983..00000000000 --- a/federation/apis/federation/v1beta1/deep_copy_generated.go +++ /dev/null @@ -1,156 +0,0 @@ -// +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 - } -} diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index 9f6a4e1533e..f7946249605 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -26,14 +26,12 @@ kube::golang::setup_env BUILD_TARGETS=( cmd/libs/go2idl/client-gen cmd/libs/go2idl/conversion-gen - cmd/libs/go2idl/deepcopy-gen cmd/libs/go2idl/set-gen ) make -C "${KUBE_ROOT}" WHAT="${BUILD_TARGETS[*]}" 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") # Please do not add any logic to this shell script. Add logic to the go code @@ -67,18 +65,6 @@ ALL_K8S_TAG_FILES=$( | 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: \ diff --git a/hack/verify-generated-protobuf.sh b/hack/verify-generated-protobuf.sh index 5cc3af125c2..07291520a33 100755 --- a/hack/verify-generated-protobuf.sh +++ b/hack/verify-generated-protobuf.sh @@ -43,7 +43,7 @@ for APIROOT in ${APIROOTS}; do TMP_APIROOT="${_tmp}/${APIROOT}" echo "diffing ${APIROOT} against freshly generated protobuf" 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%/*}" if [[ $ret -eq 0 ]]; then echo "${APIROOT} up to date." diff --git a/pkg/api/deep_copy_generated.go b/pkg/api/deep_copy_generated.go deleted file mode 100644 index 3803d2a207b..00000000000 --- a/pkg/api/deep_copy_generated.go +++ /dev/null @@ -1,3555 +0,0 @@ -// +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 api - -import ( - unversioned "k8s.io/kubernetes/pkg/api/unversioned" - conversion "k8s.io/kubernetes/pkg/conversion" - fields "k8s.io/kubernetes/pkg/fields" - labels "k8s.io/kubernetes/pkg/labels" - runtime "k8s.io/kubernetes/pkg/runtime" - types "k8s.io/kubernetes/pkg/types" - reflect "reflect" -) - -func init() { - if err := Scheme.AddGeneratedDeepCopyFuncs( - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_AWSElasticBlockStoreVolumeSource, InType: reflect.TypeOf(func() *AWSElasticBlockStoreVolumeSource { var x *AWSElasticBlockStoreVolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_Affinity, InType: reflect.TypeOf(func() *Affinity { var x *Affinity; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_AttachedVolume, InType: reflect.TypeOf(func() *AttachedVolume { var x *AttachedVolume; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_AzureFileVolumeSource, InType: reflect.TypeOf(func() *AzureFileVolumeSource { var x *AzureFileVolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_Binding, InType: reflect.TypeOf(func() *Binding { var x *Binding; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_Capabilities, InType: reflect.TypeOf(func() *Capabilities { var x *Capabilities; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_CephFSVolumeSource, InType: reflect.TypeOf(func() *CephFSVolumeSource { var x *CephFSVolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_CinderVolumeSource, InType: reflect.TypeOf(func() *CinderVolumeSource { var x *CinderVolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_ComponentCondition, InType: reflect.TypeOf(func() *ComponentCondition { var x *ComponentCondition; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_ComponentStatus, InType: reflect.TypeOf(func() *ComponentStatus { var x *ComponentStatus; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_ComponentStatusList, InType: reflect.TypeOf(func() *ComponentStatusList { var x *ComponentStatusList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_ConfigMap, InType: reflect.TypeOf(func() *ConfigMap { var x *ConfigMap; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_ConfigMapKeySelector, InType: reflect.TypeOf(func() *ConfigMapKeySelector { var x *ConfigMapKeySelector; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_ConfigMapList, InType: reflect.TypeOf(func() *ConfigMapList { var x *ConfigMapList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_ConfigMapVolumeSource, InType: reflect.TypeOf(func() *ConfigMapVolumeSource { var x *ConfigMapVolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_Container, InType: reflect.TypeOf(func() *Container { var x *Container; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_ContainerImage, InType: reflect.TypeOf(func() *ContainerImage { var x *ContainerImage; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_ContainerPort, InType: reflect.TypeOf(func() *ContainerPort { var x *ContainerPort; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_ContainerState, InType: reflect.TypeOf(func() *ContainerState { var x *ContainerState; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_ContainerStateRunning, InType: reflect.TypeOf(func() *ContainerStateRunning { var x *ContainerStateRunning; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_ContainerStateTerminated, InType: reflect.TypeOf(func() *ContainerStateTerminated { var x *ContainerStateTerminated; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_ContainerStateWaiting, InType: reflect.TypeOf(func() *ContainerStateWaiting { var x *ContainerStateWaiting; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_ContainerStatus, InType: reflect.TypeOf(func() *ContainerStatus { var x *ContainerStatus; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_ConversionError, InType: reflect.TypeOf(func() *ConversionError { var x *ConversionError; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_DaemonEndpoint, InType: reflect.TypeOf(func() *DaemonEndpoint { var x *DaemonEndpoint; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_DeleteOptions, InType: reflect.TypeOf(func() *DeleteOptions { var x *DeleteOptions; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_DownwardAPIVolumeFile, InType: reflect.TypeOf(func() *DownwardAPIVolumeFile { var x *DownwardAPIVolumeFile; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_DownwardAPIVolumeSource, InType: reflect.TypeOf(func() *DownwardAPIVolumeSource { var x *DownwardAPIVolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_EmptyDirVolumeSource, InType: reflect.TypeOf(func() *EmptyDirVolumeSource { var x *EmptyDirVolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_EndpointAddress, InType: reflect.TypeOf(func() *EndpointAddress { var x *EndpointAddress; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_EndpointPort, InType: reflect.TypeOf(func() *EndpointPort { var x *EndpointPort; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_EndpointSubset, InType: reflect.TypeOf(func() *EndpointSubset { var x *EndpointSubset; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_Endpoints, InType: reflect.TypeOf(func() *Endpoints { var x *Endpoints; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_EndpointsList, InType: reflect.TypeOf(func() *EndpointsList { var x *EndpointsList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_EnvVar, InType: reflect.TypeOf(func() *EnvVar { var x *EnvVar; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_EnvVarSource, InType: reflect.TypeOf(func() *EnvVarSource { var x *EnvVarSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_Event, InType: reflect.TypeOf(func() *Event { var x *Event; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_EventList, InType: reflect.TypeOf(func() *EventList { var x *EventList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_EventSource, InType: reflect.TypeOf(func() *EventSource { var x *EventSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_ExecAction, InType: reflect.TypeOf(func() *ExecAction { var x *ExecAction; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_ExportOptions, InType: reflect.TypeOf(func() *ExportOptions { var x *ExportOptions; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_FCVolumeSource, InType: reflect.TypeOf(func() *FCVolumeSource { var x *FCVolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_FlexVolumeSource, InType: reflect.TypeOf(func() *FlexVolumeSource { var x *FlexVolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_FlockerVolumeSource, InType: reflect.TypeOf(func() *FlockerVolumeSource { var x *FlockerVolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_GCEPersistentDiskVolumeSource, InType: reflect.TypeOf(func() *GCEPersistentDiskVolumeSource { var x *GCEPersistentDiskVolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_GitRepoVolumeSource, InType: reflect.TypeOf(func() *GitRepoVolumeSource { var x *GitRepoVolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_GlusterfsVolumeSource, InType: reflect.TypeOf(func() *GlusterfsVolumeSource { var x *GlusterfsVolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_HTTPGetAction, InType: reflect.TypeOf(func() *HTTPGetAction { var x *HTTPGetAction; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_HTTPHeader, InType: reflect.TypeOf(func() *HTTPHeader { var x *HTTPHeader; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_Handler, InType: reflect.TypeOf(func() *Handler { var x *Handler; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_HostPathVolumeSource, InType: reflect.TypeOf(func() *HostPathVolumeSource { var x *HostPathVolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_ISCSIVolumeSource, InType: reflect.TypeOf(func() *ISCSIVolumeSource { var x *ISCSIVolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_KeyToPath, InType: reflect.TypeOf(func() *KeyToPath { var x *KeyToPath; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_Lifecycle, InType: reflect.TypeOf(func() *Lifecycle { var x *Lifecycle; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_LimitRange, InType: reflect.TypeOf(func() *LimitRange { var x *LimitRange; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_LimitRangeItem, InType: reflect.TypeOf(func() *LimitRangeItem { var x *LimitRangeItem; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_LimitRangeList, InType: reflect.TypeOf(func() *LimitRangeList { var x *LimitRangeList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_LimitRangeSpec, InType: reflect.TypeOf(func() *LimitRangeSpec { var x *LimitRangeSpec; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_List, InType: reflect.TypeOf(func() *List { var x *List; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_ListOptions, InType: reflect.TypeOf(func() *ListOptions { var x *ListOptions; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_LoadBalancerIngress, InType: reflect.TypeOf(func() *LoadBalancerIngress { var x *LoadBalancerIngress; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_LoadBalancerStatus, InType: reflect.TypeOf(func() *LoadBalancerStatus { var x *LoadBalancerStatus; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_LocalObjectReference, InType: reflect.TypeOf(func() *LocalObjectReference { var x *LocalObjectReference; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_NFSVolumeSource, InType: reflect.TypeOf(func() *NFSVolumeSource { var x *NFSVolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_Namespace, InType: reflect.TypeOf(func() *Namespace { var x *Namespace; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_NamespaceList, InType: reflect.TypeOf(func() *NamespaceList { var x *NamespaceList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_NamespaceSpec, InType: reflect.TypeOf(func() *NamespaceSpec { var x *NamespaceSpec; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_NamespaceStatus, InType: reflect.TypeOf(func() *NamespaceStatus { var x *NamespaceStatus; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_Node, InType: reflect.TypeOf(func() *Node { var x *Node; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_NodeAddress, InType: reflect.TypeOf(func() *NodeAddress { var x *NodeAddress; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_NodeAffinity, InType: reflect.TypeOf(func() *NodeAffinity { var x *NodeAffinity; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_NodeCondition, InType: reflect.TypeOf(func() *NodeCondition { var x *NodeCondition; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_NodeDaemonEndpoints, InType: reflect.TypeOf(func() *NodeDaemonEndpoints { var x *NodeDaemonEndpoints; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_NodeList, InType: reflect.TypeOf(func() *NodeList { var x *NodeList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_NodeProxyOptions, InType: reflect.TypeOf(func() *NodeProxyOptions { var x *NodeProxyOptions; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_NodeResources, InType: reflect.TypeOf(func() *NodeResources { var x *NodeResources; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_NodeSelector, InType: reflect.TypeOf(func() *NodeSelector { var x *NodeSelector; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_NodeSelectorRequirement, InType: reflect.TypeOf(func() *NodeSelectorRequirement { var x *NodeSelectorRequirement; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_NodeSelectorTerm, InType: reflect.TypeOf(func() *NodeSelectorTerm { var x *NodeSelectorTerm; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_NodeSpec, InType: reflect.TypeOf(func() *NodeSpec { var x *NodeSpec; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_NodeStatus, InType: reflect.TypeOf(func() *NodeStatus { var x *NodeStatus; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_NodeSystemInfo, InType: reflect.TypeOf(func() *NodeSystemInfo { var x *NodeSystemInfo; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_ObjectFieldSelector, InType: reflect.TypeOf(func() *ObjectFieldSelector { var x *ObjectFieldSelector; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_ObjectMeta, InType: reflect.TypeOf(func() *ObjectMeta { var x *ObjectMeta; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_ObjectReference, InType: reflect.TypeOf(func() *ObjectReference { var x *ObjectReference; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_OwnerReference, InType: reflect.TypeOf(func() *OwnerReference { var x *OwnerReference; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_PersistentVolume, InType: reflect.TypeOf(func() *PersistentVolume { var x *PersistentVolume; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_PersistentVolumeClaim, InType: reflect.TypeOf(func() *PersistentVolumeClaim { var x *PersistentVolumeClaim; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_PersistentVolumeClaimList, InType: reflect.TypeOf(func() *PersistentVolumeClaimList { var x *PersistentVolumeClaimList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_PersistentVolumeClaimSpec, InType: reflect.TypeOf(func() *PersistentVolumeClaimSpec { var x *PersistentVolumeClaimSpec; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_PersistentVolumeClaimStatus, InType: reflect.TypeOf(func() *PersistentVolumeClaimStatus { var x *PersistentVolumeClaimStatus; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_PersistentVolumeClaimVolumeSource, InType: reflect.TypeOf(func() *PersistentVolumeClaimVolumeSource { var x *PersistentVolumeClaimVolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_PersistentVolumeList, InType: reflect.TypeOf(func() *PersistentVolumeList { var x *PersistentVolumeList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_PersistentVolumeSource, InType: reflect.TypeOf(func() *PersistentVolumeSource { var x *PersistentVolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_PersistentVolumeSpec, InType: reflect.TypeOf(func() *PersistentVolumeSpec { var x *PersistentVolumeSpec; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_PersistentVolumeStatus, InType: reflect.TypeOf(func() *PersistentVolumeStatus { var x *PersistentVolumeStatus; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_Pod, InType: reflect.TypeOf(func() *Pod { var x *Pod; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_PodAffinity, InType: reflect.TypeOf(func() *PodAffinity { var x *PodAffinity; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_PodAffinityTerm, InType: reflect.TypeOf(func() *PodAffinityTerm { var x *PodAffinityTerm; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_PodAntiAffinity, InType: reflect.TypeOf(func() *PodAntiAffinity { var x *PodAntiAffinity; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_PodAttachOptions, InType: reflect.TypeOf(func() *PodAttachOptions { var x *PodAttachOptions; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_PodCondition, InType: reflect.TypeOf(func() *PodCondition { var x *PodCondition; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_PodExecOptions, InType: reflect.TypeOf(func() *PodExecOptions { var x *PodExecOptions; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_PodList, InType: reflect.TypeOf(func() *PodList { var x *PodList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_PodLogOptions, InType: reflect.TypeOf(func() *PodLogOptions { var x *PodLogOptions; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_PodProxyOptions, InType: reflect.TypeOf(func() *PodProxyOptions { var x *PodProxyOptions; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_PodSecurityContext, InType: reflect.TypeOf(func() *PodSecurityContext { var x *PodSecurityContext; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_PodSpec, InType: reflect.TypeOf(func() *PodSpec { var x *PodSpec; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_PodStatus, InType: reflect.TypeOf(func() *PodStatus { var x *PodStatus; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_PodStatusResult, InType: reflect.TypeOf(func() *PodStatusResult { var x *PodStatusResult; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_PodTemplate, InType: reflect.TypeOf(func() *PodTemplate { var x *PodTemplate; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_PodTemplateList, InType: reflect.TypeOf(func() *PodTemplateList { var x *PodTemplateList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_PodTemplateSpec, InType: reflect.TypeOf(func() *PodTemplateSpec { var x *PodTemplateSpec; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_Preconditions, InType: reflect.TypeOf(func() *Preconditions { var x *Preconditions; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_PreferredSchedulingTerm, InType: reflect.TypeOf(func() *PreferredSchedulingTerm { var x *PreferredSchedulingTerm; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_Probe, InType: reflect.TypeOf(func() *Probe { var x *Probe; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_RBDVolumeSource, InType: reflect.TypeOf(func() *RBDVolumeSource { var x *RBDVolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_RangeAllocation, InType: reflect.TypeOf(func() *RangeAllocation { var x *RangeAllocation; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_ReplicationController, InType: reflect.TypeOf(func() *ReplicationController { var x *ReplicationController; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_ReplicationControllerList, InType: reflect.TypeOf(func() *ReplicationControllerList { var x *ReplicationControllerList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_ReplicationControllerSpec, InType: reflect.TypeOf(func() *ReplicationControllerSpec { var x *ReplicationControllerSpec; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_ReplicationControllerStatus, InType: reflect.TypeOf(func() *ReplicationControllerStatus { var x *ReplicationControllerStatus; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_ResourceFieldSelector, InType: reflect.TypeOf(func() *ResourceFieldSelector { var x *ResourceFieldSelector; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_ResourceQuota, InType: reflect.TypeOf(func() *ResourceQuota { var x *ResourceQuota; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_ResourceQuotaList, InType: reflect.TypeOf(func() *ResourceQuotaList { var x *ResourceQuotaList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_ResourceQuotaSpec, InType: reflect.TypeOf(func() *ResourceQuotaSpec { var x *ResourceQuotaSpec; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_ResourceQuotaStatus, InType: reflect.TypeOf(func() *ResourceQuotaStatus { var x *ResourceQuotaStatus; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_ResourceRequirements, InType: reflect.TypeOf(func() *ResourceRequirements { var x *ResourceRequirements; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_SELinuxOptions, InType: reflect.TypeOf(func() *SELinuxOptions { var x *SELinuxOptions; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_Secret, InType: reflect.TypeOf(func() *Secret { var x *Secret; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_SecretKeySelector, InType: reflect.TypeOf(func() *SecretKeySelector { var x *SecretKeySelector; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_SecretList, InType: reflect.TypeOf(func() *SecretList { var x *SecretList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_SecretVolumeSource, InType: reflect.TypeOf(func() *SecretVolumeSource { var x *SecretVolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_SecurityContext, InType: reflect.TypeOf(func() *SecurityContext { var x *SecurityContext; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_SerializedReference, InType: reflect.TypeOf(func() *SerializedReference { var x *SerializedReference; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_Service, InType: reflect.TypeOf(func() *Service { var x *Service; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_ServiceAccount, InType: reflect.TypeOf(func() *ServiceAccount { var x *ServiceAccount; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_ServiceAccountList, InType: reflect.TypeOf(func() *ServiceAccountList { var x *ServiceAccountList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_ServiceList, InType: reflect.TypeOf(func() *ServiceList { var x *ServiceList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_ServicePort, InType: reflect.TypeOf(func() *ServicePort { var x *ServicePort; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_ServiceProxyOptions, InType: reflect.TypeOf(func() *ServiceProxyOptions { var x *ServiceProxyOptions; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_ServiceSpec, InType: reflect.TypeOf(func() *ServiceSpec { var x *ServiceSpec; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_ServiceStatus, InType: reflect.TypeOf(func() *ServiceStatus { var x *ServiceStatus; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_TCPSocketAction, InType: reflect.TypeOf(func() *TCPSocketAction { var x *TCPSocketAction; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_Taint, InType: reflect.TypeOf(func() *Taint { var x *Taint; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_Toleration, InType: reflect.TypeOf(func() *Toleration { var x *Toleration; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_Volume, InType: reflect.TypeOf(func() *Volume { var x *Volume; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_VolumeMount, InType: reflect.TypeOf(func() *VolumeMount { var x *VolumeMount; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_VolumeSource, InType: reflect.TypeOf(func() *VolumeSource { var x *VolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_VsphereVirtualDiskVolumeSource, InType: reflect.TypeOf(func() *VsphereVirtualDiskVolumeSource { var x *VsphereVirtualDiskVolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_api_WeightedPodAffinityTerm, InType: reflect.TypeOf(func() *WeightedPodAffinityTerm { var x *WeightedPodAffinityTerm; return x }())}, - ); err != nil { - // if one of the deep copy functions is malformed, detect it immediately. - panic(err) - } -} - -func DeepCopy_api_AWSElasticBlockStoreVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*AWSElasticBlockStoreVolumeSource) - out := out.(*AWSElasticBlockStoreVolumeSource) - out.VolumeID = in.VolumeID - out.FSType = in.FSType - out.Partition = in.Partition - out.ReadOnly = in.ReadOnly - return nil - } -} - -func DeepCopy_api_Affinity(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Affinity) - out := out.(*Affinity) - if in.NodeAffinity != nil { - in, out := &in.NodeAffinity, &out.NodeAffinity - *out = new(NodeAffinity) - if err := DeepCopy_api_NodeAffinity(*in, *out, c); err != nil { - return err - } - } else { - out.NodeAffinity = nil - } - if in.PodAffinity != nil { - in, out := &in.PodAffinity, &out.PodAffinity - *out = new(PodAffinity) - if err := DeepCopy_api_PodAffinity(*in, *out, c); err != nil { - return err - } - } else { - out.PodAffinity = nil - } - if in.PodAntiAffinity != nil { - in, out := &in.PodAntiAffinity, &out.PodAntiAffinity - *out = new(PodAntiAffinity) - if err := DeepCopy_api_PodAntiAffinity(*in, *out, c); err != nil { - return err - } - } else { - out.PodAntiAffinity = nil - } - return nil - } -} - -func DeepCopy_api_AttachedVolume(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*AttachedVolume) - out := out.(*AttachedVolume) - out.Name = in.Name - out.DevicePath = in.DevicePath - return nil - } -} - -func DeepCopy_api_AzureFileVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*AzureFileVolumeSource) - out := out.(*AzureFileVolumeSource) - out.SecretName = in.SecretName - out.ShareName = in.ShareName - out.ReadOnly = in.ReadOnly - return nil - } -} - -func DeepCopy_api_Binding(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Binding) - out := out.(*Binding) - out.TypeMeta = in.TypeMeta - if err := DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - out.Target = in.Target - return nil - } -} - -func DeepCopy_api_Capabilities(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Capabilities) - out := out.(*Capabilities) - if in.Add != nil { - in, out := &in.Add, &out.Add - *out = make([]Capability, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Add = nil - } - if in.Drop != nil { - in, out := &in.Drop, &out.Drop - *out = make([]Capability, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Drop = nil - } - return nil - } -} - -func DeepCopy_api_CephFSVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*CephFSVolumeSource) - out := out.(*CephFSVolumeSource) - if in.Monitors != nil { - in, out := &in.Monitors, &out.Monitors - *out = make([]string, len(*in)) - copy(*out, *in) - } else { - out.Monitors = nil - } - out.Path = in.Path - out.User = in.User - out.SecretFile = in.SecretFile - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - *out = new(LocalObjectReference) - **out = **in - } else { - out.SecretRef = nil - } - out.ReadOnly = in.ReadOnly - return nil - } -} - -func DeepCopy_api_CinderVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*CinderVolumeSource) - out := out.(*CinderVolumeSource) - out.VolumeID = in.VolumeID - out.FSType = in.FSType - out.ReadOnly = in.ReadOnly - return nil - } -} - -func DeepCopy_api_ComponentCondition(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ComponentCondition) - out := out.(*ComponentCondition) - out.Type = in.Type - out.Status = in.Status - out.Message = in.Message - out.Error = in.Error - return nil - } -} - -func DeepCopy_api_ComponentStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ComponentStatus) - out := out.(*ComponentStatus) - out.TypeMeta = in.TypeMeta - if err := DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]ComponentCondition, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Conditions = nil - } - return nil - } -} - -func DeepCopy_api_ComponentStatusList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ComponentStatusList) - out := out.(*ComponentStatusList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ComponentStatus, len(*in)) - for i := range *in { - if err := DeepCopy_api_ComponentStatus(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_api_ConfigMap(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ConfigMap) - out := out.(*ConfigMap) - out.TypeMeta = in.TypeMeta - if err := DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if in.Data != nil { - in, out := &in.Data, &out.Data - *out = make(map[string]string) - for key, val := range *in { - (*out)[key] = val - } - } else { - out.Data = nil - } - return nil - } -} - -func DeepCopy_api_ConfigMapKeySelector(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ConfigMapKeySelector) - out := out.(*ConfigMapKeySelector) - out.LocalObjectReference = in.LocalObjectReference - out.Key = in.Key - return nil - } -} - -func DeepCopy_api_ConfigMapList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ConfigMapList) - out := out.(*ConfigMapList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ConfigMap, len(*in)) - for i := range *in { - if err := DeepCopy_api_ConfigMap(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_api_ConfigMapVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ConfigMapVolumeSource) - out := out.(*ConfigMapVolumeSource) - out.LocalObjectReference = in.LocalObjectReference - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]KeyToPath, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_api_Container(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Container) - out := out.(*Container) - out.Name = in.Name - out.Image = in.Image - if in.Command != nil { - in, out := &in.Command, &out.Command - *out = make([]string, len(*in)) - copy(*out, *in) - } else { - out.Command = nil - } - if in.Args != nil { - in, out := &in.Args, &out.Args - *out = make([]string, len(*in)) - copy(*out, *in) - } else { - out.Args = nil - } - out.WorkingDir = in.WorkingDir - if in.Ports != nil { - in, out := &in.Ports, &out.Ports - *out = make([]ContainerPort, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Ports = nil - } - if in.Env != nil { - in, out := &in.Env, &out.Env - *out = make([]EnvVar, len(*in)) - for i := range *in { - if err := DeepCopy_api_EnvVar(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Env = nil - } - if err := DeepCopy_api_ResourceRequirements(&in.Resources, &out.Resources, c); err != nil { - return err - } - if in.VolumeMounts != nil { - in, out := &in.VolumeMounts, &out.VolumeMounts - *out = make([]VolumeMount, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.VolumeMounts = nil - } - if in.LivenessProbe != nil { - in, out := &in.LivenessProbe, &out.LivenessProbe - *out = new(Probe) - if err := DeepCopy_api_Probe(*in, *out, c); err != nil { - return err - } - } else { - out.LivenessProbe = nil - } - if in.ReadinessProbe != nil { - in, out := &in.ReadinessProbe, &out.ReadinessProbe - *out = new(Probe) - if err := DeepCopy_api_Probe(*in, *out, c); err != nil { - return err - } - } else { - out.ReadinessProbe = nil - } - if in.Lifecycle != nil { - in, out := &in.Lifecycle, &out.Lifecycle - *out = new(Lifecycle) - if err := DeepCopy_api_Lifecycle(*in, *out, c); err != nil { - return err - } - } else { - out.Lifecycle = nil - } - out.TerminationMessagePath = in.TerminationMessagePath - out.ImagePullPolicy = in.ImagePullPolicy - if in.SecurityContext != nil { - in, out := &in.SecurityContext, &out.SecurityContext - *out = new(SecurityContext) - if err := DeepCopy_api_SecurityContext(*in, *out, c); err != nil { - return err - } - } else { - out.SecurityContext = nil - } - out.Stdin = in.Stdin - out.StdinOnce = in.StdinOnce - out.TTY = in.TTY - return nil - } -} - -func DeepCopy_api_ContainerImage(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ContainerImage) - out := out.(*ContainerImage) - if in.Names != nil { - in, out := &in.Names, &out.Names - *out = make([]string, len(*in)) - copy(*out, *in) - } else { - out.Names = nil - } - out.SizeBytes = in.SizeBytes - return nil - } -} - -func DeepCopy_api_ContainerPort(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ContainerPort) - out := out.(*ContainerPort) - out.Name = in.Name - out.HostPort = in.HostPort - out.ContainerPort = in.ContainerPort - out.Protocol = in.Protocol - out.HostIP = in.HostIP - return nil - } -} - -func DeepCopy_api_ContainerState(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ContainerState) - out := out.(*ContainerState) - if in.Waiting != nil { - in, out := &in.Waiting, &out.Waiting - *out = new(ContainerStateWaiting) - **out = **in - } else { - out.Waiting = nil - } - if in.Running != nil { - in, out := &in.Running, &out.Running - *out = new(ContainerStateRunning) - if err := DeepCopy_api_ContainerStateRunning(*in, *out, c); err != nil { - return err - } - } else { - out.Running = nil - } - if in.Terminated != nil { - in, out := &in.Terminated, &out.Terminated - *out = new(ContainerStateTerminated) - if err := DeepCopy_api_ContainerStateTerminated(*in, *out, c); err != nil { - return err - } - } else { - out.Terminated = nil - } - return nil - } -} - -func DeepCopy_api_ContainerStateRunning(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ContainerStateRunning) - out := out.(*ContainerStateRunning) - out.StartedAt = in.StartedAt.DeepCopy() - return nil - } -} - -func DeepCopy_api_ContainerStateTerminated(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ContainerStateTerminated) - out := out.(*ContainerStateTerminated) - out.ExitCode = in.ExitCode - out.Signal = in.Signal - out.Reason = in.Reason - out.Message = in.Message - out.StartedAt = in.StartedAt.DeepCopy() - out.FinishedAt = in.FinishedAt.DeepCopy() - out.ContainerID = in.ContainerID - return nil - } -} - -func DeepCopy_api_ContainerStateWaiting(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ContainerStateWaiting) - out := out.(*ContainerStateWaiting) - out.Reason = in.Reason - out.Message = in.Message - return nil - } -} - -func DeepCopy_api_ContainerStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ContainerStatus) - out := out.(*ContainerStatus) - out.Name = in.Name - if err := DeepCopy_api_ContainerState(&in.State, &out.State, c); err != nil { - return err - } - if err := DeepCopy_api_ContainerState(&in.LastTerminationState, &out.LastTerminationState, c); err != nil { - return err - } - out.Ready = in.Ready - out.RestartCount = in.RestartCount - out.Image = in.Image - out.ImageID = in.ImageID - out.ContainerID = in.ContainerID - return nil - } -} - -func DeepCopy_api_ConversionError(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ConversionError) - out := out.(*ConversionError) - if in.In == nil { - out.In = nil - } else if newVal, err := c.DeepCopy(&in.In); err != nil { - return err - } else { - out.In = *newVal.(*interface{}) - } - if in.Out == nil { - out.Out = nil - } else if newVal, err := c.DeepCopy(&in.Out); err != nil { - return err - } else { - out.Out = *newVal.(*interface{}) - } - out.Message = in.Message - return nil - } -} - -func DeepCopy_api_DaemonEndpoint(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*DaemonEndpoint) - out := out.(*DaemonEndpoint) - out.Port = in.Port - return nil - } -} - -func DeepCopy_api_DeleteOptions(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*DeleteOptions) - out := out.(*DeleteOptions) - out.TypeMeta = in.TypeMeta - if in.GracePeriodSeconds != nil { - in, out := &in.GracePeriodSeconds, &out.GracePeriodSeconds - *out = new(int64) - **out = **in - } else { - out.GracePeriodSeconds = nil - } - if in.Preconditions != nil { - in, out := &in.Preconditions, &out.Preconditions - *out = new(Preconditions) - if err := DeepCopy_api_Preconditions(*in, *out, c); err != nil { - return err - } - } else { - out.Preconditions = nil - } - if in.OrphanDependents != nil { - in, out := &in.OrphanDependents, &out.OrphanDependents - *out = new(bool) - **out = **in - } else { - out.OrphanDependents = nil - } - return nil - } -} - -func DeepCopy_api_DownwardAPIVolumeFile(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*DownwardAPIVolumeFile) - out := out.(*DownwardAPIVolumeFile) - out.Path = in.Path - if in.FieldRef != nil { - in, out := &in.FieldRef, &out.FieldRef - *out = new(ObjectFieldSelector) - **out = **in - } else { - out.FieldRef = nil - } - if in.ResourceFieldRef != nil { - in, out := &in.ResourceFieldRef, &out.ResourceFieldRef - *out = new(ResourceFieldSelector) - if err := DeepCopy_api_ResourceFieldSelector(*in, *out, c); err != nil { - return err - } - } else { - out.ResourceFieldRef = nil - } - return nil - } -} - -func DeepCopy_api_DownwardAPIVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*DownwardAPIVolumeSource) - out := out.(*DownwardAPIVolumeSource) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]DownwardAPIVolumeFile, len(*in)) - for i := range *in { - if err := DeepCopy_api_DownwardAPIVolumeFile(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_api_EmptyDirVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*EmptyDirVolumeSource) - out := out.(*EmptyDirVolumeSource) - out.Medium = in.Medium - return nil - } -} - -func DeepCopy_api_EndpointAddress(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*EndpointAddress) - out := out.(*EndpointAddress) - out.IP = in.IP - out.Hostname = in.Hostname - if in.TargetRef != nil { - in, out := &in.TargetRef, &out.TargetRef - *out = new(ObjectReference) - **out = **in - } else { - out.TargetRef = nil - } - return nil - } -} - -func DeepCopy_api_EndpointPort(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*EndpointPort) - out := out.(*EndpointPort) - out.Name = in.Name - out.Port = in.Port - out.Protocol = in.Protocol - return nil - } -} - -func DeepCopy_api_EndpointSubset(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*EndpointSubset) - out := out.(*EndpointSubset) - if in.Addresses != nil { - in, out := &in.Addresses, &out.Addresses - *out = make([]EndpointAddress, len(*in)) - for i := range *in { - if err := DeepCopy_api_EndpointAddress(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Addresses = nil - } - if in.NotReadyAddresses != nil { - in, out := &in.NotReadyAddresses, &out.NotReadyAddresses - *out = make([]EndpointAddress, len(*in)) - for i := range *in { - if err := DeepCopy_api_EndpointAddress(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.NotReadyAddresses = nil - } - if in.Ports != nil { - in, out := &in.Ports, &out.Ports - *out = make([]EndpointPort, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Ports = nil - } - return nil - } -} - -func DeepCopy_api_Endpoints(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Endpoints) - out := out.(*Endpoints) - out.TypeMeta = in.TypeMeta - if err := DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if in.Subsets != nil { - in, out := &in.Subsets, &out.Subsets - *out = make([]EndpointSubset, len(*in)) - for i := range *in { - if err := DeepCopy_api_EndpointSubset(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Subsets = nil - } - return nil - } -} - -func DeepCopy_api_EndpointsList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*EndpointsList) - out := out.(*EndpointsList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Endpoints, len(*in)) - for i := range *in { - if err := DeepCopy_api_Endpoints(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_api_EnvVar(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*EnvVar) - out := out.(*EnvVar) - out.Name = in.Name - out.Value = in.Value - if in.ValueFrom != nil { - in, out := &in.ValueFrom, &out.ValueFrom - *out = new(EnvVarSource) - if err := DeepCopy_api_EnvVarSource(*in, *out, c); err != nil { - return err - } - } else { - out.ValueFrom = nil - } - return nil - } -} - -func DeepCopy_api_EnvVarSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*EnvVarSource) - out := out.(*EnvVarSource) - if in.FieldRef != nil { - in, out := &in.FieldRef, &out.FieldRef - *out = new(ObjectFieldSelector) - **out = **in - } else { - out.FieldRef = nil - } - if in.ResourceFieldRef != nil { - in, out := &in.ResourceFieldRef, &out.ResourceFieldRef - *out = new(ResourceFieldSelector) - if err := DeepCopy_api_ResourceFieldSelector(*in, *out, c); err != nil { - return err - } - } else { - out.ResourceFieldRef = nil - } - if in.ConfigMapKeyRef != nil { - in, out := &in.ConfigMapKeyRef, &out.ConfigMapKeyRef - *out = new(ConfigMapKeySelector) - **out = **in - } else { - out.ConfigMapKeyRef = nil - } - if in.SecretKeyRef != nil { - in, out := &in.SecretKeyRef, &out.SecretKeyRef - *out = new(SecretKeySelector) - **out = **in - } else { - out.SecretKeyRef = nil - } - return nil - } -} - -func DeepCopy_api_Event(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Event) - out := out.(*Event) - out.TypeMeta = in.TypeMeta - if err := DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - out.InvolvedObject = in.InvolvedObject - out.Reason = in.Reason - out.Message = in.Message - out.Source = in.Source - out.FirstTimestamp = in.FirstTimestamp.DeepCopy() - out.LastTimestamp = in.LastTimestamp.DeepCopy() - out.Count = in.Count - out.Type = in.Type - return nil - } -} - -func DeepCopy_api_EventList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*EventList) - out := out.(*EventList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Event, len(*in)) - for i := range *in { - if err := DeepCopy_api_Event(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_api_EventSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*EventSource) - out := out.(*EventSource) - out.Component = in.Component - out.Host = in.Host - return nil - } -} - -func DeepCopy_api_ExecAction(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ExecAction) - out := out.(*ExecAction) - if in.Command != nil { - in, out := &in.Command, &out.Command - *out = make([]string, len(*in)) - copy(*out, *in) - } else { - out.Command = nil - } - return nil - } -} - -func DeepCopy_api_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_api_FCVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*FCVolumeSource) - out := out.(*FCVolumeSource) - if in.TargetWWNs != nil { - in, out := &in.TargetWWNs, &out.TargetWWNs - *out = make([]string, len(*in)) - copy(*out, *in) - } else { - out.TargetWWNs = nil - } - if in.Lun != nil { - in, out := &in.Lun, &out.Lun - *out = new(int32) - **out = **in - } else { - out.Lun = nil - } - out.FSType = in.FSType - out.ReadOnly = in.ReadOnly - return nil - } -} - -func DeepCopy_api_FlexVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*FlexVolumeSource) - out := out.(*FlexVolumeSource) - out.Driver = in.Driver - out.FSType = in.FSType - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - *out = new(LocalObjectReference) - **out = **in - } else { - out.SecretRef = nil - } - out.ReadOnly = in.ReadOnly - if in.Options != nil { - in, out := &in.Options, &out.Options - *out = make(map[string]string) - for key, val := range *in { - (*out)[key] = val - } - } else { - out.Options = nil - } - return nil - } -} - -func DeepCopy_api_FlockerVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*FlockerVolumeSource) - out := out.(*FlockerVolumeSource) - out.DatasetName = in.DatasetName - return nil - } -} - -func DeepCopy_api_GCEPersistentDiskVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*GCEPersistentDiskVolumeSource) - out := out.(*GCEPersistentDiskVolumeSource) - out.PDName = in.PDName - out.FSType = in.FSType - out.Partition = in.Partition - out.ReadOnly = in.ReadOnly - return nil - } -} - -func DeepCopy_api_GitRepoVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*GitRepoVolumeSource) - out := out.(*GitRepoVolumeSource) - out.Repository = in.Repository - out.Revision = in.Revision - out.Directory = in.Directory - return nil - } -} - -func DeepCopy_api_GlusterfsVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*GlusterfsVolumeSource) - out := out.(*GlusterfsVolumeSource) - out.EndpointsName = in.EndpointsName - out.Path = in.Path - out.ReadOnly = in.ReadOnly - return nil - } -} - -func DeepCopy_api_HTTPGetAction(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*HTTPGetAction) - out := out.(*HTTPGetAction) - out.Path = in.Path - out.Port = in.Port - out.Host = in.Host - out.Scheme = in.Scheme - if in.HTTPHeaders != nil { - in, out := &in.HTTPHeaders, &out.HTTPHeaders - *out = make([]HTTPHeader, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.HTTPHeaders = nil - } - return nil - } -} - -func DeepCopy_api_HTTPHeader(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*HTTPHeader) - out := out.(*HTTPHeader) - out.Name = in.Name - out.Value = in.Value - return nil - } -} - -func DeepCopy_api_Handler(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Handler) - out := out.(*Handler) - if in.Exec != nil { - in, out := &in.Exec, &out.Exec - *out = new(ExecAction) - if err := DeepCopy_api_ExecAction(*in, *out, c); err != nil { - return err - } - } else { - out.Exec = nil - } - if in.HTTPGet != nil { - in, out := &in.HTTPGet, &out.HTTPGet - *out = new(HTTPGetAction) - if err := DeepCopy_api_HTTPGetAction(*in, *out, c); err != nil { - return err - } - } else { - out.HTTPGet = nil - } - if in.TCPSocket != nil { - in, out := &in.TCPSocket, &out.TCPSocket - *out = new(TCPSocketAction) - **out = **in - } else { - out.TCPSocket = nil - } - return nil - } -} - -func DeepCopy_api_HostPathVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*HostPathVolumeSource) - out := out.(*HostPathVolumeSource) - out.Path = in.Path - return nil - } -} - -func DeepCopy_api_ISCSIVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ISCSIVolumeSource) - out := out.(*ISCSIVolumeSource) - out.TargetPortal = in.TargetPortal - out.IQN = in.IQN - out.Lun = in.Lun - out.ISCSIInterface = in.ISCSIInterface - out.FSType = in.FSType - out.ReadOnly = in.ReadOnly - return nil - } -} - -func DeepCopy_api_KeyToPath(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*KeyToPath) - out := out.(*KeyToPath) - out.Key = in.Key - out.Path = in.Path - return nil - } -} - -func DeepCopy_api_Lifecycle(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Lifecycle) - out := out.(*Lifecycle) - if in.PostStart != nil { - in, out := &in.PostStart, &out.PostStart - *out = new(Handler) - if err := DeepCopy_api_Handler(*in, *out, c); err != nil { - return err - } - } else { - out.PostStart = nil - } - if in.PreStop != nil { - in, out := &in.PreStop, &out.PreStop - *out = new(Handler) - if err := DeepCopy_api_Handler(*in, *out, c); err != nil { - return err - } - } else { - out.PreStop = nil - } - return nil - } -} - -func DeepCopy_api_LimitRange(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*LimitRange) - out := out.(*LimitRange) - out.TypeMeta = in.TypeMeta - if err := DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_api_LimitRangeSpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_api_LimitRangeItem(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*LimitRangeItem) - out := out.(*LimitRangeItem) - out.Type = in.Type - if in.Max != nil { - in, out := &in.Max, &out.Max - *out = make(ResourceList) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } else { - out.Max = nil - } - if in.Min != nil { - in, out := &in.Min, &out.Min - *out = make(ResourceList) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } else { - out.Min = nil - } - if in.Default != nil { - in, out := &in.Default, &out.Default - *out = make(ResourceList) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } else { - out.Default = nil - } - if in.DefaultRequest != nil { - in, out := &in.DefaultRequest, &out.DefaultRequest - *out = make(ResourceList) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } else { - out.DefaultRequest = nil - } - if in.MaxLimitRequestRatio != nil { - in, out := &in.MaxLimitRequestRatio, &out.MaxLimitRequestRatio - *out = make(ResourceList) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } else { - out.MaxLimitRequestRatio = nil - } - return nil - } -} - -func DeepCopy_api_LimitRangeList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*LimitRangeList) - out := out.(*LimitRangeList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]LimitRange, len(*in)) - for i := range *in { - if err := DeepCopy_api_LimitRange(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_api_LimitRangeSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*LimitRangeSpec) - out := out.(*LimitRangeSpec) - if in.Limits != nil { - in, out := &in.Limits, &out.Limits - *out = make([]LimitRangeItem, len(*in)) - for i := range *in { - if err := DeepCopy_api_LimitRangeItem(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Limits = nil - } - return nil - } -} - -func DeepCopy_api_List(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*List) - out := out.(*List) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]runtime.Object, len(*in)) - for i := range *in { - if newVal, err := c.DeepCopy(&(*in)[i]); err != nil { - return err - } else { - (*out)[i] = *newVal.(*runtime.Object) - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_api_ListOptions(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ListOptions) - out := out.(*ListOptions) - out.TypeMeta = in.TypeMeta - if in.LabelSelector == nil { - out.LabelSelector = nil - } else if newVal, err := c.DeepCopy(&in.LabelSelector); err != nil { - return err - } else { - out.LabelSelector = *newVal.(*labels.Selector) - } - if in.FieldSelector == nil { - out.FieldSelector = nil - } else if newVal, err := c.DeepCopy(&in.FieldSelector); err != nil { - return err - } else { - out.FieldSelector = *newVal.(*fields.Selector) - } - out.Watch = in.Watch - out.ResourceVersion = in.ResourceVersion - if in.TimeoutSeconds != nil { - in, out := &in.TimeoutSeconds, &out.TimeoutSeconds - *out = new(int64) - **out = **in - } else { - out.TimeoutSeconds = nil - } - return nil - } -} - -func DeepCopy_api_LoadBalancerIngress(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*LoadBalancerIngress) - out := out.(*LoadBalancerIngress) - out.IP = in.IP - out.Hostname = in.Hostname - return nil - } -} - -func DeepCopy_api_LoadBalancerStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*LoadBalancerStatus) - out := out.(*LoadBalancerStatus) - if in.Ingress != nil { - in, out := &in.Ingress, &out.Ingress - *out = make([]LoadBalancerIngress, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Ingress = nil - } - return nil - } -} - -func DeepCopy_api_LocalObjectReference(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*LocalObjectReference) - out := out.(*LocalObjectReference) - out.Name = in.Name - return nil - } -} - -func DeepCopy_api_NFSVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NFSVolumeSource) - out := out.(*NFSVolumeSource) - out.Server = in.Server - out.Path = in.Path - out.ReadOnly = in.ReadOnly - return nil - } -} - -func DeepCopy_api_Namespace(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Namespace) - out := out.(*Namespace) - out.TypeMeta = in.TypeMeta - if err := DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_api_NamespaceSpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - out.Status = in.Status - return nil - } -} - -func DeepCopy_api_NamespaceList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NamespaceList) - out := out.(*NamespaceList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Namespace, len(*in)) - for i := range *in { - if err := DeepCopy_api_Namespace(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_api_NamespaceSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NamespaceSpec) - out := out.(*NamespaceSpec) - if in.Finalizers != nil { - in, out := &in.Finalizers, &out.Finalizers - *out = make([]FinalizerName, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Finalizers = nil - } - return nil - } -} - -func DeepCopy_api_NamespaceStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NamespaceStatus) - out := out.(*NamespaceStatus) - out.Phase = in.Phase - return nil - } -} - -func DeepCopy_api_Node(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Node) - out := out.(*Node) - out.TypeMeta = in.TypeMeta - if err := DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - out.Spec = in.Spec - if err := DeepCopy_api_NodeStatus(&in.Status, &out.Status, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_api_NodeAddress(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NodeAddress) - out := out.(*NodeAddress) - out.Type = in.Type - out.Address = in.Address - return nil - } -} - -func DeepCopy_api_NodeAffinity(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NodeAffinity) - out := out.(*NodeAffinity) - if in.RequiredDuringSchedulingIgnoredDuringExecution != nil { - in, out := &in.RequiredDuringSchedulingIgnoredDuringExecution, &out.RequiredDuringSchedulingIgnoredDuringExecution - *out = new(NodeSelector) - if err := DeepCopy_api_NodeSelector(*in, *out, c); err != nil { - return err - } - } else { - out.RequiredDuringSchedulingIgnoredDuringExecution = nil - } - if in.PreferredDuringSchedulingIgnoredDuringExecution != nil { - in, out := &in.PreferredDuringSchedulingIgnoredDuringExecution, &out.PreferredDuringSchedulingIgnoredDuringExecution - *out = make([]PreferredSchedulingTerm, len(*in)) - for i := range *in { - if err := DeepCopy_api_PreferredSchedulingTerm(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.PreferredDuringSchedulingIgnoredDuringExecution = nil - } - return nil - } -} - -func DeepCopy_api_NodeCondition(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NodeCondition) - out := out.(*NodeCondition) - out.Type = in.Type - out.Status = in.Status - out.LastHeartbeatTime = in.LastHeartbeatTime.DeepCopy() - out.LastTransitionTime = in.LastTransitionTime.DeepCopy() - out.Reason = in.Reason - out.Message = in.Message - return nil - } -} - -func DeepCopy_api_NodeDaemonEndpoints(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NodeDaemonEndpoints) - out := out.(*NodeDaemonEndpoints) - out.KubeletEndpoint = in.KubeletEndpoint - return nil - } -} - -func DeepCopy_api_NodeList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NodeList) - out := out.(*NodeList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Node, len(*in)) - for i := range *in { - if err := DeepCopy_api_Node(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_api_NodeProxyOptions(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NodeProxyOptions) - out := out.(*NodeProxyOptions) - out.TypeMeta = in.TypeMeta - out.Path = in.Path - return nil - } -} - -func DeepCopy_api_NodeResources(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NodeResources) - out := out.(*NodeResources) - if in.Capacity != nil { - in, out := &in.Capacity, &out.Capacity - *out = make(ResourceList) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } else { - out.Capacity = nil - } - return nil - } -} - -func DeepCopy_api_NodeSelector(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NodeSelector) - out := out.(*NodeSelector) - if in.NodeSelectorTerms != nil { - in, out := &in.NodeSelectorTerms, &out.NodeSelectorTerms - *out = make([]NodeSelectorTerm, len(*in)) - for i := range *in { - if err := DeepCopy_api_NodeSelectorTerm(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.NodeSelectorTerms = nil - } - return nil - } -} - -func DeepCopy_api_NodeSelectorRequirement(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NodeSelectorRequirement) - out := out.(*NodeSelectorRequirement) - 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_api_NodeSelectorTerm(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NodeSelectorTerm) - out := out.(*NodeSelectorTerm) - if in.MatchExpressions != nil { - in, out := &in.MatchExpressions, &out.MatchExpressions - *out = make([]NodeSelectorRequirement, len(*in)) - for i := range *in { - if err := DeepCopy_api_NodeSelectorRequirement(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.MatchExpressions = nil - } - return nil - } -} - -func DeepCopy_api_NodeSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NodeSpec) - out := out.(*NodeSpec) - out.PodCIDR = in.PodCIDR - out.ExternalID = in.ExternalID - out.ProviderID = in.ProviderID - out.Unschedulable = in.Unschedulable - return nil - } -} - -func DeepCopy_api_NodeStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NodeStatus) - out := out.(*NodeStatus) - if in.Capacity != nil { - in, out := &in.Capacity, &out.Capacity - *out = make(ResourceList) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } else { - out.Capacity = nil - } - if in.Allocatable != nil { - in, out := &in.Allocatable, &out.Allocatable - *out = make(ResourceList) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } else { - out.Allocatable = nil - } - out.Phase = in.Phase - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]NodeCondition, len(*in)) - for i := range *in { - if err := DeepCopy_api_NodeCondition(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - if in.Addresses != nil { - in, out := &in.Addresses, &out.Addresses - *out = make([]NodeAddress, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Addresses = nil - } - out.DaemonEndpoints = in.DaemonEndpoints - out.NodeInfo = in.NodeInfo - if in.Images != nil { - in, out := &in.Images, &out.Images - *out = make([]ContainerImage, len(*in)) - for i := range *in { - if err := DeepCopy_api_ContainerImage(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Images = nil - } - if in.VolumesInUse != nil { - in, out := &in.VolumesInUse, &out.VolumesInUse - *out = make([]UniqueVolumeName, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.VolumesInUse = nil - } - if in.VolumesAttached != nil { - in, out := &in.VolumesAttached, &out.VolumesAttached - *out = make([]AttachedVolume, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.VolumesAttached = nil - } - return nil - } -} - -func DeepCopy_api_NodeSystemInfo(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NodeSystemInfo) - out := out.(*NodeSystemInfo) - out.MachineID = in.MachineID - out.SystemUUID = in.SystemUUID - out.BootID = in.BootID - out.KernelVersion = in.KernelVersion - out.OSImage = in.OSImage - out.ContainerRuntimeVersion = in.ContainerRuntimeVersion - out.KubeletVersion = in.KubeletVersion - out.KubeProxyVersion = in.KubeProxyVersion - out.OperatingSystem = in.OperatingSystem - out.Architecture = in.Architecture - return nil - } -} - -func DeepCopy_api_ObjectFieldSelector(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ObjectFieldSelector) - out := out.(*ObjectFieldSelector) - out.APIVersion = in.APIVersion - out.FieldPath = in.FieldPath - return nil - } -} - -func DeepCopy_api_ObjectMeta(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ObjectMeta) - out := out.(*ObjectMeta) - out.Name = in.Name - out.GenerateName = in.GenerateName - out.Namespace = in.Namespace - out.SelfLink = in.SelfLink - out.UID = in.UID - out.ResourceVersion = in.ResourceVersion - out.Generation = in.Generation - out.CreationTimestamp = in.CreationTimestamp.DeepCopy() - if in.DeletionTimestamp != nil { - in, out := &in.DeletionTimestamp, &out.DeletionTimestamp - *out = new(unversioned.Time) - **out = (*in).DeepCopy() - } else { - out.DeletionTimestamp = nil - } - if in.DeletionGracePeriodSeconds != nil { - in, out := &in.DeletionGracePeriodSeconds, &out.DeletionGracePeriodSeconds - *out = new(int64) - **out = **in - } else { - out.DeletionGracePeriodSeconds = nil - } - if in.Labels != nil { - in, out := &in.Labels, &out.Labels - *out = make(map[string]string) - for key, val := range *in { - (*out)[key] = val - } - } else { - out.Labels = nil - } - if in.Annotations != nil { - in, out := &in.Annotations, &out.Annotations - *out = make(map[string]string) - for key, val := range *in { - (*out)[key] = val - } - } else { - out.Annotations = nil - } - if in.OwnerReferences != nil { - in, out := &in.OwnerReferences, &out.OwnerReferences - *out = make([]OwnerReference, len(*in)) - for i := range *in { - if err := DeepCopy_api_OwnerReference(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.OwnerReferences = nil - } - if in.Finalizers != nil { - in, out := &in.Finalizers, &out.Finalizers - *out = make([]string, len(*in)) - copy(*out, *in) - } else { - out.Finalizers = nil - } - return nil - } -} - -func DeepCopy_api_ObjectReference(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ObjectReference) - out := out.(*ObjectReference) - out.Kind = in.Kind - out.Namespace = in.Namespace - out.Name = in.Name - out.UID = in.UID - out.APIVersion = in.APIVersion - out.ResourceVersion = in.ResourceVersion - out.FieldPath = in.FieldPath - return nil - } -} - -func DeepCopy_api_OwnerReference(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*OwnerReference) - out := out.(*OwnerReference) - out.APIVersion = in.APIVersion - out.Kind = in.Kind - out.Name = in.Name - out.UID = in.UID - if in.Controller != nil { - in, out := &in.Controller, &out.Controller - *out = new(bool) - **out = **in - } else { - out.Controller = nil - } - return nil - } -} - -func DeepCopy_api_PersistentVolume(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PersistentVolume) - out := out.(*PersistentVolume) - out.TypeMeta = in.TypeMeta - if err := DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_api_PersistentVolumeSpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - out.Status = in.Status - return nil - } -} - -func DeepCopy_api_PersistentVolumeClaim(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PersistentVolumeClaim) - out := out.(*PersistentVolumeClaim) - out.TypeMeta = in.TypeMeta - if err := DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_api_PersistentVolumeClaimSpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - if err := DeepCopy_api_PersistentVolumeClaimStatus(&in.Status, &out.Status, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_api_PersistentVolumeClaimList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PersistentVolumeClaimList) - out := out.(*PersistentVolumeClaimList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]PersistentVolumeClaim, len(*in)) - for i := range *in { - if err := DeepCopy_api_PersistentVolumeClaim(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_api_PersistentVolumeClaimSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PersistentVolumeClaimSpec) - out := out.(*PersistentVolumeClaimSpec) - if in.AccessModes != nil { - in, out := &in.AccessModes, &out.AccessModes - *out = make([]PersistentVolumeAccessMode, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.AccessModes = 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 := DeepCopy_api_ResourceRequirements(&in.Resources, &out.Resources, c); err != nil { - return err - } - out.VolumeName = in.VolumeName - return nil - } -} - -func DeepCopy_api_PersistentVolumeClaimStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PersistentVolumeClaimStatus) - out := out.(*PersistentVolumeClaimStatus) - out.Phase = in.Phase - if in.AccessModes != nil { - in, out := &in.AccessModes, &out.AccessModes - *out = make([]PersistentVolumeAccessMode, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.AccessModes = nil - } - if in.Capacity != nil { - in, out := &in.Capacity, &out.Capacity - *out = make(ResourceList) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } else { - out.Capacity = nil - } - return nil - } -} - -func DeepCopy_api_PersistentVolumeClaimVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PersistentVolumeClaimVolumeSource) - out := out.(*PersistentVolumeClaimVolumeSource) - out.ClaimName = in.ClaimName - out.ReadOnly = in.ReadOnly - return nil - } -} - -func DeepCopy_api_PersistentVolumeList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PersistentVolumeList) - out := out.(*PersistentVolumeList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]PersistentVolume, len(*in)) - for i := range *in { - if err := DeepCopy_api_PersistentVolume(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_api_PersistentVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PersistentVolumeSource) - out := out.(*PersistentVolumeSource) - if in.GCEPersistentDisk != nil { - in, out := &in.GCEPersistentDisk, &out.GCEPersistentDisk - *out = new(GCEPersistentDiskVolumeSource) - **out = **in - } else { - out.GCEPersistentDisk = nil - } - if in.AWSElasticBlockStore != nil { - in, out := &in.AWSElasticBlockStore, &out.AWSElasticBlockStore - *out = new(AWSElasticBlockStoreVolumeSource) - **out = **in - } else { - out.AWSElasticBlockStore = nil - } - if in.HostPath != nil { - in, out := &in.HostPath, &out.HostPath - *out = new(HostPathVolumeSource) - **out = **in - } else { - out.HostPath = nil - } - if in.Glusterfs != nil { - in, out := &in.Glusterfs, &out.Glusterfs - *out = new(GlusterfsVolumeSource) - **out = **in - } else { - out.Glusterfs = nil - } - if in.NFS != nil { - in, out := &in.NFS, &out.NFS - *out = new(NFSVolumeSource) - **out = **in - } else { - out.NFS = nil - } - if in.RBD != nil { - in, out := &in.RBD, &out.RBD - *out = new(RBDVolumeSource) - if err := DeepCopy_api_RBDVolumeSource(*in, *out, c); err != nil { - return err - } - } else { - out.RBD = nil - } - if in.ISCSI != nil { - in, out := &in.ISCSI, &out.ISCSI - *out = new(ISCSIVolumeSource) - **out = **in - } else { - out.ISCSI = nil - } - if in.FlexVolume != nil { - in, out := &in.FlexVolume, &out.FlexVolume - *out = new(FlexVolumeSource) - if err := DeepCopy_api_FlexVolumeSource(*in, *out, c); err != nil { - return err - } - } else { - out.FlexVolume = nil - } - if in.Cinder != nil { - in, out := &in.Cinder, &out.Cinder - *out = new(CinderVolumeSource) - **out = **in - } else { - out.Cinder = nil - } - if in.CephFS != nil { - in, out := &in.CephFS, &out.CephFS - *out = new(CephFSVolumeSource) - if err := DeepCopy_api_CephFSVolumeSource(*in, *out, c); err != nil { - return err - } - } else { - out.CephFS = nil - } - if in.FC != nil { - in, out := &in.FC, &out.FC - *out = new(FCVolumeSource) - if err := DeepCopy_api_FCVolumeSource(*in, *out, c); err != nil { - return err - } - } else { - out.FC = nil - } - if in.Flocker != nil { - in, out := &in.Flocker, &out.Flocker - *out = new(FlockerVolumeSource) - **out = **in - } else { - out.Flocker = nil - } - if in.AzureFile != nil { - in, out := &in.AzureFile, &out.AzureFile - *out = new(AzureFileVolumeSource) - **out = **in - } else { - out.AzureFile = nil - } - if in.VsphereVolume != nil { - in, out := &in.VsphereVolume, &out.VsphereVolume - *out = new(VsphereVirtualDiskVolumeSource) - **out = **in - } else { - out.VsphereVolume = nil - } - return nil - } -} - -func DeepCopy_api_PersistentVolumeSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PersistentVolumeSpec) - out := out.(*PersistentVolumeSpec) - if in.Capacity != nil { - in, out := &in.Capacity, &out.Capacity - *out = make(ResourceList) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } else { - out.Capacity = nil - } - if err := DeepCopy_api_PersistentVolumeSource(&in.PersistentVolumeSource, &out.PersistentVolumeSource, c); err != nil { - return err - } - if in.AccessModes != nil { - in, out := &in.AccessModes, &out.AccessModes - *out = make([]PersistentVolumeAccessMode, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.AccessModes = nil - } - if in.ClaimRef != nil { - in, out := &in.ClaimRef, &out.ClaimRef - *out = new(ObjectReference) - **out = **in - } else { - out.ClaimRef = nil - } - out.PersistentVolumeReclaimPolicy = in.PersistentVolumeReclaimPolicy - return nil - } -} - -func DeepCopy_api_PersistentVolumeStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PersistentVolumeStatus) - out := out.(*PersistentVolumeStatus) - out.Phase = in.Phase - out.Message = in.Message - out.Reason = in.Reason - return nil - } -} - -func DeepCopy_api_Pod(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Pod) - out := out.(*Pod) - out.TypeMeta = in.TypeMeta - if err := DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_api_PodSpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - if err := DeepCopy_api_PodStatus(&in.Status, &out.Status, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_api_PodAffinity(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodAffinity) - out := out.(*PodAffinity) - if in.RequiredDuringSchedulingIgnoredDuringExecution != nil { - in, out := &in.RequiredDuringSchedulingIgnoredDuringExecution, &out.RequiredDuringSchedulingIgnoredDuringExecution - *out = make([]PodAffinityTerm, len(*in)) - for i := range *in { - if err := DeepCopy_api_PodAffinityTerm(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.RequiredDuringSchedulingIgnoredDuringExecution = nil - } - if in.PreferredDuringSchedulingIgnoredDuringExecution != nil { - in, out := &in.PreferredDuringSchedulingIgnoredDuringExecution, &out.PreferredDuringSchedulingIgnoredDuringExecution - *out = make([]WeightedPodAffinityTerm, len(*in)) - for i := range *in { - if err := DeepCopy_api_WeightedPodAffinityTerm(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.PreferredDuringSchedulingIgnoredDuringExecution = nil - } - return nil - } -} - -func DeepCopy_api_PodAffinityTerm(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodAffinityTerm) - out := out.(*PodAffinityTerm) - if in.LabelSelector != nil { - in, out := &in.LabelSelector, &out.LabelSelector - *out = new(unversioned.LabelSelector) - if err := unversioned.DeepCopy_unversioned_LabelSelector(*in, *out, c); err != nil { - return err - } - } else { - out.LabelSelector = nil - } - if in.Namespaces != nil { - in, out := &in.Namespaces, &out.Namespaces - *out = make([]string, len(*in)) - copy(*out, *in) - } else { - out.Namespaces = nil - } - out.TopologyKey = in.TopologyKey - return nil - } -} - -func DeepCopy_api_PodAntiAffinity(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodAntiAffinity) - out := out.(*PodAntiAffinity) - if in.RequiredDuringSchedulingIgnoredDuringExecution != nil { - in, out := &in.RequiredDuringSchedulingIgnoredDuringExecution, &out.RequiredDuringSchedulingIgnoredDuringExecution - *out = make([]PodAffinityTerm, len(*in)) - for i := range *in { - if err := DeepCopy_api_PodAffinityTerm(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.RequiredDuringSchedulingIgnoredDuringExecution = nil - } - if in.PreferredDuringSchedulingIgnoredDuringExecution != nil { - in, out := &in.PreferredDuringSchedulingIgnoredDuringExecution, &out.PreferredDuringSchedulingIgnoredDuringExecution - *out = make([]WeightedPodAffinityTerm, len(*in)) - for i := range *in { - if err := DeepCopy_api_WeightedPodAffinityTerm(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.PreferredDuringSchedulingIgnoredDuringExecution = nil - } - return nil - } -} - -func DeepCopy_api_PodAttachOptions(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodAttachOptions) - out := out.(*PodAttachOptions) - out.TypeMeta = in.TypeMeta - out.Stdin = in.Stdin - out.Stdout = in.Stdout - out.Stderr = in.Stderr - out.TTY = in.TTY - out.Container = in.Container - return nil - } -} - -func DeepCopy_api_PodCondition(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodCondition) - out := out.(*PodCondition) - 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_api_PodExecOptions(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodExecOptions) - out := out.(*PodExecOptions) - out.TypeMeta = in.TypeMeta - out.Stdin = in.Stdin - out.Stdout = in.Stdout - out.Stderr = in.Stderr - out.TTY = in.TTY - out.Container = in.Container - if in.Command != nil { - in, out := &in.Command, &out.Command - *out = make([]string, len(*in)) - copy(*out, *in) - } else { - out.Command = nil - } - return nil - } -} - -func DeepCopy_api_PodList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodList) - out := out.(*PodList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Pod, len(*in)) - for i := range *in { - if err := DeepCopy_api_Pod(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_api_PodLogOptions(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodLogOptions) - out := out.(*PodLogOptions) - out.TypeMeta = in.TypeMeta - out.Container = in.Container - out.Follow = in.Follow - out.Previous = in.Previous - if in.SinceSeconds != nil { - in, out := &in.SinceSeconds, &out.SinceSeconds - *out = new(int64) - **out = **in - } else { - out.SinceSeconds = nil - } - if in.SinceTime != nil { - in, out := &in.SinceTime, &out.SinceTime - *out = new(unversioned.Time) - **out = (*in).DeepCopy() - } else { - out.SinceTime = nil - } - out.Timestamps = in.Timestamps - if in.TailLines != nil { - in, out := &in.TailLines, &out.TailLines - *out = new(int64) - **out = **in - } else { - out.TailLines = nil - } - if in.LimitBytes != nil { - in, out := &in.LimitBytes, &out.LimitBytes - *out = new(int64) - **out = **in - } else { - out.LimitBytes = nil - } - return nil - } -} - -func DeepCopy_api_PodProxyOptions(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodProxyOptions) - out := out.(*PodProxyOptions) - out.TypeMeta = in.TypeMeta - out.Path = in.Path - return nil - } -} - -func DeepCopy_api_PodSecurityContext(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodSecurityContext) - out := out.(*PodSecurityContext) - out.HostNetwork = in.HostNetwork - out.HostPID = in.HostPID - out.HostIPC = in.HostIPC - if in.SELinuxOptions != nil { - in, out := &in.SELinuxOptions, &out.SELinuxOptions - *out = new(SELinuxOptions) - **out = **in - } else { - out.SELinuxOptions = nil - } - if in.RunAsUser != nil { - in, out := &in.RunAsUser, &out.RunAsUser - *out = new(int64) - **out = **in - } else { - out.RunAsUser = nil - } - if in.RunAsNonRoot != nil { - in, out := &in.RunAsNonRoot, &out.RunAsNonRoot - *out = new(bool) - **out = **in - } else { - out.RunAsNonRoot = nil - } - if in.SupplementalGroups != nil { - in, out := &in.SupplementalGroups, &out.SupplementalGroups - *out = make([]int64, len(*in)) - copy(*out, *in) - } else { - out.SupplementalGroups = nil - } - if in.FSGroup != nil { - in, out := &in.FSGroup, &out.FSGroup - *out = new(int64) - **out = **in - } else { - out.FSGroup = nil - } - return nil - } -} - -func DeepCopy_api_PodSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodSpec) - out := out.(*PodSpec) - if in.Volumes != nil { - in, out := &in.Volumes, &out.Volumes - *out = make([]Volume, len(*in)) - for i := range *in { - if err := DeepCopy_api_Volume(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Volumes = nil - } - if in.InitContainers != nil { - in, out := &in.InitContainers, &out.InitContainers - *out = make([]Container, len(*in)) - for i := range *in { - if err := DeepCopy_api_Container(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.InitContainers = nil - } - if in.Containers != nil { - in, out := &in.Containers, &out.Containers - *out = make([]Container, len(*in)) - for i := range *in { - if err := DeepCopy_api_Container(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Containers = nil - } - out.RestartPolicy = in.RestartPolicy - if in.TerminationGracePeriodSeconds != nil { - in, out := &in.TerminationGracePeriodSeconds, &out.TerminationGracePeriodSeconds - *out = new(int64) - **out = **in - } else { - out.TerminationGracePeriodSeconds = nil - } - if in.ActiveDeadlineSeconds != nil { - in, out := &in.ActiveDeadlineSeconds, &out.ActiveDeadlineSeconds - *out = new(int64) - **out = **in - } else { - out.ActiveDeadlineSeconds = nil - } - out.DNSPolicy = in.DNSPolicy - if in.NodeSelector != nil { - in, out := &in.NodeSelector, &out.NodeSelector - *out = make(map[string]string) - for key, val := range *in { - (*out)[key] = val - } - } else { - out.NodeSelector = nil - } - out.ServiceAccountName = in.ServiceAccountName - out.NodeName = in.NodeName - if in.SecurityContext != nil { - in, out := &in.SecurityContext, &out.SecurityContext - *out = new(PodSecurityContext) - if err := DeepCopy_api_PodSecurityContext(*in, *out, c); err != nil { - return err - } - } else { - out.SecurityContext = nil - } - if in.ImagePullSecrets != nil { - in, out := &in.ImagePullSecrets, &out.ImagePullSecrets - *out = make([]LocalObjectReference, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.ImagePullSecrets = nil - } - out.Hostname = in.Hostname - out.Subdomain = in.Subdomain - return nil - } -} - -func DeepCopy_api_PodStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodStatus) - out := out.(*PodStatus) - out.Phase = in.Phase - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]PodCondition, len(*in)) - for i := range *in { - if err := DeepCopy_api_PodCondition(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - out.Message = in.Message - out.Reason = in.Reason - out.HostIP = in.HostIP - out.PodIP = in.PodIP - if in.StartTime != nil { - in, out := &in.StartTime, &out.StartTime - *out = new(unversioned.Time) - **out = (*in).DeepCopy() - } else { - out.StartTime = nil - } - if in.InitContainerStatuses != nil { - in, out := &in.InitContainerStatuses, &out.InitContainerStatuses - *out = make([]ContainerStatus, len(*in)) - for i := range *in { - if err := DeepCopy_api_ContainerStatus(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.InitContainerStatuses = nil - } - if in.ContainerStatuses != nil { - in, out := &in.ContainerStatuses, &out.ContainerStatuses - *out = make([]ContainerStatus, len(*in)) - for i := range *in { - if err := DeepCopy_api_ContainerStatus(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.ContainerStatuses = nil - } - return nil - } -} - -func DeepCopy_api_PodStatusResult(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodStatusResult) - out := out.(*PodStatusResult) - out.TypeMeta = in.TypeMeta - if err := DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_api_PodStatus(&in.Status, &out.Status, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_api_PodTemplate(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodTemplate) - out := out.(*PodTemplate) - out.TypeMeta = in.TypeMeta - if err := DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_api_PodTemplateSpec(&in.Template, &out.Template, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_api_PodTemplateList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodTemplateList) - out := out.(*PodTemplateList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]PodTemplate, len(*in)) - for i := range *in { - if err := DeepCopy_api_PodTemplate(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_api_PodTemplateSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodTemplateSpec) - out := out.(*PodTemplateSpec) - if err := DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_api_PodSpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_api_Preconditions(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Preconditions) - out := out.(*Preconditions) - if in.UID != nil { - in, out := &in.UID, &out.UID - *out = new(types.UID) - **out = **in - } else { - out.UID = nil - } - return nil - } -} - -func DeepCopy_api_PreferredSchedulingTerm(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PreferredSchedulingTerm) - out := out.(*PreferredSchedulingTerm) - out.Weight = in.Weight - if err := DeepCopy_api_NodeSelectorTerm(&in.Preference, &out.Preference, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_api_Probe(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Probe) - out := out.(*Probe) - if err := DeepCopy_api_Handler(&in.Handler, &out.Handler, c); err != nil { - return err - } - out.InitialDelaySeconds = in.InitialDelaySeconds - out.TimeoutSeconds = in.TimeoutSeconds - out.PeriodSeconds = in.PeriodSeconds - out.SuccessThreshold = in.SuccessThreshold - out.FailureThreshold = in.FailureThreshold - return nil - } -} - -func DeepCopy_api_RBDVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*RBDVolumeSource) - out := out.(*RBDVolumeSource) - if in.CephMonitors != nil { - in, out := &in.CephMonitors, &out.CephMonitors - *out = make([]string, len(*in)) - copy(*out, *in) - } else { - out.CephMonitors = nil - } - out.RBDImage = in.RBDImage - out.FSType = in.FSType - out.RBDPool = in.RBDPool - out.RadosUser = in.RadosUser - out.Keyring = in.Keyring - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - *out = new(LocalObjectReference) - **out = **in - } else { - out.SecretRef = nil - } - out.ReadOnly = in.ReadOnly - return nil - } -} - -func DeepCopy_api_RangeAllocation(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*RangeAllocation) - out := out.(*RangeAllocation) - out.TypeMeta = in.TypeMeta - if err := DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - out.Range = in.Range - if in.Data != nil { - in, out := &in.Data, &out.Data - *out = make([]byte, len(*in)) - copy(*out, *in) - } else { - out.Data = nil - } - return nil - } -} - -func DeepCopy_api_ReplicationController(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ReplicationController) - out := out.(*ReplicationController) - out.TypeMeta = in.TypeMeta - if err := DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_api_ReplicationControllerSpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - out.Status = in.Status - return nil - } -} - -func DeepCopy_api_ReplicationControllerList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ReplicationControllerList) - out := out.(*ReplicationControllerList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ReplicationController, len(*in)) - for i := range *in { - if err := DeepCopy_api_ReplicationController(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_api_ReplicationControllerSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ReplicationControllerSpec) - out := out.(*ReplicationControllerSpec) - out.Replicas = in.Replicas - if in.Selector != nil { - in, out := &in.Selector, &out.Selector - *out = make(map[string]string) - for key, val := range *in { - (*out)[key] = val - } - } else { - out.Selector = nil - } - if in.Template != nil { - in, out := &in.Template, &out.Template - *out = new(PodTemplateSpec) - if err := DeepCopy_api_PodTemplateSpec(*in, *out, c); err != nil { - return err - } - } else { - out.Template = nil - } - return nil - } -} - -func DeepCopy_api_ReplicationControllerStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ReplicationControllerStatus) - out := out.(*ReplicationControllerStatus) - out.Replicas = in.Replicas - out.FullyLabeledReplicas = in.FullyLabeledReplicas - out.ObservedGeneration = in.ObservedGeneration - return nil - } -} - -func DeepCopy_api_ResourceFieldSelector(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ResourceFieldSelector) - out := out.(*ResourceFieldSelector) - out.ContainerName = in.ContainerName - out.Resource = in.Resource - out.Divisor = in.Divisor.DeepCopy() - return nil - } -} - -func DeepCopy_api_ResourceQuota(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ResourceQuota) - out := out.(*ResourceQuota) - out.TypeMeta = in.TypeMeta - if err := DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_api_ResourceQuotaSpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - if err := DeepCopy_api_ResourceQuotaStatus(&in.Status, &out.Status, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_api_ResourceQuotaList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ResourceQuotaList) - out := out.(*ResourceQuotaList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ResourceQuota, len(*in)) - for i := range *in { - if err := DeepCopy_api_ResourceQuota(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_api_ResourceQuotaSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ResourceQuotaSpec) - out := out.(*ResourceQuotaSpec) - if in.Hard != nil { - in, out := &in.Hard, &out.Hard - *out = make(ResourceList) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } else { - out.Hard = nil - } - if in.Scopes != nil { - in, out := &in.Scopes, &out.Scopes - *out = make([]ResourceQuotaScope, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Scopes = nil - } - return nil - } -} - -func DeepCopy_api_ResourceQuotaStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ResourceQuotaStatus) - out := out.(*ResourceQuotaStatus) - if in.Hard != nil { - in, out := &in.Hard, &out.Hard - *out = make(ResourceList) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } else { - out.Hard = nil - } - if in.Used != nil { - in, out := &in.Used, &out.Used - *out = make(ResourceList) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } else { - out.Used = nil - } - return nil - } -} - -func DeepCopy_api_ResourceRequirements(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ResourceRequirements) - out := out.(*ResourceRequirements) - if in.Limits != nil { - in, out := &in.Limits, &out.Limits - *out = make(ResourceList) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } else { - out.Limits = nil - } - if in.Requests != nil { - in, out := &in.Requests, &out.Requests - *out = make(ResourceList) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } else { - out.Requests = nil - } - return nil - } -} - -func DeepCopy_api_SELinuxOptions(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*SELinuxOptions) - out := out.(*SELinuxOptions) - out.User = in.User - out.Role = in.Role - out.Type = in.Type - out.Level = in.Level - return nil - } -} - -func DeepCopy_api_Secret(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Secret) - out := out.(*Secret) - out.TypeMeta = in.TypeMeta - if err := DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if in.Data != nil { - in, out := &in.Data, &out.Data - *out = make(map[string][]byte) - for key, val := range *in { - if newVal, err := c.DeepCopy(&val); err != nil { - return err - } else { - (*out)[key] = *newVal.(*[]byte) - } - } - } else { - out.Data = nil - } - out.Type = in.Type - return nil - } -} - -func DeepCopy_api_SecretKeySelector(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*SecretKeySelector) - out := out.(*SecretKeySelector) - out.LocalObjectReference = in.LocalObjectReference - out.Key = in.Key - return nil - } -} - -func DeepCopy_api_SecretList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*SecretList) - out := out.(*SecretList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Secret, len(*in)) - for i := range *in { - if err := DeepCopy_api_Secret(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_api_SecretVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*SecretVolumeSource) - out := out.(*SecretVolumeSource) - out.SecretName = in.SecretName - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]KeyToPath, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_api_SecurityContext(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*SecurityContext) - out := out.(*SecurityContext) - if in.Capabilities != nil { - in, out := &in.Capabilities, &out.Capabilities - *out = new(Capabilities) - if err := DeepCopy_api_Capabilities(*in, *out, c); err != nil { - return err - } - } else { - out.Capabilities = nil - } - if in.Privileged != nil { - in, out := &in.Privileged, &out.Privileged - *out = new(bool) - **out = **in - } else { - out.Privileged = nil - } - if in.SELinuxOptions != nil { - in, out := &in.SELinuxOptions, &out.SELinuxOptions - *out = new(SELinuxOptions) - **out = **in - } else { - out.SELinuxOptions = nil - } - if in.RunAsUser != nil { - in, out := &in.RunAsUser, &out.RunAsUser - *out = new(int64) - **out = **in - } else { - out.RunAsUser = nil - } - if in.RunAsNonRoot != nil { - in, out := &in.RunAsNonRoot, &out.RunAsNonRoot - *out = new(bool) - **out = **in - } else { - out.RunAsNonRoot = nil - } - if in.ReadOnlyRootFilesystem != nil { - in, out := &in.ReadOnlyRootFilesystem, &out.ReadOnlyRootFilesystem - *out = new(bool) - **out = **in - } else { - out.ReadOnlyRootFilesystem = nil - } - return nil - } -} - -func DeepCopy_api_SerializedReference(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*SerializedReference) - out := out.(*SerializedReference) - out.TypeMeta = in.TypeMeta - out.Reference = in.Reference - return nil - } -} - -func DeepCopy_api_Service(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Service) - out := out.(*Service) - out.TypeMeta = in.TypeMeta - if err := DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_api_ServiceSpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - if err := DeepCopy_api_ServiceStatus(&in.Status, &out.Status, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_api_ServiceAccount(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ServiceAccount) - out := out.(*ServiceAccount) - out.TypeMeta = in.TypeMeta - if err := DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if in.Secrets != nil { - in, out := &in.Secrets, &out.Secrets - *out = make([]ObjectReference, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Secrets = nil - } - if in.ImagePullSecrets != nil { - in, out := &in.ImagePullSecrets, &out.ImagePullSecrets - *out = make([]LocalObjectReference, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.ImagePullSecrets = nil - } - return nil - } -} - -func DeepCopy_api_ServiceAccountList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ServiceAccountList) - out := out.(*ServiceAccountList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ServiceAccount, len(*in)) - for i := range *in { - if err := DeepCopy_api_ServiceAccount(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_api_ServiceList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ServiceList) - out := out.(*ServiceList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Service, len(*in)) - for i := range *in { - if err := DeepCopy_api_Service(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_api_ServicePort(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ServicePort) - out := out.(*ServicePort) - out.Name = in.Name - out.Protocol = in.Protocol - out.Port = in.Port - out.TargetPort = in.TargetPort - out.NodePort = in.NodePort - return nil - } -} - -func DeepCopy_api_ServiceProxyOptions(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ServiceProxyOptions) - out := out.(*ServiceProxyOptions) - out.TypeMeta = in.TypeMeta - out.Path = in.Path - return nil - } -} - -func DeepCopy_api_ServiceSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ServiceSpec) - out := out.(*ServiceSpec) - out.Type = in.Type - if in.Ports != nil { - in, out := &in.Ports, &out.Ports - *out = make([]ServicePort, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Ports = nil - } - if in.Selector != nil { - in, out := &in.Selector, &out.Selector - *out = make(map[string]string) - for key, val := range *in { - (*out)[key] = val - } - } else { - out.Selector = nil - } - out.ClusterIP = in.ClusterIP - if in.ExternalIPs != nil { - in, out := &in.ExternalIPs, &out.ExternalIPs - *out = make([]string, len(*in)) - copy(*out, *in) - } else { - out.ExternalIPs = nil - } - out.LoadBalancerIP = in.LoadBalancerIP - out.SessionAffinity = in.SessionAffinity - if in.LoadBalancerSourceRanges != nil { - in, out := &in.LoadBalancerSourceRanges, &out.LoadBalancerSourceRanges - *out = make([]string, len(*in)) - copy(*out, *in) - } else { - out.LoadBalancerSourceRanges = nil - } - return nil - } -} - -func DeepCopy_api_ServiceStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ServiceStatus) - out := out.(*ServiceStatus) - if err := DeepCopy_api_LoadBalancerStatus(&in.LoadBalancer, &out.LoadBalancer, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_api_TCPSocketAction(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*TCPSocketAction) - out := out.(*TCPSocketAction) - out.Port = in.Port - return nil - } -} - -func DeepCopy_api_Taint(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Taint) - out := out.(*Taint) - out.Key = in.Key - out.Value = in.Value - out.Effect = in.Effect - return nil - } -} - -func DeepCopy_api_Toleration(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Toleration) - out := out.(*Toleration) - out.Key = in.Key - out.Operator = in.Operator - out.Value = in.Value - out.Effect = in.Effect - return nil - } -} - -func DeepCopy_api_Volume(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Volume) - out := out.(*Volume) - out.Name = in.Name - if err := DeepCopy_api_VolumeSource(&in.VolumeSource, &out.VolumeSource, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_api_VolumeMount(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*VolumeMount) - out := out.(*VolumeMount) - out.Name = in.Name - out.ReadOnly = in.ReadOnly - out.MountPath = in.MountPath - out.SubPath = in.SubPath - return nil - } -} - -func DeepCopy_api_VolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*VolumeSource) - out := out.(*VolumeSource) - if in.HostPath != nil { - in, out := &in.HostPath, &out.HostPath - *out = new(HostPathVolumeSource) - **out = **in - } else { - out.HostPath = nil - } - if in.EmptyDir != nil { - in, out := &in.EmptyDir, &out.EmptyDir - *out = new(EmptyDirVolumeSource) - **out = **in - } else { - out.EmptyDir = nil - } - if in.GCEPersistentDisk != nil { - in, out := &in.GCEPersistentDisk, &out.GCEPersistentDisk - *out = new(GCEPersistentDiskVolumeSource) - **out = **in - } else { - out.GCEPersistentDisk = nil - } - if in.AWSElasticBlockStore != nil { - in, out := &in.AWSElasticBlockStore, &out.AWSElasticBlockStore - *out = new(AWSElasticBlockStoreVolumeSource) - **out = **in - } else { - out.AWSElasticBlockStore = nil - } - if in.GitRepo != nil { - in, out := &in.GitRepo, &out.GitRepo - *out = new(GitRepoVolumeSource) - **out = **in - } else { - out.GitRepo = nil - } - if in.Secret != nil { - in, out := &in.Secret, &out.Secret - *out = new(SecretVolumeSource) - if err := DeepCopy_api_SecretVolumeSource(*in, *out, c); err != nil { - return err - } - } else { - out.Secret = nil - } - if in.NFS != nil { - in, out := &in.NFS, &out.NFS - *out = new(NFSVolumeSource) - **out = **in - } else { - out.NFS = nil - } - if in.ISCSI != nil { - in, out := &in.ISCSI, &out.ISCSI - *out = new(ISCSIVolumeSource) - **out = **in - } else { - out.ISCSI = nil - } - if in.Glusterfs != nil { - in, out := &in.Glusterfs, &out.Glusterfs - *out = new(GlusterfsVolumeSource) - **out = **in - } else { - out.Glusterfs = nil - } - if in.PersistentVolumeClaim != nil { - in, out := &in.PersistentVolumeClaim, &out.PersistentVolumeClaim - *out = new(PersistentVolumeClaimVolumeSource) - **out = **in - } else { - out.PersistentVolumeClaim = nil - } - if in.RBD != nil { - in, out := &in.RBD, &out.RBD - *out = new(RBDVolumeSource) - if err := DeepCopy_api_RBDVolumeSource(*in, *out, c); err != nil { - return err - } - } else { - out.RBD = nil - } - if in.FlexVolume != nil { - in, out := &in.FlexVolume, &out.FlexVolume - *out = new(FlexVolumeSource) - if err := DeepCopy_api_FlexVolumeSource(*in, *out, c); err != nil { - return err - } - } else { - out.FlexVolume = nil - } - if in.Cinder != nil { - in, out := &in.Cinder, &out.Cinder - *out = new(CinderVolumeSource) - **out = **in - } else { - out.Cinder = nil - } - if in.CephFS != nil { - in, out := &in.CephFS, &out.CephFS - *out = new(CephFSVolumeSource) - if err := DeepCopy_api_CephFSVolumeSource(*in, *out, c); err != nil { - return err - } - } else { - out.CephFS = nil - } - if in.Flocker != nil { - in, out := &in.Flocker, &out.Flocker - *out = new(FlockerVolumeSource) - **out = **in - } else { - out.Flocker = nil - } - if in.DownwardAPI != nil { - in, out := &in.DownwardAPI, &out.DownwardAPI - *out = new(DownwardAPIVolumeSource) - if err := DeepCopy_api_DownwardAPIVolumeSource(*in, *out, c); err != nil { - return err - } - } else { - out.DownwardAPI = nil - } - if in.FC != nil { - in, out := &in.FC, &out.FC - *out = new(FCVolumeSource) - if err := DeepCopy_api_FCVolumeSource(*in, *out, c); err != nil { - return err - } - } else { - out.FC = nil - } - if in.AzureFile != nil { - in, out := &in.AzureFile, &out.AzureFile - *out = new(AzureFileVolumeSource) - **out = **in - } else { - out.AzureFile = nil - } - if in.ConfigMap != nil { - in, out := &in.ConfigMap, &out.ConfigMap - *out = new(ConfigMapVolumeSource) - if err := DeepCopy_api_ConfigMapVolumeSource(*in, *out, c); err != nil { - return err - } - } else { - out.ConfigMap = nil - } - if in.VsphereVolume != nil { - in, out := &in.VsphereVolume, &out.VsphereVolume - *out = new(VsphereVirtualDiskVolumeSource) - **out = **in - } else { - out.VsphereVolume = nil - } - return nil - } -} - -func DeepCopy_api_VsphereVirtualDiskVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*VsphereVirtualDiskVolumeSource) - out := out.(*VsphereVirtualDiskVolumeSource) - out.VolumePath = in.VolumePath - out.FSType = in.FSType - return nil - } -} - -func DeepCopy_api_WeightedPodAffinityTerm(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*WeightedPodAffinityTerm) - out := out.(*WeightedPodAffinityTerm) - out.Weight = in.Weight - if err := DeepCopy_api_PodAffinityTerm(&in.PodAffinityTerm, &out.PodAffinityTerm, c); err != nil { - return err - } - return nil - } -} diff --git a/pkg/api/unversioned/deep_copy_generated.go b/pkg/api/unversioned/deep_copy_generated.go deleted file mode 100644 index 627bb817ecb..00000000000 --- a/pkg/api/unversioned/deep_copy_generated.go +++ /dev/null @@ -1,390 +0,0 @@ -// +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 - } -} diff --git a/pkg/api/v1/deep_copy_generated.go b/pkg/api/v1/deep_copy_generated.go deleted file mode 100644 index de23e2f7038..00000000000 --- a/pkg/api/v1/deep_copy_generated.go +++ /dev/null @@ -1,3521 +0,0 @@ -// +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" - conversion "k8s.io/kubernetes/pkg/conversion" - runtime "k8s.io/kubernetes/pkg/runtime" - types "k8s.io/kubernetes/pkg/types" - reflect "reflect" -) - -func init() { - if err := api.Scheme.AddGeneratedDeepCopyFuncs( - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_AWSElasticBlockStoreVolumeSource, InType: reflect.TypeOf(func() *AWSElasticBlockStoreVolumeSource { var x *AWSElasticBlockStoreVolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_Affinity, InType: reflect.TypeOf(func() *Affinity { var x *Affinity; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_AttachedVolume, InType: reflect.TypeOf(func() *AttachedVolume { var x *AttachedVolume; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_AzureFileVolumeSource, InType: reflect.TypeOf(func() *AzureFileVolumeSource { var x *AzureFileVolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_Binding, InType: reflect.TypeOf(func() *Binding { var x *Binding; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_Capabilities, InType: reflect.TypeOf(func() *Capabilities { var x *Capabilities; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_CephFSVolumeSource, InType: reflect.TypeOf(func() *CephFSVolumeSource { var x *CephFSVolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_CinderVolumeSource, InType: reflect.TypeOf(func() *CinderVolumeSource { var x *CinderVolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ComponentCondition, InType: reflect.TypeOf(func() *ComponentCondition { var x *ComponentCondition; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ComponentStatus, InType: reflect.TypeOf(func() *ComponentStatus { var x *ComponentStatus; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ComponentStatusList, InType: reflect.TypeOf(func() *ComponentStatusList { var x *ComponentStatusList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ConfigMap, InType: reflect.TypeOf(func() *ConfigMap { var x *ConfigMap; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ConfigMapKeySelector, InType: reflect.TypeOf(func() *ConfigMapKeySelector { var x *ConfigMapKeySelector; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ConfigMapList, InType: reflect.TypeOf(func() *ConfigMapList { var x *ConfigMapList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ConfigMapVolumeSource, InType: reflect.TypeOf(func() *ConfigMapVolumeSource { var x *ConfigMapVolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_Container, InType: reflect.TypeOf(func() *Container { var x *Container; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ContainerImage, InType: reflect.TypeOf(func() *ContainerImage { var x *ContainerImage; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ContainerPort, InType: reflect.TypeOf(func() *ContainerPort { var x *ContainerPort; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ContainerState, InType: reflect.TypeOf(func() *ContainerState { var x *ContainerState; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ContainerStateRunning, InType: reflect.TypeOf(func() *ContainerStateRunning { var x *ContainerStateRunning; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ContainerStateTerminated, InType: reflect.TypeOf(func() *ContainerStateTerminated { var x *ContainerStateTerminated; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ContainerStateWaiting, InType: reflect.TypeOf(func() *ContainerStateWaiting { var x *ContainerStateWaiting; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ContainerStatus, InType: reflect.TypeOf(func() *ContainerStatus { var x *ContainerStatus; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_DaemonEndpoint, InType: reflect.TypeOf(func() *DaemonEndpoint { var x *DaemonEndpoint; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_DeleteOptions, InType: reflect.TypeOf(func() *DeleteOptions { var x *DeleteOptions; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_DownwardAPIVolumeFile, InType: reflect.TypeOf(func() *DownwardAPIVolumeFile { var x *DownwardAPIVolumeFile; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_DownwardAPIVolumeSource, InType: reflect.TypeOf(func() *DownwardAPIVolumeSource { var x *DownwardAPIVolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_EmptyDirVolumeSource, InType: reflect.TypeOf(func() *EmptyDirVolumeSource { var x *EmptyDirVolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_EndpointAddress, InType: reflect.TypeOf(func() *EndpointAddress { var x *EndpointAddress; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_EndpointPort, InType: reflect.TypeOf(func() *EndpointPort { var x *EndpointPort; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_EndpointSubset, InType: reflect.TypeOf(func() *EndpointSubset { var x *EndpointSubset; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_Endpoints, InType: reflect.TypeOf(func() *Endpoints { var x *Endpoints; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_EndpointsList, InType: reflect.TypeOf(func() *EndpointsList { var x *EndpointsList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_EnvVar, InType: reflect.TypeOf(func() *EnvVar { var x *EnvVar; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_EnvVarSource, InType: reflect.TypeOf(func() *EnvVarSource { var x *EnvVarSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_Event, InType: reflect.TypeOf(func() *Event { var x *Event; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_EventList, InType: reflect.TypeOf(func() *EventList { var x *EventList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_EventSource, InType: reflect.TypeOf(func() *EventSource { var x *EventSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ExecAction, InType: reflect.TypeOf(func() *ExecAction { var x *ExecAction; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ExportOptions, InType: reflect.TypeOf(func() *ExportOptions { var x *ExportOptions; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_FCVolumeSource, InType: reflect.TypeOf(func() *FCVolumeSource { var x *FCVolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_FlexVolumeSource, InType: reflect.TypeOf(func() *FlexVolumeSource { var x *FlexVolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_FlockerVolumeSource, InType: reflect.TypeOf(func() *FlockerVolumeSource { var x *FlockerVolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_GCEPersistentDiskVolumeSource, InType: reflect.TypeOf(func() *GCEPersistentDiskVolumeSource { var x *GCEPersistentDiskVolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_GitRepoVolumeSource, InType: reflect.TypeOf(func() *GitRepoVolumeSource { var x *GitRepoVolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_GlusterfsVolumeSource, InType: reflect.TypeOf(func() *GlusterfsVolumeSource { var x *GlusterfsVolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_HTTPGetAction, InType: reflect.TypeOf(func() *HTTPGetAction { var x *HTTPGetAction; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_HTTPHeader, InType: reflect.TypeOf(func() *HTTPHeader { var x *HTTPHeader; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_Handler, InType: reflect.TypeOf(func() *Handler { var x *Handler; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_HostPathVolumeSource, InType: reflect.TypeOf(func() *HostPathVolumeSource { var x *HostPathVolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ISCSIVolumeSource, InType: reflect.TypeOf(func() *ISCSIVolumeSource { var x *ISCSIVolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_KeyToPath, InType: reflect.TypeOf(func() *KeyToPath { var x *KeyToPath; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_Lifecycle, InType: reflect.TypeOf(func() *Lifecycle { var x *Lifecycle; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_LimitRange, InType: reflect.TypeOf(func() *LimitRange { var x *LimitRange; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_LimitRangeItem, InType: reflect.TypeOf(func() *LimitRangeItem { var x *LimitRangeItem; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_LimitRangeList, InType: reflect.TypeOf(func() *LimitRangeList { var x *LimitRangeList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_LimitRangeSpec, InType: reflect.TypeOf(func() *LimitRangeSpec { var x *LimitRangeSpec; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_List, InType: reflect.TypeOf(func() *List { var x *List; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ListOptions, InType: reflect.TypeOf(func() *ListOptions { var x *ListOptions; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_LoadBalancerIngress, InType: reflect.TypeOf(func() *LoadBalancerIngress { var x *LoadBalancerIngress; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_LoadBalancerStatus, InType: reflect.TypeOf(func() *LoadBalancerStatus { var x *LoadBalancerStatus; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_LocalObjectReference, InType: reflect.TypeOf(func() *LocalObjectReference { var x *LocalObjectReference; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_NFSVolumeSource, InType: reflect.TypeOf(func() *NFSVolumeSource { var x *NFSVolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_Namespace, InType: reflect.TypeOf(func() *Namespace { var x *Namespace; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_NamespaceList, InType: reflect.TypeOf(func() *NamespaceList { var x *NamespaceList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_NamespaceSpec, InType: reflect.TypeOf(func() *NamespaceSpec { var x *NamespaceSpec; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_NamespaceStatus, InType: reflect.TypeOf(func() *NamespaceStatus { var x *NamespaceStatus; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_Node, InType: reflect.TypeOf(func() *Node { var x *Node; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_NodeAddress, InType: reflect.TypeOf(func() *NodeAddress { var x *NodeAddress; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_NodeAffinity, InType: reflect.TypeOf(func() *NodeAffinity { var x *NodeAffinity; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_NodeCondition, InType: reflect.TypeOf(func() *NodeCondition { var x *NodeCondition; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_NodeDaemonEndpoints, InType: reflect.TypeOf(func() *NodeDaemonEndpoints { var x *NodeDaemonEndpoints; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_NodeList, InType: reflect.TypeOf(func() *NodeList { var x *NodeList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_NodeProxyOptions, InType: reflect.TypeOf(func() *NodeProxyOptions { var x *NodeProxyOptions; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_NodeSelector, InType: reflect.TypeOf(func() *NodeSelector { var x *NodeSelector; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_NodeSelectorRequirement, InType: reflect.TypeOf(func() *NodeSelectorRequirement { var x *NodeSelectorRequirement; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_NodeSelectorTerm, InType: reflect.TypeOf(func() *NodeSelectorTerm { var x *NodeSelectorTerm; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_NodeSpec, InType: reflect.TypeOf(func() *NodeSpec { var x *NodeSpec; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_NodeStatus, InType: reflect.TypeOf(func() *NodeStatus { var x *NodeStatus; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_NodeSystemInfo, InType: reflect.TypeOf(func() *NodeSystemInfo { var x *NodeSystemInfo; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ObjectFieldSelector, InType: reflect.TypeOf(func() *ObjectFieldSelector { var x *ObjectFieldSelector; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ObjectMeta, InType: reflect.TypeOf(func() *ObjectMeta { var x *ObjectMeta; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ObjectReference, InType: reflect.TypeOf(func() *ObjectReference { var x *ObjectReference; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_OwnerReference, InType: reflect.TypeOf(func() *OwnerReference { var x *OwnerReference; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_PersistentVolume, InType: reflect.TypeOf(func() *PersistentVolume { var x *PersistentVolume; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_PersistentVolumeClaim, InType: reflect.TypeOf(func() *PersistentVolumeClaim { var x *PersistentVolumeClaim; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_PersistentVolumeClaimList, InType: reflect.TypeOf(func() *PersistentVolumeClaimList { var x *PersistentVolumeClaimList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_PersistentVolumeClaimSpec, InType: reflect.TypeOf(func() *PersistentVolumeClaimSpec { var x *PersistentVolumeClaimSpec; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_PersistentVolumeClaimStatus, InType: reflect.TypeOf(func() *PersistentVolumeClaimStatus { var x *PersistentVolumeClaimStatus; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_PersistentVolumeClaimVolumeSource, InType: reflect.TypeOf(func() *PersistentVolumeClaimVolumeSource { var x *PersistentVolumeClaimVolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_PersistentVolumeList, InType: reflect.TypeOf(func() *PersistentVolumeList { var x *PersistentVolumeList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_PersistentVolumeSource, InType: reflect.TypeOf(func() *PersistentVolumeSource { var x *PersistentVolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_PersistentVolumeSpec, InType: reflect.TypeOf(func() *PersistentVolumeSpec { var x *PersistentVolumeSpec; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_PersistentVolumeStatus, InType: reflect.TypeOf(func() *PersistentVolumeStatus { var x *PersistentVolumeStatus; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_Pod, InType: reflect.TypeOf(func() *Pod { var x *Pod; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_PodAffinity, InType: reflect.TypeOf(func() *PodAffinity { var x *PodAffinity; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_PodAffinityTerm, InType: reflect.TypeOf(func() *PodAffinityTerm { var x *PodAffinityTerm; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_PodAntiAffinity, InType: reflect.TypeOf(func() *PodAntiAffinity { var x *PodAntiAffinity; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_PodAttachOptions, InType: reflect.TypeOf(func() *PodAttachOptions { var x *PodAttachOptions; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_PodCondition, InType: reflect.TypeOf(func() *PodCondition { var x *PodCondition; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_PodExecOptions, InType: reflect.TypeOf(func() *PodExecOptions { var x *PodExecOptions; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_PodList, InType: reflect.TypeOf(func() *PodList { var x *PodList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_PodLogOptions, InType: reflect.TypeOf(func() *PodLogOptions { var x *PodLogOptions; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_PodProxyOptions, InType: reflect.TypeOf(func() *PodProxyOptions { var x *PodProxyOptions; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_PodSecurityContext, InType: reflect.TypeOf(func() *PodSecurityContext { var x *PodSecurityContext; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_PodSpec, InType: reflect.TypeOf(func() *PodSpec { var x *PodSpec; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_PodStatus, InType: reflect.TypeOf(func() *PodStatus { var x *PodStatus; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_PodStatusResult, InType: reflect.TypeOf(func() *PodStatusResult { var x *PodStatusResult; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_PodTemplate, InType: reflect.TypeOf(func() *PodTemplate { var x *PodTemplate; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_PodTemplateList, InType: reflect.TypeOf(func() *PodTemplateList { var x *PodTemplateList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_PodTemplateSpec, InType: reflect.TypeOf(func() *PodTemplateSpec { var x *PodTemplateSpec; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_Preconditions, InType: reflect.TypeOf(func() *Preconditions { var x *Preconditions; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_PreferredSchedulingTerm, InType: reflect.TypeOf(func() *PreferredSchedulingTerm { var x *PreferredSchedulingTerm; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_Probe, InType: reflect.TypeOf(func() *Probe { var x *Probe; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_RBDVolumeSource, InType: reflect.TypeOf(func() *RBDVolumeSource { var x *RBDVolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_RangeAllocation, InType: reflect.TypeOf(func() *RangeAllocation { var x *RangeAllocation; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ReplicationController, InType: reflect.TypeOf(func() *ReplicationController { var x *ReplicationController; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ReplicationControllerList, InType: reflect.TypeOf(func() *ReplicationControllerList { var x *ReplicationControllerList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ReplicationControllerSpec, InType: reflect.TypeOf(func() *ReplicationControllerSpec { var x *ReplicationControllerSpec; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ReplicationControllerStatus, InType: reflect.TypeOf(func() *ReplicationControllerStatus { var x *ReplicationControllerStatus; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ResourceFieldSelector, InType: reflect.TypeOf(func() *ResourceFieldSelector { var x *ResourceFieldSelector; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ResourceQuota, InType: reflect.TypeOf(func() *ResourceQuota { var x *ResourceQuota; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ResourceQuotaList, InType: reflect.TypeOf(func() *ResourceQuotaList { var x *ResourceQuotaList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ResourceQuotaSpec, InType: reflect.TypeOf(func() *ResourceQuotaSpec { var x *ResourceQuotaSpec; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ResourceQuotaStatus, InType: reflect.TypeOf(func() *ResourceQuotaStatus { var x *ResourceQuotaStatus; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ResourceRequirements, InType: reflect.TypeOf(func() *ResourceRequirements { var x *ResourceRequirements; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_SELinuxOptions, InType: reflect.TypeOf(func() *SELinuxOptions { var x *SELinuxOptions; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_Secret, InType: reflect.TypeOf(func() *Secret { var x *Secret; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_SecretKeySelector, InType: reflect.TypeOf(func() *SecretKeySelector { var x *SecretKeySelector; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_SecretList, InType: reflect.TypeOf(func() *SecretList { var x *SecretList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_SecretVolumeSource, InType: reflect.TypeOf(func() *SecretVolumeSource { var x *SecretVolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_SecurityContext, InType: reflect.TypeOf(func() *SecurityContext { var x *SecurityContext; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_SerializedReference, InType: reflect.TypeOf(func() *SerializedReference { var x *SerializedReference; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_Service, InType: reflect.TypeOf(func() *Service { var x *Service; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ServiceAccount, InType: reflect.TypeOf(func() *ServiceAccount { var x *ServiceAccount; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ServiceAccountList, InType: reflect.TypeOf(func() *ServiceAccountList { var x *ServiceAccountList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ServiceList, InType: reflect.TypeOf(func() *ServiceList { var x *ServiceList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ServicePort, InType: reflect.TypeOf(func() *ServicePort { var x *ServicePort; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ServiceProxyOptions, InType: reflect.TypeOf(func() *ServiceProxyOptions { var x *ServiceProxyOptions; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ServiceSpec, InType: reflect.TypeOf(func() *ServiceSpec { var x *ServiceSpec; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_ServiceStatus, InType: reflect.TypeOf(func() *ServiceStatus { var x *ServiceStatus; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_TCPSocketAction, InType: reflect.TypeOf(func() *TCPSocketAction { var x *TCPSocketAction; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_Taint, InType: reflect.TypeOf(func() *Taint { var x *Taint; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_Toleration, InType: reflect.TypeOf(func() *Toleration { var x *Toleration; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_Volume, InType: reflect.TypeOf(func() *Volume { var x *Volume; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_VolumeMount, InType: reflect.TypeOf(func() *VolumeMount { var x *VolumeMount; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_VolumeSource, InType: reflect.TypeOf(func() *VolumeSource { var x *VolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_VsphereVirtualDiskVolumeSource, InType: reflect.TypeOf(func() *VsphereVirtualDiskVolumeSource { var x *VsphereVirtualDiskVolumeSource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1_WeightedPodAffinityTerm, InType: reflect.TypeOf(func() *WeightedPodAffinityTerm { var x *WeightedPodAffinityTerm; return x }())}, - ); err != nil { - // if one of the deep copy functions is malformed, detect it immediately. - panic(err) - } -} - -func DeepCopy_v1_AWSElasticBlockStoreVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*AWSElasticBlockStoreVolumeSource) - out := out.(*AWSElasticBlockStoreVolumeSource) - out.VolumeID = in.VolumeID - out.FSType = in.FSType - out.Partition = in.Partition - out.ReadOnly = in.ReadOnly - return nil - } -} - -func DeepCopy_v1_Affinity(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Affinity) - out := out.(*Affinity) - if in.NodeAffinity != nil { - in, out := &in.NodeAffinity, &out.NodeAffinity - *out = new(NodeAffinity) - if err := DeepCopy_v1_NodeAffinity(*in, *out, c); err != nil { - return err - } - } else { - out.NodeAffinity = nil - } - if in.PodAffinity != nil { - in, out := &in.PodAffinity, &out.PodAffinity - *out = new(PodAffinity) - if err := DeepCopy_v1_PodAffinity(*in, *out, c); err != nil { - return err - } - } else { - out.PodAffinity = nil - } - if in.PodAntiAffinity != nil { - in, out := &in.PodAntiAffinity, &out.PodAntiAffinity - *out = new(PodAntiAffinity) - if err := DeepCopy_v1_PodAntiAffinity(*in, *out, c); err != nil { - return err - } - } else { - out.PodAntiAffinity = nil - } - return nil - } -} - -func DeepCopy_v1_AttachedVolume(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*AttachedVolume) - out := out.(*AttachedVolume) - out.Name = in.Name - out.DevicePath = in.DevicePath - return nil - } -} - -func DeepCopy_v1_AzureFileVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*AzureFileVolumeSource) - out := out.(*AzureFileVolumeSource) - out.SecretName = in.SecretName - out.ShareName = in.ShareName - out.ReadOnly = in.ReadOnly - return nil - } -} - -func DeepCopy_v1_Binding(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Binding) - out := out.(*Binding) - out.TypeMeta = in.TypeMeta - if err := DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - out.Target = in.Target - return nil - } -} - -func DeepCopy_v1_Capabilities(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Capabilities) - out := out.(*Capabilities) - if in.Add != nil { - in, out := &in.Add, &out.Add - *out = make([]Capability, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Add = nil - } - if in.Drop != nil { - in, out := &in.Drop, &out.Drop - *out = make([]Capability, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Drop = nil - } - return nil - } -} - -func DeepCopy_v1_CephFSVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*CephFSVolumeSource) - out := out.(*CephFSVolumeSource) - if in.Monitors != nil { - in, out := &in.Monitors, &out.Monitors - *out = make([]string, len(*in)) - copy(*out, *in) - } else { - out.Monitors = nil - } - out.Path = in.Path - out.User = in.User - out.SecretFile = in.SecretFile - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - *out = new(LocalObjectReference) - **out = **in - } else { - out.SecretRef = nil - } - out.ReadOnly = in.ReadOnly - return nil - } -} - -func DeepCopy_v1_CinderVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*CinderVolumeSource) - out := out.(*CinderVolumeSource) - out.VolumeID = in.VolumeID - out.FSType = in.FSType - out.ReadOnly = in.ReadOnly - return nil - } -} - -func DeepCopy_v1_ComponentCondition(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ComponentCondition) - out := out.(*ComponentCondition) - out.Type = in.Type - out.Status = in.Status - out.Message = in.Message - out.Error = in.Error - return nil - } -} - -func DeepCopy_v1_ComponentStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ComponentStatus) - out := out.(*ComponentStatus) - out.TypeMeta = in.TypeMeta - if err := DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]ComponentCondition, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Conditions = nil - } - return nil - } -} - -func DeepCopy_v1_ComponentStatusList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ComponentStatusList) - out := out.(*ComponentStatusList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ComponentStatus, len(*in)) - for i := range *in { - if err := DeepCopy_v1_ComponentStatus(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_v1_ConfigMap(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ConfigMap) - out := out.(*ConfigMap) - out.TypeMeta = in.TypeMeta - if err := DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if in.Data != nil { - in, out := &in.Data, &out.Data - *out = make(map[string]string) - for key, val := range *in { - (*out)[key] = val - } - } else { - out.Data = nil - } - return nil - } -} - -func DeepCopy_v1_ConfigMapKeySelector(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ConfigMapKeySelector) - out := out.(*ConfigMapKeySelector) - out.LocalObjectReference = in.LocalObjectReference - out.Key = in.Key - return nil - } -} - -func DeepCopy_v1_ConfigMapList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ConfigMapList) - out := out.(*ConfigMapList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ConfigMap, len(*in)) - for i := range *in { - if err := DeepCopy_v1_ConfigMap(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_v1_ConfigMapVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ConfigMapVolumeSource) - out := out.(*ConfigMapVolumeSource) - out.LocalObjectReference = in.LocalObjectReference - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]KeyToPath, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_v1_Container(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Container) - out := out.(*Container) - out.Name = in.Name - out.Image = in.Image - if in.Command != nil { - in, out := &in.Command, &out.Command - *out = make([]string, len(*in)) - copy(*out, *in) - } else { - out.Command = nil - } - if in.Args != nil { - in, out := &in.Args, &out.Args - *out = make([]string, len(*in)) - copy(*out, *in) - } else { - out.Args = nil - } - out.WorkingDir = in.WorkingDir - if in.Ports != nil { - in, out := &in.Ports, &out.Ports - *out = make([]ContainerPort, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Ports = nil - } - if in.Env != nil { - in, out := &in.Env, &out.Env - *out = make([]EnvVar, len(*in)) - for i := range *in { - if err := DeepCopy_v1_EnvVar(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Env = nil - } - if err := DeepCopy_v1_ResourceRequirements(&in.Resources, &out.Resources, c); err != nil { - return err - } - if in.VolumeMounts != nil { - in, out := &in.VolumeMounts, &out.VolumeMounts - *out = make([]VolumeMount, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.VolumeMounts = nil - } - if in.LivenessProbe != nil { - in, out := &in.LivenessProbe, &out.LivenessProbe - *out = new(Probe) - if err := DeepCopy_v1_Probe(*in, *out, c); err != nil { - return err - } - } else { - out.LivenessProbe = nil - } - if in.ReadinessProbe != nil { - in, out := &in.ReadinessProbe, &out.ReadinessProbe - *out = new(Probe) - if err := DeepCopy_v1_Probe(*in, *out, c); err != nil { - return err - } - } else { - out.ReadinessProbe = nil - } - if in.Lifecycle != nil { - in, out := &in.Lifecycle, &out.Lifecycle - *out = new(Lifecycle) - if err := DeepCopy_v1_Lifecycle(*in, *out, c); err != nil { - return err - } - } else { - out.Lifecycle = nil - } - out.TerminationMessagePath = in.TerminationMessagePath - out.ImagePullPolicy = in.ImagePullPolicy - if in.SecurityContext != nil { - in, out := &in.SecurityContext, &out.SecurityContext - *out = new(SecurityContext) - if err := DeepCopy_v1_SecurityContext(*in, *out, c); err != nil { - return err - } - } else { - out.SecurityContext = nil - } - out.Stdin = in.Stdin - out.StdinOnce = in.StdinOnce - out.TTY = in.TTY - return nil - } -} - -func DeepCopy_v1_ContainerImage(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ContainerImage) - out := out.(*ContainerImage) - if in.Names != nil { - in, out := &in.Names, &out.Names - *out = make([]string, len(*in)) - copy(*out, *in) - } else { - out.Names = nil - } - out.SizeBytes = in.SizeBytes - return nil - } -} - -func DeepCopy_v1_ContainerPort(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ContainerPort) - out := out.(*ContainerPort) - out.Name = in.Name - out.HostPort = in.HostPort - out.ContainerPort = in.ContainerPort - out.Protocol = in.Protocol - out.HostIP = in.HostIP - return nil - } -} - -func DeepCopy_v1_ContainerState(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ContainerState) - out := out.(*ContainerState) - if in.Waiting != nil { - in, out := &in.Waiting, &out.Waiting - *out = new(ContainerStateWaiting) - **out = **in - } else { - out.Waiting = nil - } - if in.Running != nil { - in, out := &in.Running, &out.Running - *out = new(ContainerStateRunning) - if err := DeepCopy_v1_ContainerStateRunning(*in, *out, c); err != nil { - return err - } - } else { - out.Running = nil - } - if in.Terminated != nil { - in, out := &in.Terminated, &out.Terminated - *out = new(ContainerStateTerminated) - if err := DeepCopy_v1_ContainerStateTerminated(*in, *out, c); err != nil { - return err - } - } else { - out.Terminated = nil - } - return nil - } -} - -func DeepCopy_v1_ContainerStateRunning(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ContainerStateRunning) - out := out.(*ContainerStateRunning) - out.StartedAt = in.StartedAt.DeepCopy() - return nil - } -} - -func DeepCopy_v1_ContainerStateTerminated(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ContainerStateTerminated) - out := out.(*ContainerStateTerminated) - out.ExitCode = in.ExitCode - out.Signal = in.Signal - out.Reason = in.Reason - out.Message = in.Message - out.StartedAt = in.StartedAt.DeepCopy() - out.FinishedAt = in.FinishedAt.DeepCopy() - out.ContainerID = in.ContainerID - return nil - } -} - -func DeepCopy_v1_ContainerStateWaiting(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ContainerStateWaiting) - out := out.(*ContainerStateWaiting) - out.Reason = in.Reason - out.Message = in.Message - return nil - } -} - -func DeepCopy_v1_ContainerStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ContainerStatus) - out := out.(*ContainerStatus) - out.Name = in.Name - if err := DeepCopy_v1_ContainerState(&in.State, &out.State, c); err != nil { - return err - } - if err := DeepCopy_v1_ContainerState(&in.LastTerminationState, &out.LastTerminationState, c); err != nil { - return err - } - out.Ready = in.Ready - out.RestartCount = in.RestartCount - out.Image = in.Image - out.ImageID = in.ImageID - out.ContainerID = in.ContainerID - return nil - } -} - -func DeepCopy_v1_DaemonEndpoint(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*DaemonEndpoint) - out := out.(*DaemonEndpoint) - out.Port = in.Port - return nil - } -} - -func DeepCopy_v1_DeleteOptions(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*DeleteOptions) - out := out.(*DeleteOptions) - out.TypeMeta = in.TypeMeta - if in.GracePeriodSeconds != nil { - in, out := &in.GracePeriodSeconds, &out.GracePeriodSeconds - *out = new(int64) - **out = **in - } else { - out.GracePeriodSeconds = nil - } - if in.Preconditions != nil { - in, out := &in.Preconditions, &out.Preconditions - *out = new(Preconditions) - if err := DeepCopy_v1_Preconditions(*in, *out, c); err != nil { - return err - } - } else { - out.Preconditions = nil - } - if in.OrphanDependents != nil { - in, out := &in.OrphanDependents, &out.OrphanDependents - *out = new(bool) - **out = **in - } else { - out.OrphanDependents = nil - } - return nil - } -} - -func DeepCopy_v1_DownwardAPIVolumeFile(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*DownwardAPIVolumeFile) - out := out.(*DownwardAPIVolumeFile) - out.Path = in.Path - if in.FieldRef != nil { - in, out := &in.FieldRef, &out.FieldRef - *out = new(ObjectFieldSelector) - **out = **in - } else { - out.FieldRef = nil - } - if in.ResourceFieldRef != nil { - in, out := &in.ResourceFieldRef, &out.ResourceFieldRef - *out = new(ResourceFieldSelector) - if err := DeepCopy_v1_ResourceFieldSelector(*in, *out, c); err != nil { - return err - } - } else { - out.ResourceFieldRef = nil - } - return nil - } -} - -func DeepCopy_v1_DownwardAPIVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*DownwardAPIVolumeSource) - out := out.(*DownwardAPIVolumeSource) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]DownwardAPIVolumeFile, len(*in)) - for i := range *in { - if err := DeepCopy_v1_DownwardAPIVolumeFile(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_v1_EmptyDirVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*EmptyDirVolumeSource) - out := out.(*EmptyDirVolumeSource) - out.Medium = in.Medium - return nil - } -} - -func DeepCopy_v1_EndpointAddress(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*EndpointAddress) - out := out.(*EndpointAddress) - out.IP = in.IP - out.Hostname = in.Hostname - if in.TargetRef != nil { - in, out := &in.TargetRef, &out.TargetRef - *out = new(ObjectReference) - **out = **in - } else { - out.TargetRef = nil - } - return nil - } -} - -func DeepCopy_v1_EndpointPort(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*EndpointPort) - out := out.(*EndpointPort) - out.Name = in.Name - out.Port = in.Port - out.Protocol = in.Protocol - return nil - } -} - -func DeepCopy_v1_EndpointSubset(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*EndpointSubset) - out := out.(*EndpointSubset) - if in.Addresses != nil { - in, out := &in.Addresses, &out.Addresses - *out = make([]EndpointAddress, len(*in)) - for i := range *in { - if err := DeepCopy_v1_EndpointAddress(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Addresses = nil - } - if in.NotReadyAddresses != nil { - in, out := &in.NotReadyAddresses, &out.NotReadyAddresses - *out = make([]EndpointAddress, len(*in)) - for i := range *in { - if err := DeepCopy_v1_EndpointAddress(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.NotReadyAddresses = nil - } - if in.Ports != nil { - in, out := &in.Ports, &out.Ports - *out = make([]EndpointPort, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Ports = nil - } - return nil - } -} - -func DeepCopy_v1_Endpoints(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Endpoints) - out := out.(*Endpoints) - out.TypeMeta = in.TypeMeta - if err := DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if in.Subsets != nil { - in, out := &in.Subsets, &out.Subsets - *out = make([]EndpointSubset, len(*in)) - for i := range *in { - if err := DeepCopy_v1_EndpointSubset(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Subsets = nil - } - return nil - } -} - -func DeepCopy_v1_EndpointsList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*EndpointsList) - out := out.(*EndpointsList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Endpoints, len(*in)) - for i := range *in { - if err := DeepCopy_v1_Endpoints(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_v1_EnvVar(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*EnvVar) - out := out.(*EnvVar) - out.Name = in.Name - out.Value = in.Value - if in.ValueFrom != nil { - in, out := &in.ValueFrom, &out.ValueFrom - *out = new(EnvVarSource) - if err := DeepCopy_v1_EnvVarSource(*in, *out, c); err != nil { - return err - } - } else { - out.ValueFrom = nil - } - return nil - } -} - -func DeepCopy_v1_EnvVarSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*EnvVarSource) - out := out.(*EnvVarSource) - if in.FieldRef != nil { - in, out := &in.FieldRef, &out.FieldRef - *out = new(ObjectFieldSelector) - **out = **in - } else { - out.FieldRef = nil - } - if in.ResourceFieldRef != nil { - in, out := &in.ResourceFieldRef, &out.ResourceFieldRef - *out = new(ResourceFieldSelector) - if err := DeepCopy_v1_ResourceFieldSelector(*in, *out, c); err != nil { - return err - } - } else { - out.ResourceFieldRef = nil - } - if in.ConfigMapKeyRef != nil { - in, out := &in.ConfigMapKeyRef, &out.ConfigMapKeyRef - *out = new(ConfigMapKeySelector) - **out = **in - } else { - out.ConfigMapKeyRef = nil - } - if in.SecretKeyRef != nil { - in, out := &in.SecretKeyRef, &out.SecretKeyRef - *out = new(SecretKeySelector) - **out = **in - } else { - out.SecretKeyRef = nil - } - return nil - } -} - -func DeepCopy_v1_Event(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Event) - out := out.(*Event) - out.TypeMeta = in.TypeMeta - if err := DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - out.InvolvedObject = in.InvolvedObject - out.Reason = in.Reason - out.Message = in.Message - out.Source = in.Source - out.FirstTimestamp = in.FirstTimestamp.DeepCopy() - out.LastTimestamp = in.LastTimestamp.DeepCopy() - out.Count = in.Count - out.Type = in.Type - return nil - } -} - -func DeepCopy_v1_EventList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*EventList) - out := out.(*EventList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Event, len(*in)) - for i := range *in { - if err := DeepCopy_v1_Event(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_v1_EventSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*EventSource) - out := out.(*EventSource) - out.Component = in.Component - out.Host = in.Host - return nil - } -} - -func DeepCopy_v1_ExecAction(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ExecAction) - out := out.(*ExecAction) - if in.Command != nil { - in, out := &in.Command, &out.Command - *out = make([]string, len(*in)) - copy(*out, *in) - } else { - out.Command = nil - } - return nil - } -} - -func DeepCopy_v1_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_v1_FCVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*FCVolumeSource) - out := out.(*FCVolumeSource) - if in.TargetWWNs != nil { - in, out := &in.TargetWWNs, &out.TargetWWNs - *out = make([]string, len(*in)) - copy(*out, *in) - } else { - out.TargetWWNs = nil - } - if in.Lun != nil { - in, out := &in.Lun, &out.Lun - *out = new(int32) - **out = **in - } else { - out.Lun = nil - } - out.FSType = in.FSType - out.ReadOnly = in.ReadOnly - return nil - } -} - -func DeepCopy_v1_FlexVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*FlexVolumeSource) - out := out.(*FlexVolumeSource) - out.Driver = in.Driver - out.FSType = in.FSType - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - *out = new(LocalObjectReference) - **out = **in - } else { - out.SecretRef = nil - } - out.ReadOnly = in.ReadOnly - if in.Options != nil { - in, out := &in.Options, &out.Options - *out = make(map[string]string) - for key, val := range *in { - (*out)[key] = val - } - } else { - out.Options = nil - } - return nil - } -} - -func DeepCopy_v1_FlockerVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*FlockerVolumeSource) - out := out.(*FlockerVolumeSource) - out.DatasetName = in.DatasetName - return nil - } -} - -func DeepCopy_v1_GCEPersistentDiskVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*GCEPersistentDiskVolumeSource) - out := out.(*GCEPersistentDiskVolumeSource) - out.PDName = in.PDName - out.FSType = in.FSType - out.Partition = in.Partition - out.ReadOnly = in.ReadOnly - return nil - } -} - -func DeepCopy_v1_GitRepoVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*GitRepoVolumeSource) - out := out.(*GitRepoVolumeSource) - out.Repository = in.Repository - out.Revision = in.Revision - out.Directory = in.Directory - return nil - } -} - -func DeepCopy_v1_GlusterfsVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*GlusterfsVolumeSource) - out := out.(*GlusterfsVolumeSource) - out.EndpointsName = in.EndpointsName - out.Path = in.Path - out.ReadOnly = in.ReadOnly - return nil - } -} - -func DeepCopy_v1_HTTPGetAction(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*HTTPGetAction) - out := out.(*HTTPGetAction) - out.Path = in.Path - out.Port = in.Port - out.Host = in.Host - out.Scheme = in.Scheme - if in.HTTPHeaders != nil { - in, out := &in.HTTPHeaders, &out.HTTPHeaders - *out = make([]HTTPHeader, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.HTTPHeaders = nil - } - return nil - } -} - -func DeepCopy_v1_HTTPHeader(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*HTTPHeader) - out := out.(*HTTPHeader) - out.Name = in.Name - out.Value = in.Value - return nil - } -} - -func DeepCopy_v1_Handler(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Handler) - out := out.(*Handler) - if in.Exec != nil { - in, out := &in.Exec, &out.Exec - *out = new(ExecAction) - if err := DeepCopy_v1_ExecAction(*in, *out, c); err != nil { - return err - } - } else { - out.Exec = nil - } - if in.HTTPGet != nil { - in, out := &in.HTTPGet, &out.HTTPGet - *out = new(HTTPGetAction) - if err := DeepCopy_v1_HTTPGetAction(*in, *out, c); err != nil { - return err - } - } else { - out.HTTPGet = nil - } - if in.TCPSocket != nil { - in, out := &in.TCPSocket, &out.TCPSocket - *out = new(TCPSocketAction) - **out = **in - } else { - out.TCPSocket = nil - } - return nil - } -} - -func DeepCopy_v1_HostPathVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*HostPathVolumeSource) - out := out.(*HostPathVolumeSource) - out.Path = in.Path - return nil - } -} - -func DeepCopy_v1_ISCSIVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ISCSIVolumeSource) - out := out.(*ISCSIVolumeSource) - out.TargetPortal = in.TargetPortal - out.IQN = in.IQN - out.Lun = in.Lun - out.ISCSIInterface = in.ISCSIInterface - out.FSType = in.FSType - out.ReadOnly = in.ReadOnly - return nil - } -} - -func DeepCopy_v1_KeyToPath(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*KeyToPath) - out := out.(*KeyToPath) - out.Key = in.Key - out.Path = in.Path - return nil - } -} - -func DeepCopy_v1_Lifecycle(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Lifecycle) - out := out.(*Lifecycle) - if in.PostStart != nil { - in, out := &in.PostStart, &out.PostStart - *out = new(Handler) - if err := DeepCopy_v1_Handler(*in, *out, c); err != nil { - return err - } - } else { - out.PostStart = nil - } - if in.PreStop != nil { - in, out := &in.PreStop, &out.PreStop - *out = new(Handler) - if err := DeepCopy_v1_Handler(*in, *out, c); err != nil { - return err - } - } else { - out.PreStop = nil - } - return nil - } -} - -func DeepCopy_v1_LimitRange(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*LimitRange) - out := out.(*LimitRange) - out.TypeMeta = in.TypeMeta - if err := DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_v1_LimitRangeSpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_v1_LimitRangeItem(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*LimitRangeItem) - out := out.(*LimitRangeItem) - out.Type = in.Type - if in.Max != nil { - in, out := &in.Max, &out.Max - *out = make(ResourceList) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } else { - out.Max = nil - } - if in.Min != nil { - in, out := &in.Min, &out.Min - *out = make(ResourceList) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } else { - out.Min = nil - } - if in.Default != nil { - in, out := &in.Default, &out.Default - *out = make(ResourceList) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } else { - out.Default = nil - } - if in.DefaultRequest != nil { - in, out := &in.DefaultRequest, &out.DefaultRequest - *out = make(ResourceList) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } else { - out.DefaultRequest = nil - } - if in.MaxLimitRequestRatio != nil { - in, out := &in.MaxLimitRequestRatio, &out.MaxLimitRequestRatio - *out = make(ResourceList) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } else { - out.MaxLimitRequestRatio = nil - } - return nil - } -} - -func DeepCopy_v1_LimitRangeList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*LimitRangeList) - out := out.(*LimitRangeList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]LimitRange, len(*in)) - for i := range *in { - if err := DeepCopy_v1_LimitRange(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_v1_LimitRangeSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*LimitRangeSpec) - out := out.(*LimitRangeSpec) - if in.Limits != nil { - in, out := &in.Limits, &out.Limits - *out = make([]LimitRangeItem, len(*in)) - for i := range *in { - if err := DeepCopy_v1_LimitRangeItem(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Limits = nil - } - return nil - } -} - -func DeepCopy_v1_List(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*List) - out := out.(*List) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]runtime.RawExtension, len(*in)) - for i := range *in { - if err := runtime.DeepCopy_runtime_RawExtension(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_v1_ListOptions(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ListOptions) - out := out.(*ListOptions) - out.TypeMeta = in.TypeMeta - out.LabelSelector = in.LabelSelector - out.FieldSelector = in.FieldSelector - out.Watch = in.Watch - out.ResourceVersion = in.ResourceVersion - if in.TimeoutSeconds != nil { - in, out := &in.TimeoutSeconds, &out.TimeoutSeconds - *out = new(int64) - **out = **in - } else { - out.TimeoutSeconds = nil - } - return nil - } -} - -func DeepCopy_v1_LoadBalancerIngress(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*LoadBalancerIngress) - out := out.(*LoadBalancerIngress) - out.IP = in.IP - out.Hostname = in.Hostname - return nil - } -} - -func DeepCopy_v1_LoadBalancerStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*LoadBalancerStatus) - out := out.(*LoadBalancerStatus) - if in.Ingress != nil { - in, out := &in.Ingress, &out.Ingress - *out = make([]LoadBalancerIngress, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Ingress = nil - } - return nil - } -} - -func DeepCopy_v1_LocalObjectReference(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*LocalObjectReference) - out := out.(*LocalObjectReference) - out.Name = in.Name - return nil - } -} - -func DeepCopy_v1_NFSVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NFSVolumeSource) - out := out.(*NFSVolumeSource) - out.Server = in.Server - out.Path = in.Path - out.ReadOnly = in.ReadOnly - return nil - } -} - -func DeepCopy_v1_Namespace(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Namespace) - out := out.(*Namespace) - out.TypeMeta = in.TypeMeta - if err := DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_v1_NamespaceSpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - out.Status = in.Status - return nil - } -} - -func DeepCopy_v1_NamespaceList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NamespaceList) - out := out.(*NamespaceList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Namespace, len(*in)) - for i := range *in { - if err := DeepCopy_v1_Namespace(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_v1_NamespaceSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NamespaceSpec) - out := out.(*NamespaceSpec) - if in.Finalizers != nil { - in, out := &in.Finalizers, &out.Finalizers - *out = make([]FinalizerName, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Finalizers = nil - } - return nil - } -} - -func DeepCopy_v1_NamespaceStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NamespaceStatus) - out := out.(*NamespaceStatus) - out.Phase = in.Phase - return nil - } -} - -func DeepCopy_v1_Node(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Node) - out := out.(*Node) - out.TypeMeta = in.TypeMeta - if err := DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - out.Spec = in.Spec - if err := DeepCopy_v1_NodeStatus(&in.Status, &out.Status, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_v1_NodeAddress(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NodeAddress) - out := out.(*NodeAddress) - out.Type = in.Type - out.Address = in.Address - return nil - } -} - -func DeepCopy_v1_NodeAffinity(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NodeAffinity) - out := out.(*NodeAffinity) - if in.RequiredDuringSchedulingIgnoredDuringExecution != nil { - in, out := &in.RequiredDuringSchedulingIgnoredDuringExecution, &out.RequiredDuringSchedulingIgnoredDuringExecution - *out = new(NodeSelector) - if err := DeepCopy_v1_NodeSelector(*in, *out, c); err != nil { - return err - } - } else { - out.RequiredDuringSchedulingIgnoredDuringExecution = nil - } - if in.PreferredDuringSchedulingIgnoredDuringExecution != nil { - in, out := &in.PreferredDuringSchedulingIgnoredDuringExecution, &out.PreferredDuringSchedulingIgnoredDuringExecution - *out = make([]PreferredSchedulingTerm, len(*in)) - for i := range *in { - if err := DeepCopy_v1_PreferredSchedulingTerm(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.PreferredDuringSchedulingIgnoredDuringExecution = nil - } - return nil - } -} - -func DeepCopy_v1_NodeCondition(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NodeCondition) - out := out.(*NodeCondition) - out.Type = in.Type - out.Status = in.Status - out.LastHeartbeatTime = in.LastHeartbeatTime.DeepCopy() - out.LastTransitionTime = in.LastTransitionTime.DeepCopy() - out.Reason = in.Reason - out.Message = in.Message - return nil - } -} - -func DeepCopy_v1_NodeDaemonEndpoints(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NodeDaemonEndpoints) - out := out.(*NodeDaemonEndpoints) - out.KubeletEndpoint = in.KubeletEndpoint - return nil - } -} - -func DeepCopy_v1_NodeList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NodeList) - out := out.(*NodeList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Node, len(*in)) - for i := range *in { - if err := DeepCopy_v1_Node(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_v1_NodeProxyOptions(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NodeProxyOptions) - out := out.(*NodeProxyOptions) - out.TypeMeta = in.TypeMeta - out.Path = in.Path - return nil - } -} - -func DeepCopy_v1_NodeSelector(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NodeSelector) - out := out.(*NodeSelector) - if in.NodeSelectorTerms != nil { - in, out := &in.NodeSelectorTerms, &out.NodeSelectorTerms - *out = make([]NodeSelectorTerm, len(*in)) - for i := range *in { - if err := DeepCopy_v1_NodeSelectorTerm(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.NodeSelectorTerms = nil - } - return nil - } -} - -func DeepCopy_v1_NodeSelectorRequirement(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NodeSelectorRequirement) - out := out.(*NodeSelectorRequirement) - 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_v1_NodeSelectorTerm(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NodeSelectorTerm) - out := out.(*NodeSelectorTerm) - if in.MatchExpressions != nil { - in, out := &in.MatchExpressions, &out.MatchExpressions - *out = make([]NodeSelectorRequirement, len(*in)) - for i := range *in { - if err := DeepCopy_v1_NodeSelectorRequirement(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.MatchExpressions = nil - } - return nil - } -} - -func DeepCopy_v1_NodeSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NodeSpec) - out := out.(*NodeSpec) - out.PodCIDR = in.PodCIDR - out.ExternalID = in.ExternalID - out.ProviderID = in.ProviderID - out.Unschedulable = in.Unschedulable - return nil - } -} - -func DeepCopy_v1_NodeStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NodeStatus) - out := out.(*NodeStatus) - if in.Capacity != nil { - in, out := &in.Capacity, &out.Capacity - *out = make(ResourceList) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } else { - out.Capacity = nil - } - if in.Allocatable != nil { - in, out := &in.Allocatable, &out.Allocatable - *out = make(ResourceList) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } else { - out.Allocatable = nil - } - out.Phase = in.Phase - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]NodeCondition, len(*in)) - for i := range *in { - if err := DeepCopy_v1_NodeCondition(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - if in.Addresses != nil { - in, out := &in.Addresses, &out.Addresses - *out = make([]NodeAddress, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Addresses = nil - } - out.DaemonEndpoints = in.DaemonEndpoints - out.NodeInfo = in.NodeInfo - if in.Images != nil { - in, out := &in.Images, &out.Images - *out = make([]ContainerImage, len(*in)) - for i := range *in { - if err := DeepCopy_v1_ContainerImage(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Images = nil - } - if in.VolumesInUse != nil { - in, out := &in.VolumesInUse, &out.VolumesInUse - *out = make([]UniqueVolumeName, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.VolumesInUse = nil - } - if in.VolumesAttached != nil { - in, out := &in.VolumesAttached, &out.VolumesAttached - *out = make([]AttachedVolume, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.VolumesAttached = nil - } - return nil - } -} - -func DeepCopy_v1_NodeSystemInfo(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NodeSystemInfo) - out := out.(*NodeSystemInfo) - out.MachineID = in.MachineID - out.SystemUUID = in.SystemUUID - out.BootID = in.BootID - out.KernelVersion = in.KernelVersion - out.OSImage = in.OSImage - out.ContainerRuntimeVersion = in.ContainerRuntimeVersion - out.KubeletVersion = in.KubeletVersion - out.KubeProxyVersion = in.KubeProxyVersion - out.OperatingSystem = in.OperatingSystem - out.Architecture = in.Architecture - return nil - } -} - -func DeepCopy_v1_ObjectFieldSelector(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ObjectFieldSelector) - out := out.(*ObjectFieldSelector) - out.APIVersion = in.APIVersion - out.FieldPath = in.FieldPath - return nil - } -} - -func DeepCopy_v1_ObjectMeta(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ObjectMeta) - out := out.(*ObjectMeta) - out.Name = in.Name - out.GenerateName = in.GenerateName - out.Namespace = in.Namespace - out.SelfLink = in.SelfLink - out.UID = in.UID - out.ResourceVersion = in.ResourceVersion - out.Generation = in.Generation - out.CreationTimestamp = in.CreationTimestamp.DeepCopy() - if in.DeletionTimestamp != nil { - in, out := &in.DeletionTimestamp, &out.DeletionTimestamp - *out = new(unversioned.Time) - **out = (*in).DeepCopy() - } else { - out.DeletionTimestamp = nil - } - if in.DeletionGracePeriodSeconds != nil { - in, out := &in.DeletionGracePeriodSeconds, &out.DeletionGracePeriodSeconds - *out = new(int64) - **out = **in - } else { - out.DeletionGracePeriodSeconds = nil - } - if in.Labels != nil { - in, out := &in.Labels, &out.Labels - *out = make(map[string]string) - for key, val := range *in { - (*out)[key] = val - } - } else { - out.Labels = nil - } - if in.Annotations != nil { - in, out := &in.Annotations, &out.Annotations - *out = make(map[string]string) - for key, val := range *in { - (*out)[key] = val - } - } else { - out.Annotations = nil - } - if in.OwnerReferences != nil { - in, out := &in.OwnerReferences, &out.OwnerReferences - *out = make([]OwnerReference, len(*in)) - for i := range *in { - if err := DeepCopy_v1_OwnerReference(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.OwnerReferences = nil - } - if in.Finalizers != nil { - in, out := &in.Finalizers, &out.Finalizers - *out = make([]string, len(*in)) - copy(*out, *in) - } else { - out.Finalizers = nil - } - return nil - } -} - -func DeepCopy_v1_ObjectReference(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ObjectReference) - out := out.(*ObjectReference) - out.Kind = in.Kind - out.Namespace = in.Namespace - out.Name = in.Name - out.UID = in.UID - out.APIVersion = in.APIVersion - out.ResourceVersion = in.ResourceVersion - out.FieldPath = in.FieldPath - return nil - } -} - -func DeepCopy_v1_OwnerReference(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*OwnerReference) - out := out.(*OwnerReference) - out.APIVersion = in.APIVersion - out.Kind = in.Kind - out.Name = in.Name - out.UID = in.UID - if in.Controller != nil { - in, out := &in.Controller, &out.Controller - *out = new(bool) - **out = **in - } else { - out.Controller = nil - } - return nil - } -} - -func DeepCopy_v1_PersistentVolume(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PersistentVolume) - out := out.(*PersistentVolume) - out.TypeMeta = in.TypeMeta - if err := DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_v1_PersistentVolumeSpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - out.Status = in.Status - return nil - } -} - -func DeepCopy_v1_PersistentVolumeClaim(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PersistentVolumeClaim) - out := out.(*PersistentVolumeClaim) - out.TypeMeta = in.TypeMeta - if err := DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_v1_PersistentVolumeClaimSpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - if err := DeepCopy_v1_PersistentVolumeClaimStatus(&in.Status, &out.Status, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_v1_PersistentVolumeClaimList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PersistentVolumeClaimList) - out := out.(*PersistentVolumeClaimList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]PersistentVolumeClaim, len(*in)) - for i := range *in { - if err := DeepCopy_v1_PersistentVolumeClaim(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_v1_PersistentVolumeClaimSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PersistentVolumeClaimSpec) - out := out.(*PersistentVolumeClaimSpec) - if in.AccessModes != nil { - in, out := &in.AccessModes, &out.AccessModes - *out = make([]PersistentVolumeAccessMode, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.AccessModes = 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 := DeepCopy_v1_ResourceRequirements(&in.Resources, &out.Resources, c); err != nil { - return err - } - out.VolumeName = in.VolumeName - return nil - } -} - -func DeepCopy_v1_PersistentVolumeClaimStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PersistentVolumeClaimStatus) - out := out.(*PersistentVolumeClaimStatus) - out.Phase = in.Phase - if in.AccessModes != nil { - in, out := &in.AccessModes, &out.AccessModes - *out = make([]PersistentVolumeAccessMode, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.AccessModes = nil - } - if in.Capacity != nil { - in, out := &in.Capacity, &out.Capacity - *out = make(ResourceList) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } else { - out.Capacity = nil - } - return nil - } -} - -func DeepCopy_v1_PersistentVolumeClaimVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PersistentVolumeClaimVolumeSource) - out := out.(*PersistentVolumeClaimVolumeSource) - out.ClaimName = in.ClaimName - out.ReadOnly = in.ReadOnly - return nil - } -} - -func DeepCopy_v1_PersistentVolumeList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PersistentVolumeList) - out := out.(*PersistentVolumeList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]PersistentVolume, len(*in)) - for i := range *in { - if err := DeepCopy_v1_PersistentVolume(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_v1_PersistentVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PersistentVolumeSource) - out := out.(*PersistentVolumeSource) - if in.GCEPersistentDisk != nil { - in, out := &in.GCEPersistentDisk, &out.GCEPersistentDisk - *out = new(GCEPersistentDiskVolumeSource) - **out = **in - } else { - out.GCEPersistentDisk = nil - } - if in.AWSElasticBlockStore != nil { - in, out := &in.AWSElasticBlockStore, &out.AWSElasticBlockStore - *out = new(AWSElasticBlockStoreVolumeSource) - **out = **in - } else { - out.AWSElasticBlockStore = nil - } - if in.HostPath != nil { - in, out := &in.HostPath, &out.HostPath - *out = new(HostPathVolumeSource) - **out = **in - } else { - out.HostPath = nil - } - if in.Glusterfs != nil { - in, out := &in.Glusterfs, &out.Glusterfs - *out = new(GlusterfsVolumeSource) - **out = **in - } else { - out.Glusterfs = nil - } - if in.NFS != nil { - in, out := &in.NFS, &out.NFS - *out = new(NFSVolumeSource) - **out = **in - } else { - out.NFS = nil - } - if in.RBD != nil { - in, out := &in.RBD, &out.RBD - *out = new(RBDVolumeSource) - if err := DeepCopy_v1_RBDVolumeSource(*in, *out, c); err != nil { - return err - } - } else { - out.RBD = nil - } - if in.ISCSI != nil { - in, out := &in.ISCSI, &out.ISCSI - *out = new(ISCSIVolumeSource) - **out = **in - } else { - out.ISCSI = nil - } - if in.Cinder != nil { - in, out := &in.Cinder, &out.Cinder - *out = new(CinderVolumeSource) - **out = **in - } else { - out.Cinder = nil - } - if in.CephFS != nil { - in, out := &in.CephFS, &out.CephFS - *out = new(CephFSVolumeSource) - if err := DeepCopy_v1_CephFSVolumeSource(*in, *out, c); err != nil { - return err - } - } else { - out.CephFS = nil - } - if in.FC != nil { - in, out := &in.FC, &out.FC - *out = new(FCVolumeSource) - if err := DeepCopy_v1_FCVolumeSource(*in, *out, c); err != nil { - return err - } - } else { - out.FC = nil - } - if in.Flocker != nil { - in, out := &in.Flocker, &out.Flocker - *out = new(FlockerVolumeSource) - **out = **in - } else { - out.Flocker = nil - } - if in.FlexVolume != nil { - in, out := &in.FlexVolume, &out.FlexVolume - *out = new(FlexVolumeSource) - if err := DeepCopy_v1_FlexVolumeSource(*in, *out, c); err != nil { - return err - } - } else { - out.FlexVolume = nil - } - if in.AzureFile != nil { - in, out := &in.AzureFile, &out.AzureFile - *out = new(AzureFileVolumeSource) - **out = **in - } else { - out.AzureFile = nil - } - if in.VsphereVolume != nil { - in, out := &in.VsphereVolume, &out.VsphereVolume - *out = new(VsphereVirtualDiskVolumeSource) - **out = **in - } else { - out.VsphereVolume = nil - } - return nil - } -} - -func DeepCopy_v1_PersistentVolumeSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PersistentVolumeSpec) - out := out.(*PersistentVolumeSpec) - if in.Capacity != nil { - in, out := &in.Capacity, &out.Capacity - *out = make(ResourceList) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } else { - out.Capacity = nil - } - if err := DeepCopy_v1_PersistentVolumeSource(&in.PersistentVolumeSource, &out.PersistentVolumeSource, c); err != nil { - return err - } - if in.AccessModes != nil { - in, out := &in.AccessModes, &out.AccessModes - *out = make([]PersistentVolumeAccessMode, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.AccessModes = nil - } - if in.ClaimRef != nil { - in, out := &in.ClaimRef, &out.ClaimRef - *out = new(ObjectReference) - **out = **in - } else { - out.ClaimRef = nil - } - out.PersistentVolumeReclaimPolicy = in.PersistentVolumeReclaimPolicy - return nil - } -} - -func DeepCopy_v1_PersistentVolumeStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PersistentVolumeStatus) - out := out.(*PersistentVolumeStatus) - out.Phase = in.Phase - out.Message = in.Message - out.Reason = in.Reason - return nil - } -} - -func DeepCopy_v1_Pod(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Pod) - out := out.(*Pod) - out.TypeMeta = in.TypeMeta - if err := DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_v1_PodSpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - if err := DeepCopy_v1_PodStatus(&in.Status, &out.Status, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_v1_PodAffinity(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodAffinity) - out := out.(*PodAffinity) - if in.RequiredDuringSchedulingIgnoredDuringExecution != nil { - in, out := &in.RequiredDuringSchedulingIgnoredDuringExecution, &out.RequiredDuringSchedulingIgnoredDuringExecution - *out = make([]PodAffinityTerm, len(*in)) - for i := range *in { - if err := DeepCopy_v1_PodAffinityTerm(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.RequiredDuringSchedulingIgnoredDuringExecution = nil - } - if in.PreferredDuringSchedulingIgnoredDuringExecution != nil { - in, out := &in.PreferredDuringSchedulingIgnoredDuringExecution, &out.PreferredDuringSchedulingIgnoredDuringExecution - *out = make([]WeightedPodAffinityTerm, len(*in)) - for i := range *in { - if err := DeepCopy_v1_WeightedPodAffinityTerm(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.PreferredDuringSchedulingIgnoredDuringExecution = nil - } - return nil - } -} - -func DeepCopy_v1_PodAffinityTerm(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodAffinityTerm) - out := out.(*PodAffinityTerm) - if in.LabelSelector != nil { - in, out := &in.LabelSelector, &out.LabelSelector - *out = new(unversioned.LabelSelector) - if err := unversioned.DeepCopy_unversioned_LabelSelector(*in, *out, c); err != nil { - return err - } - } else { - out.LabelSelector = nil - } - if in.Namespaces != nil { - in, out := &in.Namespaces, &out.Namespaces - *out = make([]string, len(*in)) - copy(*out, *in) - } else { - out.Namespaces = nil - } - out.TopologyKey = in.TopologyKey - return nil - } -} - -func DeepCopy_v1_PodAntiAffinity(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodAntiAffinity) - out := out.(*PodAntiAffinity) - if in.RequiredDuringSchedulingIgnoredDuringExecution != nil { - in, out := &in.RequiredDuringSchedulingIgnoredDuringExecution, &out.RequiredDuringSchedulingIgnoredDuringExecution - *out = make([]PodAffinityTerm, len(*in)) - for i := range *in { - if err := DeepCopy_v1_PodAffinityTerm(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.RequiredDuringSchedulingIgnoredDuringExecution = nil - } - if in.PreferredDuringSchedulingIgnoredDuringExecution != nil { - in, out := &in.PreferredDuringSchedulingIgnoredDuringExecution, &out.PreferredDuringSchedulingIgnoredDuringExecution - *out = make([]WeightedPodAffinityTerm, len(*in)) - for i := range *in { - if err := DeepCopy_v1_WeightedPodAffinityTerm(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.PreferredDuringSchedulingIgnoredDuringExecution = nil - } - return nil - } -} - -func DeepCopy_v1_PodAttachOptions(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodAttachOptions) - out := out.(*PodAttachOptions) - out.TypeMeta = in.TypeMeta - out.Stdin = in.Stdin - out.Stdout = in.Stdout - out.Stderr = in.Stderr - out.TTY = in.TTY - out.Container = in.Container - return nil - } -} - -func DeepCopy_v1_PodCondition(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodCondition) - out := out.(*PodCondition) - 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_PodExecOptions(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodExecOptions) - out := out.(*PodExecOptions) - out.TypeMeta = in.TypeMeta - out.Stdin = in.Stdin - out.Stdout = in.Stdout - out.Stderr = in.Stderr - out.TTY = in.TTY - out.Container = in.Container - if in.Command != nil { - in, out := &in.Command, &out.Command - *out = make([]string, len(*in)) - copy(*out, *in) - } else { - out.Command = nil - } - return nil - } -} - -func DeepCopy_v1_PodList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodList) - out := out.(*PodList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Pod, len(*in)) - for i := range *in { - if err := DeepCopy_v1_Pod(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_v1_PodLogOptions(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodLogOptions) - out := out.(*PodLogOptions) - out.TypeMeta = in.TypeMeta - out.Container = in.Container - out.Follow = in.Follow - out.Previous = in.Previous - if in.SinceSeconds != nil { - in, out := &in.SinceSeconds, &out.SinceSeconds - *out = new(int64) - **out = **in - } else { - out.SinceSeconds = nil - } - if in.SinceTime != nil { - in, out := &in.SinceTime, &out.SinceTime - *out = new(unversioned.Time) - **out = (*in).DeepCopy() - } else { - out.SinceTime = nil - } - out.Timestamps = in.Timestamps - if in.TailLines != nil { - in, out := &in.TailLines, &out.TailLines - *out = new(int64) - **out = **in - } else { - out.TailLines = nil - } - if in.LimitBytes != nil { - in, out := &in.LimitBytes, &out.LimitBytes - *out = new(int64) - **out = **in - } else { - out.LimitBytes = nil - } - return nil - } -} - -func DeepCopy_v1_PodProxyOptions(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodProxyOptions) - out := out.(*PodProxyOptions) - out.TypeMeta = in.TypeMeta - out.Path = in.Path - return nil - } -} - -func DeepCopy_v1_PodSecurityContext(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodSecurityContext) - out := out.(*PodSecurityContext) - if in.SELinuxOptions != nil { - in, out := &in.SELinuxOptions, &out.SELinuxOptions - *out = new(SELinuxOptions) - **out = **in - } else { - out.SELinuxOptions = nil - } - if in.RunAsUser != nil { - in, out := &in.RunAsUser, &out.RunAsUser - *out = new(int64) - **out = **in - } else { - out.RunAsUser = nil - } - if in.RunAsNonRoot != nil { - in, out := &in.RunAsNonRoot, &out.RunAsNonRoot - *out = new(bool) - **out = **in - } else { - out.RunAsNonRoot = nil - } - if in.SupplementalGroups != nil { - in, out := &in.SupplementalGroups, &out.SupplementalGroups - *out = make([]int64, len(*in)) - copy(*out, *in) - } else { - out.SupplementalGroups = nil - } - if in.FSGroup != nil { - in, out := &in.FSGroup, &out.FSGroup - *out = new(int64) - **out = **in - } else { - out.FSGroup = nil - } - return nil - } -} - -func DeepCopy_v1_PodSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodSpec) - out := out.(*PodSpec) - if in.Volumes != nil { - in, out := &in.Volumes, &out.Volumes - *out = make([]Volume, len(*in)) - for i := range *in { - if err := DeepCopy_v1_Volume(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Volumes = nil - } - if in.InitContainers != nil { - in, out := &in.InitContainers, &out.InitContainers - *out = make([]Container, len(*in)) - for i := range *in { - if err := DeepCopy_v1_Container(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.InitContainers = nil - } - if in.Containers != nil { - in, out := &in.Containers, &out.Containers - *out = make([]Container, len(*in)) - for i := range *in { - if err := DeepCopy_v1_Container(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Containers = nil - } - out.RestartPolicy = in.RestartPolicy - if in.TerminationGracePeriodSeconds != nil { - in, out := &in.TerminationGracePeriodSeconds, &out.TerminationGracePeriodSeconds - *out = new(int64) - **out = **in - } else { - out.TerminationGracePeriodSeconds = nil - } - if in.ActiveDeadlineSeconds != nil { - in, out := &in.ActiveDeadlineSeconds, &out.ActiveDeadlineSeconds - *out = new(int64) - **out = **in - } else { - out.ActiveDeadlineSeconds = nil - } - out.DNSPolicy = in.DNSPolicy - if in.NodeSelector != nil { - in, out := &in.NodeSelector, &out.NodeSelector - *out = make(map[string]string) - for key, val := range *in { - (*out)[key] = val - } - } else { - out.NodeSelector = nil - } - out.ServiceAccountName = in.ServiceAccountName - out.DeprecatedServiceAccount = in.DeprecatedServiceAccount - out.NodeName = in.NodeName - out.HostNetwork = in.HostNetwork - out.HostPID = in.HostPID - out.HostIPC = in.HostIPC - if in.SecurityContext != nil { - in, out := &in.SecurityContext, &out.SecurityContext - *out = new(PodSecurityContext) - if err := DeepCopy_v1_PodSecurityContext(*in, *out, c); err != nil { - return err - } - } else { - out.SecurityContext = nil - } - if in.ImagePullSecrets != nil { - in, out := &in.ImagePullSecrets, &out.ImagePullSecrets - *out = make([]LocalObjectReference, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.ImagePullSecrets = nil - } - out.Hostname = in.Hostname - out.Subdomain = in.Subdomain - return nil - } -} - -func DeepCopy_v1_PodStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodStatus) - out := out.(*PodStatus) - out.Phase = in.Phase - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]PodCondition, len(*in)) - for i := range *in { - if err := DeepCopy_v1_PodCondition(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - out.Message = in.Message - out.Reason = in.Reason - out.HostIP = in.HostIP - out.PodIP = in.PodIP - if in.StartTime != nil { - in, out := &in.StartTime, &out.StartTime - *out = new(unversioned.Time) - **out = (*in).DeepCopy() - } else { - out.StartTime = nil - } - if in.InitContainerStatuses != nil { - in, out := &in.InitContainerStatuses, &out.InitContainerStatuses - *out = make([]ContainerStatus, len(*in)) - for i := range *in { - if err := DeepCopy_v1_ContainerStatus(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.InitContainerStatuses = nil - } - if in.ContainerStatuses != nil { - in, out := &in.ContainerStatuses, &out.ContainerStatuses - *out = make([]ContainerStatus, len(*in)) - for i := range *in { - if err := DeepCopy_v1_ContainerStatus(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.ContainerStatuses = nil - } - return nil - } -} - -func DeepCopy_v1_PodStatusResult(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodStatusResult) - out := out.(*PodStatusResult) - out.TypeMeta = in.TypeMeta - if err := DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_v1_PodStatus(&in.Status, &out.Status, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_v1_PodTemplate(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodTemplate) - out := out.(*PodTemplate) - out.TypeMeta = in.TypeMeta - if err := DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_v1_PodTemplateSpec(&in.Template, &out.Template, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_v1_PodTemplateList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodTemplateList) - out := out.(*PodTemplateList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]PodTemplate, len(*in)) - for i := range *in { - if err := DeepCopy_v1_PodTemplate(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_v1_PodTemplateSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodTemplateSpec) - out := out.(*PodTemplateSpec) - if err := DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_v1_PodSpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_v1_Preconditions(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Preconditions) - out := out.(*Preconditions) - if in.UID != nil { - in, out := &in.UID, &out.UID - *out = new(types.UID) - **out = **in - } else { - out.UID = nil - } - return nil - } -} - -func DeepCopy_v1_PreferredSchedulingTerm(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PreferredSchedulingTerm) - out := out.(*PreferredSchedulingTerm) - out.Weight = in.Weight - if err := DeepCopy_v1_NodeSelectorTerm(&in.Preference, &out.Preference, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_v1_Probe(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Probe) - out := out.(*Probe) - if err := DeepCopy_v1_Handler(&in.Handler, &out.Handler, c); err != nil { - return err - } - out.InitialDelaySeconds = in.InitialDelaySeconds - out.TimeoutSeconds = in.TimeoutSeconds - out.PeriodSeconds = in.PeriodSeconds - out.SuccessThreshold = in.SuccessThreshold - out.FailureThreshold = in.FailureThreshold - return nil - } -} - -func DeepCopy_v1_RBDVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*RBDVolumeSource) - out := out.(*RBDVolumeSource) - if in.CephMonitors != nil { - in, out := &in.CephMonitors, &out.CephMonitors - *out = make([]string, len(*in)) - copy(*out, *in) - } else { - out.CephMonitors = nil - } - out.RBDImage = in.RBDImage - out.FSType = in.FSType - out.RBDPool = in.RBDPool - out.RadosUser = in.RadosUser - out.Keyring = in.Keyring - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - *out = new(LocalObjectReference) - **out = **in - } else { - out.SecretRef = nil - } - out.ReadOnly = in.ReadOnly - return nil - } -} - -func DeepCopy_v1_RangeAllocation(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*RangeAllocation) - out := out.(*RangeAllocation) - out.TypeMeta = in.TypeMeta - if err := DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - out.Range = in.Range - if in.Data != nil { - in, out := &in.Data, &out.Data - *out = make([]byte, len(*in)) - copy(*out, *in) - } else { - out.Data = nil - } - return nil - } -} - -func DeepCopy_v1_ReplicationController(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ReplicationController) - out := out.(*ReplicationController) - out.TypeMeta = in.TypeMeta - if err := DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_v1_ReplicationControllerSpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - out.Status = in.Status - return nil - } -} - -func DeepCopy_v1_ReplicationControllerList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ReplicationControllerList) - out := out.(*ReplicationControllerList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ReplicationController, len(*in)) - for i := range *in { - if err := DeepCopy_v1_ReplicationController(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_v1_ReplicationControllerSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ReplicationControllerSpec) - out := out.(*ReplicationControllerSpec) - 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 = make(map[string]string) - for key, val := range *in { - (*out)[key] = val - } - } else { - out.Selector = nil - } - if in.Template != nil { - in, out := &in.Template, &out.Template - *out = new(PodTemplateSpec) - if err := DeepCopy_v1_PodTemplateSpec(*in, *out, c); err != nil { - return err - } - } else { - out.Template = nil - } - return nil - } -} - -func DeepCopy_v1_ReplicationControllerStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ReplicationControllerStatus) - out := out.(*ReplicationControllerStatus) - out.Replicas = in.Replicas - out.FullyLabeledReplicas = in.FullyLabeledReplicas - out.ObservedGeneration = in.ObservedGeneration - return nil - } -} - -func DeepCopy_v1_ResourceFieldSelector(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ResourceFieldSelector) - out := out.(*ResourceFieldSelector) - out.ContainerName = in.ContainerName - out.Resource = in.Resource - out.Divisor = in.Divisor.DeepCopy() - return nil - } -} - -func DeepCopy_v1_ResourceQuota(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ResourceQuota) - out := out.(*ResourceQuota) - out.TypeMeta = in.TypeMeta - if err := DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_v1_ResourceQuotaSpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - if err := DeepCopy_v1_ResourceQuotaStatus(&in.Status, &out.Status, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_v1_ResourceQuotaList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ResourceQuotaList) - out := out.(*ResourceQuotaList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ResourceQuota, len(*in)) - for i := range *in { - if err := DeepCopy_v1_ResourceQuota(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_v1_ResourceQuotaSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ResourceQuotaSpec) - out := out.(*ResourceQuotaSpec) - if in.Hard != nil { - in, out := &in.Hard, &out.Hard - *out = make(ResourceList) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } else { - out.Hard = nil - } - if in.Scopes != nil { - in, out := &in.Scopes, &out.Scopes - *out = make([]ResourceQuotaScope, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Scopes = nil - } - return nil - } -} - -func DeepCopy_v1_ResourceQuotaStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ResourceQuotaStatus) - out := out.(*ResourceQuotaStatus) - if in.Hard != nil { - in, out := &in.Hard, &out.Hard - *out = make(ResourceList) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } else { - out.Hard = nil - } - if in.Used != nil { - in, out := &in.Used, &out.Used - *out = make(ResourceList) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } else { - out.Used = nil - } - return nil - } -} - -func DeepCopy_v1_ResourceRequirements(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ResourceRequirements) - out := out.(*ResourceRequirements) - if in.Limits != nil { - in, out := &in.Limits, &out.Limits - *out = make(ResourceList) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } else { - out.Limits = nil - } - if in.Requests != nil { - in, out := &in.Requests, &out.Requests - *out = make(ResourceList) - for key, val := range *in { - (*out)[key] = val.DeepCopy() - } - } else { - out.Requests = nil - } - return nil - } -} - -func DeepCopy_v1_SELinuxOptions(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*SELinuxOptions) - out := out.(*SELinuxOptions) - out.User = in.User - out.Role = in.Role - out.Type = in.Type - out.Level = in.Level - return nil - } -} - -func DeepCopy_v1_Secret(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Secret) - out := out.(*Secret) - out.TypeMeta = in.TypeMeta - if err := DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if in.Data != nil { - in, out := &in.Data, &out.Data - *out = make(map[string][]byte) - for key, val := range *in { - if newVal, err := c.DeepCopy(&val); err != nil { - return err - } else { - (*out)[key] = *newVal.(*[]byte) - } - } - } else { - out.Data = nil - } - if in.StringData != nil { - in, out := &in.StringData, &out.StringData - *out = make(map[string]string) - for key, val := range *in { - (*out)[key] = val - } - } else { - out.StringData = nil - } - out.Type = in.Type - return nil - } -} - -func DeepCopy_v1_SecretKeySelector(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*SecretKeySelector) - out := out.(*SecretKeySelector) - out.LocalObjectReference = in.LocalObjectReference - out.Key = in.Key - return nil - } -} - -func DeepCopy_v1_SecretList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*SecretList) - out := out.(*SecretList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Secret, len(*in)) - for i := range *in { - if err := DeepCopy_v1_Secret(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_v1_SecretVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*SecretVolumeSource) - out := out.(*SecretVolumeSource) - out.SecretName = in.SecretName - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]KeyToPath, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_v1_SecurityContext(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*SecurityContext) - out := out.(*SecurityContext) - if in.Capabilities != nil { - in, out := &in.Capabilities, &out.Capabilities - *out = new(Capabilities) - if err := DeepCopy_v1_Capabilities(*in, *out, c); err != nil { - return err - } - } else { - out.Capabilities = nil - } - if in.Privileged != nil { - in, out := &in.Privileged, &out.Privileged - *out = new(bool) - **out = **in - } else { - out.Privileged = nil - } - if in.SELinuxOptions != nil { - in, out := &in.SELinuxOptions, &out.SELinuxOptions - *out = new(SELinuxOptions) - **out = **in - } else { - out.SELinuxOptions = nil - } - if in.RunAsUser != nil { - in, out := &in.RunAsUser, &out.RunAsUser - *out = new(int64) - **out = **in - } else { - out.RunAsUser = nil - } - if in.RunAsNonRoot != nil { - in, out := &in.RunAsNonRoot, &out.RunAsNonRoot - *out = new(bool) - **out = **in - } else { - out.RunAsNonRoot = nil - } - if in.ReadOnlyRootFilesystem != nil { - in, out := &in.ReadOnlyRootFilesystem, &out.ReadOnlyRootFilesystem - *out = new(bool) - **out = **in - } else { - out.ReadOnlyRootFilesystem = nil - } - return nil - } -} - -func DeepCopy_v1_SerializedReference(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*SerializedReference) - out := out.(*SerializedReference) - out.TypeMeta = in.TypeMeta - out.Reference = in.Reference - return nil - } -} - -func DeepCopy_v1_Service(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Service) - out := out.(*Service) - out.TypeMeta = in.TypeMeta - if err := DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_v1_ServiceSpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - if err := DeepCopy_v1_ServiceStatus(&in.Status, &out.Status, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_v1_ServiceAccount(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ServiceAccount) - out := out.(*ServiceAccount) - out.TypeMeta = in.TypeMeta - if err := DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if in.Secrets != nil { - in, out := &in.Secrets, &out.Secrets - *out = make([]ObjectReference, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Secrets = nil - } - if in.ImagePullSecrets != nil { - in, out := &in.ImagePullSecrets, &out.ImagePullSecrets - *out = make([]LocalObjectReference, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.ImagePullSecrets = nil - } - return nil - } -} - -func DeepCopy_v1_ServiceAccountList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ServiceAccountList) - out := out.(*ServiceAccountList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ServiceAccount, len(*in)) - for i := range *in { - if err := DeepCopy_v1_ServiceAccount(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_v1_ServiceList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ServiceList) - out := out.(*ServiceList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Service, len(*in)) - for i := range *in { - if err := DeepCopy_v1_Service(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_v1_ServicePort(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ServicePort) - out := out.(*ServicePort) - out.Name = in.Name - out.Protocol = in.Protocol - out.Port = in.Port - out.TargetPort = in.TargetPort - out.NodePort = in.NodePort - return nil - } -} - -func DeepCopy_v1_ServiceProxyOptions(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ServiceProxyOptions) - out := out.(*ServiceProxyOptions) - out.TypeMeta = in.TypeMeta - out.Path = in.Path - return nil - } -} - -func DeepCopy_v1_ServiceSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ServiceSpec) - out := out.(*ServiceSpec) - if in.Ports != nil { - in, out := &in.Ports, &out.Ports - *out = make([]ServicePort, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Ports = nil - } - if in.Selector != nil { - in, out := &in.Selector, &out.Selector - *out = make(map[string]string) - for key, val := range *in { - (*out)[key] = val - } - } else { - out.Selector = nil - } - out.ClusterIP = in.ClusterIP - out.Type = in.Type - if in.ExternalIPs != nil { - in, out := &in.ExternalIPs, &out.ExternalIPs - *out = make([]string, len(*in)) - copy(*out, *in) - } else { - out.ExternalIPs = nil - } - if in.DeprecatedPublicIPs != nil { - in, out := &in.DeprecatedPublicIPs, &out.DeprecatedPublicIPs - *out = make([]string, len(*in)) - copy(*out, *in) - } else { - out.DeprecatedPublicIPs = nil - } - out.SessionAffinity = in.SessionAffinity - out.LoadBalancerIP = in.LoadBalancerIP - if in.LoadBalancerSourceRanges != nil { - in, out := &in.LoadBalancerSourceRanges, &out.LoadBalancerSourceRanges - *out = make([]string, len(*in)) - copy(*out, *in) - } else { - out.LoadBalancerSourceRanges = nil - } - return nil - } -} - -func DeepCopy_v1_ServiceStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ServiceStatus) - out := out.(*ServiceStatus) - if err := DeepCopy_v1_LoadBalancerStatus(&in.LoadBalancer, &out.LoadBalancer, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_v1_TCPSocketAction(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*TCPSocketAction) - out := out.(*TCPSocketAction) - out.Port = in.Port - return nil - } -} - -func DeepCopy_v1_Taint(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Taint) - out := out.(*Taint) - out.Key = in.Key - out.Value = in.Value - out.Effect = in.Effect - return nil - } -} - -func DeepCopy_v1_Toleration(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Toleration) - out := out.(*Toleration) - out.Key = in.Key - out.Operator = in.Operator - out.Value = in.Value - out.Effect = in.Effect - return nil - } -} - -func DeepCopy_v1_Volume(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Volume) - out := out.(*Volume) - out.Name = in.Name - if err := DeepCopy_v1_VolumeSource(&in.VolumeSource, &out.VolumeSource, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_v1_VolumeMount(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*VolumeMount) - out := out.(*VolumeMount) - out.Name = in.Name - out.ReadOnly = in.ReadOnly - out.MountPath = in.MountPath - out.SubPath = in.SubPath - return nil - } -} - -func DeepCopy_v1_VolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*VolumeSource) - out := out.(*VolumeSource) - if in.HostPath != nil { - in, out := &in.HostPath, &out.HostPath - *out = new(HostPathVolumeSource) - **out = **in - } else { - out.HostPath = nil - } - if in.EmptyDir != nil { - in, out := &in.EmptyDir, &out.EmptyDir - *out = new(EmptyDirVolumeSource) - **out = **in - } else { - out.EmptyDir = nil - } - if in.GCEPersistentDisk != nil { - in, out := &in.GCEPersistentDisk, &out.GCEPersistentDisk - *out = new(GCEPersistentDiskVolumeSource) - **out = **in - } else { - out.GCEPersistentDisk = nil - } - if in.AWSElasticBlockStore != nil { - in, out := &in.AWSElasticBlockStore, &out.AWSElasticBlockStore - *out = new(AWSElasticBlockStoreVolumeSource) - **out = **in - } else { - out.AWSElasticBlockStore = nil - } - if in.GitRepo != nil { - in, out := &in.GitRepo, &out.GitRepo - *out = new(GitRepoVolumeSource) - **out = **in - } else { - out.GitRepo = nil - } - if in.Secret != nil { - in, out := &in.Secret, &out.Secret - *out = new(SecretVolumeSource) - if err := DeepCopy_v1_SecretVolumeSource(*in, *out, c); err != nil { - return err - } - } else { - out.Secret = nil - } - if in.NFS != nil { - in, out := &in.NFS, &out.NFS - *out = new(NFSVolumeSource) - **out = **in - } else { - out.NFS = nil - } - if in.ISCSI != nil { - in, out := &in.ISCSI, &out.ISCSI - *out = new(ISCSIVolumeSource) - **out = **in - } else { - out.ISCSI = nil - } - if in.Glusterfs != nil { - in, out := &in.Glusterfs, &out.Glusterfs - *out = new(GlusterfsVolumeSource) - **out = **in - } else { - out.Glusterfs = nil - } - if in.PersistentVolumeClaim != nil { - in, out := &in.PersistentVolumeClaim, &out.PersistentVolumeClaim - *out = new(PersistentVolumeClaimVolumeSource) - **out = **in - } else { - out.PersistentVolumeClaim = nil - } - if in.RBD != nil { - in, out := &in.RBD, &out.RBD - *out = new(RBDVolumeSource) - if err := DeepCopy_v1_RBDVolumeSource(*in, *out, c); err != nil { - return err - } - } else { - out.RBD = nil - } - if in.FlexVolume != nil { - in, out := &in.FlexVolume, &out.FlexVolume - *out = new(FlexVolumeSource) - if err := DeepCopy_v1_FlexVolumeSource(*in, *out, c); err != nil { - return err - } - } else { - out.FlexVolume = nil - } - if in.Cinder != nil { - in, out := &in.Cinder, &out.Cinder - *out = new(CinderVolumeSource) - **out = **in - } else { - out.Cinder = nil - } - if in.CephFS != nil { - in, out := &in.CephFS, &out.CephFS - *out = new(CephFSVolumeSource) - if err := DeepCopy_v1_CephFSVolumeSource(*in, *out, c); err != nil { - return err - } - } else { - out.CephFS = nil - } - if in.Flocker != nil { - in, out := &in.Flocker, &out.Flocker - *out = new(FlockerVolumeSource) - **out = **in - } else { - out.Flocker = nil - } - if in.DownwardAPI != nil { - in, out := &in.DownwardAPI, &out.DownwardAPI - *out = new(DownwardAPIVolumeSource) - if err := DeepCopy_v1_DownwardAPIVolumeSource(*in, *out, c); err != nil { - return err - } - } else { - out.DownwardAPI = nil - } - if in.FC != nil { - in, out := &in.FC, &out.FC - *out = new(FCVolumeSource) - if err := DeepCopy_v1_FCVolumeSource(*in, *out, c); err != nil { - return err - } - } else { - out.FC = nil - } - if in.AzureFile != nil { - in, out := &in.AzureFile, &out.AzureFile - *out = new(AzureFileVolumeSource) - **out = **in - } else { - out.AzureFile = nil - } - if in.ConfigMap != nil { - in, out := &in.ConfigMap, &out.ConfigMap - *out = new(ConfigMapVolumeSource) - if err := DeepCopy_v1_ConfigMapVolumeSource(*in, *out, c); err != nil { - return err - } - } else { - out.ConfigMap = nil - } - if in.VsphereVolume != nil { - in, out := &in.VsphereVolume, &out.VsphereVolume - *out = new(VsphereVirtualDiskVolumeSource) - **out = **in - } else { - out.VsphereVolume = nil - } - return nil - } -} - -func DeepCopy_v1_VsphereVirtualDiskVolumeSource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*VsphereVirtualDiskVolumeSource) - out := out.(*VsphereVirtualDiskVolumeSource) - out.VolumePath = in.VolumePath - out.FSType = in.FSType - return nil - } -} - -func DeepCopy_v1_WeightedPodAffinityTerm(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*WeightedPodAffinityTerm) - out := out.(*WeightedPodAffinityTerm) - out.Weight = in.Weight - if err := DeepCopy_v1_PodAffinityTerm(&in.PodAffinityTerm, &out.PodAffinityTerm, c); err != nil { - return err - } - return nil - } -} diff --git a/pkg/apis/apps/deep_copy_generated.go b/pkg/apis/apps/deep_copy_generated.go deleted file mode 100644 index c93a58cb50e..00000000000 --- a/pkg/apis/apps/deep_copy_generated.go +++ /dev/null @@ -1,128 +0,0 @@ -// +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 - } -} diff --git a/pkg/apis/apps/v1alpha1/deep_copy_generated.go b/pkg/apis/apps/v1alpha1/deep_copy_generated.go deleted file mode 100644 index f458bed915a..00000000000 --- a/pkg/apis/apps/v1alpha1/deep_copy_generated.go +++ /dev/null @@ -1,135 +0,0 @@ -// +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 - } -} diff --git a/pkg/apis/authentication.k8s.io/deep_copy_generated.go b/pkg/apis/authentication.k8s.io/deep_copy_generated.go deleted file mode 100644 index 232756c0b3b..00000000000 --- a/pkg/apis/authentication.k8s.io/deep_copy_generated.go +++ /dev/null @@ -1,103 +0,0 @@ -// +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 - } -} diff --git a/pkg/apis/authentication.k8s.io/v1beta1/deep_copy_generated.go b/pkg/apis/authentication.k8s.io/v1beta1/deep_copy_generated.go deleted file mode 100644 index e8222466189..00000000000 --- a/pkg/apis/authentication.k8s.io/v1beta1/deep_copy_generated.go +++ /dev/null @@ -1,103 +0,0 @@ -// +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 - } -} diff --git a/pkg/apis/authorization/deep_copy_generated.go b/pkg/apis/authorization/deep_copy_generated.go deleted file mode 100644 index b66c33a4e2b..00000000000 --- a/pkg/apis/authorization/deep_copy_generated.go +++ /dev/null @@ -1,182 +0,0 @@ -// +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 - } -} diff --git a/pkg/apis/authorization/v1beta1/deep_copy_generated.go b/pkg/apis/authorization/v1beta1/deep_copy_generated.go deleted file mode 100644 index af3dcdb8d83..00000000000 --- a/pkg/apis/authorization/v1beta1/deep_copy_generated.go +++ /dev/null @@ -1,182 +0,0 @@ -// +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 - } -} diff --git a/pkg/apis/autoscaling/deep_copy_generated.go b/pkg/apis/autoscaling/deep_copy_generated.go deleted file mode 100644 index 89522247dee..00000000000 --- a/pkg/apis/autoscaling/deep_copy_generated.go +++ /dev/null @@ -1,182 +0,0 @@ -// +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 - } -} diff --git a/pkg/apis/autoscaling/v1/deep_copy_generated.go b/pkg/apis/autoscaling/v1/deep_copy_generated.go deleted file mode 100644 index b218efcced1..00000000000 --- a/pkg/apis/autoscaling/v1/deep_copy_generated.go +++ /dev/null @@ -1,183 +0,0 @@ -// +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 - } -} diff --git a/pkg/apis/batch/deep_copy_generated.go b/pkg/apis/batch/deep_copy_generated.go deleted file mode 100644 index 9ef37952dcf..00000000000 --- a/pkg/apis/batch/deep_copy_generated.go +++ /dev/null @@ -1,303 +0,0 @@ -// +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 - } -} diff --git a/pkg/apis/batch/v1/deep_copy_generated.go b/pkg/apis/batch/v1/deep_copy_generated.go deleted file mode 100644 index e2523008971..00000000000 --- a/pkg/apis/batch/v1/deep_copy_generated.go +++ /dev/null @@ -1,226 +0,0 @@ -// +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 - } -} diff --git a/pkg/apis/batch/v2alpha1/deep_copy_generated.go b/pkg/apis/batch/v2alpha1/deep_copy_generated.go deleted file mode 100644 index a20352219c8..00000000000 --- a/pkg/apis/batch/v2alpha1/deep_copy_generated.go +++ /dev/null @@ -1,351 +0,0 @@ -// +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 v2alpha1 - -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_v2alpha1_Job, InType: reflect.TypeOf(func() *Job { var x *Job; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v2alpha1_JobCondition, InType: reflect.TypeOf(func() *JobCondition { var x *JobCondition; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v2alpha1_JobList, InType: reflect.TypeOf(func() *JobList { var x *JobList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v2alpha1_JobSpec, InType: reflect.TypeOf(func() *JobSpec { var x *JobSpec; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v2alpha1_JobStatus, InType: reflect.TypeOf(func() *JobStatus { var x *JobStatus; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v2alpha1_JobTemplate, InType: reflect.TypeOf(func() *JobTemplate { var x *JobTemplate; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v2alpha1_JobTemplateSpec, InType: reflect.TypeOf(func() *JobTemplateSpec { var x *JobTemplateSpec; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v2alpha1_LabelSelector, InType: reflect.TypeOf(func() *LabelSelector { var x *LabelSelector; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v2alpha1_LabelSelectorRequirement, InType: reflect.TypeOf(func() *LabelSelectorRequirement { var x *LabelSelectorRequirement; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v2alpha1_ScheduledJob, InType: reflect.TypeOf(func() *ScheduledJob { var x *ScheduledJob; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v2alpha1_ScheduledJobList, InType: reflect.TypeOf(func() *ScheduledJobList { var x *ScheduledJobList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v2alpha1_ScheduledJobSpec, InType: reflect.TypeOf(func() *ScheduledJobSpec { var x *ScheduledJobSpec; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v2alpha1_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_v2alpha1_Job(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Job) - out := out.(*Job) - out.TypeMeta = in.TypeMeta - if err := v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_v2alpha1_JobSpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - if err := DeepCopy_v2alpha1_JobStatus(&in.Status, &out.Status, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_v2alpha1_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_v2alpha1_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_v2alpha1_Job(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_v2alpha1_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_v2alpha1_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 := v1.DeepCopy_v1_PodTemplateSpec(&in.Template, &out.Template, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_v2alpha1_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_v2alpha1_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_v2alpha1_JobTemplate(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*JobTemplate) - out := out.(*JobTemplate) - out.TypeMeta = in.TypeMeta - if err := v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_v2alpha1_JobTemplateSpec(&in.Template, &out.Template, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_v2alpha1_JobTemplateSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*JobTemplateSpec) - out := out.(*JobTemplateSpec) - if err := v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_v2alpha1_JobSpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_v2alpha1_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_v2alpha1_LabelSelectorRequirement(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.MatchExpressions = nil - } - return nil - } -} - -func DeepCopy_v2alpha1_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_v2alpha1_ScheduledJob(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ScheduledJob) - out := out.(*ScheduledJob) - out.TypeMeta = in.TypeMeta - if err := v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_v2alpha1_ScheduledJobSpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - if err := DeepCopy_v2alpha1_ScheduledJobStatus(&in.Status, &out.Status, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_v2alpha1_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_v2alpha1_ScheduledJob(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_v2alpha1_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_v2alpha1_JobTemplateSpec(&in.JobTemplate, &out.JobTemplate, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_v2alpha1_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([]v1.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 - } -} diff --git a/pkg/apis/certificates/deep_copy_generated.go b/pkg/apis/certificates/deep_copy_generated.go deleted file mode 100644 index 49ad9ad84ac..00000000000 --- a/pkg/apis/certificates/deep_copy_generated.go +++ /dev/null @@ -1,141 +0,0 @@ -// +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 certificates - -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_certificates_CertificateSigningRequest, InType: reflect.TypeOf(func() *CertificateSigningRequest { var x *CertificateSigningRequest; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_certificates_CertificateSigningRequestCondition, InType: reflect.TypeOf(func() *CertificateSigningRequestCondition { var x *CertificateSigningRequestCondition; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_certificates_CertificateSigningRequestList, InType: reflect.TypeOf(func() *CertificateSigningRequestList { var x *CertificateSigningRequestList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_certificates_CertificateSigningRequestSpec, InType: reflect.TypeOf(func() *CertificateSigningRequestSpec { var x *CertificateSigningRequestSpec; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_certificates_CertificateSigningRequestStatus, InType: reflect.TypeOf(func() *CertificateSigningRequestStatus { var x *CertificateSigningRequestStatus; return x }())}, - ); err != nil { - // if one of the deep copy functions is malformed, detect it immediately. - panic(err) - } -} - -func DeepCopy_certificates_CertificateSigningRequest(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*CertificateSigningRequest) - out := out.(*CertificateSigningRequest) - out.TypeMeta = in.TypeMeta - if err := api.DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_certificates_CertificateSigningRequestSpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - if err := DeepCopy_certificates_CertificateSigningRequestStatus(&in.Status, &out.Status, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_certificates_CertificateSigningRequestCondition(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*CertificateSigningRequestCondition) - out := out.(*CertificateSigningRequestCondition) - out.Type = in.Type - out.Reason = in.Reason - out.Message = in.Message - out.LastUpdateTime = in.LastUpdateTime.DeepCopy() - return nil - } -} - -func DeepCopy_certificates_CertificateSigningRequestList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*CertificateSigningRequestList) - out := out.(*CertificateSigningRequestList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]CertificateSigningRequest, len(*in)) - for i := range *in { - if err := DeepCopy_certificates_CertificateSigningRequest(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_certificates_CertificateSigningRequestSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*CertificateSigningRequestSpec) - out := out.(*CertificateSigningRequestSpec) - if in.Request != nil { - in, out := &in.Request, &out.Request - *out = make([]byte, len(*in)) - copy(*out, *in) - } else { - out.Request = nil - } - 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 - } - return nil - } -} - -func DeepCopy_certificates_CertificateSigningRequestStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*CertificateSigningRequestStatus) - out := out.(*CertificateSigningRequestStatus) - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]CertificateSigningRequestCondition, len(*in)) - for i := range *in { - if err := DeepCopy_certificates_CertificateSigningRequestCondition(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - if in.Certificate != nil { - in, out := &in.Certificate, &out.Certificate - *out = make([]byte, len(*in)) - copy(*out, *in) - } else { - out.Certificate = nil - } - return nil - } -} diff --git a/pkg/apis/certificates/v1alpha1/deep_copy_generated.go b/pkg/apis/certificates/v1alpha1/deep_copy_generated.go deleted file mode 100644 index 0c69630a2dc..00000000000 --- a/pkg/apis/certificates/v1alpha1/deep_copy_generated.go +++ /dev/null @@ -1,142 +0,0 @@ -// +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" - 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_CertificateSigningRequest, InType: reflect.TypeOf(func() *CertificateSigningRequest { var x *CertificateSigningRequest; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_CertificateSigningRequestCondition, InType: reflect.TypeOf(func() *CertificateSigningRequestCondition { var x *CertificateSigningRequestCondition; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_CertificateSigningRequestList, InType: reflect.TypeOf(func() *CertificateSigningRequestList { var x *CertificateSigningRequestList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_CertificateSigningRequestSpec, InType: reflect.TypeOf(func() *CertificateSigningRequestSpec { var x *CertificateSigningRequestSpec; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_CertificateSigningRequestStatus, InType: reflect.TypeOf(func() *CertificateSigningRequestStatus { var x *CertificateSigningRequestStatus; return x }())}, - ); err != nil { - // if one of the deep copy functions is malformed, detect it immediately. - panic(err) - } -} - -func DeepCopy_v1alpha1_CertificateSigningRequest(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*CertificateSigningRequest) - out := out.(*CertificateSigningRequest) - out.TypeMeta = in.TypeMeta - if err := v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_v1alpha1_CertificateSigningRequestSpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - if err := DeepCopy_v1alpha1_CertificateSigningRequestStatus(&in.Status, &out.Status, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_v1alpha1_CertificateSigningRequestCondition(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*CertificateSigningRequestCondition) - out := out.(*CertificateSigningRequestCondition) - out.Type = in.Type - out.Reason = in.Reason - out.Message = in.Message - out.LastUpdateTime = in.LastUpdateTime.DeepCopy() - return nil - } -} - -func DeepCopy_v1alpha1_CertificateSigningRequestList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*CertificateSigningRequestList) - out := out.(*CertificateSigningRequestList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]CertificateSigningRequest, len(*in)) - for i := range *in { - if err := DeepCopy_v1alpha1_CertificateSigningRequest(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_v1alpha1_CertificateSigningRequestSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*CertificateSigningRequestSpec) - out := out.(*CertificateSigningRequestSpec) - if in.Request != nil { - in, out := &in.Request, &out.Request - *out = make([]byte, len(*in)) - copy(*out, *in) - } else { - out.Request = nil - } - 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 - } - return nil - } -} - -func DeepCopy_v1alpha1_CertificateSigningRequestStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*CertificateSigningRequestStatus) - out := out.(*CertificateSigningRequestStatus) - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]CertificateSigningRequestCondition, len(*in)) - for i := range *in { - if err := DeepCopy_v1alpha1_CertificateSigningRequestCondition(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - if in.Certificate != nil { - in, out := &in.Certificate, &out.Certificate - *out = make([]byte, len(*in)) - copy(*out, *in) - } else { - out.Certificate = nil - } - return nil - } -} diff --git a/pkg/apis/componentconfig/deep_copy_generated.go b/pkg/apis/componentconfig/deep_copy_generated.go deleted file mode 100644 index f16a51066e7..00000000000 --- a/pkg/apis/componentconfig/deep_copy_generated.go +++ /dev/null @@ -1,336 +0,0 @@ -// +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 componentconfig - -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_componentconfig_IPVar, InType: reflect.TypeOf(func() *IPVar { var x *IPVar; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_componentconfig_KubeControllerManagerConfiguration, InType: reflect.TypeOf(func() *KubeControllerManagerConfiguration { var x *KubeControllerManagerConfiguration; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_componentconfig_KubeProxyConfiguration, InType: reflect.TypeOf(func() *KubeProxyConfiguration { var x *KubeProxyConfiguration; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_componentconfig_KubeSchedulerConfiguration, InType: reflect.TypeOf(func() *KubeSchedulerConfiguration { var x *KubeSchedulerConfiguration; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_componentconfig_KubeletConfiguration, InType: reflect.TypeOf(func() *KubeletConfiguration { var x *KubeletConfiguration; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_componentconfig_LeaderElectionConfiguration, InType: reflect.TypeOf(func() *LeaderElectionConfiguration { var x *LeaderElectionConfiguration; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_componentconfig_PersistentVolumeRecyclerConfiguration, InType: reflect.TypeOf(func() *PersistentVolumeRecyclerConfiguration { var x *PersistentVolumeRecyclerConfiguration; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_componentconfig_PortRangeVar, InType: reflect.TypeOf(func() *PortRangeVar { var x *PortRangeVar; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_componentconfig_VolumeConfiguration, InType: reflect.TypeOf(func() *VolumeConfiguration { var x *VolumeConfiguration; return x }())}, - ); err != nil { - // if one of the deep copy functions is malformed, detect it immediately. - panic(err) - } -} - -func DeepCopy_componentconfig_IPVar(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*IPVar) - out := out.(*IPVar) - if in.Val != nil { - in, out := &in.Val, &out.Val - *out = new(string) - **out = **in - } else { - out.Val = nil - } - return nil - } -} - -func DeepCopy_componentconfig_KubeControllerManagerConfiguration(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*KubeControllerManagerConfiguration) - out := out.(*KubeControllerManagerConfiguration) - out.TypeMeta = in.TypeMeta - out.Port = in.Port - out.Address = in.Address - out.CloudProvider = in.CloudProvider - out.CloudConfigFile = in.CloudConfigFile - out.ConcurrentEndpointSyncs = in.ConcurrentEndpointSyncs - out.ConcurrentRSSyncs = in.ConcurrentRSSyncs - out.ConcurrentRCSyncs = in.ConcurrentRCSyncs - out.ConcurrentResourceQuotaSyncs = in.ConcurrentResourceQuotaSyncs - out.ConcurrentDeploymentSyncs = in.ConcurrentDeploymentSyncs - out.ConcurrentDaemonSetSyncs = in.ConcurrentDaemonSetSyncs - out.ConcurrentJobSyncs = in.ConcurrentJobSyncs - out.ConcurrentNamespaceSyncs = in.ConcurrentNamespaceSyncs - out.ConcurrentSATokenSyncs = in.ConcurrentSATokenSyncs - out.LookupCacheSizeForRC = in.LookupCacheSizeForRC - out.LookupCacheSizeForRS = in.LookupCacheSizeForRS - out.LookupCacheSizeForDaemonSet = in.LookupCacheSizeForDaemonSet - out.ServiceSyncPeriod = in.ServiceSyncPeriod - out.NodeSyncPeriod = in.NodeSyncPeriod - out.ResourceQuotaSyncPeriod = in.ResourceQuotaSyncPeriod - out.NamespaceSyncPeriod = in.NamespaceSyncPeriod - out.PVClaimBinderSyncPeriod = in.PVClaimBinderSyncPeriod - out.MinResyncPeriod = in.MinResyncPeriod - out.TerminatedPodGCThreshold = in.TerminatedPodGCThreshold - out.HorizontalPodAutoscalerSyncPeriod = in.HorizontalPodAutoscalerSyncPeriod - out.DeploymentControllerSyncPeriod = in.DeploymentControllerSyncPeriod - out.PodEvictionTimeout = in.PodEvictionTimeout - out.DeletingPodsQps = in.DeletingPodsQps - out.DeletingPodsBurst = in.DeletingPodsBurst - out.NodeMonitorGracePeriod = in.NodeMonitorGracePeriod - out.RegisterRetryCount = in.RegisterRetryCount - out.NodeStartupGracePeriod = in.NodeStartupGracePeriod - out.NodeMonitorPeriod = in.NodeMonitorPeriod - out.ServiceAccountKeyFile = in.ServiceAccountKeyFile - out.EnableProfiling = in.EnableProfiling - out.ClusterName = in.ClusterName - out.ClusterCIDR = in.ClusterCIDR - out.ServiceCIDR = in.ServiceCIDR - out.NodeCIDRMaskSize = in.NodeCIDRMaskSize - out.AllocateNodeCIDRs = in.AllocateNodeCIDRs - out.ConfigureCloudRoutes = in.ConfigureCloudRoutes - out.RootCAFile = in.RootCAFile - out.ContentType = in.ContentType - out.KubeAPIQPS = in.KubeAPIQPS - out.KubeAPIBurst = in.KubeAPIBurst - out.LeaderElection = in.LeaderElection - out.VolumeConfiguration = in.VolumeConfiguration - out.ControllerStartInterval = in.ControllerStartInterval - out.EnableGarbageCollector = in.EnableGarbageCollector - return nil - } -} - -func DeepCopy_componentconfig_KubeProxyConfiguration(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*KubeProxyConfiguration) - out := out.(*KubeProxyConfiguration) - out.TypeMeta = in.TypeMeta - out.BindAddress = in.BindAddress - out.ClusterCIDR = in.ClusterCIDR - out.HealthzBindAddress = in.HealthzBindAddress - out.HealthzPort = in.HealthzPort - out.HostnameOverride = in.HostnameOverride - if in.IPTablesMasqueradeBit != nil { - in, out := &in.IPTablesMasqueradeBit, &out.IPTablesMasqueradeBit - *out = new(int32) - **out = **in - } else { - out.IPTablesMasqueradeBit = nil - } - out.IPTablesSyncPeriod = in.IPTablesSyncPeriod - out.KubeconfigPath = in.KubeconfigPath - out.MasqueradeAll = in.MasqueradeAll - out.Master = in.Master - if in.OOMScoreAdj != nil { - in, out := &in.OOMScoreAdj, &out.OOMScoreAdj - *out = new(int32) - **out = **in - } else { - out.OOMScoreAdj = nil - } - out.Mode = in.Mode - out.PortRange = in.PortRange - out.ResourceContainer = in.ResourceContainer - out.UDPIdleTimeout = in.UDPIdleTimeout - out.ConntrackMax = in.ConntrackMax - out.ConntrackTCPEstablishedTimeout = in.ConntrackTCPEstablishedTimeout - return nil - } -} - -func DeepCopy_componentconfig_KubeSchedulerConfiguration(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*KubeSchedulerConfiguration) - out := out.(*KubeSchedulerConfiguration) - out.TypeMeta = in.TypeMeta - out.Port = in.Port - out.Address = in.Address - out.AlgorithmProvider = in.AlgorithmProvider - out.PolicyConfigFile = in.PolicyConfigFile - out.EnableProfiling = in.EnableProfiling - out.ContentType = in.ContentType - out.KubeAPIQPS = in.KubeAPIQPS - out.KubeAPIBurst = in.KubeAPIBurst - out.SchedulerName = in.SchedulerName - out.HardPodAffinitySymmetricWeight = in.HardPodAffinitySymmetricWeight - out.FailureDomains = in.FailureDomains - out.LeaderElection = in.LeaderElection - return nil - } -} - -func DeepCopy_componentconfig_KubeletConfiguration(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*KubeletConfiguration) - out := out.(*KubeletConfiguration) - out.Config = in.Config - out.SyncFrequency = in.SyncFrequency - out.FileCheckFrequency = in.FileCheckFrequency - out.HTTPCheckFrequency = in.HTTPCheckFrequency - out.ManifestURL = in.ManifestURL - out.ManifestURLHeader = in.ManifestURLHeader - out.EnableServer = in.EnableServer - out.Address = in.Address - out.Port = in.Port - out.ReadOnlyPort = in.ReadOnlyPort - out.TLSCertFile = in.TLSCertFile - out.TLSPrivateKeyFile = in.TLSPrivateKeyFile - out.CertDirectory = in.CertDirectory - out.HostnameOverride = in.HostnameOverride - out.PodInfraContainerImage = in.PodInfraContainerImage - out.DockerEndpoint = in.DockerEndpoint - out.RootDirectory = in.RootDirectory - out.SeccompProfileRoot = in.SeccompProfileRoot - out.AllowPrivileged = in.AllowPrivileged - out.HostNetworkSources = in.HostNetworkSources - out.HostPIDSources = in.HostPIDSources - out.HostIPCSources = in.HostIPCSources - out.RegistryPullQPS = in.RegistryPullQPS - out.RegistryBurst = in.RegistryBurst - out.EventRecordQPS = in.EventRecordQPS - out.EventBurst = in.EventBurst - out.EnableDebuggingHandlers = in.EnableDebuggingHandlers - out.MinimumGCAge = in.MinimumGCAge - out.MaxPerPodContainerCount = in.MaxPerPodContainerCount - out.MaxContainerCount = in.MaxContainerCount - out.CAdvisorPort = in.CAdvisorPort - out.HealthzPort = in.HealthzPort - out.HealthzBindAddress = in.HealthzBindAddress - out.OOMScoreAdj = in.OOMScoreAdj - out.RegisterNode = in.RegisterNode - out.ClusterDomain = in.ClusterDomain - out.MasterServiceNamespace = in.MasterServiceNamespace - out.ClusterDNS = in.ClusterDNS - out.StreamingConnectionIdleTimeout = in.StreamingConnectionIdleTimeout - out.NodeStatusUpdateFrequency = in.NodeStatusUpdateFrequency - out.ImageMinimumGCAge = in.ImageMinimumGCAge - out.ImageGCHighThresholdPercent = in.ImageGCHighThresholdPercent - out.ImageGCLowThresholdPercent = in.ImageGCLowThresholdPercent - out.LowDiskSpaceThresholdMB = in.LowDiskSpaceThresholdMB - out.VolumeStatsAggPeriod = in.VolumeStatsAggPeriod - out.NetworkPluginName = in.NetworkPluginName - out.NetworkPluginDir = in.NetworkPluginDir - out.VolumePluginDir = in.VolumePluginDir - out.CloudProvider = in.CloudProvider - out.CloudConfigFile = in.CloudConfigFile - out.KubeletCgroups = in.KubeletCgroups - out.RuntimeCgroups = in.RuntimeCgroups - out.SystemCgroups = in.SystemCgroups - out.CgroupRoot = in.CgroupRoot - out.ContainerRuntime = in.ContainerRuntime - out.RuntimeRequestTimeout = in.RuntimeRequestTimeout - out.RktPath = in.RktPath - out.RktAPIEndpoint = in.RktAPIEndpoint - out.RktStage1Image = in.RktStage1Image - out.LockFilePath = in.LockFilePath - out.ExitOnLockContention = in.ExitOnLockContention - out.ConfigureCBR0 = in.ConfigureCBR0 - out.HairpinMode = in.HairpinMode - out.BabysitDaemons = in.BabysitDaemons - out.MaxPods = in.MaxPods - out.NvidiaGPUs = in.NvidiaGPUs - out.DockerExecHandlerName = in.DockerExecHandlerName - out.PodCIDR = in.PodCIDR - out.ResolverConfig = in.ResolverConfig - out.CPUCFSQuota = in.CPUCFSQuota - out.Containerized = in.Containerized - out.MaxOpenFiles = in.MaxOpenFiles - out.ReconcileCIDR = in.ReconcileCIDR - out.RegisterSchedulable = in.RegisterSchedulable - out.ContentType = in.ContentType - out.KubeAPIQPS = in.KubeAPIQPS - out.KubeAPIBurst = in.KubeAPIBurst - out.SerializeImagePulls = in.SerializeImagePulls - out.ExperimentalFlannelOverlay = in.ExperimentalFlannelOverlay - out.OutOfDiskTransitionFrequency = in.OutOfDiskTransitionFrequency - out.NodeIP = in.NodeIP - if in.NodeLabels != nil { - in, out := &in.NodeLabels, &out.NodeLabels - *out = make(map[string]string) - for key, val := range *in { - (*out)[key] = val - } - } else { - out.NodeLabels = nil - } - out.NonMasqueradeCIDR = in.NonMasqueradeCIDR - out.EnableCustomMetrics = in.EnableCustomMetrics - out.EvictionHard = in.EvictionHard - out.EvictionSoft = in.EvictionSoft - out.EvictionSoftGracePeriod = in.EvictionSoftGracePeriod - out.EvictionPressureTransitionPeriod = in.EvictionPressureTransitionPeriod - out.EvictionMaxPodGracePeriod = in.EvictionMaxPodGracePeriod - out.PodsPerCore = in.PodsPerCore - out.EnableControllerAttachDetach = in.EnableControllerAttachDetach - return nil - } -} - -func DeepCopy_componentconfig_LeaderElectionConfiguration(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*LeaderElectionConfiguration) - out := out.(*LeaderElectionConfiguration) - out.LeaderElect = in.LeaderElect - out.LeaseDuration = in.LeaseDuration - out.RenewDeadline = in.RenewDeadline - out.RetryPeriod = in.RetryPeriod - return nil - } -} - -func DeepCopy_componentconfig_PersistentVolumeRecyclerConfiguration(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PersistentVolumeRecyclerConfiguration) - out := out.(*PersistentVolumeRecyclerConfiguration) - out.MaximumRetry = in.MaximumRetry - out.MinimumTimeoutNFS = in.MinimumTimeoutNFS - out.PodTemplateFilePathNFS = in.PodTemplateFilePathNFS - out.IncrementTimeoutNFS = in.IncrementTimeoutNFS - out.PodTemplateFilePathHostPath = in.PodTemplateFilePathHostPath - out.MinimumTimeoutHostPath = in.MinimumTimeoutHostPath - out.IncrementTimeoutHostPath = in.IncrementTimeoutHostPath - return nil - } -} - -func DeepCopy_componentconfig_PortRangeVar(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PortRangeVar) - out := out.(*PortRangeVar) - if in.Val != nil { - in, out := &in.Val, &out.Val - *out = new(string) - **out = **in - } else { - out.Val = nil - } - return nil - } -} - -func DeepCopy_componentconfig_VolumeConfiguration(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*VolumeConfiguration) - out := out.(*VolumeConfiguration) - out.EnableHostPathProvisioning = in.EnableHostPathProvisioning - out.EnableDynamicProvisioning = in.EnableDynamicProvisioning - out.PersistentVolumeRecyclerConfiguration = in.PersistentVolumeRecyclerConfiguration - out.FlexVolumePluginDir = in.FlexVolumePluginDir - return nil - } -} diff --git a/pkg/apis/componentconfig/v1alpha1/deep_copy_generated.go b/pkg/apis/componentconfig/v1alpha1/deep_copy_generated.go deleted file mode 100644 index 4a067d154e2..00000000000 --- a/pkg/apis/componentconfig/v1alpha1/deep_copy_generated.go +++ /dev/null @@ -1,123 +0,0 @@ -// +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" - conversion "k8s.io/kubernetes/pkg/conversion" - reflect "reflect" -) - -func init() { - if err := api.Scheme.AddGeneratedDeepCopyFuncs( - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_KubeProxyConfiguration, InType: reflect.TypeOf(func() *KubeProxyConfiguration { var x *KubeProxyConfiguration; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_KubeSchedulerConfiguration, InType: reflect.TypeOf(func() *KubeSchedulerConfiguration { var x *KubeSchedulerConfiguration; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_LeaderElectionConfiguration, InType: reflect.TypeOf(func() *LeaderElectionConfiguration { var x *LeaderElectionConfiguration; return x }())}, - ); err != nil { - // if one of the deep copy functions is malformed, detect it immediately. - panic(err) - } -} - -func DeepCopy_v1alpha1_KubeProxyConfiguration(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*KubeProxyConfiguration) - out := out.(*KubeProxyConfiguration) - out.TypeMeta = in.TypeMeta - out.BindAddress = in.BindAddress - out.ClusterCIDR = in.ClusterCIDR - out.HealthzBindAddress = in.HealthzBindAddress - out.HealthzPort = in.HealthzPort - out.HostnameOverride = in.HostnameOverride - if in.IPTablesMasqueradeBit != nil { - in, out := &in.IPTablesMasqueradeBit, &out.IPTablesMasqueradeBit - *out = new(int32) - **out = **in - } else { - out.IPTablesMasqueradeBit = nil - } - out.IPTablesSyncPeriod = in.IPTablesSyncPeriod - out.KubeconfigPath = in.KubeconfigPath - out.MasqueradeAll = in.MasqueradeAll - out.Master = in.Master - if in.OOMScoreAdj != nil { - in, out := &in.OOMScoreAdj, &out.OOMScoreAdj - *out = new(int32) - **out = **in - } else { - out.OOMScoreAdj = nil - } - out.Mode = in.Mode - out.PortRange = in.PortRange - out.ResourceContainer = in.ResourceContainer - out.UDPIdleTimeout = in.UDPIdleTimeout - out.ConntrackMax = in.ConntrackMax - out.ConntrackTCPEstablishedTimeout = in.ConntrackTCPEstablishedTimeout - return nil - } -} - -func DeepCopy_v1alpha1_KubeSchedulerConfiguration(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*KubeSchedulerConfiguration) - out := out.(*KubeSchedulerConfiguration) - out.TypeMeta = in.TypeMeta - out.Port = in.Port - out.Address = in.Address - out.AlgorithmProvider = in.AlgorithmProvider - out.PolicyConfigFile = in.PolicyConfigFile - if in.EnableProfiling != nil { - in, out := &in.EnableProfiling, &out.EnableProfiling - *out = new(bool) - **out = **in - } else { - out.EnableProfiling = nil - } - out.ContentType = in.ContentType - out.KubeAPIQPS = in.KubeAPIQPS - out.KubeAPIBurst = in.KubeAPIBurst - out.SchedulerName = in.SchedulerName - out.HardPodAffinitySymmetricWeight = in.HardPodAffinitySymmetricWeight - out.FailureDomains = in.FailureDomains - if err := DeepCopy_v1alpha1_LeaderElectionConfiguration(&in.LeaderElection, &out.LeaderElection, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_v1alpha1_LeaderElectionConfiguration(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*LeaderElectionConfiguration) - out := out.(*LeaderElectionConfiguration) - if in.LeaderElect != nil { - in, out := &in.LeaderElect, &out.LeaderElect - *out = new(bool) - **out = **in - } else { - out.LeaderElect = nil - } - out.LeaseDuration = in.LeaseDuration - out.RenewDeadline = in.RenewDeadline - out.RetryPeriod = in.RetryPeriod - return nil - } -} diff --git a/pkg/apis/extensions/deep_copy_generated.go b/pkg/apis/extensions/deep_copy_generated.go deleted file mode 100644 index 8cd3fc64224..00000000000 --- a/pkg/apis/extensions/deep_copy_generated.go +++ /dev/null @@ -1,1076 +0,0 @@ -// +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 extensions - -import ( - api "k8s.io/kubernetes/pkg/api" - unversioned "k8s.io/kubernetes/pkg/api/unversioned" - conversion "k8s.io/kubernetes/pkg/conversion" - intstr "k8s.io/kubernetes/pkg/util/intstr" - reflect "reflect" -) - -func init() { - if err := api.Scheme.AddGeneratedDeepCopyFuncs( - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_APIVersion, InType: reflect.TypeOf(func() *APIVersion { var x *APIVersion; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_CustomMetricCurrentStatus, InType: reflect.TypeOf(func() *CustomMetricCurrentStatus { var x *CustomMetricCurrentStatus; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_CustomMetricCurrentStatusList, InType: reflect.TypeOf(func() *CustomMetricCurrentStatusList { var x *CustomMetricCurrentStatusList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_CustomMetricTarget, InType: reflect.TypeOf(func() *CustomMetricTarget { var x *CustomMetricTarget; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_CustomMetricTargetList, InType: reflect.TypeOf(func() *CustomMetricTargetList { var x *CustomMetricTargetList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_DaemonSet, InType: reflect.TypeOf(func() *DaemonSet { var x *DaemonSet; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_DaemonSetList, InType: reflect.TypeOf(func() *DaemonSetList { var x *DaemonSetList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_DaemonSetSpec, InType: reflect.TypeOf(func() *DaemonSetSpec { var x *DaemonSetSpec; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_DaemonSetStatus, InType: reflect.TypeOf(func() *DaemonSetStatus { var x *DaemonSetStatus; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_Deployment, InType: reflect.TypeOf(func() *Deployment { var x *Deployment; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_DeploymentList, InType: reflect.TypeOf(func() *DeploymentList { var x *DeploymentList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_DeploymentRollback, InType: reflect.TypeOf(func() *DeploymentRollback { var x *DeploymentRollback; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_DeploymentSpec, InType: reflect.TypeOf(func() *DeploymentSpec { var x *DeploymentSpec; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_DeploymentStatus, InType: reflect.TypeOf(func() *DeploymentStatus { var x *DeploymentStatus; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_DeploymentStrategy, InType: reflect.TypeOf(func() *DeploymentStrategy { var x *DeploymentStrategy; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_FSGroupStrategyOptions, InType: reflect.TypeOf(func() *FSGroupStrategyOptions { var x *FSGroupStrategyOptions; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_HTTPIngressPath, InType: reflect.TypeOf(func() *HTTPIngressPath { var x *HTTPIngressPath; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_HTTPIngressRuleValue, InType: reflect.TypeOf(func() *HTTPIngressRuleValue { var x *HTTPIngressRuleValue; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_HostPortRange, InType: reflect.TypeOf(func() *HostPortRange { var x *HostPortRange; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_IDRange, InType: reflect.TypeOf(func() *IDRange { var x *IDRange; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_Ingress, InType: reflect.TypeOf(func() *Ingress { var x *Ingress; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_IngressBackend, InType: reflect.TypeOf(func() *IngressBackend { var x *IngressBackend; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_IngressList, InType: reflect.TypeOf(func() *IngressList { var x *IngressList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_IngressRule, InType: reflect.TypeOf(func() *IngressRule { var x *IngressRule; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_IngressRuleValue, InType: reflect.TypeOf(func() *IngressRuleValue { var x *IngressRuleValue; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_IngressSpec, InType: reflect.TypeOf(func() *IngressSpec { var x *IngressSpec; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_IngressStatus, InType: reflect.TypeOf(func() *IngressStatus { var x *IngressStatus; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_IngressTLS, InType: reflect.TypeOf(func() *IngressTLS { var x *IngressTLS; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_NetworkPolicy, InType: reflect.TypeOf(func() *NetworkPolicy { var x *NetworkPolicy; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_NetworkPolicyIngressRule, InType: reflect.TypeOf(func() *NetworkPolicyIngressRule { var x *NetworkPolicyIngressRule; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_NetworkPolicyList, InType: reflect.TypeOf(func() *NetworkPolicyList { var x *NetworkPolicyList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_NetworkPolicyPeer, InType: reflect.TypeOf(func() *NetworkPolicyPeer { var x *NetworkPolicyPeer; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_NetworkPolicyPort, InType: reflect.TypeOf(func() *NetworkPolicyPort { var x *NetworkPolicyPort; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_NetworkPolicySpec, InType: reflect.TypeOf(func() *NetworkPolicySpec { var x *NetworkPolicySpec; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_PodSecurityPolicy, InType: reflect.TypeOf(func() *PodSecurityPolicy { var x *PodSecurityPolicy; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_PodSecurityPolicyList, InType: reflect.TypeOf(func() *PodSecurityPolicyList { var x *PodSecurityPolicyList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_PodSecurityPolicySpec, InType: reflect.TypeOf(func() *PodSecurityPolicySpec { var x *PodSecurityPolicySpec; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_ReplicaSet, InType: reflect.TypeOf(func() *ReplicaSet { var x *ReplicaSet; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_ReplicaSetList, InType: reflect.TypeOf(func() *ReplicaSetList { var x *ReplicaSetList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_ReplicaSetSpec, InType: reflect.TypeOf(func() *ReplicaSetSpec { var x *ReplicaSetSpec; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_ReplicaSetStatus, InType: reflect.TypeOf(func() *ReplicaSetStatus { var x *ReplicaSetStatus; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_ReplicationControllerDummy, InType: reflect.TypeOf(func() *ReplicationControllerDummy { var x *ReplicationControllerDummy; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_RollbackConfig, InType: reflect.TypeOf(func() *RollbackConfig { var x *RollbackConfig; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_RollingUpdateDeployment, InType: reflect.TypeOf(func() *RollingUpdateDeployment { var x *RollingUpdateDeployment; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_RunAsUserStrategyOptions, InType: reflect.TypeOf(func() *RunAsUserStrategyOptions { var x *RunAsUserStrategyOptions; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_SELinuxStrategyOptions, InType: reflect.TypeOf(func() *SELinuxStrategyOptions { var x *SELinuxStrategyOptions; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_Scale, InType: reflect.TypeOf(func() *Scale { var x *Scale; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_ScaleSpec, InType: reflect.TypeOf(func() *ScaleSpec { var x *ScaleSpec; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_ScaleStatus, InType: reflect.TypeOf(func() *ScaleStatus { var x *ScaleStatus; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_SupplementalGroupsStrategyOptions, InType: reflect.TypeOf(func() *SupplementalGroupsStrategyOptions { var x *SupplementalGroupsStrategyOptions; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_ThirdPartyResource, InType: reflect.TypeOf(func() *ThirdPartyResource { var x *ThirdPartyResource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_ThirdPartyResourceData, InType: reflect.TypeOf(func() *ThirdPartyResourceData { var x *ThirdPartyResourceData; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_ThirdPartyResourceDataList, InType: reflect.TypeOf(func() *ThirdPartyResourceDataList { var x *ThirdPartyResourceDataList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_extensions_ThirdPartyResourceList, InType: reflect.TypeOf(func() *ThirdPartyResourceList { var x *ThirdPartyResourceList; return x }())}, - ); err != nil { - // if one of the deep copy functions is malformed, detect it immediately. - panic(err) - } -} - -func DeepCopy_extensions_APIVersion(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*APIVersion) - out := out.(*APIVersion) - out.Name = in.Name - return nil - } -} - -func DeepCopy_extensions_CustomMetricCurrentStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*CustomMetricCurrentStatus) - out := out.(*CustomMetricCurrentStatus) - out.Name = in.Name - out.CurrentValue = in.CurrentValue.DeepCopy() - return nil - } -} - -func DeepCopy_extensions_CustomMetricCurrentStatusList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*CustomMetricCurrentStatusList) - out := out.(*CustomMetricCurrentStatusList) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]CustomMetricCurrentStatus, len(*in)) - for i := range *in { - if err := DeepCopy_extensions_CustomMetricCurrentStatus(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_extensions_CustomMetricTarget(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*CustomMetricTarget) - out := out.(*CustomMetricTarget) - out.Name = in.Name - out.TargetValue = in.TargetValue.DeepCopy() - return nil - } -} - -func DeepCopy_extensions_CustomMetricTargetList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*CustomMetricTargetList) - out := out.(*CustomMetricTargetList) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]CustomMetricTarget, len(*in)) - for i := range *in { - if err := DeepCopy_extensions_CustomMetricTarget(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_extensions_DaemonSet(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*DaemonSet) - out := out.(*DaemonSet) - out.TypeMeta = in.TypeMeta - if err := api.DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_extensions_DaemonSetSpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - out.Status = in.Status - return nil - } -} - -func DeepCopy_extensions_DaemonSetList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*DaemonSetList) - out := out.(*DaemonSetList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]DaemonSet, len(*in)) - for i := range *in { - if err := DeepCopy_extensions_DaemonSet(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_extensions_DaemonSetSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*DaemonSetSpec) - out := out.(*DaemonSetSpec) - 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 - } - return nil - } -} - -func DeepCopy_extensions_DaemonSetStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*DaemonSetStatus) - out := out.(*DaemonSetStatus) - out.CurrentNumberScheduled = in.CurrentNumberScheduled - out.NumberMisscheduled = in.NumberMisscheduled - out.DesiredNumberScheduled = in.DesiredNumberScheduled - return nil - } -} - -func DeepCopy_extensions_Deployment(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Deployment) - out := out.(*Deployment) - out.TypeMeta = in.TypeMeta - if err := api.DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_extensions_DeploymentSpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - out.Status = in.Status - return nil - } -} - -func DeepCopy_extensions_DeploymentList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*DeploymentList) - out := out.(*DeploymentList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Deployment, len(*in)) - for i := range *in { - if err := DeepCopy_extensions_Deployment(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_extensions_DeploymentRollback(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*DeploymentRollback) - out := out.(*DeploymentRollback) - out.TypeMeta = in.TypeMeta - out.Name = in.Name - if in.UpdatedAnnotations != nil { - in, out := &in.UpdatedAnnotations, &out.UpdatedAnnotations - *out = make(map[string]string) - for key, val := range *in { - (*out)[key] = val - } - } else { - out.UpdatedAnnotations = nil - } - out.RollbackTo = in.RollbackTo - return nil - } -} - -func DeepCopy_extensions_DeploymentSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*DeploymentSpec) - out := out.(*DeploymentSpec) - 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 err := DeepCopy_extensions_DeploymentStrategy(&in.Strategy, &out.Strategy, c); err != nil { - return err - } - out.MinReadySeconds = in.MinReadySeconds - if in.RevisionHistoryLimit != nil { - in, out := &in.RevisionHistoryLimit, &out.RevisionHistoryLimit - *out = new(int32) - **out = **in - } else { - out.RevisionHistoryLimit = nil - } - out.Paused = in.Paused - if in.RollbackTo != nil { - in, out := &in.RollbackTo, &out.RollbackTo - *out = new(RollbackConfig) - **out = **in - } else { - out.RollbackTo = nil - } - return nil - } -} - -func DeepCopy_extensions_DeploymentStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*DeploymentStatus) - out := out.(*DeploymentStatus) - out.ObservedGeneration = in.ObservedGeneration - out.Replicas = in.Replicas - out.UpdatedReplicas = in.UpdatedReplicas - out.AvailableReplicas = in.AvailableReplicas - out.UnavailableReplicas = in.UnavailableReplicas - return nil - } -} - -func DeepCopy_extensions_DeploymentStrategy(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*DeploymentStrategy) - out := out.(*DeploymentStrategy) - out.Type = in.Type - if in.RollingUpdate != nil { - in, out := &in.RollingUpdate, &out.RollingUpdate - *out = new(RollingUpdateDeployment) - **out = **in - } else { - out.RollingUpdate = nil - } - return nil - } -} - -func DeepCopy_extensions_FSGroupStrategyOptions(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*FSGroupStrategyOptions) - out := out.(*FSGroupStrategyOptions) - out.Rule = in.Rule - if in.Ranges != nil { - in, out := &in.Ranges, &out.Ranges - *out = make([]IDRange, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Ranges = nil - } - return nil - } -} - -func DeepCopy_extensions_HTTPIngressPath(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*HTTPIngressPath) - out := out.(*HTTPIngressPath) - out.Path = in.Path - out.Backend = in.Backend - return nil - } -} - -func DeepCopy_extensions_HTTPIngressRuleValue(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*HTTPIngressRuleValue) - out := out.(*HTTPIngressRuleValue) - if in.Paths != nil { - in, out := &in.Paths, &out.Paths - *out = make([]HTTPIngressPath, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Paths = nil - } - return nil - } -} - -func DeepCopy_extensions_HostPortRange(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*HostPortRange) - out := out.(*HostPortRange) - out.Min = in.Min - out.Max = in.Max - return nil - } -} - -func DeepCopy_extensions_IDRange(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*IDRange) - out := out.(*IDRange) - out.Min = in.Min - out.Max = in.Max - return nil - } -} - -func DeepCopy_extensions_Ingress(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Ingress) - out := out.(*Ingress) - out.TypeMeta = in.TypeMeta - if err := api.DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_extensions_IngressSpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - if err := DeepCopy_extensions_IngressStatus(&in.Status, &out.Status, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_extensions_IngressBackend(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*IngressBackend) - out := out.(*IngressBackend) - out.ServiceName = in.ServiceName - out.ServicePort = in.ServicePort - return nil - } -} - -func DeepCopy_extensions_IngressList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*IngressList) - out := out.(*IngressList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Ingress, len(*in)) - for i := range *in { - if err := DeepCopy_extensions_Ingress(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_extensions_IngressRule(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*IngressRule) - out := out.(*IngressRule) - out.Host = in.Host - if err := DeepCopy_extensions_IngressRuleValue(&in.IngressRuleValue, &out.IngressRuleValue, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_extensions_IngressRuleValue(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*IngressRuleValue) - out := out.(*IngressRuleValue) - if in.HTTP != nil { - in, out := &in.HTTP, &out.HTTP - *out = new(HTTPIngressRuleValue) - if err := DeepCopy_extensions_HTTPIngressRuleValue(*in, *out, c); err != nil { - return err - } - } else { - out.HTTP = nil - } - return nil - } -} - -func DeepCopy_extensions_IngressSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*IngressSpec) - out := out.(*IngressSpec) - if in.Backend != nil { - in, out := &in.Backend, &out.Backend - *out = new(IngressBackend) - **out = **in - } else { - out.Backend = nil - } - if in.TLS != nil { - in, out := &in.TLS, &out.TLS - *out = make([]IngressTLS, len(*in)) - for i := range *in { - if err := DeepCopy_extensions_IngressTLS(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.TLS = nil - } - if in.Rules != nil { - in, out := &in.Rules, &out.Rules - *out = make([]IngressRule, len(*in)) - for i := range *in { - if err := DeepCopy_extensions_IngressRule(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Rules = nil - } - return nil - } -} - -func DeepCopy_extensions_IngressStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*IngressStatus) - out := out.(*IngressStatus) - if err := api.DeepCopy_api_LoadBalancerStatus(&in.LoadBalancer, &out.LoadBalancer, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_extensions_IngressTLS(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*IngressTLS) - out := out.(*IngressTLS) - if in.Hosts != nil { - in, out := &in.Hosts, &out.Hosts - *out = make([]string, len(*in)) - copy(*out, *in) - } else { - out.Hosts = nil - } - out.SecretName = in.SecretName - return nil - } -} - -func DeepCopy_extensions_NetworkPolicy(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NetworkPolicy) - out := out.(*NetworkPolicy) - out.TypeMeta = in.TypeMeta - if err := api.DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_extensions_NetworkPolicySpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_extensions_NetworkPolicyIngressRule(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NetworkPolicyIngressRule) - out := out.(*NetworkPolicyIngressRule) - if in.Ports != nil { - in, out := &in.Ports, &out.Ports - *out = make([]NetworkPolicyPort, len(*in)) - for i := range *in { - if err := DeepCopy_extensions_NetworkPolicyPort(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Ports = nil - } - if in.From != nil { - in, out := &in.From, &out.From - *out = make([]NetworkPolicyPeer, len(*in)) - for i := range *in { - if err := DeepCopy_extensions_NetworkPolicyPeer(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.From = nil - } - return nil - } -} - -func DeepCopy_extensions_NetworkPolicyList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NetworkPolicyList) - out := out.(*NetworkPolicyList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]NetworkPolicy, len(*in)) - for i := range *in { - if err := DeepCopy_extensions_NetworkPolicy(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_extensions_NetworkPolicyPeer(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NetworkPolicyPeer) - out := out.(*NetworkPolicyPeer) - if in.PodSelector != nil { - in, out := &in.PodSelector, &out.PodSelector - *out = new(unversioned.LabelSelector) - if err := unversioned.DeepCopy_unversioned_LabelSelector(*in, *out, c); err != nil { - return err - } - } else { - out.PodSelector = nil - } - if in.NamespaceSelector != nil { - in, out := &in.NamespaceSelector, &out.NamespaceSelector - *out = new(unversioned.LabelSelector) - if err := unversioned.DeepCopy_unversioned_LabelSelector(*in, *out, c); err != nil { - return err - } - } else { - out.NamespaceSelector = nil - } - return nil - } -} - -func DeepCopy_extensions_NetworkPolicyPort(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NetworkPolicyPort) - out := out.(*NetworkPolicyPort) - if in.Protocol != nil { - in, out := &in.Protocol, &out.Protocol - *out = new(api.Protocol) - **out = **in - } else { - out.Protocol = nil - } - if in.Port != nil { - in, out := &in.Port, &out.Port - *out = new(intstr.IntOrString) - **out = **in - } else { - out.Port = nil - } - return nil - } -} - -func DeepCopy_extensions_NetworkPolicySpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NetworkPolicySpec) - out := out.(*NetworkPolicySpec) - if err := unversioned.DeepCopy_unversioned_LabelSelector(&in.PodSelector, &out.PodSelector, c); err != nil { - return err - } - if in.Ingress != nil { - in, out := &in.Ingress, &out.Ingress - *out = make([]NetworkPolicyIngressRule, len(*in)) - for i := range *in { - if err := DeepCopy_extensions_NetworkPolicyIngressRule(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Ingress = nil - } - return nil - } -} - -func DeepCopy_extensions_PodSecurityPolicy(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodSecurityPolicy) - out := out.(*PodSecurityPolicy) - out.TypeMeta = in.TypeMeta - if err := api.DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_extensions_PodSecurityPolicySpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_extensions_PodSecurityPolicyList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodSecurityPolicyList) - out := out.(*PodSecurityPolicyList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]PodSecurityPolicy, len(*in)) - for i := range *in { - if err := DeepCopy_extensions_PodSecurityPolicy(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_extensions_PodSecurityPolicySpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodSecurityPolicySpec) - out := out.(*PodSecurityPolicySpec) - out.Privileged = in.Privileged - if in.DefaultAddCapabilities != nil { - in, out := &in.DefaultAddCapabilities, &out.DefaultAddCapabilities - *out = make([]api.Capability, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.DefaultAddCapabilities = nil - } - if in.RequiredDropCapabilities != nil { - in, out := &in.RequiredDropCapabilities, &out.RequiredDropCapabilities - *out = make([]api.Capability, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.RequiredDropCapabilities = nil - } - if in.AllowedCapabilities != nil { - in, out := &in.AllowedCapabilities, &out.AllowedCapabilities - *out = make([]api.Capability, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.AllowedCapabilities = nil - } - if in.Volumes != nil { - in, out := &in.Volumes, &out.Volumes - *out = make([]FSType, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Volumes = nil - } - out.HostNetwork = in.HostNetwork - if in.HostPorts != nil { - in, out := &in.HostPorts, &out.HostPorts - *out = make([]HostPortRange, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.HostPorts = nil - } - out.HostPID = in.HostPID - out.HostIPC = in.HostIPC - if err := DeepCopy_extensions_SELinuxStrategyOptions(&in.SELinux, &out.SELinux, c); err != nil { - return err - } - if err := DeepCopy_extensions_RunAsUserStrategyOptions(&in.RunAsUser, &out.RunAsUser, c); err != nil { - return err - } - if err := DeepCopy_extensions_SupplementalGroupsStrategyOptions(&in.SupplementalGroups, &out.SupplementalGroups, c); err != nil { - return err - } - if err := DeepCopy_extensions_FSGroupStrategyOptions(&in.FSGroup, &out.FSGroup, c); err != nil { - return err - } - out.ReadOnlyRootFilesystem = in.ReadOnlyRootFilesystem - return nil - } -} - -func DeepCopy_extensions_ReplicaSet(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ReplicaSet) - out := out.(*ReplicaSet) - out.TypeMeta = in.TypeMeta - if err := api.DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_extensions_ReplicaSetSpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - out.Status = in.Status - return nil - } -} - -func DeepCopy_extensions_ReplicaSetList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ReplicaSetList) - out := out.(*ReplicaSetList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ReplicaSet, len(*in)) - for i := range *in { - if err := DeepCopy_extensions_ReplicaSet(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_extensions_ReplicaSetSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ReplicaSetSpec) - out := out.(*ReplicaSetSpec) - 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 - } - return nil - } -} - -func DeepCopy_extensions_ReplicaSetStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ReplicaSetStatus) - out := out.(*ReplicaSetStatus) - out.Replicas = in.Replicas - out.FullyLabeledReplicas = in.FullyLabeledReplicas - out.ObservedGeneration = in.ObservedGeneration - return nil - } -} - -func DeepCopy_extensions_ReplicationControllerDummy(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ReplicationControllerDummy) - out := out.(*ReplicationControllerDummy) - out.TypeMeta = in.TypeMeta - return nil - } -} - -func DeepCopy_extensions_RollbackConfig(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*RollbackConfig) - out := out.(*RollbackConfig) - out.Revision = in.Revision - return nil - } -} - -func DeepCopy_extensions_RollingUpdateDeployment(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*RollingUpdateDeployment) - out := out.(*RollingUpdateDeployment) - out.MaxUnavailable = in.MaxUnavailable - out.MaxSurge = in.MaxSurge - return nil - } -} - -func DeepCopy_extensions_RunAsUserStrategyOptions(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*RunAsUserStrategyOptions) - out := out.(*RunAsUserStrategyOptions) - out.Rule = in.Rule - if in.Ranges != nil { - in, out := &in.Ranges, &out.Ranges - *out = make([]IDRange, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Ranges = nil - } - return nil - } -} - -func DeepCopy_extensions_SELinuxStrategyOptions(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*SELinuxStrategyOptions) - out := out.(*SELinuxStrategyOptions) - out.Rule = in.Rule - if in.SELinuxOptions != nil { - in, out := &in.SELinuxOptions, &out.SELinuxOptions - *out = new(api.SELinuxOptions) - **out = **in - } else { - out.SELinuxOptions = nil - } - return nil - } -} - -func DeepCopy_extensions_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 - if err := DeepCopy_extensions_ScaleStatus(&in.Status, &out.Status, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_extensions_ScaleSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ScaleSpec) - out := out.(*ScaleSpec) - out.Replicas = in.Replicas - return nil - } -} - -func DeepCopy_extensions_ScaleStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ScaleStatus) - out := out.(*ScaleStatus) - 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 - } - return nil - } -} - -func DeepCopy_extensions_SupplementalGroupsStrategyOptions(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*SupplementalGroupsStrategyOptions) - out := out.(*SupplementalGroupsStrategyOptions) - out.Rule = in.Rule - if in.Ranges != nil { - in, out := &in.Ranges, &out.Ranges - *out = make([]IDRange, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Ranges = nil - } - return nil - } -} - -func DeepCopy_extensions_ThirdPartyResource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ThirdPartyResource) - out := out.(*ThirdPartyResource) - out.TypeMeta = in.TypeMeta - if err := api.DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - out.Description = in.Description - if in.Versions != nil { - in, out := &in.Versions, &out.Versions - *out = make([]APIVersion, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Versions = nil - } - return nil - } -} - -func DeepCopy_extensions_ThirdPartyResourceData(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ThirdPartyResourceData) - out := out.(*ThirdPartyResourceData) - out.TypeMeta = in.TypeMeta - if err := api.DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if in.Data != nil { - in, out := &in.Data, &out.Data - *out = make([]byte, len(*in)) - copy(*out, *in) - } else { - out.Data = nil - } - return nil - } -} - -func DeepCopy_extensions_ThirdPartyResourceDataList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ThirdPartyResourceDataList) - out := out.(*ThirdPartyResourceDataList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ThirdPartyResourceData, len(*in)) - for i := range *in { - if err := DeepCopy_extensions_ThirdPartyResourceData(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_extensions_ThirdPartyResourceList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ThirdPartyResourceList) - out := out.(*ThirdPartyResourceList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ThirdPartyResource, len(*in)) - for i := range *in { - if err := DeepCopy_extensions_ThirdPartyResource(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} diff --git a/pkg/apis/extensions/v1beta1/deep_copy_generated.go b/pkg/apis/extensions/v1beta1/deep_copy_generated.go deleted file mode 100644 index bcd1e1c7c36..00000000000 --- a/pkg/apis/extensions/v1beta1/deep_copy_generated.go +++ /dev/null @@ -1,1447 +0,0 @@ -// +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" - unversioned "k8s.io/kubernetes/pkg/api/unversioned" - v1 "k8s.io/kubernetes/pkg/api/v1" - conversion "k8s.io/kubernetes/pkg/conversion" - intstr "k8s.io/kubernetes/pkg/util/intstr" - reflect "reflect" -) - -func init() { - if err := api.Scheme.AddGeneratedDeepCopyFuncs( - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_APIVersion, InType: reflect.TypeOf(func() *APIVersion { var x *APIVersion; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_CPUTargetUtilization, InType: reflect.TypeOf(func() *CPUTargetUtilization { var x *CPUTargetUtilization; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_CustomMetricCurrentStatus, InType: reflect.TypeOf(func() *CustomMetricCurrentStatus { var x *CustomMetricCurrentStatus; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_CustomMetricCurrentStatusList, InType: reflect.TypeOf(func() *CustomMetricCurrentStatusList { var x *CustomMetricCurrentStatusList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_CustomMetricTarget, InType: reflect.TypeOf(func() *CustomMetricTarget { var x *CustomMetricTarget; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_CustomMetricTargetList, InType: reflect.TypeOf(func() *CustomMetricTargetList { var x *CustomMetricTargetList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_DaemonSet, InType: reflect.TypeOf(func() *DaemonSet { var x *DaemonSet; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_DaemonSetList, InType: reflect.TypeOf(func() *DaemonSetList { var x *DaemonSetList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_DaemonSetSpec, InType: reflect.TypeOf(func() *DaemonSetSpec { var x *DaemonSetSpec; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_DaemonSetStatus, InType: reflect.TypeOf(func() *DaemonSetStatus { var x *DaemonSetStatus; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_Deployment, InType: reflect.TypeOf(func() *Deployment { var x *Deployment; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_DeploymentList, InType: reflect.TypeOf(func() *DeploymentList { var x *DeploymentList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_DeploymentRollback, InType: reflect.TypeOf(func() *DeploymentRollback { var x *DeploymentRollback; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_DeploymentSpec, InType: reflect.TypeOf(func() *DeploymentSpec { var x *DeploymentSpec; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_DeploymentStatus, InType: reflect.TypeOf(func() *DeploymentStatus { var x *DeploymentStatus; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_DeploymentStrategy, InType: reflect.TypeOf(func() *DeploymentStrategy { var x *DeploymentStrategy; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_ExportOptions, InType: reflect.TypeOf(func() *ExportOptions { var x *ExportOptions; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_FSGroupStrategyOptions, InType: reflect.TypeOf(func() *FSGroupStrategyOptions { var x *FSGroupStrategyOptions; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_HTTPIngressPath, InType: reflect.TypeOf(func() *HTTPIngressPath { var x *HTTPIngressPath; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_HTTPIngressRuleValue, InType: reflect.TypeOf(func() *HTTPIngressRuleValue { var x *HTTPIngressRuleValue; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_HorizontalPodAutoscaler, InType: reflect.TypeOf(func() *HorizontalPodAutoscaler { var x *HorizontalPodAutoscaler; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_HorizontalPodAutoscalerList, InType: reflect.TypeOf(func() *HorizontalPodAutoscalerList { var x *HorizontalPodAutoscalerList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_HorizontalPodAutoscalerSpec, InType: reflect.TypeOf(func() *HorizontalPodAutoscalerSpec { var x *HorizontalPodAutoscalerSpec; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_HorizontalPodAutoscalerStatus, InType: reflect.TypeOf(func() *HorizontalPodAutoscalerStatus { var x *HorizontalPodAutoscalerStatus; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_HostPortRange, InType: reflect.TypeOf(func() *HostPortRange { var x *HostPortRange; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_IDRange, InType: reflect.TypeOf(func() *IDRange { var x *IDRange; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_Ingress, InType: reflect.TypeOf(func() *Ingress { var x *Ingress; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_IngressBackend, InType: reflect.TypeOf(func() *IngressBackend { var x *IngressBackend; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_IngressList, InType: reflect.TypeOf(func() *IngressList { var x *IngressList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_IngressRule, InType: reflect.TypeOf(func() *IngressRule { var x *IngressRule; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_IngressRuleValue, InType: reflect.TypeOf(func() *IngressRuleValue { var x *IngressRuleValue; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_IngressSpec, InType: reflect.TypeOf(func() *IngressSpec { var x *IngressSpec; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_IngressStatus, InType: reflect.TypeOf(func() *IngressStatus { var x *IngressStatus; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_IngressTLS, InType: reflect.TypeOf(func() *IngressTLS { var x *IngressTLS; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_Job, InType: reflect.TypeOf(func() *Job { var x *Job; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_JobCondition, InType: reflect.TypeOf(func() *JobCondition { var x *JobCondition; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_JobList, InType: reflect.TypeOf(func() *JobList { var x *JobList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_JobSpec, InType: reflect.TypeOf(func() *JobSpec { var x *JobSpec; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_JobStatus, InType: reflect.TypeOf(func() *JobStatus { var x *JobStatus; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_LabelSelector, InType: reflect.TypeOf(func() *LabelSelector { var x *LabelSelector; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_LabelSelectorRequirement, InType: reflect.TypeOf(func() *LabelSelectorRequirement { var x *LabelSelectorRequirement; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_ListOptions, InType: reflect.TypeOf(func() *ListOptions { var x *ListOptions; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_NetworkPolicy, InType: reflect.TypeOf(func() *NetworkPolicy { var x *NetworkPolicy; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_NetworkPolicyIngressRule, InType: reflect.TypeOf(func() *NetworkPolicyIngressRule { var x *NetworkPolicyIngressRule; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_NetworkPolicyList, InType: reflect.TypeOf(func() *NetworkPolicyList { var x *NetworkPolicyList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_NetworkPolicyPeer, InType: reflect.TypeOf(func() *NetworkPolicyPeer { var x *NetworkPolicyPeer; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_NetworkPolicyPort, InType: reflect.TypeOf(func() *NetworkPolicyPort { var x *NetworkPolicyPort; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_NetworkPolicySpec, InType: reflect.TypeOf(func() *NetworkPolicySpec { var x *NetworkPolicySpec; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_PodSecurityPolicy, InType: reflect.TypeOf(func() *PodSecurityPolicy { var x *PodSecurityPolicy; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_PodSecurityPolicyList, InType: reflect.TypeOf(func() *PodSecurityPolicyList { var x *PodSecurityPolicyList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_PodSecurityPolicySpec, InType: reflect.TypeOf(func() *PodSecurityPolicySpec { var x *PodSecurityPolicySpec; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_ReplicaSet, InType: reflect.TypeOf(func() *ReplicaSet { var x *ReplicaSet; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_ReplicaSetList, InType: reflect.TypeOf(func() *ReplicaSetList { var x *ReplicaSetList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_ReplicaSetSpec, InType: reflect.TypeOf(func() *ReplicaSetSpec { var x *ReplicaSetSpec; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_ReplicaSetStatus, InType: reflect.TypeOf(func() *ReplicaSetStatus { var x *ReplicaSetStatus; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_ReplicationControllerDummy, InType: reflect.TypeOf(func() *ReplicationControllerDummy { var x *ReplicationControllerDummy; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_RollbackConfig, InType: reflect.TypeOf(func() *RollbackConfig { var x *RollbackConfig; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_RollingUpdateDeployment, InType: reflect.TypeOf(func() *RollingUpdateDeployment { var x *RollingUpdateDeployment; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_RunAsUserStrategyOptions, InType: reflect.TypeOf(func() *RunAsUserStrategyOptions { var x *RunAsUserStrategyOptions; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_SELinuxStrategyOptions, InType: reflect.TypeOf(func() *SELinuxStrategyOptions { var x *SELinuxStrategyOptions; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_Scale, InType: reflect.TypeOf(func() *Scale { var x *Scale; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_ScaleSpec, InType: reflect.TypeOf(func() *ScaleSpec { var x *ScaleSpec; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_ScaleStatus, InType: reflect.TypeOf(func() *ScaleStatus { var x *ScaleStatus; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_SubresourceReference, InType: reflect.TypeOf(func() *SubresourceReference { var x *SubresourceReference; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_SupplementalGroupsStrategyOptions, InType: reflect.TypeOf(func() *SupplementalGroupsStrategyOptions { var x *SupplementalGroupsStrategyOptions; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_ThirdPartyResource, InType: reflect.TypeOf(func() *ThirdPartyResource { var x *ThirdPartyResource; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_ThirdPartyResourceData, InType: reflect.TypeOf(func() *ThirdPartyResourceData { var x *ThirdPartyResourceData; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_ThirdPartyResourceDataList, InType: reflect.TypeOf(func() *ThirdPartyResourceDataList { var x *ThirdPartyResourceDataList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_ThirdPartyResourceList, InType: reflect.TypeOf(func() *ThirdPartyResourceList { var x *ThirdPartyResourceList; return x }())}, - ); err != nil { - // if one of the deep copy functions is malformed, detect it immediately. - panic(err) - } -} - -func DeepCopy_v1beta1_APIVersion(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*APIVersion) - out := out.(*APIVersion) - out.Name = in.Name - return nil - } -} - -func DeepCopy_v1beta1_CPUTargetUtilization(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*CPUTargetUtilization) - out := out.(*CPUTargetUtilization) - out.TargetPercentage = in.TargetPercentage - return nil - } -} - -func DeepCopy_v1beta1_CustomMetricCurrentStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*CustomMetricCurrentStatus) - out := out.(*CustomMetricCurrentStatus) - out.Name = in.Name - out.CurrentValue = in.CurrentValue.DeepCopy() - return nil - } -} - -func DeepCopy_v1beta1_CustomMetricCurrentStatusList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*CustomMetricCurrentStatusList) - out := out.(*CustomMetricCurrentStatusList) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]CustomMetricCurrentStatus, len(*in)) - for i := range *in { - if err := DeepCopy_v1beta1_CustomMetricCurrentStatus(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_v1beta1_CustomMetricTarget(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*CustomMetricTarget) - out := out.(*CustomMetricTarget) - out.Name = in.Name - out.TargetValue = in.TargetValue.DeepCopy() - return nil - } -} - -func DeepCopy_v1beta1_CustomMetricTargetList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*CustomMetricTargetList) - out := out.(*CustomMetricTargetList) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]CustomMetricTarget, len(*in)) - for i := range *in { - if err := DeepCopy_v1beta1_CustomMetricTarget(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_v1beta1_DaemonSet(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*DaemonSet) - out := out.(*DaemonSet) - out.TypeMeta = in.TypeMeta - if err := v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_v1beta1_DaemonSetSpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - out.Status = in.Status - return nil - } -} - -func DeepCopy_v1beta1_DaemonSetList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*DaemonSetList) - out := out.(*DaemonSetList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]DaemonSet, len(*in)) - for i := range *in { - if err := DeepCopy_v1beta1_DaemonSet(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_v1beta1_DaemonSetSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*DaemonSetSpec) - out := out.(*DaemonSetSpec) - if in.Selector != nil { - in, out := &in.Selector, &out.Selector - *out = new(LabelSelector) - if err := DeepCopy_v1beta1_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 - } - return nil - } -} - -func DeepCopy_v1beta1_DaemonSetStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*DaemonSetStatus) - out := out.(*DaemonSetStatus) - out.CurrentNumberScheduled = in.CurrentNumberScheduled - out.NumberMisscheduled = in.NumberMisscheduled - out.DesiredNumberScheduled = in.DesiredNumberScheduled - return nil - } -} - -func DeepCopy_v1beta1_Deployment(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Deployment) - out := out.(*Deployment) - out.TypeMeta = in.TypeMeta - if err := v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_v1beta1_DeploymentSpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - out.Status = in.Status - return nil - } -} - -func DeepCopy_v1beta1_DeploymentList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*DeploymentList) - out := out.(*DeploymentList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Deployment, len(*in)) - for i := range *in { - if err := DeepCopy_v1beta1_Deployment(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_v1beta1_DeploymentRollback(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*DeploymentRollback) - out := out.(*DeploymentRollback) - out.TypeMeta = in.TypeMeta - out.Name = in.Name - if in.UpdatedAnnotations != nil { - in, out := &in.UpdatedAnnotations, &out.UpdatedAnnotations - *out = make(map[string]string) - for key, val := range *in { - (*out)[key] = val - } - } else { - out.UpdatedAnnotations = nil - } - out.RollbackTo = in.RollbackTo - return nil - } -} - -func DeepCopy_v1beta1_DeploymentSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*DeploymentSpec) - out := out.(*DeploymentSpec) - 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(LabelSelector) - if err := DeepCopy_v1beta1_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 err := DeepCopy_v1beta1_DeploymentStrategy(&in.Strategy, &out.Strategy, c); err != nil { - return err - } - out.MinReadySeconds = in.MinReadySeconds - if in.RevisionHistoryLimit != nil { - in, out := &in.RevisionHistoryLimit, &out.RevisionHistoryLimit - *out = new(int32) - **out = **in - } else { - out.RevisionHistoryLimit = nil - } - out.Paused = in.Paused - if in.RollbackTo != nil { - in, out := &in.RollbackTo, &out.RollbackTo - *out = new(RollbackConfig) - **out = **in - } else { - out.RollbackTo = nil - } - return nil - } -} - -func DeepCopy_v1beta1_DeploymentStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*DeploymentStatus) - out := out.(*DeploymentStatus) - out.ObservedGeneration = in.ObservedGeneration - out.Replicas = in.Replicas - out.UpdatedReplicas = in.UpdatedReplicas - out.AvailableReplicas = in.AvailableReplicas - out.UnavailableReplicas = in.UnavailableReplicas - return nil - } -} - -func DeepCopy_v1beta1_DeploymentStrategy(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*DeploymentStrategy) - out := out.(*DeploymentStrategy) - out.Type = in.Type - if in.RollingUpdate != nil { - in, out := &in.RollingUpdate, &out.RollingUpdate - *out = new(RollingUpdateDeployment) - if err := DeepCopy_v1beta1_RollingUpdateDeployment(*in, *out, c); err != nil { - return err - } - } else { - out.RollingUpdate = nil - } - return nil - } -} - -func DeepCopy_v1beta1_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_v1beta1_FSGroupStrategyOptions(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*FSGroupStrategyOptions) - out := out.(*FSGroupStrategyOptions) - out.Rule = in.Rule - if in.Ranges != nil { - in, out := &in.Ranges, &out.Ranges - *out = make([]IDRange, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Ranges = nil - } - return nil - } -} - -func DeepCopy_v1beta1_HTTPIngressPath(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*HTTPIngressPath) - out := out.(*HTTPIngressPath) - out.Path = in.Path - out.Backend = in.Backend - return nil - } -} - -func DeepCopy_v1beta1_HTTPIngressRuleValue(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*HTTPIngressRuleValue) - out := out.(*HTTPIngressRuleValue) - if in.Paths != nil { - in, out := &in.Paths, &out.Paths - *out = make([]HTTPIngressPath, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Paths = nil - } - return nil - } -} - -func DeepCopy_v1beta1_HorizontalPodAutoscaler(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*HorizontalPodAutoscaler) - out := out.(*HorizontalPodAutoscaler) - out.TypeMeta = in.TypeMeta - if err := v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_v1beta1_HorizontalPodAutoscalerSpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - if err := DeepCopy_v1beta1_HorizontalPodAutoscalerStatus(&in.Status, &out.Status, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_v1beta1_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_v1beta1_HorizontalPodAutoscaler(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_v1beta1_HorizontalPodAutoscalerSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*HorizontalPodAutoscalerSpec) - out := out.(*HorizontalPodAutoscalerSpec) - out.ScaleRef = in.ScaleRef - 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.CPUUtilization != nil { - in, out := &in.CPUUtilization, &out.CPUUtilization - *out = new(CPUTargetUtilization) - **out = **in - } else { - out.CPUUtilization = nil - } - return nil - } -} - -func DeepCopy_v1beta1_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_v1beta1_HostPortRange(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*HostPortRange) - out := out.(*HostPortRange) - out.Min = in.Min - out.Max = in.Max - return nil - } -} - -func DeepCopy_v1beta1_IDRange(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*IDRange) - out := out.(*IDRange) - out.Min = in.Min - out.Max = in.Max - return nil - } -} - -func DeepCopy_v1beta1_Ingress(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Ingress) - out := out.(*Ingress) - out.TypeMeta = in.TypeMeta - if err := v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_v1beta1_IngressSpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - if err := DeepCopy_v1beta1_IngressStatus(&in.Status, &out.Status, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_v1beta1_IngressBackend(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*IngressBackend) - out := out.(*IngressBackend) - out.ServiceName = in.ServiceName - out.ServicePort = in.ServicePort - return nil - } -} - -func DeepCopy_v1beta1_IngressList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*IngressList) - out := out.(*IngressList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Ingress, len(*in)) - for i := range *in { - if err := DeepCopy_v1beta1_Ingress(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_v1beta1_IngressRule(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*IngressRule) - out := out.(*IngressRule) - out.Host = in.Host - if err := DeepCopy_v1beta1_IngressRuleValue(&in.IngressRuleValue, &out.IngressRuleValue, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_v1beta1_IngressRuleValue(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*IngressRuleValue) - out := out.(*IngressRuleValue) - if in.HTTP != nil { - in, out := &in.HTTP, &out.HTTP - *out = new(HTTPIngressRuleValue) - if err := DeepCopy_v1beta1_HTTPIngressRuleValue(*in, *out, c); err != nil { - return err - } - } else { - out.HTTP = nil - } - return nil - } -} - -func DeepCopy_v1beta1_IngressSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*IngressSpec) - out := out.(*IngressSpec) - if in.Backend != nil { - in, out := &in.Backend, &out.Backend - *out = new(IngressBackend) - **out = **in - } else { - out.Backend = nil - } - if in.TLS != nil { - in, out := &in.TLS, &out.TLS - *out = make([]IngressTLS, len(*in)) - for i := range *in { - if err := DeepCopy_v1beta1_IngressTLS(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.TLS = nil - } - if in.Rules != nil { - in, out := &in.Rules, &out.Rules - *out = make([]IngressRule, len(*in)) - for i := range *in { - if err := DeepCopy_v1beta1_IngressRule(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Rules = nil - } - return nil - } -} - -func DeepCopy_v1beta1_IngressStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*IngressStatus) - out := out.(*IngressStatus) - if err := v1.DeepCopy_v1_LoadBalancerStatus(&in.LoadBalancer, &out.LoadBalancer, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_v1beta1_IngressTLS(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*IngressTLS) - out := out.(*IngressTLS) - if in.Hosts != nil { - in, out := &in.Hosts, &out.Hosts - *out = make([]string, len(*in)) - copy(*out, *in) - } else { - out.Hosts = nil - } - out.SecretName = in.SecretName - return nil - } -} - -func DeepCopy_v1beta1_Job(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Job) - out := out.(*Job) - out.TypeMeta = in.TypeMeta - if err := v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_v1beta1_JobSpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - if err := DeepCopy_v1beta1_JobStatus(&in.Status, &out.Status, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_v1beta1_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_v1beta1_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_v1beta1_Job(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_v1beta1_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_v1beta1_LabelSelector(*in, *out, c); err != nil { - return err - } - } else { - out.Selector = nil - } - if in.AutoSelector != nil { - in, out := &in.AutoSelector, &out.AutoSelector - *out = new(bool) - **out = **in - } else { - out.AutoSelector = nil - } - if err := v1.DeepCopy_v1_PodTemplateSpec(&in.Template, &out.Template, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_v1beta1_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_v1beta1_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_v1beta1_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_v1beta1_LabelSelectorRequirement(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.MatchExpressions = nil - } - return nil - } -} - -func DeepCopy_v1beta1_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_v1beta1_ListOptions(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ListOptions) - out := out.(*ListOptions) - out.TypeMeta = in.TypeMeta - out.LabelSelector = in.LabelSelector - out.FieldSelector = in.FieldSelector - out.Watch = in.Watch - out.ResourceVersion = in.ResourceVersion - if in.TimeoutSeconds != nil { - in, out := &in.TimeoutSeconds, &out.TimeoutSeconds - *out = new(int64) - **out = **in - } else { - out.TimeoutSeconds = nil - } - return nil - } -} - -func DeepCopy_v1beta1_NetworkPolicy(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NetworkPolicy) - out := out.(*NetworkPolicy) - out.TypeMeta = in.TypeMeta - if err := v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_v1beta1_NetworkPolicySpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_v1beta1_NetworkPolicyIngressRule(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NetworkPolicyIngressRule) - out := out.(*NetworkPolicyIngressRule) - if in.Ports != nil { - in, out := &in.Ports, &out.Ports - *out = make([]NetworkPolicyPort, len(*in)) - for i := range *in { - if err := DeepCopy_v1beta1_NetworkPolicyPort(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Ports = nil - } - if in.From != nil { - in, out := &in.From, &out.From - *out = make([]NetworkPolicyPeer, len(*in)) - for i := range *in { - if err := DeepCopy_v1beta1_NetworkPolicyPeer(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.From = nil - } - return nil - } -} - -func DeepCopy_v1beta1_NetworkPolicyList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NetworkPolicyList) - out := out.(*NetworkPolicyList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]NetworkPolicy, len(*in)) - for i := range *in { - if err := DeepCopy_v1beta1_NetworkPolicy(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_v1beta1_NetworkPolicyPeer(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NetworkPolicyPeer) - out := out.(*NetworkPolicyPeer) - if in.PodSelector != nil { - in, out := &in.PodSelector, &out.PodSelector - *out = new(LabelSelector) - if err := DeepCopy_v1beta1_LabelSelector(*in, *out, c); err != nil { - return err - } - } else { - out.PodSelector = nil - } - if in.NamespaceSelector != nil { - in, out := &in.NamespaceSelector, &out.NamespaceSelector - *out = new(LabelSelector) - if err := DeepCopy_v1beta1_LabelSelector(*in, *out, c); err != nil { - return err - } - } else { - out.NamespaceSelector = nil - } - return nil - } -} - -func DeepCopy_v1beta1_NetworkPolicyPort(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NetworkPolicyPort) - out := out.(*NetworkPolicyPort) - if in.Protocol != nil { - in, out := &in.Protocol, &out.Protocol - *out = new(v1.Protocol) - **out = **in - } else { - out.Protocol = nil - } - if in.Port != nil { - in, out := &in.Port, &out.Port - *out = new(intstr.IntOrString) - **out = **in - } else { - out.Port = nil - } - return nil - } -} - -func DeepCopy_v1beta1_NetworkPolicySpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*NetworkPolicySpec) - out := out.(*NetworkPolicySpec) - if err := DeepCopy_v1beta1_LabelSelector(&in.PodSelector, &out.PodSelector, c); err != nil { - return err - } - if in.Ingress != nil { - in, out := &in.Ingress, &out.Ingress - *out = make([]NetworkPolicyIngressRule, len(*in)) - for i := range *in { - if err := DeepCopy_v1beta1_NetworkPolicyIngressRule(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Ingress = nil - } - return nil - } -} - -func DeepCopy_v1beta1_PodSecurityPolicy(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodSecurityPolicy) - out := out.(*PodSecurityPolicy) - out.TypeMeta = in.TypeMeta - if err := v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_v1beta1_PodSecurityPolicySpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_v1beta1_PodSecurityPolicyList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodSecurityPolicyList) - out := out.(*PodSecurityPolicyList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]PodSecurityPolicy, len(*in)) - for i := range *in { - if err := DeepCopy_v1beta1_PodSecurityPolicy(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_v1beta1_PodSecurityPolicySpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodSecurityPolicySpec) - out := out.(*PodSecurityPolicySpec) - out.Privileged = in.Privileged - if in.DefaultAddCapabilities != nil { - in, out := &in.DefaultAddCapabilities, &out.DefaultAddCapabilities - *out = make([]v1.Capability, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.DefaultAddCapabilities = nil - } - if in.RequiredDropCapabilities != nil { - in, out := &in.RequiredDropCapabilities, &out.RequiredDropCapabilities - *out = make([]v1.Capability, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.RequiredDropCapabilities = nil - } - if in.AllowedCapabilities != nil { - in, out := &in.AllowedCapabilities, &out.AllowedCapabilities - *out = make([]v1.Capability, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.AllowedCapabilities = nil - } - if in.Volumes != nil { - in, out := &in.Volumes, &out.Volumes - *out = make([]FSType, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Volumes = nil - } - out.HostNetwork = in.HostNetwork - if in.HostPorts != nil { - in, out := &in.HostPorts, &out.HostPorts - *out = make([]HostPortRange, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.HostPorts = nil - } - out.HostPID = in.HostPID - out.HostIPC = in.HostIPC - if err := DeepCopy_v1beta1_SELinuxStrategyOptions(&in.SELinux, &out.SELinux, c); err != nil { - return err - } - if err := DeepCopy_v1beta1_RunAsUserStrategyOptions(&in.RunAsUser, &out.RunAsUser, c); err != nil { - return err - } - if err := DeepCopy_v1beta1_SupplementalGroupsStrategyOptions(&in.SupplementalGroups, &out.SupplementalGroups, c); err != nil { - return err - } - if err := DeepCopy_v1beta1_FSGroupStrategyOptions(&in.FSGroup, &out.FSGroup, c); err != nil { - return err - } - out.ReadOnlyRootFilesystem = in.ReadOnlyRootFilesystem - return nil - } -} - -func DeepCopy_v1beta1_ReplicaSet(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ReplicaSet) - out := out.(*ReplicaSet) - out.TypeMeta = in.TypeMeta - if err := v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_v1beta1_ReplicaSetSpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - out.Status = in.Status - return nil - } -} - -func DeepCopy_v1beta1_ReplicaSetList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ReplicaSetList) - out := out.(*ReplicaSetList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ReplicaSet, len(*in)) - for i := range *in { - if err := DeepCopy_v1beta1_ReplicaSet(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_v1beta1_ReplicaSetSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ReplicaSetSpec) - out := out.(*ReplicaSetSpec) - 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(LabelSelector) - if err := DeepCopy_v1beta1_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 - } - return nil - } -} - -func DeepCopy_v1beta1_ReplicaSetStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ReplicaSetStatus) - out := out.(*ReplicaSetStatus) - out.Replicas = in.Replicas - out.FullyLabeledReplicas = in.FullyLabeledReplicas - out.ObservedGeneration = in.ObservedGeneration - return nil - } -} - -func DeepCopy_v1beta1_ReplicationControllerDummy(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ReplicationControllerDummy) - out := out.(*ReplicationControllerDummy) - out.TypeMeta = in.TypeMeta - return nil - } -} - -func DeepCopy_v1beta1_RollbackConfig(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*RollbackConfig) - out := out.(*RollbackConfig) - out.Revision = in.Revision - return nil - } -} - -func DeepCopy_v1beta1_RollingUpdateDeployment(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*RollingUpdateDeployment) - out := out.(*RollingUpdateDeployment) - if in.MaxUnavailable != nil { - in, out := &in.MaxUnavailable, &out.MaxUnavailable - *out = new(intstr.IntOrString) - **out = **in - } else { - out.MaxUnavailable = nil - } - if in.MaxSurge != nil { - in, out := &in.MaxSurge, &out.MaxSurge - *out = new(intstr.IntOrString) - **out = **in - } else { - out.MaxSurge = nil - } - return nil - } -} - -func DeepCopy_v1beta1_RunAsUserStrategyOptions(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*RunAsUserStrategyOptions) - out := out.(*RunAsUserStrategyOptions) - out.Rule = in.Rule - if in.Ranges != nil { - in, out := &in.Ranges, &out.Ranges - *out = make([]IDRange, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Ranges = nil - } - return nil - } -} - -func DeepCopy_v1beta1_SELinuxStrategyOptions(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*SELinuxStrategyOptions) - out := out.(*SELinuxStrategyOptions) - out.Rule = in.Rule - if in.SELinuxOptions != nil { - in, out := &in.SELinuxOptions, &out.SELinuxOptions - *out = new(v1.SELinuxOptions) - **out = **in - } else { - out.SELinuxOptions = nil - } - return nil - } -} - -func DeepCopy_v1beta1_Scale(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Scale) - out := out.(*Scale) - out.TypeMeta = in.TypeMeta - if err := v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - out.Spec = in.Spec - if err := DeepCopy_v1beta1_ScaleStatus(&in.Status, &out.Status, c); err != nil { - return err - } - return nil - } -} - -func DeepCopy_v1beta1_ScaleSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ScaleSpec) - out := out.(*ScaleSpec) - out.Replicas = in.Replicas - return nil - } -} - -func DeepCopy_v1beta1_ScaleStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ScaleStatus) - out := out.(*ScaleStatus) - out.Replicas = in.Replicas - if in.Selector != nil { - in, out := &in.Selector, &out.Selector - *out = make(map[string]string) - for key, val := range *in { - (*out)[key] = val - } - } else { - out.Selector = nil - } - out.TargetSelector = in.TargetSelector - return nil - } -} - -func DeepCopy_v1beta1_SubresourceReference(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*SubresourceReference) - out := out.(*SubresourceReference) - out.Kind = in.Kind - out.Name = in.Name - out.APIVersion = in.APIVersion - out.Subresource = in.Subresource - return nil - } -} - -func DeepCopy_v1beta1_SupplementalGroupsStrategyOptions(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*SupplementalGroupsStrategyOptions) - out := out.(*SupplementalGroupsStrategyOptions) - out.Rule = in.Rule - if in.Ranges != nil { - in, out := &in.Ranges, &out.Ranges - *out = make([]IDRange, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Ranges = nil - } - return nil - } -} - -func DeepCopy_v1beta1_ThirdPartyResource(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ThirdPartyResource) - out := out.(*ThirdPartyResource) - out.TypeMeta = in.TypeMeta - if err := v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - out.Description = in.Description - if in.Versions != nil { - in, out := &in.Versions, &out.Versions - *out = make([]APIVersion, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Versions = nil - } - return nil - } -} - -func DeepCopy_v1beta1_ThirdPartyResourceData(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ThirdPartyResourceData) - out := out.(*ThirdPartyResourceData) - out.TypeMeta = in.TypeMeta - if err := v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if in.Data != nil { - in, out := &in.Data, &out.Data - *out = make([]byte, len(*in)) - copy(*out, *in) - } else { - out.Data = nil - } - return nil - } -} - -func DeepCopy_v1beta1_ThirdPartyResourceDataList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ThirdPartyResourceDataList) - out := out.(*ThirdPartyResourceDataList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ThirdPartyResourceData, len(*in)) - for i := range *in { - if err := DeepCopy_v1beta1_ThirdPartyResourceData(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_v1beta1_ThirdPartyResourceList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ThirdPartyResourceList) - out := out.(*ThirdPartyResourceList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ThirdPartyResource, len(*in)) - for i := range *in { - if err := DeepCopy_v1beta1_ThirdPartyResource(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} diff --git a/pkg/apis/policy/deep_copy_generated.go b/pkg/apis/policy/deep_copy_generated.go deleted file mode 100644 index fb095543665..00000000000 --- a/pkg/apis/policy/deep_copy_generated.go +++ /dev/null @@ -1,107 +0,0 @@ -// +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 policy - -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_policy_PodDisruptionBudget, InType: reflect.TypeOf(func() *PodDisruptionBudget { var x *PodDisruptionBudget; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_policy_PodDisruptionBudgetList, InType: reflect.TypeOf(func() *PodDisruptionBudgetList { var x *PodDisruptionBudgetList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_policy_PodDisruptionBudgetSpec, InType: reflect.TypeOf(func() *PodDisruptionBudgetSpec { var x *PodDisruptionBudgetSpec; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_policy_PodDisruptionBudgetStatus, InType: reflect.TypeOf(func() *PodDisruptionBudgetStatus { var x *PodDisruptionBudgetStatus; return x }())}, - ); err != nil { - // if one of the deep copy functions is malformed, detect it immediately. - panic(err) - } -} - -func DeepCopy_policy_PodDisruptionBudget(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodDisruptionBudget) - out := out.(*PodDisruptionBudget) - out.TypeMeta = in.TypeMeta - if err := api.DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_policy_PodDisruptionBudgetSpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - out.Status = in.Status - return nil - } -} - -func DeepCopy_policy_PodDisruptionBudgetList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodDisruptionBudgetList) - out := out.(*PodDisruptionBudgetList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]PodDisruptionBudget, len(*in)) - for i := range *in { - if err := DeepCopy_policy_PodDisruptionBudget(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_policy_PodDisruptionBudgetSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodDisruptionBudgetSpec) - out := out.(*PodDisruptionBudgetSpec) - out.MinAvailable = in.MinAvailable - 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 - } - return nil - } -} - -func DeepCopy_policy_PodDisruptionBudgetStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodDisruptionBudgetStatus) - out := out.(*PodDisruptionBudgetStatus) - out.PodDisruptionAllowed = in.PodDisruptionAllowed - out.CurrentHealthy = in.CurrentHealthy - out.DesiredHealthy = in.DesiredHealthy - out.ExpectedPods = in.ExpectedPods - return nil - } -} diff --git a/pkg/apis/policy/v1alpha1/deep_copy_generated.go b/pkg/apis/policy/v1alpha1/deep_copy_generated.go deleted file mode 100644 index 99d807b7edd..00000000000 --- a/pkg/apis/policy/v1alpha1/deep_copy_generated.go +++ /dev/null @@ -1,108 +0,0 @@ -// +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_PodDisruptionBudget, InType: reflect.TypeOf(func() *PodDisruptionBudget { var x *PodDisruptionBudget; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_PodDisruptionBudgetList, InType: reflect.TypeOf(func() *PodDisruptionBudgetList { var x *PodDisruptionBudgetList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_PodDisruptionBudgetSpec, InType: reflect.TypeOf(func() *PodDisruptionBudgetSpec { var x *PodDisruptionBudgetSpec; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_PodDisruptionBudgetStatus, InType: reflect.TypeOf(func() *PodDisruptionBudgetStatus { var x *PodDisruptionBudgetStatus; return x }())}, - ); err != nil { - // if one of the deep copy functions is malformed, detect it immediately. - panic(err) - } -} - -func DeepCopy_v1alpha1_PodDisruptionBudget(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodDisruptionBudget) - out := out.(*PodDisruptionBudget) - out.TypeMeta = in.TypeMeta - if err := v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if err := DeepCopy_v1alpha1_PodDisruptionBudgetSpec(&in.Spec, &out.Spec, c); err != nil { - return err - } - out.Status = in.Status - return nil - } -} - -func DeepCopy_v1alpha1_PodDisruptionBudgetList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodDisruptionBudgetList) - out := out.(*PodDisruptionBudgetList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]PodDisruptionBudget, len(*in)) - for i := range *in { - if err := DeepCopy_v1alpha1_PodDisruptionBudget(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_v1alpha1_PodDisruptionBudgetSpec(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodDisruptionBudgetSpec) - out := out.(*PodDisruptionBudgetSpec) - out.MinAvailable = in.MinAvailable - 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 - } - return nil - } -} - -func DeepCopy_v1alpha1_PodDisruptionBudgetStatus(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PodDisruptionBudgetStatus) - out := out.(*PodDisruptionBudgetStatus) - out.PodDisruptionAllowed = in.PodDisruptionAllowed - out.CurrentHealthy = in.CurrentHealthy - out.DesiredHealthy = in.DesiredHealthy - out.ExpectedPods = in.ExpectedPods - return nil - } -} diff --git a/pkg/apis/rbac/deep_copy_generated.go b/pkg/apis/rbac/deep_copy_generated.go deleted file mode 100644 index 72026d9bb11..00000000000 --- a/pkg/apis/rbac/deep_copy_generated.go +++ /dev/null @@ -1,282 +0,0 @@ -// +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 rbac - -import ( - api "k8s.io/kubernetes/pkg/api" - conversion "k8s.io/kubernetes/pkg/conversion" - runtime "k8s.io/kubernetes/pkg/runtime" - reflect "reflect" -) - -func init() { - if err := api.Scheme.AddGeneratedDeepCopyFuncs( - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_rbac_ClusterRole, InType: reflect.TypeOf(func() *ClusterRole { var x *ClusterRole; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_rbac_ClusterRoleBinding, InType: reflect.TypeOf(func() *ClusterRoleBinding { var x *ClusterRoleBinding; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_rbac_ClusterRoleBindingList, InType: reflect.TypeOf(func() *ClusterRoleBindingList { var x *ClusterRoleBindingList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_rbac_ClusterRoleList, InType: reflect.TypeOf(func() *ClusterRoleList { var x *ClusterRoleList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_rbac_PolicyRule, InType: reflect.TypeOf(func() *PolicyRule { var x *PolicyRule; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_rbac_Role, InType: reflect.TypeOf(func() *Role { var x *Role; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_rbac_RoleBinding, InType: reflect.TypeOf(func() *RoleBinding { var x *RoleBinding; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_rbac_RoleBindingList, InType: reflect.TypeOf(func() *RoleBindingList { var x *RoleBindingList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_rbac_RoleList, InType: reflect.TypeOf(func() *RoleList { var x *RoleList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_rbac_Subject, InType: reflect.TypeOf(func() *Subject { var x *Subject; return x }())}, - ); err != nil { - // if one of the deep copy functions is malformed, detect it immediately. - panic(err) - } -} - -func DeepCopy_rbac_ClusterRole(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ClusterRole) - out := out.(*ClusterRole) - out.TypeMeta = in.TypeMeta - if err := api.DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if in.Rules != nil { - in, out := &in.Rules, &out.Rules - *out = make([]PolicyRule, len(*in)) - for i := range *in { - if err := DeepCopy_rbac_PolicyRule(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Rules = nil - } - return nil - } -} - -func DeepCopy_rbac_ClusterRoleBinding(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ClusterRoleBinding) - out := out.(*ClusterRoleBinding) - out.TypeMeta = in.TypeMeta - if err := api.DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if in.Subjects != nil { - in, out := &in.Subjects, &out.Subjects - *out = make([]Subject, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Subjects = nil - } - out.RoleRef = in.RoleRef - return nil - } -} - -func DeepCopy_rbac_ClusterRoleBindingList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ClusterRoleBindingList) - out := out.(*ClusterRoleBindingList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ClusterRoleBinding, len(*in)) - for i := range *in { - if err := DeepCopy_rbac_ClusterRoleBinding(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_rbac_ClusterRoleList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ClusterRoleList) - out := out.(*ClusterRoleList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ClusterRole, len(*in)) - for i := range *in { - if err := DeepCopy_rbac_ClusterRole(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_rbac_PolicyRule(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PolicyRule) - out := out.(*PolicyRule) - if in.Verbs != nil { - in, out := &in.Verbs, &out.Verbs - *out = make([]string, len(*in)) - copy(*out, *in) - } else { - out.Verbs = nil - } - if in.AttributeRestrictions == nil { - out.AttributeRestrictions = nil - } else if newVal, err := c.DeepCopy(&in.AttributeRestrictions); err != nil { - return err - } else { - out.AttributeRestrictions = *newVal.(*runtime.Object) - } - if in.APIGroups != nil { - in, out := &in.APIGroups, &out.APIGroups - *out = make([]string, len(*in)) - copy(*out, *in) - } else { - out.APIGroups = nil - } - if in.Resources != nil { - in, out := &in.Resources, &out.Resources - *out = make([]string, len(*in)) - copy(*out, *in) - } else { - out.Resources = nil - } - if in.ResourceNames != nil { - in, out := &in.ResourceNames, &out.ResourceNames - *out = make([]string, len(*in)) - copy(*out, *in) - } else { - out.ResourceNames = nil - } - if in.NonResourceURLs != nil { - in, out := &in.NonResourceURLs, &out.NonResourceURLs - *out = make([]string, len(*in)) - copy(*out, *in) - } else { - out.NonResourceURLs = nil - } - return nil - } -} - -func DeepCopy_rbac_Role(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Role) - out := out.(*Role) - out.TypeMeta = in.TypeMeta - if err := api.DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if in.Rules != nil { - in, out := &in.Rules, &out.Rules - *out = make([]PolicyRule, len(*in)) - for i := range *in { - if err := DeepCopy_rbac_PolicyRule(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Rules = nil - } - return nil - } -} - -func DeepCopy_rbac_RoleBinding(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*RoleBinding) - out := out.(*RoleBinding) - out.TypeMeta = in.TypeMeta - if err := api.DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if in.Subjects != nil { - in, out := &in.Subjects, &out.Subjects - *out = make([]Subject, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Subjects = nil - } - out.RoleRef = in.RoleRef - return nil - } -} - -func DeepCopy_rbac_RoleBindingList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*RoleBindingList) - out := out.(*RoleBindingList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]RoleBinding, len(*in)) - for i := range *in { - if err := DeepCopy_rbac_RoleBinding(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_rbac_RoleList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*RoleList) - out := out.(*RoleList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Role, len(*in)) - for i := range *in { - if err := DeepCopy_rbac_Role(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_rbac_Subject(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Subject) - out := out.(*Subject) - out.Kind = in.Kind - out.APIVersion = in.APIVersion - out.Name = in.Name - out.Namespace = in.Namespace - return nil - } -} diff --git a/pkg/apis/rbac/v1alpha1/deep_copy_generated.go b/pkg/apis/rbac/v1alpha1/deep_copy_generated.go deleted file mode 100644 index f0145a6ac81..00000000000 --- a/pkg/apis/rbac/v1alpha1/deep_copy_generated.go +++ /dev/null @@ -1,279 +0,0 @@ -// +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" - v1 "k8s.io/kubernetes/pkg/api/v1" - conversion "k8s.io/kubernetes/pkg/conversion" - runtime "k8s.io/kubernetes/pkg/runtime" - reflect "reflect" -) - -func init() { - if err := api.Scheme.AddGeneratedDeepCopyFuncs( - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_ClusterRole, InType: reflect.TypeOf(func() *ClusterRole { var x *ClusterRole; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_ClusterRoleBinding, InType: reflect.TypeOf(func() *ClusterRoleBinding { var x *ClusterRoleBinding; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_ClusterRoleBindingList, InType: reflect.TypeOf(func() *ClusterRoleBindingList { var x *ClusterRoleBindingList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_ClusterRoleList, InType: reflect.TypeOf(func() *ClusterRoleList { var x *ClusterRoleList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_PolicyRule, InType: reflect.TypeOf(func() *PolicyRule { var x *PolicyRule; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_Role, InType: reflect.TypeOf(func() *Role { var x *Role; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_RoleBinding, InType: reflect.TypeOf(func() *RoleBinding { var x *RoleBinding; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_RoleBindingList, InType: reflect.TypeOf(func() *RoleBindingList { var x *RoleBindingList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_RoleList, InType: reflect.TypeOf(func() *RoleList { var x *RoleList; return x }())}, - conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_Subject, InType: reflect.TypeOf(func() *Subject { var x *Subject; return x }())}, - ); err != nil { - // if one of the deep copy functions is malformed, detect it immediately. - panic(err) - } -} - -func DeepCopy_v1alpha1_ClusterRole(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ClusterRole) - out := out.(*ClusterRole) - out.TypeMeta = in.TypeMeta - if err := v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if in.Rules != nil { - in, out := &in.Rules, &out.Rules - *out = make([]PolicyRule, len(*in)) - for i := range *in { - if err := DeepCopy_v1alpha1_PolicyRule(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Rules = nil - } - return nil - } -} - -func DeepCopy_v1alpha1_ClusterRoleBinding(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ClusterRoleBinding) - out := out.(*ClusterRoleBinding) - out.TypeMeta = in.TypeMeta - if err := v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if in.Subjects != nil { - in, out := &in.Subjects, &out.Subjects - *out = make([]Subject, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Subjects = nil - } - out.RoleRef = in.RoleRef - return nil - } -} - -func DeepCopy_v1alpha1_ClusterRoleBindingList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ClusterRoleBindingList) - out := out.(*ClusterRoleBindingList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ClusterRoleBinding, len(*in)) - for i := range *in { - if err := DeepCopy_v1alpha1_ClusterRoleBinding(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_v1alpha1_ClusterRoleList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*ClusterRoleList) - out := out.(*ClusterRoleList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ClusterRole, len(*in)) - for i := range *in { - if err := DeepCopy_v1alpha1_ClusterRole(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_v1alpha1_PolicyRule(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*PolicyRule) - out := out.(*PolicyRule) - if in.Verbs != nil { - in, out := &in.Verbs, &out.Verbs - *out = make([]string, len(*in)) - copy(*out, *in) - } else { - out.Verbs = nil - } - if err := runtime.DeepCopy_runtime_RawExtension(&in.AttributeRestrictions, &out.AttributeRestrictions, c); err != nil { - return err - } - if in.APIGroups != nil { - in, out := &in.APIGroups, &out.APIGroups - *out = make([]string, len(*in)) - copy(*out, *in) - } else { - out.APIGroups = nil - } - if in.Resources != nil { - in, out := &in.Resources, &out.Resources - *out = make([]string, len(*in)) - copy(*out, *in) - } else { - out.Resources = nil - } - if in.ResourceNames != nil { - in, out := &in.ResourceNames, &out.ResourceNames - *out = make([]string, len(*in)) - copy(*out, *in) - } else { - out.ResourceNames = nil - } - if in.NonResourceURLs != nil { - in, out := &in.NonResourceURLs, &out.NonResourceURLs - *out = make([]string, len(*in)) - copy(*out, *in) - } else { - out.NonResourceURLs = nil - } - return nil - } -} - -func DeepCopy_v1alpha1_Role(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Role) - out := out.(*Role) - out.TypeMeta = in.TypeMeta - if err := v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if in.Rules != nil { - in, out := &in.Rules, &out.Rules - *out = make([]PolicyRule, len(*in)) - for i := range *in { - if err := DeepCopy_v1alpha1_PolicyRule(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Rules = nil - } - return nil - } -} - -func DeepCopy_v1alpha1_RoleBinding(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*RoleBinding) - out := out.(*RoleBinding) - out.TypeMeta = in.TypeMeta - if err := v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { - return err - } - if in.Subjects != nil { - in, out := &in.Subjects, &out.Subjects - *out = make([]Subject, len(*in)) - for i := range *in { - (*out)[i] = (*in)[i] - } - } else { - out.Subjects = nil - } - out.RoleRef = in.RoleRef - return nil - } -} - -func DeepCopy_v1alpha1_RoleBindingList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*RoleBindingList) - out := out.(*RoleBindingList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]RoleBinding, len(*in)) - for i := range *in { - if err := DeepCopy_v1alpha1_RoleBinding(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_v1alpha1_RoleList(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*RoleList) - out := out.(*RoleList) - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Role, len(*in)) - for i := range *in { - if err := DeepCopy_v1alpha1_Role(&(*in)[i], &(*out)[i], c); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil - } -} - -func DeepCopy_v1alpha1_Subject(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Subject) - out := out.(*Subject) - out.Kind = in.Kind - out.APIVersion = in.APIVersion - out.Name = in.Name - out.Namespace = in.Namespace - return nil - } -} diff --git a/pkg/runtime/deep_copy_generated.go b/pkg/runtime/deep_copy_generated.go deleted file mode 100644 index 627c22b63ab..00000000000 --- a/pkg/runtime/deep_copy_generated.go +++ /dev/null @@ -1,75 +0,0 @@ -// +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 runtime - -import ( - conversion "k8s.io/kubernetes/pkg/conversion" -) - -func DeepCopy_runtime_RawExtension(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*RawExtension) - out := out.(*RawExtension) - if in.Raw != nil { - in, out := &in.Raw, &out.Raw - *out = make([]byte, len(*in)) - copy(*out, *in) - } else { - out.Raw = nil - } - if in.Object == nil { - out.Object = nil - } else if newVal, err := c.DeepCopy(&in.Object); err != nil { - return err - } else { - out.Object = *newVal.(*Object) - } - return nil - } -} - -func DeepCopy_runtime_TypeMeta(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*TypeMeta) - out := out.(*TypeMeta) - out.APIVersion = in.APIVersion - out.Kind = in.Kind - return nil - } -} - -func DeepCopy_runtime_Unknown(in interface{}, out interface{}, c *conversion.Cloner) error { - { - in := in.(*Unknown) - out := out.(*Unknown) - out.TypeMeta = in.TypeMeta - if in.Raw != nil { - in, out := &in.Raw, &out.Raw - *out = make([]byte, len(*in)) - copy(*out, *in) - } else { - out.Raw = nil - } - out.ContentEncoding = in.ContentEncoding - out.ContentType = in.ContentType - return nil - } -} From db42d52be455757dcdf9f650c02102d5a947e5fd Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Tue, 24 May 2016 09:18:22 -0700 Subject: [PATCH 04/18] Add a clean_generated make rule Easier to clean up the mess when needed. --- Makefile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index d6734094482..fde1a6621f1 100644 --- a/Makefile +++ b/Makefile @@ -142,13 +142,20 @@ test-cmd: # # Example: # make clean -clean: +clean: clean_generated build/make-clean.sh rm -rf $(OUT_DIR) - find . -type f -name $(GENERATED_FILE_PREFIX)\* | xargs rm -f rm -rf Godeps/_workspace # Just until we are sure it is gone .PHONY: clean +# Remove all auto-generated artifacts. +# +# Example: +# make clean_generated +clean_generated: + find . -type f -name $(GENERATED_FILE_PREFIX)\* | xargs rm -f +.PHONY: clean_generated + # Run 'go vet'. # # Args: From 9eb42ff1089243928da623c33fb28eb07f910436 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Tue, 24 May 2016 08:31:43 -0700 Subject: [PATCH 05/18] Don't check in generated conversion code Conversion is now generated by Makefile, on demand, rather than all at once. Manually verified no net change in generated code. --- .gitignore | 3 + Makefile | 216 +- federation/apis/core/conversion.go | 56 - federation/apis/core/register.go | 3 - federation/apis/core/v1/conversion.go | 82 - federation/apis/core/v1/register.go | 2 - .../v1beta1/conversion_generated.go | 296 - hack/update-codegen.sh | 31 - pkg/api/v1/conversion_generated.go | 6820 ----------------- .../apps/v1alpha1/conversion_generated.go | 156 - .../v1beta1/conversion_generated.go | 143 - .../v1beta1/conversion_generated.go | 333 - .../autoscaling/v1/conversion_generated.go | 300 - pkg/apis/batch/v1/conversion_generated.go | 330 - .../batch/v2alpha1/conversion_generated.go | 573 -- .../v1alpha1/conversion_generated.go | 237 - .../v1alpha1/conversion_generated.go | 182 - .../v1beta1/conversion_generated.go | 2539 ------ .../policy/v1alpha1/conversion_generated.go | 183 - .../rbac/v1alpha1/conversion_generated.go | 536 -- 20 files changed, 195 insertions(+), 12826 deletions(-) delete mode 100644 federation/apis/core/conversion.go delete mode 100644 federation/apis/core/v1/conversion.go delete mode 100644 federation/apis/federation/v1beta1/conversion_generated.go delete mode 100644 pkg/api/v1/conversion_generated.go delete mode 100644 pkg/apis/apps/v1alpha1/conversion_generated.go delete mode 100644 pkg/apis/authentication.k8s.io/v1beta1/conversion_generated.go delete mode 100644 pkg/apis/authorization/v1beta1/conversion_generated.go delete mode 100644 pkg/apis/autoscaling/v1/conversion_generated.go delete mode 100644 pkg/apis/batch/v1/conversion_generated.go delete mode 100644 pkg/apis/batch/v2alpha1/conversion_generated.go delete mode 100644 pkg/apis/certificates/v1alpha1/conversion_generated.go delete mode 100644 pkg/apis/componentconfig/v1alpha1/conversion_generated.go delete mode 100644 pkg/apis/extensions/v1beta1/conversion_generated.go delete mode 100644 pkg/apis/policy/v1alpha1/conversion_generated.go delete mode 100644 pkg/apis/rbac/v1alpha1/conversion_generated.go diff --git a/.gitignore b/.gitignore index 399fe07d63a..40660628ca2 100644 --- a/.gitignore +++ b/.gitignore @@ -100,3 +100,6 @@ kubernetes.tar.gz # generated files in any directory zz_generated.* + +# make-related metadata +.make.* diff --git a/Makefile b/Makefile index fde1a6621f1..4cb737befed 100644 --- a/Makefile +++ b/Makefile @@ -24,6 +24,7 @@ OUT_DIR = _output BIN_DIR := $(OUT_DIR)/bin PRJ_SRC_PATH := k8s.io/kubernetes GENERATED_FILE_PREFIX := zz_generated. +MAKE_METAFILE_PREFIX := .make. KUBE_GOFLAGS = $(GOFLAGS) export KUBE_GOFLAGS @@ -44,7 +45,9 @@ export KUBE_GOLDFLAGS # make # make all # make all WHAT=cmd/kubelet GOFLAGS=-v -all: gen_deepcopy build +# +# TODO: It's a not ideal that we build the tools on every invocation. +all: gen_deepcopy gen_conversion build .PHONY: all # Build ginkgo @@ -55,7 +58,7 @@ ginkgo: hack/make-rules/build.sh vendor/github.com/onsi/ginkgo/ginkgo .PHONY: ginkgo -# This is a helper to break circular dependencies. +# This is a helper to break circular dependencies with recursive `make` calls. build: @hack/make-rules/build.sh $(WHAT) .PHONY: build @@ -85,7 +88,7 @@ verify: # make check # make test # make check WHAT=pkg/kubelet GOFLAGS=-v -check test: gen_deepcopy +check test: gen_deepcopy gen_conversion @hack/make-rules/test.sh $(WHAT) $(TESTS) .PHONY: check test @@ -93,7 +96,7 @@ check test: gen_deepcopy # # Example: # make test-integration -test-integration: gen_deepcopy +test-integration: gen_deepcopy gen_conversion @hack/make-rules/test-integration.sh .PHONY: test-integration @@ -101,7 +104,7 @@ test-integration: gen_deepcopy # # Example: # make test-e2e -test-e2e: ginkgo gen_deepcopy +test-e2e: ginkgo gen_deepcopy gen_conversion @go run hack/e2e.go -v --build --up --test --down .PHONY: test-e2e @@ -126,9 +129,9 @@ test-e2e: ginkgo gen_deepcopy # make test-e2e-node FOCUS=kubelet SKIP=container # make test-e2e-node REMOTE=true DELETE_INSTANCES=true # Build and run tests. -test-e2e-node: ginkgo gen_deepcopy - @hack/make-rules/test-e2e-node.sh -.PHONY: test-e2e-node +test-e2e_node: ginkgo gen_deepcopy gen_conversion + @hack/make-rules/test-e2e_node.sh +.PHONY: test-e2e_node # Build and run cmdline tests. # @@ -142,12 +145,20 @@ test-cmd: # # Example: # make clean -clean: clean_generated +clean: clean_generated clean_meta build/make-clean.sh rm -rf $(OUT_DIR) rm -rf Godeps/_workspace # Just until we are sure it is gone .PHONY: clean +# Remove make-related metadata files. +# +# Example: +# make clean_meta +clean_meta: + find . -type f -name $(MAKE_METAFILE_PREFIX)\* | xargs rm -f +.PHONE: clean_meta + # Remove all auto-generated artifacts. # # Example: @@ -174,7 +185,7 @@ vet: # # Example: # make release -release: gen_deepcopy +release: gen_deepcopy gen_conversion @build/release.sh .PHONY: release @@ -182,7 +193,7 @@ release: gen_deepcopy # # Example: # make release-skip-tests -release-skip-tests quick-release: gen_deepcopy +release-skip-tests quick-release: gen_deepcopy gen_conversion @KUBE_RELEASE_RUN_TESTS=n KUBE_FASTBUILD=true build/release.sh .PHONY: release-skip-tests quick-release @@ -190,19 +201,63 @@ release-skip-tests quick-release: gen_deepcopy # Code-generation logic. # +# This variable holds a list of every directory that contains Go files in this +# project. Other rules and variables can use this as a starting point to +# reduce filesystem accesses. +ALL_GO_DIRS := $(shell \ + find . \ + -not \( \ + \( \ + -path ./vendor -o \ + -path ./_\* -o \ + -path ./.\* \ + \) -prune \ + \) \ + -type f -name \*.go \ + | sed 's|^./||' \ + | xargs dirname \ + | sort -u \ +) + +# The name of the make metadata file listing Go files. +GOFILES_METAFILE := $(MAKE_METAFILE_PREFIX)gofiles + +# Establish a dependency between the deps file and the dir. Whenever a dir +# changes (files added or removed) the deps file will be considered stale. +# +# This is looser than we really need (e.g. we don't really care about non *.go +# files or even *_test.go files), but this is much easier to represent. +# +# Because we 'sinclude' the deps file, it is considered for rebuilding, as part +# of make's normal evaluation. +# +# The '$(eval)' is needed because this has a different RHS for each LHS, and +# would otherwise produce results that make can't parse. +$(foreach dir, $(ALL_GO_DIRS), $(eval \ + $(dir)/$(GOFILES_METAFILE): $(dir) \ +)) + +# How to rebuild a deps file. When make determines that the deps file is stale +# (see above), it executes this rule, and then re-loads the deps file. +# +# This is looser than we really need (e.g. we don't really care about test +# files), but this is MUCH faster than calling `go list`. +$(foreach dir, $(ALL_GO_DIRS), $(dir)/$(GOFILES_METAFILE)): + @FILES=$$(ls $(@D)/*.go | grep -v $(GENERATED_FILE_PREFIX)); \ + echo "gofiles__$(@D) := $$(echo $${FILES})" >$@ + +# Include any deps files as additional Makefile rules. This triggers make to +# consider the deps files for rebuild, which makes the whole +# dependency-management logic work. 'sinclude' is "silent include" which does +# not fail if the file does not exist. +$(foreach dir, $(ALL_GO_DIRS), $(eval sinclude $(dir)/$(GOFILES_METAFILE))) + # 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 := $(shell \ - find . \ - -not \( \ - \( \ - -path ./vendor -o \ - -path ./$(OUT_DIR) -o \ - -path ./.git \ - \) -prune \ - \) \ - -type f -name \*.go | xargs grep -l '^// \?+k8s:' \ - ) +ALL_K8S_TAG_FILES := $(shell \ + find $(ALL_GO_DIRS) -maxdepth 1 -type f -name \*.go \ + | xargs grep -l '^// *+k8s:' \ +) # # Deep-copy generation @@ -242,8 +297,10 @@ gen_deepcopy: # # The '$(eval)' is needed because this has a different RHS for each LHS, and # would otherwise produce results that make can't parse. -$(foreach dir, $(DEEP_COPY_DIRS), \ - $(eval $(dir)/$(DEEP_COPY_FILENAME): $(shell ls $(dir)/*.go | grep -v $(GENERATED_FILE_PREFIX)))) +$(foreach dir, $(DEEP_COPY_DIRS), $(eval \ + $(dir)/$(DEEP_COPY_FILENAME): $(dir)/$(GOFILES_METAFILE) \ + $(gofiles__$(dir)) \ +)) # For each dir in DEEP_COPY_DIRS, handle deep-copy generation. # This has to be done in two steps because wildcards don't seem to work in @@ -253,3 +310,114 @@ $(addsuffix /$(DEEP_COPY_FILENAME), $(DEEP_COPY_DIRS)): -i $(PRJ_SRC_PATH)/$$(dirname $@) \ --bounding-dirs $(PRJ_SRC_PATH) \ -O $(DEEP_COPY_BASENAME) + +# +# Conversion generation +# +# Any package that wants conversion functions generated must include one or +# more comment-tags in any .go file, in column 0, of the form: +# // +k8s:conversion-gen= +# +# The CONVERSION_TARGET_DIR is a project-local path to another directory which +# should be considered when evaluating peer types for conversions. Types which +# are found in the source package (where conversions are being generated) +# but do not have a peer in one of the target directories will not have +# conversions generated. +# +# TODO: it might be better in the long term to make peer-types explicit in the +# IDL. + +# All directories that request any form of conversion generation. +CONVERSION_DIRS := $(shell \ + grep '^// *+k8s:conversion-gen=' $(ALL_K8S_TAG_FILES) \ + | cut -f1 -d: \ + | xargs dirname \ + | sort -u \ + ) + +# The result file, in each pkg, of conversion generation. +CONVERSION_BASENAME := $(GENERATED_FILE_PREFIX)conversion +CONVERSION_FILENAME := $(CONVERSION_BASENAME).go + +# The name of the make metadata file controlling conversions. +CONVERSIONS_METAFILE := $(MAKE_METAFILE_PREFIX)conversions + +# Unfortunately there's not a good way to use Go's build tools to check +# if a binary needs to be rebuilt. We just have to try it. +gen_conversion: + @$(MAKE) -s build WHAT=cmd/libs/go2idl/conversion-gen + @$(MAKE) -s $(addsuffix /$(CONVERSION_FILENAME), $(CONVERSION_DIRS)) + +# Establish a dependency between the deps file and the dir. Whenever a dir +# changes (files added or removed) the deps file will be considered stale. +# +# This is looser than we really need (e.g. we don't really care about non *.go +# files or even *_test.go files), but this is much easier to represent. +# +# Because we 'sinclude' the deps file, it is considered for rebuilding, as part +# of make's normal evaluation. +# +# The '$(eval)' is needed because this has a different RHS for each LHS, and +# would otherwise produce results that make can't parse. +$(foreach dir, $(CONVERSION_DIRS), $(eval $(dir)/$(CONVERSIONS_METAFILE): $(dir))) + +# How to rebuild a deps file. When make determines that the deps file is stale +# (see above), it executes this rule, and then re-loads the deps file. +# +# This is looser than we really need (e.g. we don't really care about test +# files), but this is MUCH faster than calling `go list`. +$(foreach dir, $(CONVERSION_DIRS), $(dir)/$(CONVERSIONS_METAFILE)): + @TAGS=$$(grep -h '^// *+k8s:conversion-gen=' $(@D)/*.go \ + | cut -f2- -d= \ + | sed 's|$(PRJ_SRC_PATH)/||'); \ + echo "conversions__$(@D) := $$(echo $${TAGS})" >$@ + +# Include any deps files as additional Makefile rules. This triggers make to +# consider the deps files for rebuild, which makes the whole +# dependency-management logic work. 'sinclude' is "silent include" which does +# not fail if the file does not exist. +$(foreach dir, $(CONVERSION_DIRS), $(eval sinclude $(dir)/$(CONVERSIONS_METAFILE))) + +# For each dir in CONVERSION_DIRS, this generates a statement of the form: +# path/to/dir/$(CONVERSION_FILENAME): path/to/dir/$(GOFILES_METAFILE) \ +# $(gofiles__path/to/dir) +# The variable value was set in $(GOFILES_METAFILE) and included as part of the +# dependency management logic. +# +# Note that this is a deps-only statement, not a full rule (see below). +# This has to be done in a distinct step because wildcards don't seem to work +# in static pattern rules. +# +# The '$(eval)' is needed because this has a different RHS for each LHS, and +# would otherwise produce results that make can't parse. +$(foreach dir, $(CONVERSION_DIRS), $(eval \ + $(dir)/$(CONVERSION_FILENAME): $(dir)/$(GOFILES_METAFILE) \ + $(gofiles__$(dir)) \ +)) + +# For each dir in CONVERSION_DIRS, for each target in $(conversions__$(dir)), +# this generates a statement of the form: +# path/to/dir/$(CONVERSION_FILENAME): /path/to/target/$(GOFILES_METAFILE) \ +# $(gofiles__path/to/target/) +# The variable value was set in $(GOFILES_METAFILE) and included as part of the +# dependency management logic. +# +# Note that this is a deps-only statement, not a full rule (see below). +# This has to be done in a distinct step because wildcards don't seem to work +# in static pattern rules. +# +# The '$(eval)' is needed because this has a different RHS for each LHS, and +# would otherwise produce results that make can't parse. +$(foreach dir, $(CONVERSION_DIRS), \ + $(foreach tgt, $(conversions__$(dir)), $(eval \ + $(dir)/$(CONVERSION_FILENAME): $(tgt)/$(GOFILES_METAFILE) \ + $(gofiles__$(tgt)) \ + )) \ +) + +# For each dir in CONVERSION_DIRS, this generates a rule to auto-generate +# conversion code. Dependencies of the target have been populated above. +$(addsuffix /$(CONVERSION_FILENAME), $(CONVERSION_DIRS)): + @$(BIN_DIR)/conversion-gen \ + -i $(PRJ_SRC_PATH)/$(@D) \ + -O $(CONVERSION_BASENAME) diff --git a/federation/apis/core/conversion.go b/federation/apis/core/conversion.go deleted file mode 100644 index 925fba54f2f..00000000000 --- a/federation/apis/core/conversion.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -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, - ) -} diff --git a/federation/apis/core/register.go b/federation/apis/core/register.go index c4d1c289e08..e3345bfc8f0 100644 --- a/federation/apis/core/register.go +++ b/federation/apis/core/register.go @@ -72,7 +72,4 @@ func AddToScheme(scheme *runtime.Scheme) { &unversioned.APIGroup{}, &unversioned.APIResourceList{}, ) - - addDefaultingFuncs(scheme) - addConversionFuncs(scheme) } diff --git a/federation/apis/core/v1/conversion.go b/federation/apis/core/v1/conversion.go deleted file mode 100644 index 1e73e668f5e..00000000000 --- a/federation/apis/core/v1/conversion.go +++ /dev/null @@ -1,82 +0,0 @@ -/* -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) - } - } -} diff --git a/federation/apis/core/v1/register.go b/federation/apis/core/v1/register.go index 30054870f24..48655967327 100644 --- a/federation/apis/core/v1/register.go +++ b/federation/apis/core/v1/register.go @@ -32,8 +32,6 @@ var SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: "v1 func AddToScheme(scheme *runtime.Scheme) { // Add the API to Scheme. addKnownTypes(scheme) - addConversionFuncs(scheme) - addDefaultingFuncs(scheme) } // Adds the list of known types to api.Scheme. diff --git a/federation/apis/federation/v1beta1/conversion_generated.go b/federation/apis/federation/v1beta1/conversion_generated.go deleted file mode 100644 index fa582e3a6cf..00000000000 --- a/federation/apis/federation/v1beta1/conversion_generated.go +++ /dev/null @@ -1,296 +0,0 @@ -// +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 ( - federation "k8s.io/kubernetes/federation/apis/federation" - api "k8s.io/kubernetes/pkg/api" - v1 "k8s.io/kubernetes/pkg/api/v1" - conversion "k8s.io/kubernetes/pkg/conversion" -) - -func init() { - if err := api.Scheme.AddGeneratedConversionFuncs( - Convert_v1beta1_Cluster_To_federation_Cluster, - Convert_federation_Cluster_To_v1beta1_Cluster, - Convert_v1beta1_ClusterCondition_To_federation_ClusterCondition, - Convert_federation_ClusterCondition_To_v1beta1_ClusterCondition, - Convert_v1beta1_ClusterList_To_federation_ClusterList, - Convert_federation_ClusterList_To_v1beta1_ClusterList, - Convert_v1beta1_ClusterSpec_To_federation_ClusterSpec, - Convert_federation_ClusterSpec_To_v1beta1_ClusterSpec, - Convert_v1beta1_ClusterStatus_To_federation_ClusterStatus, - Convert_federation_ClusterStatus_To_v1beta1_ClusterStatus, - Convert_v1beta1_ServerAddressByClientCIDR_To_federation_ServerAddressByClientCIDR, - Convert_federation_ServerAddressByClientCIDR_To_v1beta1_ServerAddressByClientCIDR, - ); err != nil { - // if one of the conversion functions is malformed, detect it immediately. - panic(err) - } -} - -func autoConvert_v1beta1_Cluster_To_federation_Cluster(in *Cluster, out *federation.Cluster, 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_v1beta1_ClusterSpec_To_federation_ClusterSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_ClusterStatus_To_federation_ClusterStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_v1beta1_Cluster_To_federation_Cluster(in *Cluster, out *federation.Cluster, s conversion.Scope) error { - return autoConvert_v1beta1_Cluster_To_federation_Cluster(in, out, s) -} - -func autoConvert_federation_Cluster_To_v1beta1_Cluster(in *federation.Cluster, out *Cluster, 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_federation_ClusterSpec_To_v1beta1_ClusterSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_federation_ClusterStatus_To_v1beta1_ClusterStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_federation_Cluster_To_v1beta1_Cluster(in *federation.Cluster, out *Cluster, s conversion.Scope) error { - return autoConvert_federation_Cluster_To_v1beta1_Cluster(in, out, s) -} - -func autoConvert_v1beta1_ClusterCondition_To_federation_ClusterCondition(in *ClusterCondition, out *federation.ClusterCondition, s conversion.Scope) error { - out.Type = federation.ClusterConditionType(in.Type) - out.Status = api.ConditionStatus(in.Status) - if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastProbeTime, &out.LastProbeTime, s); err != nil { - return err - } - if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastTransitionTime, &out.LastTransitionTime, s); err != nil { - return err - } - out.Reason = in.Reason - out.Message = in.Message - return nil -} - -func Convert_v1beta1_ClusterCondition_To_federation_ClusterCondition(in *ClusterCondition, out *federation.ClusterCondition, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterCondition_To_federation_ClusterCondition(in, out, s) -} - -func autoConvert_federation_ClusterCondition_To_v1beta1_ClusterCondition(in *federation.ClusterCondition, out *ClusterCondition, s conversion.Scope) error { - out.Type = ClusterConditionType(in.Type) - out.Status = v1.ConditionStatus(in.Status) - if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastProbeTime, &out.LastProbeTime, s); err != nil { - return err - } - if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastTransitionTime, &out.LastTransitionTime, s); err != nil { - return err - } - out.Reason = in.Reason - out.Message = in.Message - return nil -} - -func Convert_federation_ClusterCondition_To_v1beta1_ClusterCondition(in *federation.ClusterCondition, out *ClusterCondition, s conversion.Scope) error { - return autoConvert_federation_ClusterCondition_To_v1beta1_ClusterCondition(in, out, s) -} - -func autoConvert_v1beta1_ClusterList_To_federation_ClusterList(in *ClusterList, out *federation.ClusterList, 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([]federation.Cluster, len(*in)) - for i := range *in { - if err := Convert_v1beta1_Cluster_To_federation_Cluster(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1beta1_ClusterList_To_federation_ClusterList(in *ClusterList, out *federation.ClusterList, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterList_To_federation_ClusterList(in, out, s) -} - -func autoConvert_federation_ClusterList_To_v1beta1_ClusterList(in *federation.ClusterList, out *ClusterList, 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([]Cluster, len(*in)) - for i := range *in { - if err := Convert_federation_Cluster_To_v1beta1_Cluster(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_federation_ClusterList_To_v1beta1_ClusterList(in *federation.ClusterList, out *ClusterList, s conversion.Scope) error { - return autoConvert_federation_ClusterList_To_v1beta1_ClusterList(in, out, s) -} - -func autoConvert_v1beta1_ClusterSpec_To_federation_ClusterSpec(in *ClusterSpec, out *federation.ClusterSpec, s conversion.Scope) error { - if in.ServerAddressByClientCIDRs != nil { - in, out := &in.ServerAddressByClientCIDRs, &out.ServerAddressByClientCIDRs - *out = make([]federation.ServerAddressByClientCIDR, len(*in)) - for i := range *in { - if err := Convert_v1beta1_ServerAddressByClientCIDR_To_federation_ServerAddressByClientCIDR(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.ServerAddressByClientCIDRs = nil - } - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - *out = new(api.LocalObjectReference) - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(*in, *out, 0); err != nil { - return err - } - } else { - out.SecretRef = nil - } - return nil -} - -func Convert_v1beta1_ClusterSpec_To_federation_ClusterSpec(in *ClusterSpec, out *federation.ClusterSpec, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterSpec_To_federation_ClusterSpec(in, out, s) -} - -func autoConvert_federation_ClusterSpec_To_v1beta1_ClusterSpec(in *federation.ClusterSpec, out *ClusterSpec, s conversion.Scope) error { - if in.ServerAddressByClientCIDRs != nil { - in, out := &in.ServerAddressByClientCIDRs, &out.ServerAddressByClientCIDRs - *out = make([]ServerAddressByClientCIDR, len(*in)) - for i := range *in { - if err := Convert_federation_ServerAddressByClientCIDR_To_v1beta1_ServerAddressByClientCIDR(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.ServerAddressByClientCIDRs = nil - } - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - *out = new(v1.LocalObjectReference) - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(*in, *out, 0); err != nil { - return err - } - } else { - out.SecretRef = nil - } - return nil -} - -func Convert_federation_ClusterSpec_To_v1beta1_ClusterSpec(in *federation.ClusterSpec, out *ClusterSpec, s conversion.Scope) error { - return autoConvert_federation_ClusterSpec_To_v1beta1_ClusterSpec(in, out, s) -} - -func autoConvert_v1beta1_ClusterStatus_To_federation_ClusterStatus(in *ClusterStatus, out *federation.ClusterStatus, s conversion.Scope) error { - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]federation.ClusterCondition, len(*in)) - for i := range *in { - if err := Convert_v1beta1_ClusterCondition_To_federation_ClusterCondition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - out.Zones = in.Zones - out.Region = in.Region - return nil -} - -func Convert_v1beta1_ClusterStatus_To_federation_ClusterStatus(in *ClusterStatus, out *federation.ClusterStatus, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterStatus_To_federation_ClusterStatus(in, out, s) -} - -func autoConvert_federation_ClusterStatus_To_v1beta1_ClusterStatus(in *federation.ClusterStatus, out *ClusterStatus, s conversion.Scope) error { - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]ClusterCondition, len(*in)) - for i := range *in { - if err := Convert_federation_ClusterCondition_To_v1beta1_ClusterCondition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - out.Zones = in.Zones - out.Region = in.Region - return nil -} - -func Convert_federation_ClusterStatus_To_v1beta1_ClusterStatus(in *federation.ClusterStatus, out *ClusterStatus, s conversion.Scope) error { - return autoConvert_federation_ClusterStatus_To_v1beta1_ClusterStatus(in, out, s) -} - -func autoConvert_v1beta1_ServerAddressByClientCIDR_To_federation_ServerAddressByClientCIDR(in *ServerAddressByClientCIDR, out *federation.ServerAddressByClientCIDR, s conversion.Scope) error { - out.ClientCIDR = in.ClientCIDR - out.ServerAddress = in.ServerAddress - return nil -} - -func Convert_v1beta1_ServerAddressByClientCIDR_To_federation_ServerAddressByClientCIDR(in *ServerAddressByClientCIDR, out *federation.ServerAddressByClientCIDR, s conversion.Scope) error { - return autoConvert_v1beta1_ServerAddressByClientCIDR_To_federation_ServerAddressByClientCIDR(in, out, s) -} - -func autoConvert_federation_ServerAddressByClientCIDR_To_v1beta1_ServerAddressByClientCIDR(in *federation.ServerAddressByClientCIDR, out *ServerAddressByClientCIDR, s conversion.Scope) error { - out.ClientCIDR = in.ClientCIDR - out.ServerAddress = in.ServerAddress - return nil -} - -func Convert_federation_ServerAddressByClientCIDR_To_v1beta1_ServerAddressByClientCIDR(in *federation.ServerAddressByClientCIDR, out *ServerAddressByClientCIDR, s conversion.Scope) error { - return autoConvert_federation_ServerAddressByClientCIDR_To_v1beta1_ServerAddressByClientCIDR(in, out, s) -} diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index f7946249605..8eb38f23869 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -25,13 +25,11 @@ kube::golang::setup_env BUILD_TARGETS=( cmd/libs/go2idl/client-gen - cmd/libs/go2idl/conversion-gen cmd/libs/go2idl/set-gen ) make -C "${KUBE_ROOT}" WHAT="${BUILD_TARGETS[*]}" clientgen=$(kube::util::find-binary "client-gen") -conversiongen=$(kube::util::find-binary "conversion-gen") setgen=$(kube::util::find-binary "set-gen") # Please do not add any logic to this shell script. Add logic to the go code @@ -48,32 +46,3 @@ ${clientgen} --clientset-name=federation_release_1_4 --clientset-path=k8s.io/kub ${setgen} "$@" # 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|^./||' - ) - ) -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} diff --git a/pkg/api/v1/conversion_generated.go b/pkg/api/v1/conversion_generated.go deleted file mode 100644 index a9cb349c0d3..00000000000 --- a/pkg/api/v1/conversion_generated.go +++ /dev/null @@ -1,6820 +0,0 @@ -// +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 v1 - -import ( - api "k8s.io/kubernetes/pkg/api" - resource "k8s.io/kubernetes/pkg/api/resource" - conversion "k8s.io/kubernetes/pkg/conversion" - runtime "k8s.io/kubernetes/pkg/runtime" - types "k8s.io/kubernetes/pkg/types" -) - -func init() { - if err := api.Scheme.AddGeneratedConversionFuncs( - Convert_v1_AWSElasticBlockStoreVolumeSource_To_api_AWSElasticBlockStoreVolumeSource, - Convert_api_AWSElasticBlockStoreVolumeSource_To_v1_AWSElasticBlockStoreVolumeSource, - Convert_v1_Affinity_To_api_Affinity, - Convert_api_Affinity_To_v1_Affinity, - Convert_v1_AttachedVolume_To_api_AttachedVolume, - Convert_api_AttachedVolume_To_v1_AttachedVolume, - Convert_v1_AzureFileVolumeSource_To_api_AzureFileVolumeSource, - Convert_api_AzureFileVolumeSource_To_v1_AzureFileVolumeSource, - Convert_v1_Binding_To_api_Binding, - Convert_api_Binding_To_v1_Binding, - Convert_v1_Capabilities_To_api_Capabilities, - Convert_api_Capabilities_To_v1_Capabilities, - Convert_v1_CephFSVolumeSource_To_api_CephFSVolumeSource, - Convert_api_CephFSVolumeSource_To_v1_CephFSVolumeSource, - Convert_v1_CinderVolumeSource_To_api_CinderVolumeSource, - Convert_api_CinderVolumeSource_To_v1_CinderVolumeSource, - Convert_v1_ComponentCondition_To_api_ComponentCondition, - Convert_api_ComponentCondition_To_v1_ComponentCondition, - Convert_v1_ComponentStatus_To_api_ComponentStatus, - Convert_api_ComponentStatus_To_v1_ComponentStatus, - Convert_v1_ComponentStatusList_To_api_ComponentStatusList, - Convert_api_ComponentStatusList_To_v1_ComponentStatusList, - Convert_v1_ConfigMap_To_api_ConfigMap, - Convert_api_ConfigMap_To_v1_ConfigMap, - Convert_v1_ConfigMapKeySelector_To_api_ConfigMapKeySelector, - Convert_api_ConfigMapKeySelector_To_v1_ConfigMapKeySelector, - Convert_v1_ConfigMapList_To_api_ConfigMapList, - Convert_api_ConfigMapList_To_v1_ConfigMapList, - Convert_v1_ConfigMapVolumeSource_To_api_ConfigMapVolumeSource, - Convert_api_ConfigMapVolumeSource_To_v1_ConfigMapVolumeSource, - Convert_v1_Container_To_api_Container, - Convert_api_Container_To_v1_Container, - Convert_v1_ContainerImage_To_api_ContainerImage, - Convert_api_ContainerImage_To_v1_ContainerImage, - Convert_v1_ContainerPort_To_api_ContainerPort, - Convert_api_ContainerPort_To_v1_ContainerPort, - Convert_v1_ContainerState_To_api_ContainerState, - Convert_api_ContainerState_To_v1_ContainerState, - Convert_v1_ContainerStateRunning_To_api_ContainerStateRunning, - Convert_api_ContainerStateRunning_To_v1_ContainerStateRunning, - Convert_v1_ContainerStateTerminated_To_api_ContainerStateTerminated, - Convert_api_ContainerStateTerminated_To_v1_ContainerStateTerminated, - Convert_v1_ContainerStateWaiting_To_api_ContainerStateWaiting, - Convert_api_ContainerStateWaiting_To_v1_ContainerStateWaiting, - Convert_v1_ContainerStatus_To_api_ContainerStatus, - Convert_api_ContainerStatus_To_v1_ContainerStatus, - Convert_v1_DaemonEndpoint_To_api_DaemonEndpoint, - Convert_api_DaemonEndpoint_To_v1_DaemonEndpoint, - Convert_v1_DeleteOptions_To_api_DeleteOptions, - Convert_api_DeleteOptions_To_v1_DeleteOptions, - Convert_v1_DownwardAPIVolumeFile_To_api_DownwardAPIVolumeFile, - Convert_api_DownwardAPIVolumeFile_To_v1_DownwardAPIVolumeFile, - Convert_v1_DownwardAPIVolumeSource_To_api_DownwardAPIVolumeSource, - Convert_api_DownwardAPIVolumeSource_To_v1_DownwardAPIVolumeSource, - Convert_v1_EmptyDirVolumeSource_To_api_EmptyDirVolumeSource, - Convert_api_EmptyDirVolumeSource_To_v1_EmptyDirVolumeSource, - Convert_v1_EndpointAddress_To_api_EndpointAddress, - Convert_api_EndpointAddress_To_v1_EndpointAddress, - Convert_v1_EndpointPort_To_api_EndpointPort, - Convert_api_EndpointPort_To_v1_EndpointPort, - Convert_v1_EndpointSubset_To_api_EndpointSubset, - Convert_api_EndpointSubset_To_v1_EndpointSubset, - Convert_v1_Endpoints_To_api_Endpoints, - Convert_api_Endpoints_To_v1_Endpoints, - Convert_v1_EndpointsList_To_api_EndpointsList, - Convert_api_EndpointsList_To_v1_EndpointsList, - Convert_v1_EnvVar_To_api_EnvVar, - Convert_api_EnvVar_To_v1_EnvVar, - Convert_v1_EnvVarSource_To_api_EnvVarSource, - Convert_api_EnvVarSource_To_v1_EnvVarSource, - Convert_v1_Event_To_api_Event, - Convert_api_Event_To_v1_Event, - Convert_v1_EventList_To_api_EventList, - Convert_api_EventList_To_v1_EventList, - Convert_v1_EventSource_To_api_EventSource, - Convert_api_EventSource_To_v1_EventSource, - Convert_v1_ExecAction_To_api_ExecAction, - Convert_api_ExecAction_To_v1_ExecAction, - Convert_v1_ExportOptions_To_api_ExportOptions, - Convert_api_ExportOptions_To_v1_ExportOptions, - Convert_v1_FCVolumeSource_To_api_FCVolumeSource, - Convert_api_FCVolumeSource_To_v1_FCVolumeSource, - Convert_v1_FlexVolumeSource_To_api_FlexVolumeSource, - Convert_api_FlexVolumeSource_To_v1_FlexVolumeSource, - Convert_v1_FlockerVolumeSource_To_api_FlockerVolumeSource, - Convert_api_FlockerVolumeSource_To_v1_FlockerVolumeSource, - Convert_v1_GCEPersistentDiskVolumeSource_To_api_GCEPersistentDiskVolumeSource, - Convert_api_GCEPersistentDiskVolumeSource_To_v1_GCEPersistentDiskVolumeSource, - Convert_v1_GitRepoVolumeSource_To_api_GitRepoVolumeSource, - Convert_api_GitRepoVolumeSource_To_v1_GitRepoVolumeSource, - Convert_v1_GlusterfsVolumeSource_To_api_GlusterfsVolumeSource, - Convert_api_GlusterfsVolumeSource_To_v1_GlusterfsVolumeSource, - Convert_v1_HTTPGetAction_To_api_HTTPGetAction, - Convert_api_HTTPGetAction_To_v1_HTTPGetAction, - Convert_v1_HTTPHeader_To_api_HTTPHeader, - Convert_api_HTTPHeader_To_v1_HTTPHeader, - Convert_v1_Handler_To_api_Handler, - Convert_api_Handler_To_v1_Handler, - Convert_v1_HostPathVolumeSource_To_api_HostPathVolumeSource, - Convert_api_HostPathVolumeSource_To_v1_HostPathVolumeSource, - Convert_v1_ISCSIVolumeSource_To_api_ISCSIVolumeSource, - Convert_api_ISCSIVolumeSource_To_v1_ISCSIVolumeSource, - Convert_v1_KeyToPath_To_api_KeyToPath, - Convert_api_KeyToPath_To_v1_KeyToPath, - Convert_v1_Lifecycle_To_api_Lifecycle, - Convert_api_Lifecycle_To_v1_Lifecycle, - Convert_v1_LimitRange_To_api_LimitRange, - Convert_api_LimitRange_To_v1_LimitRange, - Convert_v1_LimitRangeItem_To_api_LimitRangeItem, - Convert_api_LimitRangeItem_To_v1_LimitRangeItem, - Convert_v1_LimitRangeList_To_api_LimitRangeList, - Convert_api_LimitRangeList_To_v1_LimitRangeList, - Convert_v1_LimitRangeSpec_To_api_LimitRangeSpec, - Convert_api_LimitRangeSpec_To_v1_LimitRangeSpec, - Convert_v1_List_To_api_List, - Convert_api_List_To_v1_List, - Convert_v1_ListOptions_To_api_ListOptions, - Convert_api_ListOptions_To_v1_ListOptions, - Convert_v1_LoadBalancerIngress_To_api_LoadBalancerIngress, - Convert_api_LoadBalancerIngress_To_v1_LoadBalancerIngress, - Convert_v1_LoadBalancerStatus_To_api_LoadBalancerStatus, - Convert_api_LoadBalancerStatus_To_v1_LoadBalancerStatus, - Convert_v1_LocalObjectReference_To_api_LocalObjectReference, - Convert_api_LocalObjectReference_To_v1_LocalObjectReference, - Convert_v1_NFSVolumeSource_To_api_NFSVolumeSource, - Convert_api_NFSVolumeSource_To_v1_NFSVolumeSource, - Convert_v1_Namespace_To_api_Namespace, - Convert_api_Namespace_To_v1_Namespace, - Convert_v1_NamespaceList_To_api_NamespaceList, - Convert_api_NamespaceList_To_v1_NamespaceList, - Convert_v1_NamespaceSpec_To_api_NamespaceSpec, - Convert_api_NamespaceSpec_To_v1_NamespaceSpec, - Convert_v1_NamespaceStatus_To_api_NamespaceStatus, - Convert_api_NamespaceStatus_To_v1_NamespaceStatus, - Convert_v1_Node_To_api_Node, - Convert_api_Node_To_v1_Node, - Convert_v1_NodeAddress_To_api_NodeAddress, - Convert_api_NodeAddress_To_v1_NodeAddress, - Convert_v1_NodeAffinity_To_api_NodeAffinity, - Convert_api_NodeAffinity_To_v1_NodeAffinity, - Convert_v1_NodeCondition_To_api_NodeCondition, - Convert_api_NodeCondition_To_v1_NodeCondition, - Convert_v1_NodeDaemonEndpoints_To_api_NodeDaemonEndpoints, - Convert_api_NodeDaemonEndpoints_To_v1_NodeDaemonEndpoints, - Convert_v1_NodeList_To_api_NodeList, - Convert_api_NodeList_To_v1_NodeList, - Convert_v1_NodeProxyOptions_To_api_NodeProxyOptions, - Convert_api_NodeProxyOptions_To_v1_NodeProxyOptions, - Convert_v1_NodeSelector_To_api_NodeSelector, - Convert_api_NodeSelector_To_v1_NodeSelector, - Convert_v1_NodeSelectorRequirement_To_api_NodeSelectorRequirement, - Convert_api_NodeSelectorRequirement_To_v1_NodeSelectorRequirement, - Convert_v1_NodeSelectorTerm_To_api_NodeSelectorTerm, - Convert_api_NodeSelectorTerm_To_v1_NodeSelectorTerm, - Convert_v1_NodeSpec_To_api_NodeSpec, - Convert_api_NodeSpec_To_v1_NodeSpec, - Convert_v1_NodeStatus_To_api_NodeStatus, - Convert_api_NodeStatus_To_v1_NodeStatus, - Convert_v1_NodeSystemInfo_To_api_NodeSystemInfo, - Convert_api_NodeSystemInfo_To_v1_NodeSystemInfo, - Convert_v1_ObjectFieldSelector_To_api_ObjectFieldSelector, - Convert_api_ObjectFieldSelector_To_v1_ObjectFieldSelector, - Convert_v1_ObjectMeta_To_api_ObjectMeta, - Convert_api_ObjectMeta_To_v1_ObjectMeta, - Convert_v1_ObjectReference_To_api_ObjectReference, - Convert_api_ObjectReference_To_v1_ObjectReference, - Convert_v1_OwnerReference_To_api_OwnerReference, - Convert_api_OwnerReference_To_v1_OwnerReference, - Convert_v1_PersistentVolume_To_api_PersistentVolume, - Convert_api_PersistentVolume_To_v1_PersistentVolume, - Convert_v1_PersistentVolumeClaim_To_api_PersistentVolumeClaim, - Convert_api_PersistentVolumeClaim_To_v1_PersistentVolumeClaim, - Convert_v1_PersistentVolumeClaimList_To_api_PersistentVolumeClaimList, - Convert_api_PersistentVolumeClaimList_To_v1_PersistentVolumeClaimList, - Convert_v1_PersistentVolumeClaimSpec_To_api_PersistentVolumeClaimSpec, - Convert_api_PersistentVolumeClaimSpec_To_v1_PersistentVolumeClaimSpec, - Convert_v1_PersistentVolumeClaimStatus_To_api_PersistentVolumeClaimStatus, - Convert_api_PersistentVolumeClaimStatus_To_v1_PersistentVolumeClaimStatus, - Convert_v1_PersistentVolumeClaimVolumeSource_To_api_PersistentVolumeClaimVolumeSource, - Convert_api_PersistentVolumeClaimVolumeSource_To_v1_PersistentVolumeClaimVolumeSource, - Convert_v1_PersistentVolumeList_To_api_PersistentVolumeList, - Convert_api_PersistentVolumeList_To_v1_PersistentVolumeList, - Convert_v1_PersistentVolumeSource_To_api_PersistentVolumeSource, - Convert_api_PersistentVolumeSource_To_v1_PersistentVolumeSource, - Convert_v1_PersistentVolumeSpec_To_api_PersistentVolumeSpec, - Convert_api_PersistentVolumeSpec_To_v1_PersistentVolumeSpec, - Convert_v1_PersistentVolumeStatus_To_api_PersistentVolumeStatus, - Convert_api_PersistentVolumeStatus_To_v1_PersistentVolumeStatus, - Convert_v1_Pod_To_api_Pod, - Convert_api_Pod_To_v1_Pod, - Convert_v1_PodAffinity_To_api_PodAffinity, - Convert_api_PodAffinity_To_v1_PodAffinity, - Convert_v1_PodAffinityTerm_To_api_PodAffinityTerm, - Convert_api_PodAffinityTerm_To_v1_PodAffinityTerm, - Convert_v1_PodAntiAffinity_To_api_PodAntiAffinity, - Convert_api_PodAntiAffinity_To_v1_PodAntiAffinity, - Convert_v1_PodAttachOptions_To_api_PodAttachOptions, - Convert_api_PodAttachOptions_To_v1_PodAttachOptions, - Convert_v1_PodCondition_To_api_PodCondition, - Convert_api_PodCondition_To_v1_PodCondition, - Convert_v1_PodExecOptions_To_api_PodExecOptions, - Convert_api_PodExecOptions_To_v1_PodExecOptions, - Convert_v1_PodList_To_api_PodList, - Convert_api_PodList_To_v1_PodList, - Convert_v1_PodLogOptions_To_api_PodLogOptions, - Convert_api_PodLogOptions_To_v1_PodLogOptions, - Convert_v1_PodProxyOptions_To_api_PodProxyOptions, - Convert_api_PodProxyOptions_To_v1_PodProxyOptions, - Convert_v1_PodSecurityContext_To_api_PodSecurityContext, - Convert_api_PodSecurityContext_To_v1_PodSecurityContext, - Convert_v1_PodSpec_To_api_PodSpec, - Convert_api_PodSpec_To_v1_PodSpec, - Convert_v1_PodStatus_To_api_PodStatus, - Convert_api_PodStatus_To_v1_PodStatus, - Convert_v1_PodStatusResult_To_api_PodStatusResult, - Convert_api_PodStatusResult_To_v1_PodStatusResult, - Convert_v1_PodTemplate_To_api_PodTemplate, - Convert_api_PodTemplate_To_v1_PodTemplate, - Convert_v1_PodTemplateList_To_api_PodTemplateList, - Convert_api_PodTemplateList_To_v1_PodTemplateList, - Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec, - Convert_api_PodTemplateSpec_To_v1_PodTemplateSpec, - Convert_v1_Preconditions_To_api_Preconditions, - Convert_api_Preconditions_To_v1_Preconditions, - Convert_v1_PreferredSchedulingTerm_To_api_PreferredSchedulingTerm, - Convert_api_PreferredSchedulingTerm_To_v1_PreferredSchedulingTerm, - Convert_v1_Probe_To_api_Probe, - Convert_api_Probe_To_v1_Probe, - Convert_v1_RBDVolumeSource_To_api_RBDVolumeSource, - Convert_api_RBDVolumeSource_To_v1_RBDVolumeSource, - Convert_v1_RangeAllocation_To_api_RangeAllocation, - Convert_api_RangeAllocation_To_v1_RangeAllocation, - Convert_v1_ReplicationController_To_api_ReplicationController, - Convert_api_ReplicationController_To_v1_ReplicationController, - Convert_v1_ReplicationControllerList_To_api_ReplicationControllerList, - Convert_api_ReplicationControllerList_To_v1_ReplicationControllerList, - Convert_v1_ReplicationControllerSpec_To_api_ReplicationControllerSpec, - Convert_api_ReplicationControllerSpec_To_v1_ReplicationControllerSpec, - Convert_v1_ReplicationControllerStatus_To_api_ReplicationControllerStatus, - Convert_api_ReplicationControllerStatus_To_v1_ReplicationControllerStatus, - Convert_v1_ResourceFieldSelector_To_api_ResourceFieldSelector, - Convert_api_ResourceFieldSelector_To_v1_ResourceFieldSelector, - Convert_v1_ResourceQuota_To_api_ResourceQuota, - Convert_api_ResourceQuota_To_v1_ResourceQuota, - Convert_v1_ResourceQuotaList_To_api_ResourceQuotaList, - Convert_api_ResourceQuotaList_To_v1_ResourceQuotaList, - Convert_v1_ResourceQuotaSpec_To_api_ResourceQuotaSpec, - Convert_api_ResourceQuotaSpec_To_v1_ResourceQuotaSpec, - Convert_v1_ResourceQuotaStatus_To_api_ResourceQuotaStatus, - Convert_api_ResourceQuotaStatus_To_v1_ResourceQuotaStatus, - Convert_v1_ResourceRequirements_To_api_ResourceRequirements, - Convert_api_ResourceRequirements_To_v1_ResourceRequirements, - Convert_v1_SELinuxOptions_To_api_SELinuxOptions, - Convert_api_SELinuxOptions_To_v1_SELinuxOptions, - Convert_v1_Secret_To_api_Secret, - Convert_api_Secret_To_v1_Secret, - Convert_v1_SecretKeySelector_To_api_SecretKeySelector, - Convert_api_SecretKeySelector_To_v1_SecretKeySelector, - Convert_v1_SecretList_To_api_SecretList, - Convert_api_SecretList_To_v1_SecretList, - Convert_v1_SecretVolumeSource_To_api_SecretVolumeSource, - Convert_api_SecretVolumeSource_To_v1_SecretVolumeSource, - Convert_v1_SecurityContext_To_api_SecurityContext, - Convert_api_SecurityContext_To_v1_SecurityContext, - Convert_v1_SerializedReference_To_api_SerializedReference, - Convert_api_SerializedReference_To_v1_SerializedReference, - Convert_v1_Service_To_api_Service, - Convert_api_Service_To_v1_Service, - Convert_v1_ServiceAccount_To_api_ServiceAccount, - Convert_api_ServiceAccount_To_v1_ServiceAccount, - Convert_v1_ServiceAccountList_To_api_ServiceAccountList, - Convert_api_ServiceAccountList_To_v1_ServiceAccountList, - Convert_v1_ServiceList_To_api_ServiceList, - Convert_api_ServiceList_To_v1_ServiceList, - Convert_v1_ServicePort_To_api_ServicePort, - Convert_api_ServicePort_To_v1_ServicePort, - Convert_v1_ServiceProxyOptions_To_api_ServiceProxyOptions, - Convert_api_ServiceProxyOptions_To_v1_ServiceProxyOptions, - Convert_v1_ServiceSpec_To_api_ServiceSpec, - Convert_api_ServiceSpec_To_v1_ServiceSpec, - Convert_v1_ServiceStatus_To_api_ServiceStatus, - Convert_api_ServiceStatus_To_v1_ServiceStatus, - Convert_v1_TCPSocketAction_To_api_TCPSocketAction, - Convert_api_TCPSocketAction_To_v1_TCPSocketAction, - Convert_v1_Taint_To_api_Taint, - Convert_api_Taint_To_v1_Taint, - Convert_v1_Toleration_To_api_Toleration, - Convert_api_Toleration_To_v1_Toleration, - Convert_v1_Volume_To_api_Volume, - Convert_api_Volume_To_v1_Volume, - Convert_v1_VolumeMount_To_api_VolumeMount, - Convert_api_VolumeMount_To_v1_VolumeMount, - Convert_v1_VolumeSource_To_api_VolumeSource, - Convert_api_VolumeSource_To_v1_VolumeSource, - Convert_v1_VsphereVirtualDiskVolumeSource_To_api_VsphereVirtualDiskVolumeSource, - Convert_api_VsphereVirtualDiskVolumeSource_To_v1_VsphereVirtualDiskVolumeSource, - Convert_v1_WeightedPodAffinityTerm_To_api_WeightedPodAffinityTerm, - Convert_api_WeightedPodAffinityTerm_To_v1_WeightedPodAffinityTerm, - ); err != nil { - // if one of the conversion functions is malformed, detect it immediately. - panic(err) - } -} - -func autoConvert_v1_AWSElasticBlockStoreVolumeSource_To_api_AWSElasticBlockStoreVolumeSource(in *AWSElasticBlockStoreVolumeSource, out *api.AWSElasticBlockStoreVolumeSource, s conversion.Scope) error { - out.VolumeID = in.VolumeID - out.FSType = in.FSType - out.Partition = in.Partition - out.ReadOnly = in.ReadOnly - return nil -} - -func Convert_v1_AWSElasticBlockStoreVolumeSource_To_api_AWSElasticBlockStoreVolumeSource(in *AWSElasticBlockStoreVolumeSource, out *api.AWSElasticBlockStoreVolumeSource, s conversion.Scope) error { - return autoConvert_v1_AWSElasticBlockStoreVolumeSource_To_api_AWSElasticBlockStoreVolumeSource(in, out, s) -} - -func autoConvert_api_AWSElasticBlockStoreVolumeSource_To_v1_AWSElasticBlockStoreVolumeSource(in *api.AWSElasticBlockStoreVolumeSource, out *AWSElasticBlockStoreVolumeSource, s conversion.Scope) error { - out.VolumeID = in.VolumeID - out.FSType = in.FSType - out.Partition = in.Partition - out.ReadOnly = in.ReadOnly - return nil -} - -func Convert_api_AWSElasticBlockStoreVolumeSource_To_v1_AWSElasticBlockStoreVolumeSource(in *api.AWSElasticBlockStoreVolumeSource, out *AWSElasticBlockStoreVolumeSource, s conversion.Scope) error { - return autoConvert_api_AWSElasticBlockStoreVolumeSource_To_v1_AWSElasticBlockStoreVolumeSource(in, out, s) -} - -func autoConvert_v1_Affinity_To_api_Affinity(in *Affinity, out *api.Affinity, s conversion.Scope) error { - if in.NodeAffinity != nil { - in, out := &in.NodeAffinity, &out.NodeAffinity - *out = new(api.NodeAffinity) - if err := Convert_v1_NodeAffinity_To_api_NodeAffinity(*in, *out, s); err != nil { - return err - } - } else { - out.NodeAffinity = nil - } - if in.PodAffinity != nil { - in, out := &in.PodAffinity, &out.PodAffinity - *out = new(api.PodAffinity) - if err := Convert_v1_PodAffinity_To_api_PodAffinity(*in, *out, s); err != nil { - return err - } - } else { - out.PodAffinity = nil - } - if in.PodAntiAffinity != nil { - in, out := &in.PodAntiAffinity, &out.PodAntiAffinity - *out = new(api.PodAntiAffinity) - if err := Convert_v1_PodAntiAffinity_To_api_PodAntiAffinity(*in, *out, s); err != nil { - return err - } - } else { - out.PodAntiAffinity = nil - } - return nil -} - -func Convert_v1_Affinity_To_api_Affinity(in *Affinity, out *api.Affinity, s conversion.Scope) error { - return autoConvert_v1_Affinity_To_api_Affinity(in, out, s) -} - -func autoConvert_api_Affinity_To_v1_Affinity(in *api.Affinity, out *Affinity, s conversion.Scope) error { - if in.NodeAffinity != nil { - in, out := &in.NodeAffinity, &out.NodeAffinity - *out = new(NodeAffinity) - if err := Convert_api_NodeAffinity_To_v1_NodeAffinity(*in, *out, s); err != nil { - return err - } - } else { - out.NodeAffinity = nil - } - if in.PodAffinity != nil { - in, out := &in.PodAffinity, &out.PodAffinity - *out = new(PodAffinity) - if err := Convert_api_PodAffinity_To_v1_PodAffinity(*in, *out, s); err != nil { - return err - } - } else { - out.PodAffinity = nil - } - if in.PodAntiAffinity != nil { - in, out := &in.PodAntiAffinity, &out.PodAntiAffinity - *out = new(PodAntiAffinity) - if err := Convert_api_PodAntiAffinity_To_v1_PodAntiAffinity(*in, *out, s); err != nil { - return err - } - } else { - out.PodAntiAffinity = nil - } - return nil -} - -func Convert_api_Affinity_To_v1_Affinity(in *api.Affinity, out *Affinity, s conversion.Scope) error { - return autoConvert_api_Affinity_To_v1_Affinity(in, out, s) -} - -func autoConvert_v1_AttachedVolume_To_api_AttachedVolume(in *AttachedVolume, out *api.AttachedVolume, s conversion.Scope) error { - out.Name = api.UniqueVolumeName(in.Name) - out.DevicePath = in.DevicePath - return nil -} - -func Convert_v1_AttachedVolume_To_api_AttachedVolume(in *AttachedVolume, out *api.AttachedVolume, s conversion.Scope) error { - return autoConvert_v1_AttachedVolume_To_api_AttachedVolume(in, out, s) -} - -func autoConvert_api_AttachedVolume_To_v1_AttachedVolume(in *api.AttachedVolume, out *AttachedVolume, s conversion.Scope) error { - out.Name = UniqueVolumeName(in.Name) - out.DevicePath = in.DevicePath - return nil -} - -func Convert_api_AttachedVolume_To_v1_AttachedVolume(in *api.AttachedVolume, out *AttachedVolume, s conversion.Scope) error { - return autoConvert_api_AttachedVolume_To_v1_AttachedVolume(in, out, s) -} - -func autoConvert_v1_AzureFileVolumeSource_To_api_AzureFileVolumeSource(in *AzureFileVolumeSource, out *api.AzureFileVolumeSource, s conversion.Scope) error { - out.SecretName = in.SecretName - out.ShareName = in.ShareName - out.ReadOnly = in.ReadOnly - return nil -} - -func Convert_v1_AzureFileVolumeSource_To_api_AzureFileVolumeSource(in *AzureFileVolumeSource, out *api.AzureFileVolumeSource, s conversion.Scope) error { - return autoConvert_v1_AzureFileVolumeSource_To_api_AzureFileVolumeSource(in, out, s) -} - -func autoConvert_api_AzureFileVolumeSource_To_v1_AzureFileVolumeSource(in *api.AzureFileVolumeSource, out *AzureFileVolumeSource, s conversion.Scope) error { - out.SecretName = in.SecretName - out.ShareName = in.ShareName - out.ReadOnly = in.ReadOnly - return nil -} - -func Convert_api_AzureFileVolumeSource_To_v1_AzureFileVolumeSource(in *api.AzureFileVolumeSource, out *AzureFileVolumeSource, s conversion.Scope) error { - return autoConvert_api_AzureFileVolumeSource_To_v1_AzureFileVolumeSource(in, out, s) -} - -func autoConvert_v1_Binding_To_api_Binding(in *Binding, out *api.Binding, 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_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - if err := Convert_v1_ObjectReference_To_api_ObjectReference(&in.Target, &out.Target, s); err != nil { - return err - } - return nil -} - -func Convert_v1_Binding_To_api_Binding(in *Binding, out *api.Binding, s conversion.Scope) error { - return autoConvert_v1_Binding_To_api_Binding(in, out, s) -} - -func autoConvert_api_Binding_To_v1_Binding(in *api.Binding, out *Binding, 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_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - if err := Convert_api_ObjectReference_To_v1_ObjectReference(&in.Target, &out.Target, s); err != nil { - return err - } - return nil -} - -func Convert_api_Binding_To_v1_Binding(in *api.Binding, out *Binding, s conversion.Scope) error { - return autoConvert_api_Binding_To_v1_Binding(in, out, s) -} - -func autoConvert_v1_Capabilities_To_api_Capabilities(in *Capabilities, out *api.Capabilities, s conversion.Scope) error { - if in.Add != nil { - in, out := &in.Add, &out.Add - *out = make([]api.Capability, len(*in)) - for i := range *in { - (*out)[i] = api.Capability((*in)[i]) - } - } else { - out.Add = nil - } - if in.Drop != nil { - in, out := &in.Drop, &out.Drop - *out = make([]api.Capability, len(*in)) - for i := range *in { - (*out)[i] = api.Capability((*in)[i]) - } - } else { - out.Drop = nil - } - return nil -} - -func Convert_v1_Capabilities_To_api_Capabilities(in *Capabilities, out *api.Capabilities, s conversion.Scope) error { - return autoConvert_v1_Capabilities_To_api_Capabilities(in, out, s) -} - -func autoConvert_api_Capabilities_To_v1_Capabilities(in *api.Capabilities, out *Capabilities, s conversion.Scope) error { - if in.Add != nil { - in, out := &in.Add, &out.Add - *out = make([]Capability, len(*in)) - for i := range *in { - (*out)[i] = Capability((*in)[i]) - } - } else { - out.Add = nil - } - if in.Drop != nil { - in, out := &in.Drop, &out.Drop - *out = make([]Capability, len(*in)) - for i := range *in { - (*out)[i] = Capability((*in)[i]) - } - } else { - out.Drop = nil - } - return nil -} - -func Convert_api_Capabilities_To_v1_Capabilities(in *api.Capabilities, out *Capabilities, s conversion.Scope) error { - return autoConvert_api_Capabilities_To_v1_Capabilities(in, out, s) -} - -func autoConvert_v1_CephFSVolumeSource_To_api_CephFSVolumeSource(in *CephFSVolumeSource, out *api.CephFSVolumeSource, s conversion.Scope) error { - out.Monitors = in.Monitors - out.Path = in.Path - out.User = in.User - out.SecretFile = in.SecretFile - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - *out = new(api.LocalObjectReference) - if err := Convert_v1_LocalObjectReference_To_api_LocalObjectReference(*in, *out, s); err != nil { - return err - } - } else { - out.SecretRef = nil - } - out.ReadOnly = in.ReadOnly - return nil -} - -func Convert_v1_CephFSVolumeSource_To_api_CephFSVolumeSource(in *CephFSVolumeSource, out *api.CephFSVolumeSource, s conversion.Scope) error { - return autoConvert_v1_CephFSVolumeSource_To_api_CephFSVolumeSource(in, out, s) -} - -func autoConvert_api_CephFSVolumeSource_To_v1_CephFSVolumeSource(in *api.CephFSVolumeSource, out *CephFSVolumeSource, s conversion.Scope) error { - out.Monitors = in.Monitors - out.Path = in.Path - out.User = in.User - out.SecretFile = in.SecretFile - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - *out = new(LocalObjectReference) - if err := Convert_api_LocalObjectReference_To_v1_LocalObjectReference(*in, *out, s); err != nil { - return err - } - } else { - out.SecretRef = nil - } - out.ReadOnly = in.ReadOnly - return nil -} - -func Convert_api_CephFSVolumeSource_To_v1_CephFSVolumeSource(in *api.CephFSVolumeSource, out *CephFSVolumeSource, s conversion.Scope) error { - return autoConvert_api_CephFSVolumeSource_To_v1_CephFSVolumeSource(in, out, s) -} - -func autoConvert_v1_CinderVolumeSource_To_api_CinderVolumeSource(in *CinderVolumeSource, out *api.CinderVolumeSource, s conversion.Scope) error { - out.VolumeID = in.VolumeID - out.FSType = in.FSType - out.ReadOnly = in.ReadOnly - return nil -} - -func Convert_v1_CinderVolumeSource_To_api_CinderVolumeSource(in *CinderVolumeSource, out *api.CinderVolumeSource, s conversion.Scope) error { - return autoConvert_v1_CinderVolumeSource_To_api_CinderVolumeSource(in, out, s) -} - -func autoConvert_api_CinderVolumeSource_To_v1_CinderVolumeSource(in *api.CinderVolumeSource, out *CinderVolumeSource, s conversion.Scope) error { - out.VolumeID = in.VolumeID - out.FSType = in.FSType - out.ReadOnly = in.ReadOnly - return nil -} - -func Convert_api_CinderVolumeSource_To_v1_CinderVolumeSource(in *api.CinderVolumeSource, out *CinderVolumeSource, s conversion.Scope) error { - return autoConvert_api_CinderVolumeSource_To_v1_CinderVolumeSource(in, out, s) -} - -func autoConvert_v1_ComponentCondition_To_api_ComponentCondition(in *ComponentCondition, out *api.ComponentCondition, s conversion.Scope) error { - out.Type = api.ComponentConditionType(in.Type) - out.Status = api.ConditionStatus(in.Status) - out.Message = in.Message - out.Error = in.Error - return nil -} - -func Convert_v1_ComponentCondition_To_api_ComponentCondition(in *ComponentCondition, out *api.ComponentCondition, s conversion.Scope) error { - return autoConvert_v1_ComponentCondition_To_api_ComponentCondition(in, out, s) -} - -func autoConvert_api_ComponentCondition_To_v1_ComponentCondition(in *api.ComponentCondition, out *ComponentCondition, s conversion.Scope) error { - out.Type = ComponentConditionType(in.Type) - out.Status = ConditionStatus(in.Status) - out.Message = in.Message - out.Error = in.Error - return nil -} - -func Convert_api_ComponentCondition_To_v1_ComponentCondition(in *api.ComponentCondition, out *ComponentCondition, s conversion.Scope) error { - return autoConvert_api_ComponentCondition_To_v1_ComponentCondition(in, out, s) -} - -func autoConvert_v1_ComponentStatus_To_api_ComponentStatus(in *ComponentStatus, out *api.ComponentStatus, 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_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]api.ComponentCondition, len(*in)) - for i := range *in { - if err := Convert_v1_ComponentCondition_To_api_ComponentCondition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - return nil -} - -func Convert_v1_ComponentStatus_To_api_ComponentStatus(in *ComponentStatus, out *api.ComponentStatus, s conversion.Scope) error { - return autoConvert_v1_ComponentStatus_To_api_ComponentStatus(in, out, s) -} - -func autoConvert_api_ComponentStatus_To_v1_ComponentStatus(in *api.ComponentStatus, out *ComponentStatus, 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_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]ComponentCondition, len(*in)) - for i := range *in { - if err := Convert_api_ComponentCondition_To_v1_ComponentCondition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - return nil -} - -func Convert_api_ComponentStatus_To_v1_ComponentStatus(in *api.ComponentStatus, out *ComponentStatus, s conversion.Scope) error { - return autoConvert_api_ComponentStatus_To_v1_ComponentStatus(in, out, s) -} - -func autoConvert_v1_ComponentStatusList_To_api_ComponentStatusList(in *ComponentStatusList, out *api.ComponentStatusList, 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([]api.ComponentStatus, len(*in)) - for i := range *in { - if err := Convert_v1_ComponentStatus_To_api_ComponentStatus(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1_ComponentStatusList_To_api_ComponentStatusList(in *ComponentStatusList, out *api.ComponentStatusList, s conversion.Scope) error { - return autoConvert_v1_ComponentStatusList_To_api_ComponentStatusList(in, out, s) -} - -func autoConvert_api_ComponentStatusList_To_v1_ComponentStatusList(in *api.ComponentStatusList, out *ComponentStatusList, 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([]ComponentStatus, len(*in)) - for i := range *in { - if err := Convert_api_ComponentStatus_To_v1_ComponentStatus(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_api_ComponentStatusList_To_v1_ComponentStatusList(in *api.ComponentStatusList, out *ComponentStatusList, s conversion.Scope) error { - return autoConvert_api_ComponentStatusList_To_v1_ComponentStatusList(in, out, s) -} - -func autoConvert_v1_ConfigMap_To_api_ConfigMap(in *ConfigMap, out *api.ConfigMap, s conversion.Scope) error { - SetDefaults_ConfigMap(in) - if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { - return err - } - if err := Convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - out.Data = in.Data - return nil -} - -func Convert_v1_ConfigMap_To_api_ConfigMap(in *ConfigMap, out *api.ConfigMap, s conversion.Scope) error { - return autoConvert_v1_ConfigMap_To_api_ConfigMap(in, out, s) -} - -func autoConvert_api_ConfigMap_To_v1_ConfigMap(in *api.ConfigMap, out *ConfigMap, 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_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - out.Data = in.Data - return nil -} - -func Convert_api_ConfigMap_To_v1_ConfigMap(in *api.ConfigMap, out *ConfigMap, s conversion.Scope) error { - return autoConvert_api_ConfigMap_To_v1_ConfigMap(in, out, s) -} - -func autoConvert_v1_ConfigMapKeySelector_To_api_ConfigMapKeySelector(in *ConfigMapKeySelector, out *api.ConfigMapKeySelector, s conversion.Scope) error { - if err := Convert_v1_LocalObjectReference_To_api_LocalObjectReference(&in.LocalObjectReference, &out.LocalObjectReference, s); err != nil { - return err - } - out.Key = in.Key - return nil -} - -func Convert_v1_ConfigMapKeySelector_To_api_ConfigMapKeySelector(in *ConfigMapKeySelector, out *api.ConfigMapKeySelector, s conversion.Scope) error { - return autoConvert_v1_ConfigMapKeySelector_To_api_ConfigMapKeySelector(in, out, s) -} - -func autoConvert_api_ConfigMapKeySelector_To_v1_ConfigMapKeySelector(in *api.ConfigMapKeySelector, out *ConfigMapKeySelector, s conversion.Scope) error { - if err := Convert_api_LocalObjectReference_To_v1_LocalObjectReference(&in.LocalObjectReference, &out.LocalObjectReference, s); err != nil { - return err - } - out.Key = in.Key - return nil -} - -func Convert_api_ConfigMapKeySelector_To_v1_ConfigMapKeySelector(in *api.ConfigMapKeySelector, out *ConfigMapKeySelector, s conversion.Scope) error { - return autoConvert_api_ConfigMapKeySelector_To_v1_ConfigMapKeySelector(in, out, s) -} - -func autoConvert_v1_ConfigMapList_To_api_ConfigMapList(in *ConfigMapList, out *api.ConfigMapList, 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([]api.ConfigMap, len(*in)) - for i := range *in { - if err := Convert_v1_ConfigMap_To_api_ConfigMap(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1_ConfigMapList_To_api_ConfigMapList(in *ConfigMapList, out *api.ConfigMapList, s conversion.Scope) error { - return autoConvert_v1_ConfigMapList_To_api_ConfigMapList(in, out, s) -} - -func autoConvert_api_ConfigMapList_To_v1_ConfigMapList(in *api.ConfigMapList, out *ConfigMapList, 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([]ConfigMap, len(*in)) - for i := range *in { - if err := Convert_api_ConfigMap_To_v1_ConfigMap(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_api_ConfigMapList_To_v1_ConfigMapList(in *api.ConfigMapList, out *ConfigMapList, s conversion.Scope) error { - return autoConvert_api_ConfigMapList_To_v1_ConfigMapList(in, out, s) -} - -func autoConvert_v1_ConfigMapVolumeSource_To_api_ConfigMapVolumeSource(in *ConfigMapVolumeSource, out *api.ConfigMapVolumeSource, s conversion.Scope) error { - if err := Convert_v1_LocalObjectReference_To_api_LocalObjectReference(&in.LocalObjectReference, &out.LocalObjectReference, s); err != nil { - return err - } - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]api.KeyToPath, len(*in)) - for i := range *in { - if err := Convert_v1_KeyToPath_To_api_KeyToPath(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1_ConfigMapVolumeSource_To_api_ConfigMapVolumeSource(in *ConfigMapVolumeSource, out *api.ConfigMapVolumeSource, s conversion.Scope) error { - return autoConvert_v1_ConfigMapVolumeSource_To_api_ConfigMapVolumeSource(in, out, s) -} - -func autoConvert_api_ConfigMapVolumeSource_To_v1_ConfigMapVolumeSource(in *api.ConfigMapVolumeSource, out *ConfigMapVolumeSource, s conversion.Scope) error { - if err := Convert_api_LocalObjectReference_To_v1_LocalObjectReference(&in.LocalObjectReference, &out.LocalObjectReference, s); err != nil { - return err - } - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]KeyToPath, len(*in)) - for i := range *in { - if err := Convert_api_KeyToPath_To_v1_KeyToPath(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_api_ConfigMapVolumeSource_To_v1_ConfigMapVolumeSource(in *api.ConfigMapVolumeSource, out *ConfigMapVolumeSource, s conversion.Scope) error { - return autoConvert_api_ConfigMapVolumeSource_To_v1_ConfigMapVolumeSource(in, out, s) -} - -func autoConvert_v1_Container_To_api_Container(in *Container, out *api.Container, s conversion.Scope) error { - SetDefaults_Container(in) - out.Name = in.Name - out.Image = in.Image - out.Command = in.Command - out.Args = in.Args - out.WorkingDir = in.WorkingDir - if in.Ports != nil { - in, out := &in.Ports, &out.Ports - *out = make([]api.ContainerPort, len(*in)) - for i := range *in { - if err := Convert_v1_ContainerPort_To_api_ContainerPort(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Ports = nil - } - if in.Env != nil { - in, out := &in.Env, &out.Env - *out = make([]api.EnvVar, len(*in)) - for i := range *in { - if err := Convert_v1_EnvVar_To_api_EnvVar(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Env = nil - } - if err := Convert_v1_ResourceRequirements_To_api_ResourceRequirements(&in.Resources, &out.Resources, s); err != nil { - return err - } - if in.VolumeMounts != nil { - in, out := &in.VolumeMounts, &out.VolumeMounts - *out = make([]api.VolumeMount, len(*in)) - for i := range *in { - if err := Convert_v1_VolumeMount_To_api_VolumeMount(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.VolumeMounts = nil - } - if in.LivenessProbe != nil { - in, out := &in.LivenessProbe, &out.LivenessProbe - *out = new(api.Probe) - if err := Convert_v1_Probe_To_api_Probe(*in, *out, s); err != nil { - return err - } - } else { - out.LivenessProbe = nil - } - if in.ReadinessProbe != nil { - in, out := &in.ReadinessProbe, &out.ReadinessProbe - *out = new(api.Probe) - if err := Convert_v1_Probe_To_api_Probe(*in, *out, s); err != nil { - return err - } - } else { - out.ReadinessProbe = nil - } - if in.Lifecycle != nil { - in, out := &in.Lifecycle, &out.Lifecycle - *out = new(api.Lifecycle) - if err := Convert_v1_Lifecycle_To_api_Lifecycle(*in, *out, s); err != nil { - return err - } - } else { - out.Lifecycle = nil - } - out.TerminationMessagePath = in.TerminationMessagePath - out.ImagePullPolicy = api.PullPolicy(in.ImagePullPolicy) - if in.SecurityContext != nil { - in, out := &in.SecurityContext, &out.SecurityContext - *out = new(api.SecurityContext) - if err := Convert_v1_SecurityContext_To_api_SecurityContext(*in, *out, s); err != nil { - return err - } - } else { - out.SecurityContext = nil - } - out.Stdin = in.Stdin - out.StdinOnce = in.StdinOnce - out.TTY = in.TTY - return nil -} - -func Convert_v1_Container_To_api_Container(in *Container, out *api.Container, s conversion.Scope) error { - return autoConvert_v1_Container_To_api_Container(in, out, s) -} - -func autoConvert_api_Container_To_v1_Container(in *api.Container, out *Container, s conversion.Scope) error { - out.Name = in.Name - out.Image = in.Image - out.Command = in.Command - out.Args = in.Args - out.WorkingDir = in.WorkingDir - if in.Ports != nil { - in, out := &in.Ports, &out.Ports - *out = make([]ContainerPort, len(*in)) - for i := range *in { - if err := Convert_api_ContainerPort_To_v1_ContainerPort(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Ports = nil - } - if in.Env != nil { - in, out := &in.Env, &out.Env - *out = make([]EnvVar, len(*in)) - for i := range *in { - if err := Convert_api_EnvVar_To_v1_EnvVar(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Env = nil - } - if err := Convert_api_ResourceRequirements_To_v1_ResourceRequirements(&in.Resources, &out.Resources, s); err != nil { - return err - } - if in.VolumeMounts != nil { - in, out := &in.VolumeMounts, &out.VolumeMounts - *out = make([]VolumeMount, len(*in)) - for i := range *in { - if err := Convert_api_VolumeMount_To_v1_VolumeMount(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.VolumeMounts = nil - } - if in.LivenessProbe != nil { - in, out := &in.LivenessProbe, &out.LivenessProbe - *out = new(Probe) - if err := Convert_api_Probe_To_v1_Probe(*in, *out, s); err != nil { - return err - } - } else { - out.LivenessProbe = nil - } - if in.ReadinessProbe != nil { - in, out := &in.ReadinessProbe, &out.ReadinessProbe - *out = new(Probe) - if err := Convert_api_Probe_To_v1_Probe(*in, *out, s); err != nil { - return err - } - } else { - out.ReadinessProbe = nil - } - if in.Lifecycle != nil { - in, out := &in.Lifecycle, &out.Lifecycle - *out = new(Lifecycle) - if err := Convert_api_Lifecycle_To_v1_Lifecycle(*in, *out, s); err != nil { - return err - } - } else { - out.Lifecycle = nil - } - out.TerminationMessagePath = in.TerminationMessagePath - out.ImagePullPolicy = PullPolicy(in.ImagePullPolicy) - if in.SecurityContext != nil { - in, out := &in.SecurityContext, &out.SecurityContext - *out = new(SecurityContext) - if err := Convert_api_SecurityContext_To_v1_SecurityContext(*in, *out, s); err != nil { - return err - } - } else { - out.SecurityContext = nil - } - out.Stdin = in.Stdin - out.StdinOnce = in.StdinOnce - out.TTY = in.TTY - return nil -} - -func Convert_api_Container_To_v1_Container(in *api.Container, out *Container, s conversion.Scope) error { - return autoConvert_api_Container_To_v1_Container(in, out, s) -} - -func autoConvert_v1_ContainerImage_To_api_ContainerImage(in *ContainerImage, out *api.ContainerImage, s conversion.Scope) error { - out.Names = in.Names - out.SizeBytes = in.SizeBytes - return nil -} - -func Convert_v1_ContainerImage_To_api_ContainerImage(in *ContainerImage, out *api.ContainerImage, s conversion.Scope) error { - return autoConvert_v1_ContainerImage_To_api_ContainerImage(in, out, s) -} - -func autoConvert_api_ContainerImage_To_v1_ContainerImage(in *api.ContainerImage, out *ContainerImage, s conversion.Scope) error { - out.Names = in.Names - out.SizeBytes = in.SizeBytes - return nil -} - -func Convert_api_ContainerImage_To_v1_ContainerImage(in *api.ContainerImage, out *ContainerImage, s conversion.Scope) error { - return autoConvert_api_ContainerImage_To_v1_ContainerImage(in, out, s) -} - -func autoConvert_v1_ContainerPort_To_api_ContainerPort(in *ContainerPort, out *api.ContainerPort, s conversion.Scope) error { - SetDefaults_ContainerPort(in) - out.Name = in.Name - out.HostPort = in.HostPort - out.ContainerPort = in.ContainerPort - out.Protocol = api.Protocol(in.Protocol) - out.HostIP = in.HostIP - return nil -} - -func Convert_v1_ContainerPort_To_api_ContainerPort(in *ContainerPort, out *api.ContainerPort, s conversion.Scope) error { - return autoConvert_v1_ContainerPort_To_api_ContainerPort(in, out, s) -} - -func autoConvert_api_ContainerPort_To_v1_ContainerPort(in *api.ContainerPort, out *ContainerPort, s conversion.Scope) error { - out.Name = in.Name - out.HostPort = in.HostPort - out.ContainerPort = in.ContainerPort - out.Protocol = Protocol(in.Protocol) - out.HostIP = in.HostIP - return nil -} - -func Convert_api_ContainerPort_To_v1_ContainerPort(in *api.ContainerPort, out *ContainerPort, s conversion.Scope) error { - return autoConvert_api_ContainerPort_To_v1_ContainerPort(in, out, s) -} - -func autoConvert_v1_ContainerState_To_api_ContainerState(in *ContainerState, out *api.ContainerState, s conversion.Scope) error { - if in.Waiting != nil { - in, out := &in.Waiting, &out.Waiting - *out = new(api.ContainerStateWaiting) - if err := Convert_v1_ContainerStateWaiting_To_api_ContainerStateWaiting(*in, *out, s); err != nil { - return err - } - } else { - out.Waiting = nil - } - if in.Running != nil { - in, out := &in.Running, &out.Running - *out = new(api.ContainerStateRunning) - if err := Convert_v1_ContainerStateRunning_To_api_ContainerStateRunning(*in, *out, s); err != nil { - return err - } - } else { - out.Running = nil - } - if in.Terminated != nil { - in, out := &in.Terminated, &out.Terminated - *out = new(api.ContainerStateTerminated) - if err := Convert_v1_ContainerStateTerminated_To_api_ContainerStateTerminated(*in, *out, s); err != nil { - return err - } - } else { - out.Terminated = nil - } - return nil -} - -func Convert_v1_ContainerState_To_api_ContainerState(in *ContainerState, out *api.ContainerState, s conversion.Scope) error { - return autoConvert_v1_ContainerState_To_api_ContainerState(in, out, s) -} - -func autoConvert_api_ContainerState_To_v1_ContainerState(in *api.ContainerState, out *ContainerState, s conversion.Scope) error { - if in.Waiting != nil { - in, out := &in.Waiting, &out.Waiting - *out = new(ContainerStateWaiting) - if err := Convert_api_ContainerStateWaiting_To_v1_ContainerStateWaiting(*in, *out, s); err != nil { - return err - } - } else { - out.Waiting = nil - } - if in.Running != nil { - in, out := &in.Running, &out.Running - *out = new(ContainerStateRunning) - if err := Convert_api_ContainerStateRunning_To_v1_ContainerStateRunning(*in, *out, s); err != nil { - return err - } - } else { - out.Running = nil - } - if in.Terminated != nil { - in, out := &in.Terminated, &out.Terminated - *out = new(ContainerStateTerminated) - if err := Convert_api_ContainerStateTerminated_To_v1_ContainerStateTerminated(*in, *out, s); err != nil { - return err - } - } else { - out.Terminated = nil - } - return nil -} - -func Convert_api_ContainerState_To_v1_ContainerState(in *api.ContainerState, out *ContainerState, s conversion.Scope) error { - return autoConvert_api_ContainerState_To_v1_ContainerState(in, out, s) -} - -func autoConvert_v1_ContainerStateRunning_To_api_ContainerStateRunning(in *ContainerStateRunning, out *api.ContainerStateRunning, s conversion.Scope) error { - if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.StartedAt, &out.StartedAt, s); err != nil { - return err - } - return nil -} - -func Convert_v1_ContainerStateRunning_To_api_ContainerStateRunning(in *ContainerStateRunning, out *api.ContainerStateRunning, s conversion.Scope) error { - return autoConvert_v1_ContainerStateRunning_To_api_ContainerStateRunning(in, out, s) -} - -func autoConvert_api_ContainerStateRunning_To_v1_ContainerStateRunning(in *api.ContainerStateRunning, out *ContainerStateRunning, s conversion.Scope) error { - if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.StartedAt, &out.StartedAt, s); err != nil { - return err - } - return nil -} - -func Convert_api_ContainerStateRunning_To_v1_ContainerStateRunning(in *api.ContainerStateRunning, out *ContainerStateRunning, s conversion.Scope) error { - return autoConvert_api_ContainerStateRunning_To_v1_ContainerStateRunning(in, out, s) -} - -func autoConvert_v1_ContainerStateTerminated_To_api_ContainerStateTerminated(in *ContainerStateTerminated, out *api.ContainerStateTerminated, s conversion.Scope) error { - out.ExitCode = in.ExitCode - out.Signal = in.Signal - out.Reason = in.Reason - out.Message = in.Message - if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.StartedAt, &out.StartedAt, s); err != nil { - return err - } - if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.FinishedAt, &out.FinishedAt, s); err != nil { - return err - } - out.ContainerID = in.ContainerID - return nil -} - -func Convert_v1_ContainerStateTerminated_To_api_ContainerStateTerminated(in *ContainerStateTerminated, out *api.ContainerStateTerminated, s conversion.Scope) error { - return autoConvert_v1_ContainerStateTerminated_To_api_ContainerStateTerminated(in, out, s) -} - -func autoConvert_api_ContainerStateTerminated_To_v1_ContainerStateTerminated(in *api.ContainerStateTerminated, out *ContainerStateTerminated, s conversion.Scope) error { - out.ExitCode = in.ExitCode - out.Signal = in.Signal - out.Reason = in.Reason - out.Message = in.Message - if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.StartedAt, &out.StartedAt, s); err != nil { - return err - } - if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.FinishedAt, &out.FinishedAt, s); err != nil { - return err - } - out.ContainerID = in.ContainerID - return nil -} - -func Convert_api_ContainerStateTerminated_To_v1_ContainerStateTerminated(in *api.ContainerStateTerminated, out *ContainerStateTerminated, s conversion.Scope) error { - return autoConvert_api_ContainerStateTerminated_To_v1_ContainerStateTerminated(in, out, s) -} - -func autoConvert_v1_ContainerStateWaiting_To_api_ContainerStateWaiting(in *ContainerStateWaiting, out *api.ContainerStateWaiting, s conversion.Scope) error { - out.Reason = in.Reason - out.Message = in.Message - return nil -} - -func Convert_v1_ContainerStateWaiting_To_api_ContainerStateWaiting(in *ContainerStateWaiting, out *api.ContainerStateWaiting, s conversion.Scope) error { - return autoConvert_v1_ContainerStateWaiting_To_api_ContainerStateWaiting(in, out, s) -} - -func autoConvert_api_ContainerStateWaiting_To_v1_ContainerStateWaiting(in *api.ContainerStateWaiting, out *ContainerStateWaiting, s conversion.Scope) error { - out.Reason = in.Reason - out.Message = in.Message - return nil -} - -func Convert_api_ContainerStateWaiting_To_v1_ContainerStateWaiting(in *api.ContainerStateWaiting, out *ContainerStateWaiting, s conversion.Scope) error { - return autoConvert_api_ContainerStateWaiting_To_v1_ContainerStateWaiting(in, out, s) -} - -func autoConvert_v1_ContainerStatus_To_api_ContainerStatus(in *ContainerStatus, out *api.ContainerStatus, s conversion.Scope) error { - out.Name = in.Name - if err := Convert_v1_ContainerState_To_api_ContainerState(&in.State, &out.State, s); err != nil { - return err - } - if err := Convert_v1_ContainerState_To_api_ContainerState(&in.LastTerminationState, &out.LastTerminationState, s); err != nil { - return err - } - out.Ready = in.Ready - out.RestartCount = in.RestartCount - out.Image = in.Image - out.ImageID = in.ImageID - out.ContainerID = in.ContainerID - return nil -} - -func Convert_v1_ContainerStatus_To_api_ContainerStatus(in *ContainerStatus, out *api.ContainerStatus, s conversion.Scope) error { - return autoConvert_v1_ContainerStatus_To_api_ContainerStatus(in, out, s) -} - -func autoConvert_api_ContainerStatus_To_v1_ContainerStatus(in *api.ContainerStatus, out *ContainerStatus, s conversion.Scope) error { - out.Name = in.Name - if err := Convert_api_ContainerState_To_v1_ContainerState(&in.State, &out.State, s); err != nil { - return err - } - if err := Convert_api_ContainerState_To_v1_ContainerState(&in.LastTerminationState, &out.LastTerminationState, s); err != nil { - return err - } - out.Ready = in.Ready - out.RestartCount = in.RestartCount - out.Image = in.Image - out.ImageID = in.ImageID - out.ContainerID = in.ContainerID - return nil -} - -func Convert_api_ContainerStatus_To_v1_ContainerStatus(in *api.ContainerStatus, out *ContainerStatus, s conversion.Scope) error { - return autoConvert_api_ContainerStatus_To_v1_ContainerStatus(in, out, s) -} - -func autoConvert_v1_DaemonEndpoint_To_api_DaemonEndpoint(in *DaemonEndpoint, out *api.DaemonEndpoint, s conversion.Scope) error { - out.Port = in.Port - return nil -} - -func Convert_v1_DaemonEndpoint_To_api_DaemonEndpoint(in *DaemonEndpoint, out *api.DaemonEndpoint, s conversion.Scope) error { - return autoConvert_v1_DaemonEndpoint_To_api_DaemonEndpoint(in, out, s) -} - -func autoConvert_api_DaemonEndpoint_To_v1_DaemonEndpoint(in *api.DaemonEndpoint, out *DaemonEndpoint, s conversion.Scope) error { - out.Port = in.Port - return nil -} - -func Convert_api_DaemonEndpoint_To_v1_DaemonEndpoint(in *api.DaemonEndpoint, out *DaemonEndpoint, s conversion.Scope) error { - return autoConvert_api_DaemonEndpoint_To_v1_DaemonEndpoint(in, out, s) -} - -func autoConvert_v1_DeleteOptions_To_api_DeleteOptions(in *DeleteOptions, out *api.DeleteOptions, s conversion.Scope) error { - if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { - return err - } - out.GracePeriodSeconds = in.GracePeriodSeconds - if in.Preconditions != nil { - in, out := &in.Preconditions, &out.Preconditions - *out = new(api.Preconditions) - if err := Convert_v1_Preconditions_To_api_Preconditions(*in, *out, s); err != nil { - return err - } - } else { - out.Preconditions = nil - } - out.OrphanDependents = in.OrphanDependents - return nil -} - -func Convert_v1_DeleteOptions_To_api_DeleteOptions(in *DeleteOptions, out *api.DeleteOptions, s conversion.Scope) error { - return autoConvert_v1_DeleteOptions_To_api_DeleteOptions(in, out, s) -} - -func autoConvert_api_DeleteOptions_To_v1_DeleteOptions(in *api.DeleteOptions, out *DeleteOptions, s conversion.Scope) error { - if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { - return err - } - out.GracePeriodSeconds = in.GracePeriodSeconds - if in.Preconditions != nil { - in, out := &in.Preconditions, &out.Preconditions - *out = new(Preconditions) - if err := Convert_api_Preconditions_To_v1_Preconditions(*in, *out, s); err != nil { - return err - } - } else { - out.Preconditions = nil - } - out.OrphanDependents = in.OrphanDependents - return nil -} - -func Convert_api_DeleteOptions_To_v1_DeleteOptions(in *api.DeleteOptions, out *DeleteOptions, s conversion.Scope) error { - return autoConvert_api_DeleteOptions_To_v1_DeleteOptions(in, out, s) -} - -func autoConvert_v1_DownwardAPIVolumeFile_To_api_DownwardAPIVolumeFile(in *DownwardAPIVolumeFile, out *api.DownwardAPIVolumeFile, s conversion.Scope) error { - out.Path = in.Path - if in.FieldRef != nil { - in, out := &in.FieldRef, &out.FieldRef - *out = new(api.ObjectFieldSelector) - if err := Convert_v1_ObjectFieldSelector_To_api_ObjectFieldSelector(*in, *out, s); err != nil { - return err - } - } else { - out.FieldRef = nil - } - if in.ResourceFieldRef != nil { - in, out := &in.ResourceFieldRef, &out.ResourceFieldRef - *out = new(api.ResourceFieldSelector) - if err := Convert_v1_ResourceFieldSelector_To_api_ResourceFieldSelector(*in, *out, s); err != nil { - return err - } - } else { - out.ResourceFieldRef = nil - } - return nil -} - -func Convert_v1_DownwardAPIVolumeFile_To_api_DownwardAPIVolumeFile(in *DownwardAPIVolumeFile, out *api.DownwardAPIVolumeFile, s conversion.Scope) error { - return autoConvert_v1_DownwardAPIVolumeFile_To_api_DownwardAPIVolumeFile(in, out, s) -} - -func autoConvert_api_DownwardAPIVolumeFile_To_v1_DownwardAPIVolumeFile(in *api.DownwardAPIVolumeFile, out *DownwardAPIVolumeFile, s conversion.Scope) error { - out.Path = in.Path - if in.FieldRef != nil { - in, out := &in.FieldRef, &out.FieldRef - *out = new(ObjectFieldSelector) - if err := Convert_api_ObjectFieldSelector_To_v1_ObjectFieldSelector(*in, *out, s); err != nil { - return err - } - } else { - out.FieldRef = nil - } - if in.ResourceFieldRef != nil { - in, out := &in.ResourceFieldRef, &out.ResourceFieldRef - *out = new(ResourceFieldSelector) - if err := Convert_api_ResourceFieldSelector_To_v1_ResourceFieldSelector(*in, *out, s); err != nil { - return err - } - } else { - out.ResourceFieldRef = nil - } - return nil -} - -func Convert_api_DownwardAPIVolumeFile_To_v1_DownwardAPIVolumeFile(in *api.DownwardAPIVolumeFile, out *DownwardAPIVolumeFile, s conversion.Scope) error { - return autoConvert_api_DownwardAPIVolumeFile_To_v1_DownwardAPIVolumeFile(in, out, s) -} - -func autoConvert_v1_DownwardAPIVolumeSource_To_api_DownwardAPIVolumeSource(in *DownwardAPIVolumeSource, out *api.DownwardAPIVolumeSource, s conversion.Scope) error { - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]api.DownwardAPIVolumeFile, len(*in)) - for i := range *in { - if err := Convert_v1_DownwardAPIVolumeFile_To_api_DownwardAPIVolumeFile(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1_DownwardAPIVolumeSource_To_api_DownwardAPIVolumeSource(in *DownwardAPIVolumeSource, out *api.DownwardAPIVolumeSource, s conversion.Scope) error { - return autoConvert_v1_DownwardAPIVolumeSource_To_api_DownwardAPIVolumeSource(in, out, s) -} - -func autoConvert_api_DownwardAPIVolumeSource_To_v1_DownwardAPIVolumeSource(in *api.DownwardAPIVolumeSource, out *DownwardAPIVolumeSource, s conversion.Scope) error { - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]DownwardAPIVolumeFile, len(*in)) - for i := range *in { - if err := Convert_api_DownwardAPIVolumeFile_To_v1_DownwardAPIVolumeFile(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_api_DownwardAPIVolumeSource_To_v1_DownwardAPIVolumeSource(in *api.DownwardAPIVolumeSource, out *DownwardAPIVolumeSource, s conversion.Scope) error { - return autoConvert_api_DownwardAPIVolumeSource_To_v1_DownwardAPIVolumeSource(in, out, s) -} - -func autoConvert_v1_EmptyDirVolumeSource_To_api_EmptyDirVolumeSource(in *EmptyDirVolumeSource, out *api.EmptyDirVolumeSource, s conversion.Scope) error { - out.Medium = api.StorageMedium(in.Medium) - return nil -} - -func Convert_v1_EmptyDirVolumeSource_To_api_EmptyDirVolumeSource(in *EmptyDirVolumeSource, out *api.EmptyDirVolumeSource, s conversion.Scope) error { - return autoConvert_v1_EmptyDirVolumeSource_To_api_EmptyDirVolumeSource(in, out, s) -} - -func autoConvert_api_EmptyDirVolumeSource_To_v1_EmptyDirVolumeSource(in *api.EmptyDirVolumeSource, out *EmptyDirVolumeSource, s conversion.Scope) error { - out.Medium = StorageMedium(in.Medium) - return nil -} - -func Convert_api_EmptyDirVolumeSource_To_v1_EmptyDirVolumeSource(in *api.EmptyDirVolumeSource, out *EmptyDirVolumeSource, s conversion.Scope) error { - return autoConvert_api_EmptyDirVolumeSource_To_v1_EmptyDirVolumeSource(in, out, s) -} - -func autoConvert_v1_EndpointAddress_To_api_EndpointAddress(in *EndpointAddress, out *api.EndpointAddress, s conversion.Scope) error { - out.IP = in.IP - out.Hostname = in.Hostname - if in.TargetRef != nil { - in, out := &in.TargetRef, &out.TargetRef - *out = new(api.ObjectReference) - if err := Convert_v1_ObjectReference_To_api_ObjectReference(*in, *out, s); err != nil { - return err - } - } else { - out.TargetRef = nil - } - return nil -} - -func Convert_v1_EndpointAddress_To_api_EndpointAddress(in *EndpointAddress, out *api.EndpointAddress, s conversion.Scope) error { - return autoConvert_v1_EndpointAddress_To_api_EndpointAddress(in, out, s) -} - -func autoConvert_api_EndpointAddress_To_v1_EndpointAddress(in *api.EndpointAddress, out *EndpointAddress, s conversion.Scope) error { - out.IP = in.IP - out.Hostname = in.Hostname - if in.TargetRef != nil { - in, out := &in.TargetRef, &out.TargetRef - *out = new(ObjectReference) - if err := Convert_api_ObjectReference_To_v1_ObjectReference(*in, *out, s); err != nil { - return err - } - } else { - out.TargetRef = nil - } - return nil -} - -func Convert_api_EndpointAddress_To_v1_EndpointAddress(in *api.EndpointAddress, out *EndpointAddress, s conversion.Scope) error { - return autoConvert_api_EndpointAddress_To_v1_EndpointAddress(in, out, s) -} - -func autoConvert_v1_EndpointPort_To_api_EndpointPort(in *EndpointPort, out *api.EndpointPort, s conversion.Scope) error { - out.Name = in.Name - out.Port = in.Port - out.Protocol = api.Protocol(in.Protocol) - return nil -} - -func Convert_v1_EndpointPort_To_api_EndpointPort(in *EndpointPort, out *api.EndpointPort, s conversion.Scope) error { - return autoConvert_v1_EndpointPort_To_api_EndpointPort(in, out, s) -} - -func autoConvert_api_EndpointPort_To_v1_EndpointPort(in *api.EndpointPort, out *EndpointPort, s conversion.Scope) error { - out.Name = in.Name - out.Port = in.Port - out.Protocol = Protocol(in.Protocol) - return nil -} - -func Convert_api_EndpointPort_To_v1_EndpointPort(in *api.EndpointPort, out *EndpointPort, s conversion.Scope) error { - return autoConvert_api_EndpointPort_To_v1_EndpointPort(in, out, s) -} - -func autoConvert_v1_EndpointSubset_To_api_EndpointSubset(in *EndpointSubset, out *api.EndpointSubset, s conversion.Scope) error { - if in.Addresses != nil { - in, out := &in.Addresses, &out.Addresses - *out = make([]api.EndpointAddress, len(*in)) - for i := range *in { - if err := Convert_v1_EndpointAddress_To_api_EndpointAddress(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Addresses = nil - } - if in.NotReadyAddresses != nil { - in, out := &in.NotReadyAddresses, &out.NotReadyAddresses - *out = make([]api.EndpointAddress, len(*in)) - for i := range *in { - if err := Convert_v1_EndpointAddress_To_api_EndpointAddress(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.NotReadyAddresses = nil - } - if in.Ports != nil { - in, out := &in.Ports, &out.Ports - *out = make([]api.EndpointPort, len(*in)) - for i := range *in { - if err := Convert_v1_EndpointPort_To_api_EndpointPort(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Ports = nil - } - return nil -} - -func Convert_v1_EndpointSubset_To_api_EndpointSubset(in *EndpointSubset, out *api.EndpointSubset, s conversion.Scope) error { - return autoConvert_v1_EndpointSubset_To_api_EndpointSubset(in, out, s) -} - -func autoConvert_api_EndpointSubset_To_v1_EndpointSubset(in *api.EndpointSubset, out *EndpointSubset, s conversion.Scope) error { - if in.Addresses != nil { - in, out := &in.Addresses, &out.Addresses - *out = make([]EndpointAddress, len(*in)) - for i := range *in { - if err := Convert_api_EndpointAddress_To_v1_EndpointAddress(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Addresses = nil - } - if in.NotReadyAddresses != nil { - in, out := &in.NotReadyAddresses, &out.NotReadyAddresses - *out = make([]EndpointAddress, len(*in)) - for i := range *in { - if err := Convert_api_EndpointAddress_To_v1_EndpointAddress(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.NotReadyAddresses = nil - } - if in.Ports != nil { - in, out := &in.Ports, &out.Ports - *out = make([]EndpointPort, len(*in)) - for i := range *in { - if err := Convert_api_EndpointPort_To_v1_EndpointPort(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Ports = nil - } - return nil -} - -func Convert_api_EndpointSubset_To_v1_EndpointSubset(in *api.EndpointSubset, out *EndpointSubset, s conversion.Scope) error { - return autoConvert_api_EndpointSubset_To_v1_EndpointSubset(in, out, s) -} - -func autoConvert_v1_Endpoints_To_api_Endpoints(in *Endpoints, out *api.Endpoints, s conversion.Scope) error { - SetDefaults_Endpoints(in) - if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { - return err - } - if err := Convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - if in.Subsets != nil { - in, out := &in.Subsets, &out.Subsets - *out = make([]api.EndpointSubset, len(*in)) - for i := range *in { - if err := Convert_v1_EndpointSubset_To_api_EndpointSubset(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Subsets = nil - } - return nil -} - -func Convert_v1_Endpoints_To_api_Endpoints(in *Endpoints, out *api.Endpoints, s conversion.Scope) error { - return autoConvert_v1_Endpoints_To_api_Endpoints(in, out, s) -} - -func autoConvert_api_Endpoints_To_v1_Endpoints(in *api.Endpoints, out *Endpoints, 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_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - if in.Subsets != nil { - in, out := &in.Subsets, &out.Subsets - *out = make([]EndpointSubset, len(*in)) - for i := range *in { - if err := Convert_api_EndpointSubset_To_v1_EndpointSubset(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Subsets = nil - } - return nil -} - -func Convert_api_Endpoints_To_v1_Endpoints(in *api.Endpoints, out *Endpoints, s conversion.Scope) error { - return autoConvert_api_Endpoints_To_v1_Endpoints(in, out, s) -} - -func autoConvert_v1_EndpointsList_To_api_EndpointsList(in *EndpointsList, out *api.EndpointsList, 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([]api.Endpoints, len(*in)) - for i := range *in { - if err := Convert_v1_Endpoints_To_api_Endpoints(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1_EndpointsList_To_api_EndpointsList(in *EndpointsList, out *api.EndpointsList, s conversion.Scope) error { - return autoConvert_v1_EndpointsList_To_api_EndpointsList(in, out, s) -} - -func autoConvert_api_EndpointsList_To_v1_EndpointsList(in *api.EndpointsList, out *EndpointsList, 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([]Endpoints, len(*in)) - for i := range *in { - if err := Convert_api_Endpoints_To_v1_Endpoints(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_api_EndpointsList_To_v1_EndpointsList(in *api.EndpointsList, out *EndpointsList, s conversion.Scope) error { - return autoConvert_api_EndpointsList_To_v1_EndpointsList(in, out, s) -} - -func autoConvert_v1_EnvVar_To_api_EnvVar(in *EnvVar, out *api.EnvVar, s conversion.Scope) error { - out.Name = in.Name - out.Value = in.Value - if in.ValueFrom != nil { - in, out := &in.ValueFrom, &out.ValueFrom - *out = new(api.EnvVarSource) - if err := Convert_v1_EnvVarSource_To_api_EnvVarSource(*in, *out, s); err != nil { - return err - } - } else { - out.ValueFrom = nil - } - return nil -} - -func Convert_v1_EnvVar_To_api_EnvVar(in *EnvVar, out *api.EnvVar, s conversion.Scope) error { - return autoConvert_v1_EnvVar_To_api_EnvVar(in, out, s) -} - -func autoConvert_api_EnvVar_To_v1_EnvVar(in *api.EnvVar, out *EnvVar, s conversion.Scope) error { - out.Name = in.Name - out.Value = in.Value - if in.ValueFrom != nil { - in, out := &in.ValueFrom, &out.ValueFrom - *out = new(EnvVarSource) - if err := Convert_api_EnvVarSource_To_v1_EnvVarSource(*in, *out, s); err != nil { - return err - } - } else { - out.ValueFrom = nil - } - return nil -} - -func Convert_api_EnvVar_To_v1_EnvVar(in *api.EnvVar, out *EnvVar, s conversion.Scope) error { - return autoConvert_api_EnvVar_To_v1_EnvVar(in, out, s) -} - -func autoConvert_v1_EnvVarSource_To_api_EnvVarSource(in *EnvVarSource, out *api.EnvVarSource, s conversion.Scope) error { - if in.FieldRef != nil { - in, out := &in.FieldRef, &out.FieldRef - *out = new(api.ObjectFieldSelector) - if err := Convert_v1_ObjectFieldSelector_To_api_ObjectFieldSelector(*in, *out, s); err != nil { - return err - } - } else { - out.FieldRef = nil - } - if in.ResourceFieldRef != nil { - in, out := &in.ResourceFieldRef, &out.ResourceFieldRef - *out = new(api.ResourceFieldSelector) - if err := Convert_v1_ResourceFieldSelector_To_api_ResourceFieldSelector(*in, *out, s); err != nil { - return err - } - } else { - out.ResourceFieldRef = nil - } - if in.ConfigMapKeyRef != nil { - in, out := &in.ConfigMapKeyRef, &out.ConfigMapKeyRef - *out = new(api.ConfigMapKeySelector) - if err := Convert_v1_ConfigMapKeySelector_To_api_ConfigMapKeySelector(*in, *out, s); err != nil { - return err - } - } else { - out.ConfigMapKeyRef = nil - } - if in.SecretKeyRef != nil { - in, out := &in.SecretKeyRef, &out.SecretKeyRef - *out = new(api.SecretKeySelector) - if err := Convert_v1_SecretKeySelector_To_api_SecretKeySelector(*in, *out, s); err != nil { - return err - } - } else { - out.SecretKeyRef = nil - } - return nil -} - -func Convert_v1_EnvVarSource_To_api_EnvVarSource(in *EnvVarSource, out *api.EnvVarSource, s conversion.Scope) error { - return autoConvert_v1_EnvVarSource_To_api_EnvVarSource(in, out, s) -} - -func autoConvert_api_EnvVarSource_To_v1_EnvVarSource(in *api.EnvVarSource, out *EnvVarSource, s conversion.Scope) error { - if in.FieldRef != nil { - in, out := &in.FieldRef, &out.FieldRef - *out = new(ObjectFieldSelector) - if err := Convert_api_ObjectFieldSelector_To_v1_ObjectFieldSelector(*in, *out, s); err != nil { - return err - } - } else { - out.FieldRef = nil - } - if in.ResourceFieldRef != nil { - in, out := &in.ResourceFieldRef, &out.ResourceFieldRef - *out = new(ResourceFieldSelector) - if err := Convert_api_ResourceFieldSelector_To_v1_ResourceFieldSelector(*in, *out, s); err != nil { - return err - } - } else { - out.ResourceFieldRef = nil - } - if in.ConfigMapKeyRef != nil { - in, out := &in.ConfigMapKeyRef, &out.ConfigMapKeyRef - *out = new(ConfigMapKeySelector) - if err := Convert_api_ConfigMapKeySelector_To_v1_ConfigMapKeySelector(*in, *out, s); err != nil { - return err - } - } else { - out.ConfigMapKeyRef = nil - } - if in.SecretKeyRef != nil { - in, out := &in.SecretKeyRef, &out.SecretKeyRef - *out = new(SecretKeySelector) - if err := Convert_api_SecretKeySelector_To_v1_SecretKeySelector(*in, *out, s); err != nil { - return err - } - } else { - out.SecretKeyRef = nil - } - return nil -} - -func Convert_api_EnvVarSource_To_v1_EnvVarSource(in *api.EnvVarSource, out *EnvVarSource, s conversion.Scope) error { - return autoConvert_api_EnvVarSource_To_v1_EnvVarSource(in, out, s) -} - -func autoConvert_v1_Event_To_api_Event(in *Event, out *api.Event, 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_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - if err := Convert_v1_ObjectReference_To_api_ObjectReference(&in.InvolvedObject, &out.InvolvedObject, s); err != nil { - return err - } - out.Reason = in.Reason - out.Message = in.Message - if err := Convert_v1_EventSource_To_api_EventSource(&in.Source, &out.Source, s); err != nil { - return err - } - if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.FirstTimestamp, &out.FirstTimestamp, s); err != nil { - return err - } - if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastTimestamp, &out.LastTimestamp, s); err != nil { - return err - } - out.Count = in.Count - out.Type = in.Type - return nil -} - -func Convert_v1_Event_To_api_Event(in *Event, out *api.Event, s conversion.Scope) error { - return autoConvert_v1_Event_To_api_Event(in, out, s) -} - -func autoConvert_api_Event_To_v1_Event(in *api.Event, out *Event, 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_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - if err := Convert_api_ObjectReference_To_v1_ObjectReference(&in.InvolvedObject, &out.InvolvedObject, s); err != nil { - return err - } - out.Reason = in.Reason - out.Message = in.Message - if err := Convert_api_EventSource_To_v1_EventSource(&in.Source, &out.Source, s); err != nil { - return err - } - if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.FirstTimestamp, &out.FirstTimestamp, s); err != nil { - return err - } - if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastTimestamp, &out.LastTimestamp, s); err != nil { - return err - } - out.Count = in.Count - out.Type = in.Type - return nil -} - -func Convert_api_Event_To_v1_Event(in *api.Event, out *Event, s conversion.Scope) error { - return autoConvert_api_Event_To_v1_Event(in, out, s) -} - -func autoConvert_v1_EventList_To_api_EventList(in *EventList, out *api.EventList, 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([]api.Event, len(*in)) - for i := range *in { - if err := Convert_v1_Event_To_api_Event(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1_EventList_To_api_EventList(in *EventList, out *api.EventList, s conversion.Scope) error { - return autoConvert_v1_EventList_To_api_EventList(in, out, s) -} - -func autoConvert_api_EventList_To_v1_EventList(in *api.EventList, out *EventList, 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([]Event, len(*in)) - for i := range *in { - if err := Convert_api_Event_To_v1_Event(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_api_EventList_To_v1_EventList(in *api.EventList, out *EventList, s conversion.Scope) error { - return autoConvert_api_EventList_To_v1_EventList(in, out, s) -} - -func autoConvert_v1_EventSource_To_api_EventSource(in *EventSource, out *api.EventSource, s conversion.Scope) error { - out.Component = in.Component - out.Host = in.Host - return nil -} - -func Convert_v1_EventSource_To_api_EventSource(in *EventSource, out *api.EventSource, s conversion.Scope) error { - return autoConvert_v1_EventSource_To_api_EventSource(in, out, s) -} - -func autoConvert_api_EventSource_To_v1_EventSource(in *api.EventSource, out *EventSource, s conversion.Scope) error { - out.Component = in.Component - out.Host = in.Host - return nil -} - -func Convert_api_EventSource_To_v1_EventSource(in *api.EventSource, out *EventSource, s conversion.Scope) error { - return autoConvert_api_EventSource_To_v1_EventSource(in, out, s) -} - -func autoConvert_v1_ExecAction_To_api_ExecAction(in *ExecAction, out *api.ExecAction, s conversion.Scope) error { - out.Command = in.Command - return nil -} - -func Convert_v1_ExecAction_To_api_ExecAction(in *ExecAction, out *api.ExecAction, s conversion.Scope) error { - return autoConvert_v1_ExecAction_To_api_ExecAction(in, out, s) -} - -func autoConvert_api_ExecAction_To_v1_ExecAction(in *api.ExecAction, out *ExecAction, s conversion.Scope) error { - out.Command = in.Command - return nil -} - -func Convert_api_ExecAction_To_v1_ExecAction(in *api.ExecAction, out *ExecAction, s conversion.Scope) error { - return autoConvert_api_ExecAction_To_v1_ExecAction(in, out, s) -} - -func autoConvert_v1_ExportOptions_To_api_ExportOptions(in *ExportOptions, out *api.ExportOptions, s conversion.Scope) error { - if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { - return err - } - out.Export = in.Export - out.Exact = in.Exact - return nil -} - -func Convert_v1_ExportOptions_To_api_ExportOptions(in *ExportOptions, out *api.ExportOptions, s conversion.Scope) error { - return autoConvert_v1_ExportOptions_To_api_ExportOptions(in, out, s) -} - -func autoConvert_api_ExportOptions_To_v1_ExportOptions(in *api.ExportOptions, out *ExportOptions, s conversion.Scope) error { - if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { - return err - } - out.Export = in.Export - out.Exact = in.Exact - return nil -} - -func Convert_api_ExportOptions_To_v1_ExportOptions(in *api.ExportOptions, out *ExportOptions, s conversion.Scope) error { - return autoConvert_api_ExportOptions_To_v1_ExportOptions(in, out, s) -} - -func autoConvert_v1_FCVolumeSource_To_api_FCVolumeSource(in *FCVolumeSource, out *api.FCVolumeSource, s conversion.Scope) error { - out.TargetWWNs = in.TargetWWNs - out.Lun = in.Lun - out.FSType = in.FSType - out.ReadOnly = in.ReadOnly - return nil -} - -func Convert_v1_FCVolumeSource_To_api_FCVolumeSource(in *FCVolumeSource, out *api.FCVolumeSource, s conversion.Scope) error { - return autoConvert_v1_FCVolumeSource_To_api_FCVolumeSource(in, out, s) -} - -func autoConvert_api_FCVolumeSource_To_v1_FCVolumeSource(in *api.FCVolumeSource, out *FCVolumeSource, s conversion.Scope) error { - out.TargetWWNs = in.TargetWWNs - out.Lun = in.Lun - out.FSType = in.FSType - out.ReadOnly = in.ReadOnly - return nil -} - -func Convert_api_FCVolumeSource_To_v1_FCVolumeSource(in *api.FCVolumeSource, out *FCVolumeSource, s conversion.Scope) error { - return autoConvert_api_FCVolumeSource_To_v1_FCVolumeSource(in, out, s) -} - -func autoConvert_v1_FlexVolumeSource_To_api_FlexVolumeSource(in *FlexVolumeSource, out *api.FlexVolumeSource, s conversion.Scope) error { - out.Driver = in.Driver - out.FSType = in.FSType - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - *out = new(api.LocalObjectReference) - if err := Convert_v1_LocalObjectReference_To_api_LocalObjectReference(*in, *out, s); err != nil { - return err - } - } else { - out.SecretRef = nil - } - out.ReadOnly = in.ReadOnly - out.Options = in.Options - return nil -} - -func Convert_v1_FlexVolumeSource_To_api_FlexVolumeSource(in *FlexVolumeSource, out *api.FlexVolumeSource, s conversion.Scope) error { - return autoConvert_v1_FlexVolumeSource_To_api_FlexVolumeSource(in, out, s) -} - -func autoConvert_api_FlexVolumeSource_To_v1_FlexVolumeSource(in *api.FlexVolumeSource, out *FlexVolumeSource, s conversion.Scope) error { - out.Driver = in.Driver - out.FSType = in.FSType - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - *out = new(LocalObjectReference) - if err := Convert_api_LocalObjectReference_To_v1_LocalObjectReference(*in, *out, s); err != nil { - return err - } - } else { - out.SecretRef = nil - } - out.ReadOnly = in.ReadOnly - out.Options = in.Options - return nil -} - -func Convert_api_FlexVolumeSource_To_v1_FlexVolumeSource(in *api.FlexVolumeSource, out *FlexVolumeSource, s conversion.Scope) error { - return autoConvert_api_FlexVolumeSource_To_v1_FlexVolumeSource(in, out, s) -} - -func autoConvert_v1_FlockerVolumeSource_To_api_FlockerVolumeSource(in *FlockerVolumeSource, out *api.FlockerVolumeSource, s conversion.Scope) error { - out.DatasetName = in.DatasetName - return nil -} - -func Convert_v1_FlockerVolumeSource_To_api_FlockerVolumeSource(in *FlockerVolumeSource, out *api.FlockerVolumeSource, s conversion.Scope) error { - return autoConvert_v1_FlockerVolumeSource_To_api_FlockerVolumeSource(in, out, s) -} - -func autoConvert_api_FlockerVolumeSource_To_v1_FlockerVolumeSource(in *api.FlockerVolumeSource, out *FlockerVolumeSource, s conversion.Scope) error { - out.DatasetName = in.DatasetName - return nil -} - -func Convert_api_FlockerVolumeSource_To_v1_FlockerVolumeSource(in *api.FlockerVolumeSource, out *FlockerVolumeSource, s conversion.Scope) error { - return autoConvert_api_FlockerVolumeSource_To_v1_FlockerVolumeSource(in, out, s) -} - -func autoConvert_v1_GCEPersistentDiskVolumeSource_To_api_GCEPersistentDiskVolumeSource(in *GCEPersistentDiskVolumeSource, out *api.GCEPersistentDiskVolumeSource, s conversion.Scope) error { - out.PDName = in.PDName - out.FSType = in.FSType - out.Partition = in.Partition - out.ReadOnly = in.ReadOnly - return nil -} - -func Convert_v1_GCEPersistentDiskVolumeSource_To_api_GCEPersistentDiskVolumeSource(in *GCEPersistentDiskVolumeSource, out *api.GCEPersistentDiskVolumeSource, s conversion.Scope) error { - return autoConvert_v1_GCEPersistentDiskVolumeSource_To_api_GCEPersistentDiskVolumeSource(in, out, s) -} - -func autoConvert_api_GCEPersistentDiskVolumeSource_To_v1_GCEPersistentDiskVolumeSource(in *api.GCEPersistentDiskVolumeSource, out *GCEPersistentDiskVolumeSource, s conversion.Scope) error { - out.PDName = in.PDName - out.FSType = in.FSType - out.Partition = in.Partition - out.ReadOnly = in.ReadOnly - return nil -} - -func Convert_api_GCEPersistentDiskVolumeSource_To_v1_GCEPersistentDiskVolumeSource(in *api.GCEPersistentDiskVolumeSource, out *GCEPersistentDiskVolumeSource, s conversion.Scope) error { - return autoConvert_api_GCEPersistentDiskVolumeSource_To_v1_GCEPersistentDiskVolumeSource(in, out, s) -} - -func autoConvert_v1_GitRepoVolumeSource_To_api_GitRepoVolumeSource(in *GitRepoVolumeSource, out *api.GitRepoVolumeSource, s conversion.Scope) error { - out.Repository = in.Repository - out.Revision = in.Revision - out.Directory = in.Directory - return nil -} - -func Convert_v1_GitRepoVolumeSource_To_api_GitRepoVolumeSource(in *GitRepoVolumeSource, out *api.GitRepoVolumeSource, s conversion.Scope) error { - return autoConvert_v1_GitRepoVolumeSource_To_api_GitRepoVolumeSource(in, out, s) -} - -func autoConvert_api_GitRepoVolumeSource_To_v1_GitRepoVolumeSource(in *api.GitRepoVolumeSource, out *GitRepoVolumeSource, s conversion.Scope) error { - out.Repository = in.Repository - out.Revision = in.Revision - out.Directory = in.Directory - return nil -} - -func Convert_api_GitRepoVolumeSource_To_v1_GitRepoVolumeSource(in *api.GitRepoVolumeSource, out *GitRepoVolumeSource, s conversion.Scope) error { - return autoConvert_api_GitRepoVolumeSource_To_v1_GitRepoVolumeSource(in, out, s) -} - -func autoConvert_v1_GlusterfsVolumeSource_To_api_GlusterfsVolumeSource(in *GlusterfsVolumeSource, out *api.GlusterfsVolumeSource, s conversion.Scope) error { - out.EndpointsName = in.EndpointsName - out.Path = in.Path - out.ReadOnly = in.ReadOnly - return nil -} - -func Convert_v1_GlusterfsVolumeSource_To_api_GlusterfsVolumeSource(in *GlusterfsVolumeSource, out *api.GlusterfsVolumeSource, s conversion.Scope) error { - return autoConvert_v1_GlusterfsVolumeSource_To_api_GlusterfsVolumeSource(in, out, s) -} - -func autoConvert_api_GlusterfsVolumeSource_To_v1_GlusterfsVolumeSource(in *api.GlusterfsVolumeSource, out *GlusterfsVolumeSource, s conversion.Scope) error { - out.EndpointsName = in.EndpointsName - out.Path = in.Path - out.ReadOnly = in.ReadOnly - return nil -} - -func Convert_api_GlusterfsVolumeSource_To_v1_GlusterfsVolumeSource(in *api.GlusterfsVolumeSource, out *GlusterfsVolumeSource, s conversion.Scope) error { - return autoConvert_api_GlusterfsVolumeSource_To_v1_GlusterfsVolumeSource(in, out, s) -} - -func autoConvert_v1_HTTPGetAction_To_api_HTTPGetAction(in *HTTPGetAction, out *api.HTTPGetAction, s conversion.Scope) error { - SetDefaults_HTTPGetAction(in) - out.Path = in.Path - if err := api.Convert_intstr_IntOrString_To_intstr_IntOrString(&in.Port, &out.Port, s); err != nil { - return err - } - out.Host = in.Host - out.Scheme = api.URIScheme(in.Scheme) - if in.HTTPHeaders != nil { - in, out := &in.HTTPHeaders, &out.HTTPHeaders - *out = make([]api.HTTPHeader, len(*in)) - for i := range *in { - if err := Convert_v1_HTTPHeader_To_api_HTTPHeader(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.HTTPHeaders = nil - } - return nil -} - -func Convert_v1_HTTPGetAction_To_api_HTTPGetAction(in *HTTPGetAction, out *api.HTTPGetAction, s conversion.Scope) error { - return autoConvert_v1_HTTPGetAction_To_api_HTTPGetAction(in, out, s) -} - -func autoConvert_api_HTTPGetAction_To_v1_HTTPGetAction(in *api.HTTPGetAction, out *HTTPGetAction, s conversion.Scope) error { - out.Path = in.Path - if err := api.Convert_intstr_IntOrString_To_intstr_IntOrString(&in.Port, &out.Port, s); err != nil { - return err - } - out.Host = in.Host - out.Scheme = URIScheme(in.Scheme) - if in.HTTPHeaders != nil { - in, out := &in.HTTPHeaders, &out.HTTPHeaders - *out = make([]HTTPHeader, len(*in)) - for i := range *in { - if err := Convert_api_HTTPHeader_To_v1_HTTPHeader(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.HTTPHeaders = nil - } - return nil -} - -func Convert_api_HTTPGetAction_To_v1_HTTPGetAction(in *api.HTTPGetAction, out *HTTPGetAction, s conversion.Scope) error { - return autoConvert_api_HTTPGetAction_To_v1_HTTPGetAction(in, out, s) -} - -func autoConvert_v1_HTTPHeader_To_api_HTTPHeader(in *HTTPHeader, out *api.HTTPHeader, s conversion.Scope) error { - out.Name = in.Name - out.Value = in.Value - return nil -} - -func Convert_v1_HTTPHeader_To_api_HTTPHeader(in *HTTPHeader, out *api.HTTPHeader, s conversion.Scope) error { - return autoConvert_v1_HTTPHeader_To_api_HTTPHeader(in, out, s) -} - -func autoConvert_api_HTTPHeader_To_v1_HTTPHeader(in *api.HTTPHeader, out *HTTPHeader, s conversion.Scope) error { - out.Name = in.Name - out.Value = in.Value - return nil -} - -func Convert_api_HTTPHeader_To_v1_HTTPHeader(in *api.HTTPHeader, out *HTTPHeader, s conversion.Scope) error { - return autoConvert_api_HTTPHeader_To_v1_HTTPHeader(in, out, s) -} - -func autoConvert_v1_Handler_To_api_Handler(in *Handler, out *api.Handler, s conversion.Scope) error { - if in.Exec != nil { - in, out := &in.Exec, &out.Exec - *out = new(api.ExecAction) - if err := Convert_v1_ExecAction_To_api_ExecAction(*in, *out, s); err != nil { - return err - } - } else { - out.Exec = nil - } - if in.HTTPGet != nil { - in, out := &in.HTTPGet, &out.HTTPGet - *out = new(api.HTTPGetAction) - if err := Convert_v1_HTTPGetAction_To_api_HTTPGetAction(*in, *out, s); err != nil { - return err - } - } else { - out.HTTPGet = nil - } - if in.TCPSocket != nil { - in, out := &in.TCPSocket, &out.TCPSocket - *out = new(api.TCPSocketAction) - if err := Convert_v1_TCPSocketAction_To_api_TCPSocketAction(*in, *out, s); err != nil { - return err - } - } else { - out.TCPSocket = nil - } - return nil -} - -func Convert_v1_Handler_To_api_Handler(in *Handler, out *api.Handler, s conversion.Scope) error { - return autoConvert_v1_Handler_To_api_Handler(in, out, s) -} - -func autoConvert_api_Handler_To_v1_Handler(in *api.Handler, out *Handler, s conversion.Scope) error { - if in.Exec != nil { - in, out := &in.Exec, &out.Exec - *out = new(ExecAction) - if err := Convert_api_ExecAction_To_v1_ExecAction(*in, *out, s); err != nil { - return err - } - } else { - out.Exec = nil - } - if in.HTTPGet != nil { - in, out := &in.HTTPGet, &out.HTTPGet - *out = new(HTTPGetAction) - if err := Convert_api_HTTPGetAction_To_v1_HTTPGetAction(*in, *out, s); err != nil { - return err - } - } else { - out.HTTPGet = nil - } - if in.TCPSocket != nil { - in, out := &in.TCPSocket, &out.TCPSocket - *out = new(TCPSocketAction) - if err := Convert_api_TCPSocketAction_To_v1_TCPSocketAction(*in, *out, s); err != nil { - return err - } - } else { - out.TCPSocket = nil - } - return nil -} - -func Convert_api_Handler_To_v1_Handler(in *api.Handler, out *Handler, s conversion.Scope) error { - return autoConvert_api_Handler_To_v1_Handler(in, out, s) -} - -func autoConvert_v1_HostPathVolumeSource_To_api_HostPathVolumeSource(in *HostPathVolumeSource, out *api.HostPathVolumeSource, s conversion.Scope) error { - out.Path = in.Path - return nil -} - -func Convert_v1_HostPathVolumeSource_To_api_HostPathVolumeSource(in *HostPathVolumeSource, out *api.HostPathVolumeSource, s conversion.Scope) error { - return autoConvert_v1_HostPathVolumeSource_To_api_HostPathVolumeSource(in, out, s) -} - -func autoConvert_api_HostPathVolumeSource_To_v1_HostPathVolumeSource(in *api.HostPathVolumeSource, out *HostPathVolumeSource, s conversion.Scope) error { - out.Path = in.Path - return nil -} - -func Convert_api_HostPathVolumeSource_To_v1_HostPathVolumeSource(in *api.HostPathVolumeSource, out *HostPathVolumeSource, s conversion.Scope) error { - return autoConvert_api_HostPathVolumeSource_To_v1_HostPathVolumeSource(in, out, s) -} - -func autoConvert_v1_ISCSIVolumeSource_To_api_ISCSIVolumeSource(in *ISCSIVolumeSource, out *api.ISCSIVolumeSource, s conversion.Scope) error { - SetDefaults_ISCSIVolumeSource(in) - out.TargetPortal = in.TargetPortal - out.IQN = in.IQN - out.Lun = in.Lun - out.ISCSIInterface = in.ISCSIInterface - out.FSType = in.FSType - out.ReadOnly = in.ReadOnly - return nil -} - -func Convert_v1_ISCSIVolumeSource_To_api_ISCSIVolumeSource(in *ISCSIVolumeSource, out *api.ISCSIVolumeSource, s conversion.Scope) error { - return autoConvert_v1_ISCSIVolumeSource_To_api_ISCSIVolumeSource(in, out, s) -} - -func autoConvert_api_ISCSIVolumeSource_To_v1_ISCSIVolumeSource(in *api.ISCSIVolumeSource, out *ISCSIVolumeSource, s conversion.Scope) error { - out.TargetPortal = in.TargetPortal - out.IQN = in.IQN - out.Lun = in.Lun - out.ISCSIInterface = in.ISCSIInterface - out.FSType = in.FSType - out.ReadOnly = in.ReadOnly - return nil -} - -func Convert_api_ISCSIVolumeSource_To_v1_ISCSIVolumeSource(in *api.ISCSIVolumeSource, out *ISCSIVolumeSource, s conversion.Scope) error { - return autoConvert_api_ISCSIVolumeSource_To_v1_ISCSIVolumeSource(in, out, s) -} - -func autoConvert_v1_KeyToPath_To_api_KeyToPath(in *KeyToPath, out *api.KeyToPath, s conversion.Scope) error { - out.Key = in.Key - out.Path = in.Path - return nil -} - -func Convert_v1_KeyToPath_To_api_KeyToPath(in *KeyToPath, out *api.KeyToPath, s conversion.Scope) error { - return autoConvert_v1_KeyToPath_To_api_KeyToPath(in, out, s) -} - -func autoConvert_api_KeyToPath_To_v1_KeyToPath(in *api.KeyToPath, out *KeyToPath, s conversion.Scope) error { - out.Key = in.Key - out.Path = in.Path - return nil -} - -func Convert_api_KeyToPath_To_v1_KeyToPath(in *api.KeyToPath, out *KeyToPath, s conversion.Scope) error { - return autoConvert_api_KeyToPath_To_v1_KeyToPath(in, out, s) -} - -func autoConvert_v1_Lifecycle_To_api_Lifecycle(in *Lifecycle, out *api.Lifecycle, s conversion.Scope) error { - if in.PostStart != nil { - in, out := &in.PostStart, &out.PostStart - *out = new(api.Handler) - if err := Convert_v1_Handler_To_api_Handler(*in, *out, s); err != nil { - return err - } - } else { - out.PostStart = nil - } - if in.PreStop != nil { - in, out := &in.PreStop, &out.PreStop - *out = new(api.Handler) - if err := Convert_v1_Handler_To_api_Handler(*in, *out, s); err != nil { - return err - } - } else { - out.PreStop = nil - } - return nil -} - -func Convert_v1_Lifecycle_To_api_Lifecycle(in *Lifecycle, out *api.Lifecycle, s conversion.Scope) error { - return autoConvert_v1_Lifecycle_To_api_Lifecycle(in, out, s) -} - -func autoConvert_api_Lifecycle_To_v1_Lifecycle(in *api.Lifecycle, out *Lifecycle, s conversion.Scope) error { - if in.PostStart != nil { - in, out := &in.PostStart, &out.PostStart - *out = new(Handler) - if err := Convert_api_Handler_To_v1_Handler(*in, *out, s); err != nil { - return err - } - } else { - out.PostStart = nil - } - if in.PreStop != nil { - in, out := &in.PreStop, &out.PreStop - *out = new(Handler) - if err := Convert_api_Handler_To_v1_Handler(*in, *out, s); err != nil { - return err - } - } else { - out.PreStop = nil - } - return nil -} - -func Convert_api_Lifecycle_To_v1_Lifecycle(in *api.Lifecycle, out *Lifecycle, s conversion.Scope) error { - return autoConvert_api_Lifecycle_To_v1_Lifecycle(in, out, s) -} - -func autoConvert_v1_LimitRange_To_api_LimitRange(in *LimitRange, out *api.LimitRange, 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_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - if err := Convert_v1_LimitRangeSpec_To_api_LimitRangeSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -func Convert_v1_LimitRange_To_api_LimitRange(in *LimitRange, out *api.LimitRange, s conversion.Scope) error { - return autoConvert_v1_LimitRange_To_api_LimitRange(in, out, s) -} - -func autoConvert_api_LimitRange_To_v1_LimitRange(in *api.LimitRange, out *LimitRange, 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_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - if err := Convert_api_LimitRangeSpec_To_v1_LimitRangeSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -func Convert_api_LimitRange_To_v1_LimitRange(in *api.LimitRange, out *LimitRange, s conversion.Scope) error { - return autoConvert_api_LimitRange_To_v1_LimitRange(in, out, s) -} - -func autoConvert_v1_LimitRangeItem_To_api_LimitRangeItem(in *LimitRangeItem, out *api.LimitRangeItem, s conversion.Scope) error { - SetDefaults_LimitRangeItem(in) - out.Type = api.LimitType(in.Type) - if err := Convert_v1_ResourceList_To_api_ResourceList(&in.Max, &out.Max, s); err != nil { - return err - } - if err := Convert_v1_ResourceList_To_api_ResourceList(&in.Min, &out.Min, s); err != nil { - return err - } - if err := Convert_v1_ResourceList_To_api_ResourceList(&in.Default, &out.Default, s); err != nil { - return err - } - if err := Convert_v1_ResourceList_To_api_ResourceList(&in.DefaultRequest, &out.DefaultRequest, s); err != nil { - return err - } - if err := Convert_v1_ResourceList_To_api_ResourceList(&in.MaxLimitRequestRatio, &out.MaxLimitRequestRatio, s); err != nil { - return err - } - return nil -} - -func Convert_v1_LimitRangeItem_To_api_LimitRangeItem(in *LimitRangeItem, out *api.LimitRangeItem, s conversion.Scope) error { - return autoConvert_v1_LimitRangeItem_To_api_LimitRangeItem(in, out, s) -} - -func autoConvert_api_LimitRangeItem_To_v1_LimitRangeItem(in *api.LimitRangeItem, out *LimitRangeItem, s conversion.Scope) error { - out.Type = LimitType(in.Type) - if in.Max != nil { - in, out := &in.Max, &out.Max - *out = make(ResourceList, len(*in)) - for key, val := range *in { - newVal := new(resource.Quantity) - if err := api.Convert_resource_Quantity_To_resource_Quantity(&val, newVal, s); err != nil { - return err - } - (*out)[ResourceName(key)] = *newVal - } - } else { - out.Max = nil - } - if in.Min != nil { - in, out := &in.Min, &out.Min - *out = make(ResourceList, len(*in)) - for key, val := range *in { - newVal := new(resource.Quantity) - if err := api.Convert_resource_Quantity_To_resource_Quantity(&val, newVal, s); err != nil { - return err - } - (*out)[ResourceName(key)] = *newVal - } - } else { - out.Min = nil - } - if in.Default != nil { - in, out := &in.Default, &out.Default - *out = make(ResourceList, len(*in)) - for key, val := range *in { - newVal := new(resource.Quantity) - if err := api.Convert_resource_Quantity_To_resource_Quantity(&val, newVal, s); err != nil { - return err - } - (*out)[ResourceName(key)] = *newVal - } - } else { - out.Default = nil - } - if in.DefaultRequest != nil { - in, out := &in.DefaultRequest, &out.DefaultRequest - *out = make(ResourceList, len(*in)) - for key, val := range *in { - newVal := new(resource.Quantity) - if err := api.Convert_resource_Quantity_To_resource_Quantity(&val, newVal, s); err != nil { - return err - } - (*out)[ResourceName(key)] = *newVal - } - } else { - out.DefaultRequest = nil - } - if in.MaxLimitRequestRatio != nil { - in, out := &in.MaxLimitRequestRatio, &out.MaxLimitRequestRatio - *out = make(ResourceList, len(*in)) - for key, val := range *in { - newVal := new(resource.Quantity) - if err := api.Convert_resource_Quantity_To_resource_Quantity(&val, newVal, s); err != nil { - return err - } - (*out)[ResourceName(key)] = *newVal - } - } else { - out.MaxLimitRequestRatio = nil - } - return nil -} - -func Convert_api_LimitRangeItem_To_v1_LimitRangeItem(in *api.LimitRangeItem, out *LimitRangeItem, s conversion.Scope) error { - return autoConvert_api_LimitRangeItem_To_v1_LimitRangeItem(in, out, s) -} - -func autoConvert_v1_LimitRangeList_To_api_LimitRangeList(in *LimitRangeList, out *api.LimitRangeList, 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([]api.LimitRange, len(*in)) - for i := range *in { - if err := Convert_v1_LimitRange_To_api_LimitRange(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1_LimitRangeList_To_api_LimitRangeList(in *LimitRangeList, out *api.LimitRangeList, s conversion.Scope) error { - return autoConvert_v1_LimitRangeList_To_api_LimitRangeList(in, out, s) -} - -func autoConvert_api_LimitRangeList_To_v1_LimitRangeList(in *api.LimitRangeList, out *LimitRangeList, 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([]LimitRange, len(*in)) - for i := range *in { - if err := Convert_api_LimitRange_To_v1_LimitRange(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_api_LimitRangeList_To_v1_LimitRangeList(in *api.LimitRangeList, out *LimitRangeList, s conversion.Scope) error { - return autoConvert_api_LimitRangeList_To_v1_LimitRangeList(in, out, s) -} - -func autoConvert_v1_LimitRangeSpec_To_api_LimitRangeSpec(in *LimitRangeSpec, out *api.LimitRangeSpec, s conversion.Scope) error { - if in.Limits != nil { - in, out := &in.Limits, &out.Limits - *out = make([]api.LimitRangeItem, len(*in)) - for i := range *in { - if err := Convert_v1_LimitRangeItem_To_api_LimitRangeItem(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Limits = nil - } - return nil -} - -func Convert_v1_LimitRangeSpec_To_api_LimitRangeSpec(in *LimitRangeSpec, out *api.LimitRangeSpec, s conversion.Scope) error { - return autoConvert_v1_LimitRangeSpec_To_api_LimitRangeSpec(in, out, s) -} - -func autoConvert_api_LimitRangeSpec_To_v1_LimitRangeSpec(in *api.LimitRangeSpec, out *LimitRangeSpec, s conversion.Scope) error { - if in.Limits != nil { - in, out := &in.Limits, &out.Limits - *out = make([]LimitRangeItem, len(*in)) - for i := range *in { - if err := Convert_api_LimitRangeItem_To_v1_LimitRangeItem(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Limits = nil - } - return nil -} - -func Convert_api_LimitRangeSpec_To_v1_LimitRangeSpec(in *api.LimitRangeSpec, out *LimitRangeSpec, s conversion.Scope) error { - return autoConvert_api_LimitRangeSpec_To_v1_LimitRangeSpec(in, out, s) -} - -func autoConvert_v1_List_To_api_List(in *List, out *api.List, 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([]runtime.Object, len(*in)) - for i := range *in { - if err := runtime.Convert_runtime_RawExtension_To_runtime_Object(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1_List_To_api_List(in *List, out *api.List, s conversion.Scope) error { - return autoConvert_v1_List_To_api_List(in, out, s) -} - -func autoConvert_api_List_To_v1_List(in *api.List, out *List, 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([]runtime.RawExtension, len(*in)) - for i := range *in { - if err := runtime.Convert_runtime_Object_To_runtime_RawExtension(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_api_List_To_v1_List(in *api.List, out *List, s conversion.Scope) error { - return autoConvert_api_List_To_v1_List(in, out, s) -} - -func autoConvert_v1_ListOptions_To_api_ListOptions(in *ListOptions, out *api.ListOptions, 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_string_To_labels_Selector(&in.LabelSelector, &out.LabelSelector, s); err != nil { - return err - } - if err := api.Convert_string_To_fields_Selector(&in.FieldSelector, &out.FieldSelector, s); err != nil { - return err - } - out.Watch = in.Watch - out.ResourceVersion = in.ResourceVersion - out.TimeoutSeconds = in.TimeoutSeconds - return nil -} - -func Convert_v1_ListOptions_To_api_ListOptions(in *ListOptions, out *api.ListOptions, s conversion.Scope) error { - return autoConvert_v1_ListOptions_To_api_ListOptions(in, out, s) -} - -func autoConvert_api_ListOptions_To_v1_ListOptions(in *api.ListOptions, out *ListOptions, 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_labels_Selector_To_string(&in.LabelSelector, &out.LabelSelector, s); err != nil { - return err - } - if err := api.Convert_fields_Selector_To_string(&in.FieldSelector, &out.FieldSelector, s); err != nil { - return err - } - out.Watch = in.Watch - out.ResourceVersion = in.ResourceVersion - out.TimeoutSeconds = in.TimeoutSeconds - return nil -} - -func Convert_api_ListOptions_To_v1_ListOptions(in *api.ListOptions, out *ListOptions, s conversion.Scope) error { - return autoConvert_api_ListOptions_To_v1_ListOptions(in, out, s) -} - -func autoConvert_v1_LoadBalancerIngress_To_api_LoadBalancerIngress(in *LoadBalancerIngress, out *api.LoadBalancerIngress, s conversion.Scope) error { - out.IP = in.IP - out.Hostname = in.Hostname - return nil -} - -func Convert_v1_LoadBalancerIngress_To_api_LoadBalancerIngress(in *LoadBalancerIngress, out *api.LoadBalancerIngress, s conversion.Scope) error { - return autoConvert_v1_LoadBalancerIngress_To_api_LoadBalancerIngress(in, out, s) -} - -func autoConvert_api_LoadBalancerIngress_To_v1_LoadBalancerIngress(in *api.LoadBalancerIngress, out *LoadBalancerIngress, s conversion.Scope) error { - out.IP = in.IP - out.Hostname = in.Hostname - return nil -} - -func Convert_api_LoadBalancerIngress_To_v1_LoadBalancerIngress(in *api.LoadBalancerIngress, out *LoadBalancerIngress, s conversion.Scope) error { - return autoConvert_api_LoadBalancerIngress_To_v1_LoadBalancerIngress(in, out, s) -} - -func autoConvert_v1_LoadBalancerStatus_To_api_LoadBalancerStatus(in *LoadBalancerStatus, out *api.LoadBalancerStatus, s conversion.Scope) error { - if in.Ingress != nil { - in, out := &in.Ingress, &out.Ingress - *out = make([]api.LoadBalancerIngress, len(*in)) - for i := range *in { - if err := Convert_v1_LoadBalancerIngress_To_api_LoadBalancerIngress(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Ingress = nil - } - return nil -} - -func Convert_v1_LoadBalancerStatus_To_api_LoadBalancerStatus(in *LoadBalancerStatus, out *api.LoadBalancerStatus, s conversion.Scope) error { - return autoConvert_v1_LoadBalancerStatus_To_api_LoadBalancerStatus(in, out, s) -} - -func autoConvert_api_LoadBalancerStatus_To_v1_LoadBalancerStatus(in *api.LoadBalancerStatus, out *LoadBalancerStatus, s conversion.Scope) error { - if in.Ingress != nil { - in, out := &in.Ingress, &out.Ingress - *out = make([]LoadBalancerIngress, len(*in)) - for i := range *in { - if err := Convert_api_LoadBalancerIngress_To_v1_LoadBalancerIngress(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Ingress = nil - } - return nil -} - -func Convert_api_LoadBalancerStatus_To_v1_LoadBalancerStatus(in *api.LoadBalancerStatus, out *LoadBalancerStatus, s conversion.Scope) error { - return autoConvert_api_LoadBalancerStatus_To_v1_LoadBalancerStatus(in, out, s) -} - -func autoConvert_v1_LocalObjectReference_To_api_LocalObjectReference(in *LocalObjectReference, out *api.LocalObjectReference, s conversion.Scope) error { - out.Name = in.Name - return nil -} - -func Convert_v1_LocalObjectReference_To_api_LocalObjectReference(in *LocalObjectReference, out *api.LocalObjectReference, s conversion.Scope) error { - return autoConvert_v1_LocalObjectReference_To_api_LocalObjectReference(in, out, s) -} - -func autoConvert_api_LocalObjectReference_To_v1_LocalObjectReference(in *api.LocalObjectReference, out *LocalObjectReference, s conversion.Scope) error { - out.Name = in.Name - return nil -} - -func Convert_api_LocalObjectReference_To_v1_LocalObjectReference(in *api.LocalObjectReference, out *LocalObjectReference, s conversion.Scope) error { - return autoConvert_api_LocalObjectReference_To_v1_LocalObjectReference(in, out, s) -} - -func autoConvert_v1_NFSVolumeSource_To_api_NFSVolumeSource(in *NFSVolumeSource, out *api.NFSVolumeSource, s conversion.Scope) error { - out.Server = in.Server - out.Path = in.Path - out.ReadOnly = in.ReadOnly - return nil -} - -func Convert_v1_NFSVolumeSource_To_api_NFSVolumeSource(in *NFSVolumeSource, out *api.NFSVolumeSource, s conversion.Scope) error { - return autoConvert_v1_NFSVolumeSource_To_api_NFSVolumeSource(in, out, s) -} - -func autoConvert_api_NFSVolumeSource_To_v1_NFSVolumeSource(in *api.NFSVolumeSource, out *NFSVolumeSource, s conversion.Scope) error { - out.Server = in.Server - out.Path = in.Path - out.ReadOnly = in.ReadOnly - return nil -} - -func Convert_api_NFSVolumeSource_To_v1_NFSVolumeSource(in *api.NFSVolumeSource, out *NFSVolumeSource, s conversion.Scope) error { - return autoConvert_api_NFSVolumeSource_To_v1_NFSVolumeSource(in, out, s) -} - -func autoConvert_v1_Namespace_To_api_Namespace(in *Namespace, out *api.Namespace, 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_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - if err := Convert_v1_NamespaceSpec_To_api_NamespaceSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1_NamespaceStatus_To_api_NamespaceStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_v1_Namespace_To_api_Namespace(in *Namespace, out *api.Namespace, s conversion.Scope) error { - return autoConvert_v1_Namespace_To_api_Namespace(in, out, s) -} - -func autoConvert_api_Namespace_To_v1_Namespace(in *api.Namespace, out *Namespace, 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_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - if err := Convert_api_NamespaceSpec_To_v1_NamespaceSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_api_NamespaceStatus_To_v1_NamespaceStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_api_Namespace_To_v1_Namespace(in *api.Namespace, out *Namespace, s conversion.Scope) error { - return autoConvert_api_Namespace_To_v1_Namespace(in, out, s) -} - -func autoConvert_v1_NamespaceList_To_api_NamespaceList(in *NamespaceList, out *api.NamespaceList, 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([]api.Namespace, len(*in)) - for i := range *in { - if err := Convert_v1_Namespace_To_api_Namespace(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1_NamespaceList_To_api_NamespaceList(in *NamespaceList, out *api.NamespaceList, s conversion.Scope) error { - return autoConvert_v1_NamespaceList_To_api_NamespaceList(in, out, s) -} - -func autoConvert_api_NamespaceList_To_v1_NamespaceList(in *api.NamespaceList, out *NamespaceList, 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([]Namespace, len(*in)) - for i := range *in { - if err := Convert_api_Namespace_To_v1_Namespace(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_api_NamespaceList_To_v1_NamespaceList(in *api.NamespaceList, out *NamespaceList, s conversion.Scope) error { - return autoConvert_api_NamespaceList_To_v1_NamespaceList(in, out, s) -} - -func autoConvert_v1_NamespaceSpec_To_api_NamespaceSpec(in *NamespaceSpec, out *api.NamespaceSpec, s conversion.Scope) error { - if in.Finalizers != nil { - in, out := &in.Finalizers, &out.Finalizers - *out = make([]api.FinalizerName, len(*in)) - for i := range *in { - (*out)[i] = api.FinalizerName((*in)[i]) - } - } else { - out.Finalizers = nil - } - return nil -} - -func Convert_v1_NamespaceSpec_To_api_NamespaceSpec(in *NamespaceSpec, out *api.NamespaceSpec, s conversion.Scope) error { - return autoConvert_v1_NamespaceSpec_To_api_NamespaceSpec(in, out, s) -} - -func autoConvert_api_NamespaceSpec_To_v1_NamespaceSpec(in *api.NamespaceSpec, out *NamespaceSpec, s conversion.Scope) error { - if in.Finalizers != nil { - in, out := &in.Finalizers, &out.Finalizers - *out = make([]FinalizerName, len(*in)) - for i := range *in { - (*out)[i] = FinalizerName((*in)[i]) - } - } else { - out.Finalizers = nil - } - return nil -} - -func Convert_api_NamespaceSpec_To_v1_NamespaceSpec(in *api.NamespaceSpec, out *NamespaceSpec, s conversion.Scope) error { - return autoConvert_api_NamespaceSpec_To_v1_NamespaceSpec(in, out, s) -} - -func autoConvert_v1_NamespaceStatus_To_api_NamespaceStatus(in *NamespaceStatus, out *api.NamespaceStatus, s conversion.Scope) error { - SetDefaults_NamespaceStatus(in) - out.Phase = api.NamespacePhase(in.Phase) - return nil -} - -func Convert_v1_NamespaceStatus_To_api_NamespaceStatus(in *NamespaceStatus, out *api.NamespaceStatus, s conversion.Scope) error { - return autoConvert_v1_NamespaceStatus_To_api_NamespaceStatus(in, out, s) -} - -func autoConvert_api_NamespaceStatus_To_v1_NamespaceStatus(in *api.NamespaceStatus, out *NamespaceStatus, s conversion.Scope) error { - out.Phase = NamespacePhase(in.Phase) - return nil -} - -func Convert_api_NamespaceStatus_To_v1_NamespaceStatus(in *api.NamespaceStatus, out *NamespaceStatus, s conversion.Scope) error { - return autoConvert_api_NamespaceStatus_To_v1_NamespaceStatus(in, out, s) -} - -func autoConvert_v1_Node_To_api_Node(in *Node, out *api.Node, s conversion.Scope) error { - SetDefaults_Node(in) - if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { - return err - } - if err := Convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - if err := Convert_v1_NodeSpec_To_api_NodeSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1_NodeStatus_To_api_NodeStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_v1_Node_To_api_Node(in *Node, out *api.Node, s conversion.Scope) error { - return autoConvert_v1_Node_To_api_Node(in, out, s) -} - -func autoConvert_api_Node_To_v1_Node(in *api.Node, out *Node, 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_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - if err := Convert_api_NodeSpec_To_v1_NodeSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_api_NodeStatus_To_v1_NodeStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_api_Node_To_v1_Node(in *api.Node, out *Node, s conversion.Scope) error { - return autoConvert_api_Node_To_v1_Node(in, out, s) -} - -func autoConvert_v1_NodeAddress_To_api_NodeAddress(in *NodeAddress, out *api.NodeAddress, s conversion.Scope) error { - out.Type = api.NodeAddressType(in.Type) - out.Address = in.Address - return nil -} - -func Convert_v1_NodeAddress_To_api_NodeAddress(in *NodeAddress, out *api.NodeAddress, s conversion.Scope) error { - return autoConvert_v1_NodeAddress_To_api_NodeAddress(in, out, s) -} - -func autoConvert_api_NodeAddress_To_v1_NodeAddress(in *api.NodeAddress, out *NodeAddress, s conversion.Scope) error { - out.Type = NodeAddressType(in.Type) - out.Address = in.Address - return nil -} - -func Convert_api_NodeAddress_To_v1_NodeAddress(in *api.NodeAddress, out *NodeAddress, s conversion.Scope) error { - return autoConvert_api_NodeAddress_To_v1_NodeAddress(in, out, s) -} - -func autoConvert_v1_NodeAffinity_To_api_NodeAffinity(in *NodeAffinity, out *api.NodeAffinity, s conversion.Scope) error { - if in.RequiredDuringSchedulingIgnoredDuringExecution != nil { - in, out := &in.RequiredDuringSchedulingIgnoredDuringExecution, &out.RequiredDuringSchedulingIgnoredDuringExecution - *out = new(api.NodeSelector) - if err := Convert_v1_NodeSelector_To_api_NodeSelector(*in, *out, s); err != nil { - return err - } - } else { - out.RequiredDuringSchedulingIgnoredDuringExecution = nil - } - if in.PreferredDuringSchedulingIgnoredDuringExecution != nil { - in, out := &in.PreferredDuringSchedulingIgnoredDuringExecution, &out.PreferredDuringSchedulingIgnoredDuringExecution - *out = make([]api.PreferredSchedulingTerm, len(*in)) - for i := range *in { - if err := Convert_v1_PreferredSchedulingTerm_To_api_PreferredSchedulingTerm(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.PreferredDuringSchedulingIgnoredDuringExecution = nil - } - return nil -} - -func Convert_v1_NodeAffinity_To_api_NodeAffinity(in *NodeAffinity, out *api.NodeAffinity, s conversion.Scope) error { - return autoConvert_v1_NodeAffinity_To_api_NodeAffinity(in, out, s) -} - -func autoConvert_api_NodeAffinity_To_v1_NodeAffinity(in *api.NodeAffinity, out *NodeAffinity, s conversion.Scope) error { - if in.RequiredDuringSchedulingIgnoredDuringExecution != nil { - in, out := &in.RequiredDuringSchedulingIgnoredDuringExecution, &out.RequiredDuringSchedulingIgnoredDuringExecution - *out = new(NodeSelector) - if err := Convert_api_NodeSelector_To_v1_NodeSelector(*in, *out, s); err != nil { - return err - } - } else { - out.RequiredDuringSchedulingIgnoredDuringExecution = nil - } - if in.PreferredDuringSchedulingIgnoredDuringExecution != nil { - in, out := &in.PreferredDuringSchedulingIgnoredDuringExecution, &out.PreferredDuringSchedulingIgnoredDuringExecution - *out = make([]PreferredSchedulingTerm, len(*in)) - for i := range *in { - if err := Convert_api_PreferredSchedulingTerm_To_v1_PreferredSchedulingTerm(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.PreferredDuringSchedulingIgnoredDuringExecution = nil - } - return nil -} - -func Convert_api_NodeAffinity_To_v1_NodeAffinity(in *api.NodeAffinity, out *NodeAffinity, s conversion.Scope) error { - return autoConvert_api_NodeAffinity_To_v1_NodeAffinity(in, out, s) -} - -func autoConvert_v1_NodeCondition_To_api_NodeCondition(in *NodeCondition, out *api.NodeCondition, s conversion.Scope) error { - out.Type = api.NodeConditionType(in.Type) - out.Status = api.ConditionStatus(in.Status) - if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastHeartbeatTime, &out.LastHeartbeatTime, s); err != nil { - return err - } - if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastTransitionTime, &out.LastTransitionTime, s); err != nil { - return err - } - out.Reason = in.Reason - out.Message = in.Message - return nil -} - -func Convert_v1_NodeCondition_To_api_NodeCondition(in *NodeCondition, out *api.NodeCondition, s conversion.Scope) error { - return autoConvert_v1_NodeCondition_To_api_NodeCondition(in, out, s) -} - -func autoConvert_api_NodeCondition_To_v1_NodeCondition(in *api.NodeCondition, out *NodeCondition, s conversion.Scope) error { - out.Type = NodeConditionType(in.Type) - out.Status = ConditionStatus(in.Status) - if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastHeartbeatTime, &out.LastHeartbeatTime, s); err != nil { - return err - } - if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastTransitionTime, &out.LastTransitionTime, s); err != nil { - return err - } - out.Reason = in.Reason - out.Message = in.Message - return nil -} - -func Convert_api_NodeCondition_To_v1_NodeCondition(in *api.NodeCondition, out *NodeCondition, s conversion.Scope) error { - return autoConvert_api_NodeCondition_To_v1_NodeCondition(in, out, s) -} - -func autoConvert_v1_NodeDaemonEndpoints_To_api_NodeDaemonEndpoints(in *NodeDaemonEndpoints, out *api.NodeDaemonEndpoints, s conversion.Scope) error { - if err := Convert_v1_DaemonEndpoint_To_api_DaemonEndpoint(&in.KubeletEndpoint, &out.KubeletEndpoint, s); err != nil { - return err - } - return nil -} - -func Convert_v1_NodeDaemonEndpoints_To_api_NodeDaemonEndpoints(in *NodeDaemonEndpoints, out *api.NodeDaemonEndpoints, s conversion.Scope) error { - return autoConvert_v1_NodeDaemonEndpoints_To_api_NodeDaemonEndpoints(in, out, s) -} - -func autoConvert_api_NodeDaemonEndpoints_To_v1_NodeDaemonEndpoints(in *api.NodeDaemonEndpoints, out *NodeDaemonEndpoints, s conversion.Scope) error { - if err := Convert_api_DaemonEndpoint_To_v1_DaemonEndpoint(&in.KubeletEndpoint, &out.KubeletEndpoint, s); err != nil { - return err - } - return nil -} - -func Convert_api_NodeDaemonEndpoints_To_v1_NodeDaemonEndpoints(in *api.NodeDaemonEndpoints, out *NodeDaemonEndpoints, s conversion.Scope) error { - return autoConvert_api_NodeDaemonEndpoints_To_v1_NodeDaemonEndpoints(in, out, s) -} - -func autoConvert_v1_NodeList_To_api_NodeList(in *NodeList, out *api.NodeList, 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([]api.Node, len(*in)) - for i := range *in { - if err := Convert_v1_Node_To_api_Node(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1_NodeList_To_api_NodeList(in *NodeList, out *api.NodeList, s conversion.Scope) error { - return autoConvert_v1_NodeList_To_api_NodeList(in, out, s) -} - -func autoConvert_api_NodeList_To_v1_NodeList(in *api.NodeList, out *NodeList, 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([]Node, len(*in)) - for i := range *in { - if err := Convert_api_Node_To_v1_Node(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_api_NodeList_To_v1_NodeList(in *api.NodeList, out *NodeList, s conversion.Scope) error { - return autoConvert_api_NodeList_To_v1_NodeList(in, out, s) -} - -func autoConvert_v1_NodeProxyOptions_To_api_NodeProxyOptions(in *NodeProxyOptions, out *api.NodeProxyOptions, s conversion.Scope) error { - if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { - return err - } - out.Path = in.Path - return nil -} - -func Convert_v1_NodeProxyOptions_To_api_NodeProxyOptions(in *NodeProxyOptions, out *api.NodeProxyOptions, s conversion.Scope) error { - return autoConvert_v1_NodeProxyOptions_To_api_NodeProxyOptions(in, out, s) -} - -func autoConvert_api_NodeProxyOptions_To_v1_NodeProxyOptions(in *api.NodeProxyOptions, out *NodeProxyOptions, s conversion.Scope) error { - if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { - return err - } - out.Path = in.Path - return nil -} - -func Convert_api_NodeProxyOptions_To_v1_NodeProxyOptions(in *api.NodeProxyOptions, out *NodeProxyOptions, s conversion.Scope) error { - return autoConvert_api_NodeProxyOptions_To_v1_NodeProxyOptions(in, out, s) -} - -func autoConvert_v1_NodeSelector_To_api_NodeSelector(in *NodeSelector, out *api.NodeSelector, s conversion.Scope) error { - if in.NodeSelectorTerms != nil { - in, out := &in.NodeSelectorTerms, &out.NodeSelectorTerms - *out = make([]api.NodeSelectorTerm, len(*in)) - for i := range *in { - if err := Convert_v1_NodeSelectorTerm_To_api_NodeSelectorTerm(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.NodeSelectorTerms = nil - } - return nil -} - -func Convert_v1_NodeSelector_To_api_NodeSelector(in *NodeSelector, out *api.NodeSelector, s conversion.Scope) error { - return autoConvert_v1_NodeSelector_To_api_NodeSelector(in, out, s) -} - -func autoConvert_api_NodeSelector_To_v1_NodeSelector(in *api.NodeSelector, out *NodeSelector, s conversion.Scope) error { - if in.NodeSelectorTerms != nil { - in, out := &in.NodeSelectorTerms, &out.NodeSelectorTerms - *out = make([]NodeSelectorTerm, len(*in)) - for i := range *in { - if err := Convert_api_NodeSelectorTerm_To_v1_NodeSelectorTerm(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.NodeSelectorTerms = nil - } - return nil -} - -func Convert_api_NodeSelector_To_v1_NodeSelector(in *api.NodeSelector, out *NodeSelector, s conversion.Scope) error { - return autoConvert_api_NodeSelector_To_v1_NodeSelector(in, out, s) -} - -func autoConvert_v1_NodeSelectorRequirement_To_api_NodeSelectorRequirement(in *NodeSelectorRequirement, out *api.NodeSelectorRequirement, s conversion.Scope) error { - out.Key = in.Key - out.Operator = api.NodeSelectorOperator(in.Operator) - out.Values = in.Values - return nil -} - -func Convert_v1_NodeSelectorRequirement_To_api_NodeSelectorRequirement(in *NodeSelectorRequirement, out *api.NodeSelectorRequirement, s conversion.Scope) error { - return autoConvert_v1_NodeSelectorRequirement_To_api_NodeSelectorRequirement(in, out, s) -} - -func autoConvert_api_NodeSelectorRequirement_To_v1_NodeSelectorRequirement(in *api.NodeSelectorRequirement, out *NodeSelectorRequirement, s conversion.Scope) error { - out.Key = in.Key - out.Operator = NodeSelectorOperator(in.Operator) - out.Values = in.Values - return nil -} - -func Convert_api_NodeSelectorRequirement_To_v1_NodeSelectorRequirement(in *api.NodeSelectorRequirement, out *NodeSelectorRequirement, s conversion.Scope) error { - return autoConvert_api_NodeSelectorRequirement_To_v1_NodeSelectorRequirement(in, out, s) -} - -func autoConvert_v1_NodeSelectorTerm_To_api_NodeSelectorTerm(in *NodeSelectorTerm, out *api.NodeSelectorTerm, s conversion.Scope) error { - if in.MatchExpressions != nil { - in, out := &in.MatchExpressions, &out.MatchExpressions - *out = make([]api.NodeSelectorRequirement, len(*in)) - for i := range *in { - if err := Convert_v1_NodeSelectorRequirement_To_api_NodeSelectorRequirement(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.MatchExpressions = nil - } - return nil -} - -func Convert_v1_NodeSelectorTerm_To_api_NodeSelectorTerm(in *NodeSelectorTerm, out *api.NodeSelectorTerm, s conversion.Scope) error { - return autoConvert_v1_NodeSelectorTerm_To_api_NodeSelectorTerm(in, out, s) -} - -func autoConvert_api_NodeSelectorTerm_To_v1_NodeSelectorTerm(in *api.NodeSelectorTerm, out *NodeSelectorTerm, s conversion.Scope) error { - if in.MatchExpressions != nil { - in, out := &in.MatchExpressions, &out.MatchExpressions - *out = make([]NodeSelectorRequirement, len(*in)) - for i := range *in { - if err := Convert_api_NodeSelectorRequirement_To_v1_NodeSelectorRequirement(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.MatchExpressions = nil - } - return nil -} - -func Convert_api_NodeSelectorTerm_To_v1_NodeSelectorTerm(in *api.NodeSelectorTerm, out *NodeSelectorTerm, s conversion.Scope) error { - return autoConvert_api_NodeSelectorTerm_To_v1_NodeSelectorTerm(in, out, s) -} - -func autoConvert_v1_NodeSpec_To_api_NodeSpec(in *NodeSpec, out *api.NodeSpec, s conversion.Scope) error { - out.PodCIDR = in.PodCIDR - out.ExternalID = in.ExternalID - out.ProviderID = in.ProviderID - out.Unschedulable = in.Unschedulable - return nil -} - -func Convert_v1_NodeSpec_To_api_NodeSpec(in *NodeSpec, out *api.NodeSpec, s conversion.Scope) error { - return autoConvert_v1_NodeSpec_To_api_NodeSpec(in, out, s) -} - -func autoConvert_api_NodeSpec_To_v1_NodeSpec(in *api.NodeSpec, out *NodeSpec, s conversion.Scope) error { - out.PodCIDR = in.PodCIDR - out.ExternalID = in.ExternalID - out.ProviderID = in.ProviderID - out.Unschedulable = in.Unschedulable - return nil -} - -func Convert_api_NodeSpec_To_v1_NodeSpec(in *api.NodeSpec, out *NodeSpec, s conversion.Scope) error { - return autoConvert_api_NodeSpec_To_v1_NodeSpec(in, out, s) -} - -func autoConvert_v1_NodeStatus_To_api_NodeStatus(in *NodeStatus, out *api.NodeStatus, s conversion.Scope) error { - SetDefaults_NodeStatus(in) - if err := Convert_v1_ResourceList_To_api_ResourceList(&in.Capacity, &out.Capacity, s); err != nil { - return err - } - if err := Convert_v1_ResourceList_To_api_ResourceList(&in.Allocatable, &out.Allocatable, s); err != nil { - return err - } - out.Phase = api.NodePhase(in.Phase) - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]api.NodeCondition, len(*in)) - for i := range *in { - if err := Convert_v1_NodeCondition_To_api_NodeCondition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - if in.Addresses != nil { - in, out := &in.Addresses, &out.Addresses - *out = make([]api.NodeAddress, len(*in)) - for i := range *in { - if err := Convert_v1_NodeAddress_To_api_NodeAddress(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Addresses = nil - } - if err := Convert_v1_NodeDaemonEndpoints_To_api_NodeDaemonEndpoints(&in.DaemonEndpoints, &out.DaemonEndpoints, s); err != nil { - return err - } - if err := Convert_v1_NodeSystemInfo_To_api_NodeSystemInfo(&in.NodeInfo, &out.NodeInfo, s); err != nil { - return err - } - if in.Images != nil { - in, out := &in.Images, &out.Images - *out = make([]api.ContainerImage, len(*in)) - for i := range *in { - if err := Convert_v1_ContainerImage_To_api_ContainerImage(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Images = nil - } - if in.VolumesInUse != nil { - in, out := &in.VolumesInUse, &out.VolumesInUse - *out = make([]api.UniqueVolumeName, len(*in)) - for i := range *in { - (*out)[i] = api.UniqueVolumeName((*in)[i]) - } - } else { - out.VolumesInUse = nil - } - if in.VolumesAttached != nil { - in, out := &in.VolumesAttached, &out.VolumesAttached - *out = make([]api.AttachedVolume, len(*in)) - for i := range *in { - if err := Convert_v1_AttachedVolume_To_api_AttachedVolume(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.VolumesAttached = nil - } - return nil -} - -func Convert_v1_NodeStatus_To_api_NodeStatus(in *NodeStatus, out *api.NodeStatus, s conversion.Scope) error { - return autoConvert_v1_NodeStatus_To_api_NodeStatus(in, out, s) -} - -func autoConvert_api_NodeStatus_To_v1_NodeStatus(in *api.NodeStatus, out *NodeStatus, s conversion.Scope) error { - if in.Capacity != nil { - in, out := &in.Capacity, &out.Capacity - *out = make(ResourceList, len(*in)) - for key, val := range *in { - newVal := new(resource.Quantity) - if err := api.Convert_resource_Quantity_To_resource_Quantity(&val, newVal, s); err != nil { - return err - } - (*out)[ResourceName(key)] = *newVal - } - } else { - out.Capacity = nil - } - if in.Allocatable != nil { - in, out := &in.Allocatable, &out.Allocatable - *out = make(ResourceList, len(*in)) - for key, val := range *in { - newVal := new(resource.Quantity) - if err := api.Convert_resource_Quantity_To_resource_Quantity(&val, newVal, s); err != nil { - return err - } - (*out)[ResourceName(key)] = *newVal - } - } else { - out.Allocatable = nil - } - out.Phase = NodePhase(in.Phase) - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]NodeCondition, len(*in)) - for i := range *in { - if err := Convert_api_NodeCondition_To_v1_NodeCondition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - if in.Addresses != nil { - in, out := &in.Addresses, &out.Addresses - *out = make([]NodeAddress, len(*in)) - for i := range *in { - if err := Convert_api_NodeAddress_To_v1_NodeAddress(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Addresses = nil - } - if err := Convert_api_NodeDaemonEndpoints_To_v1_NodeDaemonEndpoints(&in.DaemonEndpoints, &out.DaemonEndpoints, s); err != nil { - return err - } - if err := Convert_api_NodeSystemInfo_To_v1_NodeSystemInfo(&in.NodeInfo, &out.NodeInfo, s); err != nil { - return err - } - if in.Images != nil { - in, out := &in.Images, &out.Images - *out = make([]ContainerImage, len(*in)) - for i := range *in { - if err := Convert_api_ContainerImage_To_v1_ContainerImage(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Images = nil - } - if in.VolumesInUse != nil { - in, out := &in.VolumesInUse, &out.VolumesInUse - *out = make([]UniqueVolumeName, len(*in)) - for i := range *in { - (*out)[i] = UniqueVolumeName((*in)[i]) - } - } else { - out.VolumesInUse = nil - } - if in.VolumesAttached != nil { - in, out := &in.VolumesAttached, &out.VolumesAttached - *out = make([]AttachedVolume, len(*in)) - for i := range *in { - if err := Convert_api_AttachedVolume_To_v1_AttachedVolume(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.VolumesAttached = nil - } - return nil -} - -func Convert_api_NodeStatus_To_v1_NodeStatus(in *api.NodeStatus, out *NodeStatus, s conversion.Scope) error { - return autoConvert_api_NodeStatus_To_v1_NodeStatus(in, out, s) -} - -func autoConvert_v1_NodeSystemInfo_To_api_NodeSystemInfo(in *NodeSystemInfo, out *api.NodeSystemInfo, s conversion.Scope) error { - out.MachineID = in.MachineID - out.SystemUUID = in.SystemUUID - out.BootID = in.BootID - out.KernelVersion = in.KernelVersion - out.OSImage = in.OSImage - out.ContainerRuntimeVersion = in.ContainerRuntimeVersion - out.KubeletVersion = in.KubeletVersion - out.KubeProxyVersion = in.KubeProxyVersion - out.OperatingSystem = in.OperatingSystem - out.Architecture = in.Architecture - return nil -} - -func Convert_v1_NodeSystemInfo_To_api_NodeSystemInfo(in *NodeSystemInfo, out *api.NodeSystemInfo, s conversion.Scope) error { - return autoConvert_v1_NodeSystemInfo_To_api_NodeSystemInfo(in, out, s) -} - -func autoConvert_api_NodeSystemInfo_To_v1_NodeSystemInfo(in *api.NodeSystemInfo, out *NodeSystemInfo, s conversion.Scope) error { - out.MachineID = in.MachineID - out.SystemUUID = in.SystemUUID - out.BootID = in.BootID - out.KernelVersion = in.KernelVersion - out.OSImage = in.OSImage - out.ContainerRuntimeVersion = in.ContainerRuntimeVersion - out.KubeletVersion = in.KubeletVersion - out.KubeProxyVersion = in.KubeProxyVersion - out.OperatingSystem = in.OperatingSystem - out.Architecture = in.Architecture - return nil -} - -func Convert_api_NodeSystemInfo_To_v1_NodeSystemInfo(in *api.NodeSystemInfo, out *NodeSystemInfo, s conversion.Scope) error { - return autoConvert_api_NodeSystemInfo_To_v1_NodeSystemInfo(in, out, s) -} - -func autoConvert_v1_ObjectFieldSelector_To_api_ObjectFieldSelector(in *ObjectFieldSelector, out *api.ObjectFieldSelector, s conversion.Scope) error { - SetDefaults_ObjectFieldSelector(in) - out.APIVersion = in.APIVersion - out.FieldPath = in.FieldPath - return nil -} - -func Convert_v1_ObjectFieldSelector_To_api_ObjectFieldSelector(in *ObjectFieldSelector, out *api.ObjectFieldSelector, s conversion.Scope) error { - return autoConvert_v1_ObjectFieldSelector_To_api_ObjectFieldSelector(in, out, s) -} - -func autoConvert_api_ObjectFieldSelector_To_v1_ObjectFieldSelector(in *api.ObjectFieldSelector, out *ObjectFieldSelector, s conversion.Scope) error { - out.APIVersion = in.APIVersion - out.FieldPath = in.FieldPath - return nil -} - -func Convert_api_ObjectFieldSelector_To_v1_ObjectFieldSelector(in *api.ObjectFieldSelector, out *ObjectFieldSelector, s conversion.Scope) error { - return autoConvert_api_ObjectFieldSelector_To_v1_ObjectFieldSelector(in, out, s) -} - -func autoConvert_v1_ObjectMeta_To_api_ObjectMeta(in *ObjectMeta, out *api.ObjectMeta, s conversion.Scope) error { - out.Name = in.Name - out.GenerateName = in.GenerateName - out.Namespace = in.Namespace - out.SelfLink = in.SelfLink - out.UID = types.UID(in.UID) - out.ResourceVersion = in.ResourceVersion - out.Generation = in.Generation - if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.CreationTimestamp, &out.CreationTimestamp, s); err != nil { - return err - } - out.DeletionTimestamp = in.DeletionTimestamp - out.DeletionGracePeriodSeconds = in.DeletionGracePeriodSeconds - out.Labels = in.Labels - out.Annotations = in.Annotations - if in.OwnerReferences != nil { - in, out := &in.OwnerReferences, &out.OwnerReferences - *out = make([]api.OwnerReference, len(*in)) - for i := range *in { - if err := Convert_v1_OwnerReference_To_api_OwnerReference(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.OwnerReferences = nil - } - out.Finalizers = in.Finalizers - return nil -} - -func Convert_v1_ObjectMeta_To_api_ObjectMeta(in *ObjectMeta, out *api.ObjectMeta, s conversion.Scope) error { - return autoConvert_v1_ObjectMeta_To_api_ObjectMeta(in, out, s) -} - -func autoConvert_api_ObjectMeta_To_v1_ObjectMeta(in *api.ObjectMeta, out *ObjectMeta, s conversion.Scope) error { - out.Name = in.Name - out.GenerateName = in.GenerateName - out.Namespace = in.Namespace - out.SelfLink = in.SelfLink - out.UID = types.UID(in.UID) - out.ResourceVersion = in.ResourceVersion - out.Generation = in.Generation - if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.CreationTimestamp, &out.CreationTimestamp, s); err != nil { - return err - } - out.DeletionTimestamp = in.DeletionTimestamp - out.DeletionGracePeriodSeconds = in.DeletionGracePeriodSeconds - out.Labels = in.Labels - out.Annotations = in.Annotations - if in.OwnerReferences != nil { - in, out := &in.OwnerReferences, &out.OwnerReferences - *out = make([]OwnerReference, len(*in)) - for i := range *in { - if err := Convert_api_OwnerReference_To_v1_OwnerReference(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.OwnerReferences = nil - } - out.Finalizers = in.Finalizers - return nil -} - -func Convert_api_ObjectMeta_To_v1_ObjectMeta(in *api.ObjectMeta, out *ObjectMeta, s conversion.Scope) error { - return autoConvert_api_ObjectMeta_To_v1_ObjectMeta(in, out, s) -} - -func autoConvert_v1_ObjectReference_To_api_ObjectReference(in *ObjectReference, out *api.ObjectReference, s conversion.Scope) error { - out.Kind = in.Kind - out.Namespace = in.Namespace - out.Name = in.Name - out.UID = types.UID(in.UID) - out.APIVersion = in.APIVersion - out.ResourceVersion = in.ResourceVersion - out.FieldPath = in.FieldPath - return nil -} - -func Convert_v1_ObjectReference_To_api_ObjectReference(in *ObjectReference, out *api.ObjectReference, s conversion.Scope) error { - return autoConvert_v1_ObjectReference_To_api_ObjectReference(in, out, s) -} - -func autoConvert_api_ObjectReference_To_v1_ObjectReference(in *api.ObjectReference, out *ObjectReference, s conversion.Scope) error { - out.Kind = in.Kind - out.Namespace = in.Namespace - out.Name = in.Name - out.UID = types.UID(in.UID) - out.APIVersion = in.APIVersion - out.ResourceVersion = in.ResourceVersion - out.FieldPath = in.FieldPath - return nil -} - -func Convert_api_ObjectReference_To_v1_ObjectReference(in *api.ObjectReference, out *ObjectReference, s conversion.Scope) error { - return autoConvert_api_ObjectReference_To_v1_ObjectReference(in, out, s) -} - -func autoConvert_v1_OwnerReference_To_api_OwnerReference(in *OwnerReference, out *api.OwnerReference, s conversion.Scope) error { - out.APIVersion = in.APIVersion - out.Kind = in.Kind - out.Name = in.Name - out.UID = types.UID(in.UID) - out.Controller = in.Controller - return nil -} - -func Convert_v1_OwnerReference_To_api_OwnerReference(in *OwnerReference, out *api.OwnerReference, s conversion.Scope) error { - return autoConvert_v1_OwnerReference_To_api_OwnerReference(in, out, s) -} - -func autoConvert_api_OwnerReference_To_v1_OwnerReference(in *api.OwnerReference, out *OwnerReference, s conversion.Scope) error { - out.APIVersion = in.APIVersion - out.Kind = in.Kind - out.Name = in.Name - out.UID = types.UID(in.UID) - out.Controller = in.Controller - return nil -} - -func Convert_api_OwnerReference_To_v1_OwnerReference(in *api.OwnerReference, out *OwnerReference, s conversion.Scope) error { - return autoConvert_api_OwnerReference_To_v1_OwnerReference(in, out, s) -} - -func autoConvert_v1_PersistentVolume_To_api_PersistentVolume(in *PersistentVolume, out *api.PersistentVolume, s conversion.Scope) error { - SetDefaults_PersistentVolume(in) - if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { - return err - } - if err := Convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - if err := Convert_v1_PersistentVolumeSpec_To_api_PersistentVolumeSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1_PersistentVolumeStatus_To_api_PersistentVolumeStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_v1_PersistentVolume_To_api_PersistentVolume(in *PersistentVolume, out *api.PersistentVolume, s conversion.Scope) error { - return autoConvert_v1_PersistentVolume_To_api_PersistentVolume(in, out, s) -} - -func autoConvert_api_PersistentVolume_To_v1_PersistentVolume(in *api.PersistentVolume, out *PersistentVolume, 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_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - if err := Convert_api_PersistentVolumeSpec_To_v1_PersistentVolumeSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_api_PersistentVolumeStatus_To_v1_PersistentVolumeStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_api_PersistentVolume_To_v1_PersistentVolume(in *api.PersistentVolume, out *PersistentVolume, s conversion.Scope) error { - return autoConvert_api_PersistentVolume_To_v1_PersistentVolume(in, out, s) -} - -func autoConvert_v1_PersistentVolumeClaim_To_api_PersistentVolumeClaim(in *PersistentVolumeClaim, out *api.PersistentVolumeClaim, s conversion.Scope) error { - SetDefaults_PersistentVolumeClaim(in) - if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { - return err - } - if err := Convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - if err := Convert_v1_PersistentVolumeClaimSpec_To_api_PersistentVolumeClaimSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1_PersistentVolumeClaimStatus_To_api_PersistentVolumeClaimStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_v1_PersistentVolumeClaim_To_api_PersistentVolumeClaim(in *PersistentVolumeClaim, out *api.PersistentVolumeClaim, s conversion.Scope) error { - return autoConvert_v1_PersistentVolumeClaim_To_api_PersistentVolumeClaim(in, out, s) -} - -func autoConvert_api_PersistentVolumeClaim_To_v1_PersistentVolumeClaim(in *api.PersistentVolumeClaim, out *PersistentVolumeClaim, 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_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - if err := Convert_api_PersistentVolumeClaimSpec_To_v1_PersistentVolumeClaimSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_api_PersistentVolumeClaimStatus_To_v1_PersistentVolumeClaimStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_api_PersistentVolumeClaim_To_v1_PersistentVolumeClaim(in *api.PersistentVolumeClaim, out *PersistentVolumeClaim, s conversion.Scope) error { - return autoConvert_api_PersistentVolumeClaim_To_v1_PersistentVolumeClaim(in, out, s) -} - -func autoConvert_v1_PersistentVolumeClaimList_To_api_PersistentVolumeClaimList(in *PersistentVolumeClaimList, out *api.PersistentVolumeClaimList, 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([]api.PersistentVolumeClaim, len(*in)) - for i := range *in { - if err := Convert_v1_PersistentVolumeClaim_To_api_PersistentVolumeClaim(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1_PersistentVolumeClaimList_To_api_PersistentVolumeClaimList(in *PersistentVolumeClaimList, out *api.PersistentVolumeClaimList, s conversion.Scope) error { - return autoConvert_v1_PersistentVolumeClaimList_To_api_PersistentVolumeClaimList(in, out, s) -} - -func autoConvert_api_PersistentVolumeClaimList_To_v1_PersistentVolumeClaimList(in *api.PersistentVolumeClaimList, out *PersistentVolumeClaimList, 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([]PersistentVolumeClaim, len(*in)) - for i := range *in { - if err := Convert_api_PersistentVolumeClaim_To_v1_PersistentVolumeClaim(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_api_PersistentVolumeClaimList_To_v1_PersistentVolumeClaimList(in *api.PersistentVolumeClaimList, out *PersistentVolumeClaimList, s conversion.Scope) error { - return autoConvert_api_PersistentVolumeClaimList_To_v1_PersistentVolumeClaimList(in, out, s) -} - -func autoConvert_v1_PersistentVolumeClaimSpec_To_api_PersistentVolumeClaimSpec(in *PersistentVolumeClaimSpec, out *api.PersistentVolumeClaimSpec, s conversion.Scope) error { - if in.AccessModes != nil { - in, out := &in.AccessModes, &out.AccessModes - *out = make([]api.PersistentVolumeAccessMode, len(*in)) - for i := range *in { - (*out)[i] = api.PersistentVolumeAccessMode((*in)[i]) - } - } else { - out.AccessModes = nil - } - out.Selector = in.Selector - if err := Convert_v1_ResourceRequirements_To_api_ResourceRequirements(&in.Resources, &out.Resources, s); err != nil { - return err - } - out.VolumeName = in.VolumeName - return nil -} - -func Convert_v1_PersistentVolumeClaimSpec_To_api_PersistentVolumeClaimSpec(in *PersistentVolumeClaimSpec, out *api.PersistentVolumeClaimSpec, s conversion.Scope) error { - return autoConvert_v1_PersistentVolumeClaimSpec_To_api_PersistentVolumeClaimSpec(in, out, s) -} - -func autoConvert_api_PersistentVolumeClaimSpec_To_v1_PersistentVolumeClaimSpec(in *api.PersistentVolumeClaimSpec, out *PersistentVolumeClaimSpec, s conversion.Scope) error { - if in.AccessModes != nil { - in, out := &in.AccessModes, &out.AccessModes - *out = make([]PersistentVolumeAccessMode, len(*in)) - for i := range *in { - (*out)[i] = PersistentVolumeAccessMode((*in)[i]) - } - } else { - out.AccessModes = nil - } - out.Selector = in.Selector - if err := Convert_api_ResourceRequirements_To_v1_ResourceRequirements(&in.Resources, &out.Resources, s); err != nil { - return err - } - out.VolumeName = in.VolumeName - return nil -} - -func Convert_api_PersistentVolumeClaimSpec_To_v1_PersistentVolumeClaimSpec(in *api.PersistentVolumeClaimSpec, out *PersistentVolumeClaimSpec, s conversion.Scope) error { - return autoConvert_api_PersistentVolumeClaimSpec_To_v1_PersistentVolumeClaimSpec(in, out, s) -} - -func autoConvert_v1_PersistentVolumeClaimStatus_To_api_PersistentVolumeClaimStatus(in *PersistentVolumeClaimStatus, out *api.PersistentVolumeClaimStatus, s conversion.Scope) error { - out.Phase = api.PersistentVolumeClaimPhase(in.Phase) - if in.AccessModes != nil { - in, out := &in.AccessModes, &out.AccessModes - *out = make([]api.PersistentVolumeAccessMode, len(*in)) - for i := range *in { - (*out)[i] = api.PersistentVolumeAccessMode((*in)[i]) - } - } else { - out.AccessModes = nil - } - if err := Convert_v1_ResourceList_To_api_ResourceList(&in.Capacity, &out.Capacity, s); err != nil { - return err - } - return nil -} - -func Convert_v1_PersistentVolumeClaimStatus_To_api_PersistentVolumeClaimStatus(in *PersistentVolumeClaimStatus, out *api.PersistentVolumeClaimStatus, s conversion.Scope) error { - return autoConvert_v1_PersistentVolumeClaimStatus_To_api_PersistentVolumeClaimStatus(in, out, s) -} - -func autoConvert_api_PersistentVolumeClaimStatus_To_v1_PersistentVolumeClaimStatus(in *api.PersistentVolumeClaimStatus, out *PersistentVolumeClaimStatus, s conversion.Scope) error { - out.Phase = PersistentVolumeClaimPhase(in.Phase) - if in.AccessModes != nil { - in, out := &in.AccessModes, &out.AccessModes - *out = make([]PersistentVolumeAccessMode, len(*in)) - for i := range *in { - (*out)[i] = PersistentVolumeAccessMode((*in)[i]) - } - } else { - out.AccessModes = nil - } - if in.Capacity != nil { - in, out := &in.Capacity, &out.Capacity - *out = make(ResourceList, len(*in)) - for key, val := range *in { - newVal := new(resource.Quantity) - if err := api.Convert_resource_Quantity_To_resource_Quantity(&val, newVal, s); err != nil { - return err - } - (*out)[ResourceName(key)] = *newVal - } - } else { - out.Capacity = nil - } - return nil -} - -func Convert_api_PersistentVolumeClaimStatus_To_v1_PersistentVolumeClaimStatus(in *api.PersistentVolumeClaimStatus, out *PersistentVolumeClaimStatus, s conversion.Scope) error { - return autoConvert_api_PersistentVolumeClaimStatus_To_v1_PersistentVolumeClaimStatus(in, out, s) -} - -func autoConvert_v1_PersistentVolumeClaimVolumeSource_To_api_PersistentVolumeClaimVolumeSource(in *PersistentVolumeClaimVolumeSource, out *api.PersistentVolumeClaimVolumeSource, s conversion.Scope) error { - out.ClaimName = in.ClaimName - out.ReadOnly = in.ReadOnly - return nil -} - -func Convert_v1_PersistentVolumeClaimVolumeSource_To_api_PersistentVolumeClaimVolumeSource(in *PersistentVolumeClaimVolumeSource, out *api.PersistentVolumeClaimVolumeSource, s conversion.Scope) error { - return autoConvert_v1_PersistentVolumeClaimVolumeSource_To_api_PersistentVolumeClaimVolumeSource(in, out, s) -} - -func autoConvert_api_PersistentVolumeClaimVolumeSource_To_v1_PersistentVolumeClaimVolumeSource(in *api.PersistentVolumeClaimVolumeSource, out *PersistentVolumeClaimVolumeSource, s conversion.Scope) error { - out.ClaimName = in.ClaimName - out.ReadOnly = in.ReadOnly - return nil -} - -func Convert_api_PersistentVolumeClaimVolumeSource_To_v1_PersistentVolumeClaimVolumeSource(in *api.PersistentVolumeClaimVolumeSource, out *PersistentVolumeClaimVolumeSource, s conversion.Scope) error { - return autoConvert_api_PersistentVolumeClaimVolumeSource_To_v1_PersistentVolumeClaimVolumeSource(in, out, s) -} - -func autoConvert_v1_PersistentVolumeList_To_api_PersistentVolumeList(in *PersistentVolumeList, out *api.PersistentVolumeList, 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([]api.PersistentVolume, len(*in)) - for i := range *in { - if err := Convert_v1_PersistentVolume_To_api_PersistentVolume(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1_PersistentVolumeList_To_api_PersistentVolumeList(in *PersistentVolumeList, out *api.PersistentVolumeList, s conversion.Scope) error { - return autoConvert_v1_PersistentVolumeList_To_api_PersistentVolumeList(in, out, s) -} - -func autoConvert_api_PersistentVolumeList_To_v1_PersistentVolumeList(in *api.PersistentVolumeList, out *PersistentVolumeList, 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([]PersistentVolume, len(*in)) - for i := range *in { - if err := Convert_api_PersistentVolume_To_v1_PersistentVolume(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_api_PersistentVolumeList_To_v1_PersistentVolumeList(in *api.PersistentVolumeList, out *PersistentVolumeList, s conversion.Scope) error { - return autoConvert_api_PersistentVolumeList_To_v1_PersistentVolumeList(in, out, s) -} - -func autoConvert_v1_PersistentVolumeSource_To_api_PersistentVolumeSource(in *PersistentVolumeSource, out *api.PersistentVolumeSource, s conversion.Scope) error { - if in.GCEPersistentDisk != nil { - in, out := &in.GCEPersistentDisk, &out.GCEPersistentDisk - *out = new(api.GCEPersistentDiskVolumeSource) - if err := Convert_v1_GCEPersistentDiskVolumeSource_To_api_GCEPersistentDiskVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.GCEPersistentDisk = nil - } - if in.AWSElasticBlockStore != nil { - in, out := &in.AWSElasticBlockStore, &out.AWSElasticBlockStore - *out = new(api.AWSElasticBlockStoreVolumeSource) - if err := Convert_v1_AWSElasticBlockStoreVolumeSource_To_api_AWSElasticBlockStoreVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.AWSElasticBlockStore = nil - } - if in.HostPath != nil { - in, out := &in.HostPath, &out.HostPath - *out = new(api.HostPathVolumeSource) - if err := Convert_v1_HostPathVolumeSource_To_api_HostPathVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.HostPath = nil - } - if in.Glusterfs != nil { - in, out := &in.Glusterfs, &out.Glusterfs - *out = new(api.GlusterfsVolumeSource) - if err := Convert_v1_GlusterfsVolumeSource_To_api_GlusterfsVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.Glusterfs = nil - } - if in.NFS != nil { - in, out := &in.NFS, &out.NFS - *out = new(api.NFSVolumeSource) - if err := Convert_v1_NFSVolumeSource_To_api_NFSVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.NFS = nil - } - if in.RBD != nil { - in, out := &in.RBD, &out.RBD - *out = new(api.RBDVolumeSource) - if err := Convert_v1_RBDVolumeSource_To_api_RBDVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.RBD = nil - } - if in.ISCSI != nil { - in, out := &in.ISCSI, &out.ISCSI - *out = new(api.ISCSIVolumeSource) - if err := Convert_v1_ISCSIVolumeSource_To_api_ISCSIVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.ISCSI = nil - } - if in.Cinder != nil { - in, out := &in.Cinder, &out.Cinder - *out = new(api.CinderVolumeSource) - if err := Convert_v1_CinderVolumeSource_To_api_CinderVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.Cinder = nil - } - if in.CephFS != nil { - in, out := &in.CephFS, &out.CephFS - *out = new(api.CephFSVolumeSource) - if err := Convert_v1_CephFSVolumeSource_To_api_CephFSVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.CephFS = nil - } - if in.FC != nil { - in, out := &in.FC, &out.FC - *out = new(api.FCVolumeSource) - if err := Convert_v1_FCVolumeSource_To_api_FCVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.FC = nil - } - if in.Flocker != nil { - in, out := &in.Flocker, &out.Flocker - *out = new(api.FlockerVolumeSource) - if err := Convert_v1_FlockerVolumeSource_To_api_FlockerVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.Flocker = nil - } - if in.FlexVolume != nil { - in, out := &in.FlexVolume, &out.FlexVolume - *out = new(api.FlexVolumeSource) - if err := Convert_v1_FlexVolumeSource_To_api_FlexVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.FlexVolume = nil - } - if in.AzureFile != nil { - in, out := &in.AzureFile, &out.AzureFile - *out = new(api.AzureFileVolumeSource) - if err := Convert_v1_AzureFileVolumeSource_To_api_AzureFileVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.AzureFile = nil - } - if in.VsphereVolume != nil { - in, out := &in.VsphereVolume, &out.VsphereVolume - *out = new(api.VsphereVirtualDiskVolumeSource) - if err := Convert_v1_VsphereVirtualDiskVolumeSource_To_api_VsphereVirtualDiskVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.VsphereVolume = nil - } - return nil -} - -func Convert_v1_PersistentVolumeSource_To_api_PersistentVolumeSource(in *PersistentVolumeSource, out *api.PersistentVolumeSource, s conversion.Scope) error { - return autoConvert_v1_PersistentVolumeSource_To_api_PersistentVolumeSource(in, out, s) -} - -func autoConvert_api_PersistentVolumeSource_To_v1_PersistentVolumeSource(in *api.PersistentVolumeSource, out *PersistentVolumeSource, s conversion.Scope) error { - if in.GCEPersistentDisk != nil { - in, out := &in.GCEPersistentDisk, &out.GCEPersistentDisk - *out = new(GCEPersistentDiskVolumeSource) - if err := Convert_api_GCEPersistentDiskVolumeSource_To_v1_GCEPersistentDiskVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.GCEPersistentDisk = nil - } - if in.AWSElasticBlockStore != nil { - in, out := &in.AWSElasticBlockStore, &out.AWSElasticBlockStore - *out = new(AWSElasticBlockStoreVolumeSource) - if err := Convert_api_AWSElasticBlockStoreVolumeSource_To_v1_AWSElasticBlockStoreVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.AWSElasticBlockStore = nil - } - if in.HostPath != nil { - in, out := &in.HostPath, &out.HostPath - *out = new(HostPathVolumeSource) - if err := Convert_api_HostPathVolumeSource_To_v1_HostPathVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.HostPath = nil - } - if in.Glusterfs != nil { - in, out := &in.Glusterfs, &out.Glusterfs - *out = new(GlusterfsVolumeSource) - if err := Convert_api_GlusterfsVolumeSource_To_v1_GlusterfsVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.Glusterfs = nil - } - if in.NFS != nil { - in, out := &in.NFS, &out.NFS - *out = new(NFSVolumeSource) - if err := Convert_api_NFSVolumeSource_To_v1_NFSVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.NFS = nil - } - if in.RBD != nil { - in, out := &in.RBD, &out.RBD - *out = new(RBDVolumeSource) - if err := Convert_api_RBDVolumeSource_To_v1_RBDVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.RBD = nil - } - if in.ISCSI != nil { - in, out := &in.ISCSI, &out.ISCSI - *out = new(ISCSIVolumeSource) - if err := Convert_api_ISCSIVolumeSource_To_v1_ISCSIVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.ISCSI = nil - } - if in.FlexVolume != nil { - in, out := &in.FlexVolume, &out.FlexVolume - *out = new(FlexVolumeSource) - if err := Convert_api_FlexVolumeSource_To_v1_FlexVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.FlexVolume = nil - } - if in.Cinder != nil { - in, out := &in.Cinder, &out.Cinder - *out = new(CinderVolumeSource) - if err := Convert_api_CinderVolumeSource_To_v1_CinderVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.Cinder = nil - } - if in.CephFS != nil { - in, out := &in.CephFS, &out.CephFS - *out = new(CephFSVolumeSource) - if err := Convert_api_CephFSVolumeSource_To_v1_CephFSVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.CephFS = nil - } - if in.FC != nil { - in, out := &in.FC, &out.FC - *out = new(FCVolumeSource) - if err := Convert_api_FCVolumeSource_To_v1_FCVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.FC = nil - } - if in.Flocker != nil { - in, out := &in.Flocker, &out.Flocker - *out = new(FlockerVolumeSource) - if err := Convert_api_FlockerVolumeSource_To_v1_FlockerVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.Flocker = nil - } - if in.AzureFile != nil { - in, out := &in.AzureFile, &out.AzureFile - *out = new(AzureFileVolumeSource) - if err := Convert_api_AzureFileVolumeSource_To_v1_AzureFileVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.AzureFile = nil - } - if in.VsphereVolume != nil { - in, out := &in.VsphereVolume, &out.VsphereVolume - *out = new(VsphereVirtualDiskVolumeSource) - if err := Convert_api_VsphereVirtualDiskVolumeSource_To_v1_VsphereVirtualDiskVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.VsphereVolume = nil - } - return nil -} - -func Convert_api_PersistentVolumeSource_To_v1_PersistentVolumeSource(in *api.PersistentVolumeSource, out *PersistentVolumeSource, s conversion.Scope) error { - return autoConvert_api_PersistentVolumeSource_To_v1_PersistentVolumeSource(in, out, s) -} - -func autoConvert_v1_PersistentVolumeSpec_To_api_PersistentVolumeSpec(in *PersistentVolumeSpec, out *api.PersistentVolumeSpec, s conversion.Scope) error { - if err := Convert_v1_ResourceList_To_api_ResourceList(&in.Capacity, &out.Capacity, s); err != nil { - return err - } - if err := Convert_v1_PersistentVolumeSource_To_api_PersistentVolumeSource(&in.PersistentVolumeSource, &out.PersistentVolumeSource, s); err != nil { - return err - } - if in.AccessModes != nil { - in, out := &in.AccessModes, &out.AccessModes - *out = make([]api.PersistentVolumeAccessMode, len(*in)) - for i := range *in { - (*out)[i] = api.PersistentVolumeAccessMode((*in)[i]) - } - } else { - out.AccessModes = nil - } - if in.ClaimRef != nil { - in, out := &in.ClaimRef, &out.ClaimRef - *out = new(api.ObjectReference) - if err := Convert_v1_ObjectReference_To_api_ObjectReference(*in, *out, s); err != nil { - return err - } - } else { - out.ClaimRef = nil - } - out.PersistentVolumeReclaimPolicy = api.PersistentVolumeReclaimPolicy(in.PersistentVolumeReclaimPolicy) - return nil -} - -func Convert_v1_PersistentVolumeSpec_To_api_PersistentVolumeSpec(in *PersistentVolumeSpec, out *api.PersistentVolumeSpec, s conversion.Scope) error { - return autoConvert_v1_PersistentVolumeSpec_To_api_PersistentVolumeSpec(in, out, s) -} - -func autoConvert_api_PersistentVolumeSpec_To_v1_PersistentVolumeSpec(in *api.PersistentVolumeSpec, out *PersistentVolumeSpec, s conversion.Scope) error { - if in.Capacity != nil { - in, out := &in.Capacity, &out.Capacity - *out = make(ResourceList, len(*in)) - for key, val := range *in { - newVal := new(resource.Quantity) - if err := api.Convert_resource_Quantity_To_resource_Quantity(&val, newVal, s); err != nil { - return err - } - (*out)[ResourceName(key)] = *newVal - } - } else { - out.Capacity = nil - } - if err := Convert_api_PersistentVolumeSource_To_v1_PersistentVolumeSource(&in.PersistentVolumeSource, &out.PersistentVolumeSource, s); err != nil { - return err - } - if in.AccessModes != nil { - in, out := &in.AccessModes, &out.AccessModes - *out = make([]PersistentVolumeAccessMode, len(*in)) - for i := range *in { - (*out)[i] = PersistentVolumeAccessMode((*in)[i]) - } - } else { - out.AccessModes = nil - } - if in.ClaimRef != nil { - in, out := &in.ClaimRef, &out.ClaimRef - *out = new(ObjectReference) - if err := Convert_api_ObjectReference_To_v1_ObjectReference(*in, *out, s); err != nil { - return err - } - } else { - out.ClaimRef = nil - } - out.PersistentVolumeReclaimPolicy = PersistentVolumeReclaimPolicy(in.PersistentVolumeReclaimPolicy) - return nil -} - -func Convert_api_PersistentVolumeSpec_To_v1_PersistentVolumeSpec(in *api.PersistentVolumeSpec, out *PersistentVolumeSpec, s conversion.Scope) error { - return autoConvert_api_PersistentVolumeSpec_To_v1_PersistentVolumeSpec(in, out, s) -} - -func autoConvert_v1_PersistentVolumeStatus_To_api_PersistentVolumeStatus(in *PersistentVolumeStatus, out *api.PersistentVolumeStatus, s conversion.Scope) error { - out.Phase = api.PersistentVolumePhase(in.Phase) - out.Message = in.Message - out.Reason = in.Reason - return nil -} - -func Convert_v1_PersistentVolumeStatus_To_api_PersistentVolumeStatus(in *PersistentVolumeStatus, out *api.PersistentVolumeStatus, s conversion.Scope) error { - return autoConvert_v1_PersistentVolumeStatus_To_api_PersistentVolumeStatus(in, out, s) -} - -func autoConvert_api_PersistentVolumeStatus_To_v1_PersistentVolumeStatus(in *api.PersistentVolumeStatus, out *PersistentVolumeStatus, s conversion.Scope) error { - out.Phase = PersistentVolumePhase(in.Phase) - out.Message = in.Message - out.Reason = in.Reason - return nil -} - -func Convert_api_PersistentVolumeStatus_To_v1_PersistentVolumeStatus(in *api.PersistentVolumeStatus, out *PersistentVolumeStatus, s conversion.Scope) error { - return autoConvert_api_PersistentVolumeStatus_To_v1_PersistentVolumeStatus(in, out, s) -} - -func autoConvert_v1_Pod_To_api_Pod(in *Pod, out *api.Pod, s conversion.Scope) error { - SetDefaults_Pod(in) - if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { - return err - } - if err := Convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - if err := Convert_v1_PodSpec_To_api_PodSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1_PodStatus_To_api_PodStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func autoConvert_api_Pod_To_v1_Pod(in *api.Pod, out *Pod, 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_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - if err := Convert_api_PodSpec_To_v1_PodSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_api_PodStatus_To_v1_PodStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func autoConvert_v1_PodAffinity_To_api_PodAffinity(in *PodAffinity, out *api.PodAffinity, s conversion.Scope) error { - if in.RequiredDuringSchedulingIgnoredDuringExecution != nil { - in, out := &in.RequiredDuringSchedulingIgnoredDuringExecution, &out.RequiredDuringSchedulingIgnoredDuringExecution - *out = make([]api.PodAffinityTerm, len(*in)) - for i := range *in { - if err := Convert_v1_PodAffinityTerm_To_api_PodAffinityTerm(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.RequiredDuringSchedulingIgnoredDuringExecution = nil - } - if in.PreferredDuringSchedulingIgnoredDuringExecution != nil { - in, out := &in.PreferredDuringSchedulingIgnoredDuringExecution, &out.PreferredDuringSchedulingIgnoredDuringExecution - *out = make([]api.WeightedPodAffinityTerm, len(*in)) - for i := range *in { - if err := Convert_v1_WeightedPodAffinityTerm_To_api_WeightedPodAffinityTerm(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.PreferredDuringSchedulingIgnoredDuringExecution = nil - } - return nil -} - -func Convert_v1_PodAffinity_To_api_PodAffinity(in *PodAffinity, out *api.PodAffinity, s conversion.Scope) error { - return autoConvert_v1_PodAffinity_To_api_PodAffinity(in, out, s) -} - -func autoConvert_api_PodAffinity_To_v1_PodAffinity(in *api.PodAffinity, out *PodAffinity, s conversion.Scope) error { - if in.RequiredDuringSchedulingIgnoredDuringExecution != nil { - in, out := &in.RequiredDuringSchedulingIgnoredDuringExecution, &out.RequiredDuringSchedulingIgnoredDuringExecution - *out = make([]PodAffinityTerm, len(*in)) - for i := range *in { - if err := Convert_api_PodAffinityTerm_To_v1_PodAffinityTerm(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.RequiredDuringSchedulingIgnoredDuringExecution = nil - } - if in.PreferredDuringSchedulingIgnoredDuringExecution != nil { - in, out := &in.PreferredDuringSchedulingIgnoredDuringExecution, &out.PreferredDuringSchedulingIgnoredDuringExecution - *out = make([]WeightedPodAffinityTerm, len(*in)) - for i := range *in { - if err := Convert_api_WeightedPodAffinityTerm_To_v1_WeightedPodAffinityTerm(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.PreferredDuringSchedulingIgnoredDuringExecution = nil - } - return nil -} - -func Convert_api_PodAffinity_To_v1_PodAffinity(in *api.PodAffinity, out *PodAffinity, s conversion.Scope) error { - return autoConvert_api_PodAffinity_To_v1_PodAffinity(in, out, s) -} - -func autoConvert_v1_PodAffinityTerm_To_api_PodAffinityTerm(in *PodAffinityTerm, out *api.PodAffinityTerm, s conversion.Scope) error { - out.LabelSelector = in.LabelSelector - out.Namespaces = in.Namespaces - out.TopologyKey = in.TopologyKey - return nil -} - -func Convert_v1_PodAffinityTerm_To_api_PodAffinityTerm(in *PodAffinityTerm, out *api.PodAffinityTerm, s conversion.Scope) error { - return autoConvert_v1_PodAffinityTerm_To_api_PodAffinityTerm(in, out, s) -} - -func autoConvert_api_PodAffinityTerm_To_v1_PodAffinityTerm(in *api.PodAffinityTerm, out *PodAffinityTerm, s conversion.Scope) error { - out.LabelSelector = in.LabelSelector - out.Namespaces = in.Namespaces - out.TopologyKey = in.TopologyKey - return nil -} - -func Convert_api_PodAffinityTerm_To_v1_PodAffinityTerm(in *api.PodAffinityTerm, out *PodAffinityTerm, s conversion.Scope) error { - return autoConvert_api_PodAffinityTerm_To_v1_PodAffinityTerm(in, out, s) -} - -func autoConvert_v1_PodAntiAffinity_To_api_PodAntiAffinity(in *PodAntiAffinity, out *api.PodAntiAffinity, s conversion.Scope) error { - if in.RequiredDuringSchedulingIgnoredDuringExecution != nil { - in, out := &in.RequiredDuringSchedulingIgnoredDuringExecution, &out.RequiredDuringSchedulingIgnoredDuringExecution - *out = make([]api.PodAffinityTerm, len(*in)) - for i := range *in { - if err := Convert_v1_PodAffinityTerm_To_api_PodAffinityTerm(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.RequiredDuringSchedulingIgnoredDuringExecution = nil - } - if in.PreferredDuringSchedulingIgnoredDuringExecution != nil { - in, out := &in.PreferredDuringSchedulingIgnoredDuringExecution, &out.PreferredDuringSchedulingIgnoredDuringExecution - *out = make([]api.WeightedPodAffinityTerm, len(*in)) - for i := range *in { - if err := Convert_v1_WeightedPodAffinityTerm_To_api_WeightedPodAffinityTerm(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.PreferredDuringSchedulingIgnoredDuringExecution = nil - } - return nil -} - -func Convert_v1_PodAntiAffinity_To_api_PodAntiAffinity(in *PodAntiAffinity, out *api.PodAntiAffinity, s conversion.Scope) error { - return autoConvert_v1_PodAntiAffinity_To_api_PodAntiAffinity(in, out, s) -} - -func autoConvert_api_PodAntiAffinity_To_v1_PodAntiAffinity(in *api.PodAntiAffinity, out *PodAntiAffinity, s conversion.Scope) error { - if in.RequiredDuringSchedulingIgnoredDuringExecution != nil { - in, out := &in.RequiredDuringSchedulingIgnoredDuringExecution, &out.RequiredDuringSchedulingIgnoredDuringExecution - *out = make([]PodAffinityTerm, len(*in)) - for i := range *in { - if err := Convert_api_PodAffinityTerm_To_v1_PodAffinityTerm(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.RequiredDuringSchedulingIgnoredDuringExecution = nil - } - if in.PreferredDuringSchedulingIgnoredDuringExecution != nil { - in, out := &in.PreferredDuringSchedulingIgnoredDuringExecution, &out.PreferredDuringSchedulingIgnoredDuringExecution - *out = make([]WeightedPodAffinityTerm, len(*in)) - for i := range *in { - if err := Convert_api_WeightedPodAffinityTerm_To_v1_WeightedPodAffinityTerm(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.PreferredDuringSchedulingIgnoredDuringExecution = nil - } - return nil -} - -func Convert_api_PodAntiAffinity_To_v1_PodAntiAffinity(in *api.PodAntiAffinity, out *PodAntiAffinity, s conversion.Scope) error { - return autoConvert_api_PodAntiAffinity_To_v1_PodAntiAffinity(in, out, s) -} - -func autoConvert_v1_PodAttachOptions_To_api_PodAttachOptions(in *PodAttachOptions, out *api.PodAttachOptions, s conversion.Scope) error { - SetDefaults_PodAttachOptions(in) - if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { - return err - } - out.Stdin = in.Stdin - out.Stdout = in.Stdout - out.Stderr = in.Stderr - out.TTY = in.TTY - out.Container = in.Container - return nil -} - -func Convert_v1_PodAttachOptions_To_api_PodAttachOptions(in *PodAttachOptions, out *api.PodAttachOptions, s conversion.Scope) error { - return autoConvert_v1_PodAttachOptions_To_api_PodAttachOptions(in, out, s) -} - -func autoConvert_api_PodAttachOptions_To_v1_PodAttachOptions(in *api.PodAttachOptions, out *PodAttachOptions, s conversion.Scope) error { - if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { - return err - } - out.Stdin = in.Stdin - out.Stdout = in.Stdout - out.Stderr = in.Stderr - out.TTY = in.TTY - out.Container = in.Container - return nil -} - -func Convert_api_PodAttachOptions_To_v1_PodAttachOptions(in *api.PodAttachOptions, out *PodAttachOptions, s conversion.Scope) error { - return autoConvert_api_PodAttachOptions_To_v1_PodAttachOptions(in, out, s) -} - -func autoConvert_v1_PodCondition_To_api_PodCondition(in *PodCondition, out *api.PodCondition, s conversion.Scope) error { - out.Type = api.PodConditionType(in.Type) - out.Status = api.ConditionStatus(in.Status) - if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastProbeTime, &out.LastProbeTime, s); err != nil { - return err - } - if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastTransitionTime, &out.LastTransitionTime, s); err != nil { - return err - } - out.Reason = in.Reason - out.Message = in.Message - return nil -} - -func Convert_v1_PodCondition_To_api_PodCondition(in *PodCondition, out *api.PodCondition, s conversion.Scope) error { - return autoConvert_v1_PodCondition_To_api_PodCondition(in, out, s) -} - -func autoConvert_api_PodCondition_To_v1_PodCondition(in *api.PodCondition, out *PodCondition, s conversion.Scope) error { - out.Type = PodConditionType(in.Type) - out.Status = ConditionStatus(in.Status) - if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastProbeTime, &out.LastProbeTime, s); err != nil { - return err - } - if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastTransitionTime, &out.LastTransitionTime, s); err != nil { - return err - } - out.Reason = in.Reason - out.Message = in.Message - return nil -} - -func Convert_api_PodCondition_To_v1_PodCondition(in *api.PodCondition, out *PodCondition, s conversion.Scope) error { - return autoConvert_api_PodCondition_To_v1_PodCondition(in, out, s) -} - -func autoConvert_v1_PodExecOptions_To_api_PodExecOptions(in *PodExecOptions, out *api.PodExecOptions, s conversion.Scope) error { - SetDefaults_PodExecOptions(in) - if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { - return err - } - out.Stdin = in.Stdin - out.Stdout = in.Stdout - out.Stderr = in.Stderr - out.TTY = in.TTY - out.Container = in.Container - out.Command = in.Command - return nil -} - -func Convert_v1_PodExecOptions_To_api_PodExecOptions(in *PodExecOptions, out *api.PodExecOptions, s conversion.Scope) error { - return autoConvert_v1_PodExecOptions_To_api_PodExecOptions(in, out, s) -} - -func autoConvert_api_PodExecOptions_To_v1_PodExecOptions(in *api.PodExecOptions, out *PodExecOptions, s conversion.Scope) error { - if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { - return err - } - out.Stdin = in.Stdin - out.Stdout = in.Stdout - out.Stderr = in.Stderr - out.TTY = in.TTY - out.Container = in.Container - out.Command = in.Command - return nil -} - -func Convert_api_PodExecOptions_To_v1_PodExecOptions(in *api.PodExecOptions, out *PodExecOptions, s conversion.Scope) error { - return autoConvert_api_PodExecOptions_To_v1_PodExecOptions(in, out, s) -} - -func autoConvert_v1_PodList_To_api_PodList(in *PodList, out *api.PodList, 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([]api.Pod, len(*in)) - for i := range *in { - if err := Convert_v1_Pod_To_api_Pod(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1_PodList_To_api_PodList(in *PodList, out *api.PodList, s conversion.Scope) error { - return autoConvert_v1_PodList_To_api_PodList(in, out, s) -} - -func autoConvert_api_PodList_To_v1_PodList(in *api.PodList, out *PodList, 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([]Pod, len(*in)) - for i := range *in { - if err := Convert_api_Pod_To_v1_Pod(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_api_PodList_To_v1_PodList(in *api.PodList, out *PodList, s conversion.Scope) error { - return autoConvert_api_PodList_To_v1_PodList(in, out, s) -} - -func autoConvert_v1_PodLogOptions_To_api_PodLogOptions(in *PodLogOptions, out *api.PodLogOptions, s conversion.Scope) error { - if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { - return err - } - out.Container = in.Container - out.Follow = in.Follow - out.Previous = in.Previous - out.SinceSeconds = in.SinceSeconds - out.SinceTime = in.SinceTime - out.Timestamps = in.Timestamps - out.TailLines = in.TailLines - out.LimitBytes = in.LimitBytes - return nil -} - -func Convert_v1_PodLogOptions_To_api_PodLogOptions(in *PodLogOptions, out *api.PodLogOptions, s conversion.Scope) error { - return autoConvert_v1_PodLogOptions_To_api_PodLogOptions(in, out, s) -} - -func autoConvert_api_PodLogOptions_To_v1_PodLogOptions(in *api.PodLogOptions, out *PodLogOptions, s conversion.Scope) error { - if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { - return err - } - out.Container = in.Container - out.Follow = in.Follow - out.Previous = in.Previous - out.SinceSeconds = in.SinceSeconds - out.SinceTime = in.SinceTime - out.Timestamps = in.Timestamps - out.TailLines = in.TailLines - out.LimitBytes = in.LimitBytes - return nil -} - -func Convert_api_PodLogOptions_To_v1_PodLogOptions(in *api.PodLogOptions, out *PodLogOptions, s conversion.Scope) error { - return autoConvert_api_PodLogOptions_To_v1_PodLogOptions(in, out, s) -} - -func autoConvert_v1_PodProxyOptions_To_api_PodProxyOptions(in *PodProxyOptions, out *api.PodProxyOptions, s conversion.Scope) error { - if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { - return err - } - out.Path = in.Path - return nil -} - -func Convert_v1_PodProxyOptions_To_api_PodProxyOptions(in *PodProxyOptions, out *api.PodProxyOptions, s conversion.Scope) error { - return autoConvert_v1_PodProxyOptions_To_api_PodProxyOptions(in, out, s) -} - -func autoConvert_api_PodProxyOptions_To_v1_PodProxyOptions(in *api.PodProxyOptions, out *PodProxyOptions, s conversion.Scope) error { - if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { - return err - } - out.Path = in.Path - return nil -} - -func Convert_api_PodProxyOptions_To_v1_PodProxyOptions(in *api.PodProxyOptions, out *PodProxyOptions, s conversion.Scope) error { - return autoConvert_api_PodProxyOptions_To_v1_PodProxyOptions(in, out, s) -} - -func autoConvert_v1_PodSecurityContext_To_api_PodSecurityContext(in *PodSecurityContext, out *api.PodSecurityContext, s conversion.Scope) error { - if in.SELinuxOptions != nil { - in, out := &in.SELinuxOptions, &out.SELinuxOptions - *out = new(api.SELinuxOptions) - if err := Convert_v1_SELinuxOptions_To_api_SELinuxOptions(*in, *out, s); err != nil { - return err - } - } else { - out.SELinuxOptions = nil - } - out.RunAsUser = in.RunAsUser - out.RunAsNonRoot = in.RunAsNonRoot - out.SupplementalGroups = in.SupplementalGroups - out.FSGroup = in.FSGroup - return nil -} - -func autoConvert_api_PodSecurityContext_To_v1_PodSecurityContext(in *api.PodSecurityContext, out *PodSecurityContext, s conversion.Scope) error { - if in.SELinuxOptions != nil { - in, out := &in.SELinuxOptions, &out.SELinuxOptions - *out = new(SELinuxOptions) - if err := Convert_api_SELinuxOptions_To_v1_SELinuxOptions(*in, *out, s); err != nil { - return err - } - } else { - out.SELinuxOptions = nil - } - out.RunAsUser = in.RunAsUser - out.RunAsNonRoot = in.RunAsNonRoot - out.SupplementalGroups = in.SupplementalGroups - out.FSGroup = in.FSGroup - return nil -} - -func autoConvert_v1_PodSpec_To_api_PodSpec(in *PodSpec, out *api.PodSpec, s conversion.Scope) error { - SetDefaults_PodSpec(in) - if in.Volumes != nil { - in, out := &in.Volumes, &out.Volumes - *out = make([]api.Volume, len(*in)) - for i := range *in { - if err := Convert_v1_Volume_To_api_Volume(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Volumes = nil - } - if in.InitContainers != nil { - in, out := &in.InitContainers, &out.InitContainers - *out = make([]api.Container, len(*in)) - for i := range *in { - if err := Convert_v1_Container_To_api_Container(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.InitContainers = nil - } - if in.Containers != nil { - in, out := &in.Containers, &out.Containers - *out = make([]api.Container, len(*in)) - for i := range *in { - if err := Convert_v1_Container_To_api_Container(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Containers = nil - } - out.RestartPolicy = api.RestartPolicy(in.RestartPolicy) - out.TerminationGracePeriodSeconds = in.TerminationGracePeriodSeconds - out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds - out.DNSPolicy = api.DNSPolicy(in.DNSPolicy) - out.NodeSelector = in.NodeSelector - out.ServiceAccountName = in.ServiceAccountName - out.NodeName = in.NodeName - if in.SecurityContext != nil { - in, out := &in.SecurityContext, &out.SecurityContext - *out = new(api.PodSecurityContext) - if err := Convert_v1_PodSecurityContext_To_api_PodSecurityContext(*in, *out, s); err != nil { - return err - } - } else { - out.SecurityContext = nil - } - if in.ImagePullSecrets != nil { - in, out := &in.ImagePullSecrets, &out.ImagePullSecrets - *out = make([]api.LocalObjectReference, len(*in)) - for i := range *in { - if err := Convert_v1_LocalObjectReference_To_api_LocalObjectReference(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.ImagePullSecrets = nil - } - out.Hostname = in.Hostname - out.Subdomain = in.Subdomain - return nil -} - -func autoConvert_api_PodSpec_To_v1_PodSpec(in *api.PodSpec, out *PodSpec, s conversion.Scope) error { - if in.Volumes != nil { - in, out := &in.Volumes, &out.Volumes - *out = make([]Volume, len(*in)) - for i := range *in { - if err := Convert_api_Volume_To_v1_Volume(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Volumes = nil - } - if in.InitContainers != nil { - in, out := &in.InitContainers, &out.InitContainers - *out = make([]Container, len(*in)) - for i := range *in { - if err := Convert_api_Container_To_v1_Container(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.InitContainers = nil - } - if in.Containers != nil { - in, out := &in.Containers, &out.Containers - *out = make([]Container, len(*in)) - for i := range *in { - if err := Convert_api_Container_To_v1_Container(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Containers = nil - } - out.RestartPolicy = RestartPolicy(in.RestartPolicy) - out.TerminationGracePeriodSeconds = in.TerminationGracePeriodSeconds - out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds - out.DNSPolicy = DNSPolicy(in.DNSPolicy) - out.NodeSelector = in.NodeSelector - out.ServiceAccountName = in.ServiceAccountName - out.NodeName = in.NodeName - if in.SecurityContext != nil { - in, out := &in.SecurityContext, &out.SecurityContext - *out = new(PodSecurityContext) - if err := Convert_api_PodSecurityContext_To_v1_PodSecurityContext(*in, *out, s); err != nil { - return err - } - } else { - out.SecurityContext = nil - } - if in.ImagePullSecrets != nil { - in, out := &in.ImagePullSecrets, &out.ImagePullSecrets - *out = make([]LocalObjectReference, len(*in)) - for i := range *in { - if err := Convert_api_LocalObjectReference_To_v1_LocalObjectReference(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.ImagePullSecrets = nil - } - out.Hostname = in.Hostname - out.Subdomain = in.Subdomain - return nil -} - -func autoConvert_v1_PodStatus_To_api_PodStatus(in *PodStatus, out *api.PodStatus, s conversion.Scope) error { - out.Phase = api.PodPhase(in.Phase) - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]api.PodCondition, len(*in)) - for i := range *in { - if err := Convert_v1_PodCondition_To_api_PodCondition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - out.Message = in.Message - out.Reason = in.Reason - out.HostIP = in.HostIP - out.PodIP = in.PodIP - out.StartTime = in.StartTime - if in.InitContainerStatuses != nil { - in, out := &in.InitContainerStatuses, &out.InitContainerStatuses - *out = make([]api.ContainerStatus, len(*in)) - for i := range *in { - if err := Convert_v1_ContainerStatus_To_api_ContainerStatus(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.InitContainerStatuses = nil - } - if in.ContainerStatuses != nil { - in, out := &in.ContainerStatuses, &out.ContainerStatuses - *out = make([]api.ContainerStatus, len(*in)) - for i := range *in { - if err := Convert_v1_ContainerStatus_To_api_ContainerStatus(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.ContainerStatuses = nil - } - return nil -} - -func Convert_v1_PodStatus_To_api_PodStatus(in *PodStatus, out *api.PodStatus, s conversion.Scope) error { - return autoConvert_v1_PodStatus_To_api_PodStatus(in, out, s) -} - -func autoConvert_api_PodStatus_To_v1_PodStatus(in *api.PodStatus, out *PodStatus, s conversion.Scope) error { - out.Phase = PodPhase(in.Phase) - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]PodCondition, len(*in)) - for i := range *in { - if err := Convert_api_PodCondition_To_v1_PodCondition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - out.Message = in.Message - out.Reason = in.Reason - out.HostIP = in.HostIP - out.PodIP = in.PodIP - out.StartTime = in.StartTime - if in.InitContainerStatuses != nil { - in, out := &in.InitContainerStatuses, &out.InitContainerStatuses - *out = make([]ContainerStatus, len(*in)) - for i := range *in { - if err := Convert_api_ContainerStatus_To_v1_ContainerStatus(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.InitContainerStatuses = nil - } - if in.ContainerStatuses != nil { - in, out := &in.ContainerStatuses, &out.ContainerStatuses - *out = make([]ContainerStatus, len(*in)) - for i := range *in { - if err := Convert_api_ContainerStatus_To_v1_ContainerStatus(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.ContainerStatuses = nil - } - return nil -} - -func Convert_api_PodStatus_To_v1_PodStatus(in *api.PodStatus, out *PodStatus, s conversion.Scope) error { - return autoConvert_api_PodStatus_To_v1_PodStatus(in, out, s) -} - -func autoConvert_v1_PodStatusResult_To_api_PodStatusResult(in *PodStatusResult, out *api.PodStatusResult, 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_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - if err := Convert_v1_PodStatus_To_api_PodStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func autoConvert_api_PodStatusResult_To_v1_PodStatusResult(in *api.PodStatusResult, out *PodStatusResult, 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_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - if err := Convert_api_PodStatus_To_v1_PodStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func autoConvert_v1_PodTemplate_To_api_PodTemplate(in *PodTemplate, out *api.PodTemplate, 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_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - if err := Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -func Convert_v1_PodTemplate_To_api_PodTemplate(in *PodTemplate, out *api.PodTemplate, s conversion.Scope) error { - return autoConvert_v1_PodTemplate_To_api_PodTemplate(in, out, s) -} - -func autoConvert_api_PodTemplate_To_v1_PodTemplate(in *api.PodTemplate, out *PodTemplate, 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_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - if err := Convert_api_PodTemplateSpec_To_v1_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -func Convert_api_PodTemplate_To_v1_PodTemplate(in *api.PodTemplate, out *PodTemplate, s conversion.Scope) error { - return autoConvert_api_PodTemplate_To_v1_PodTemplate(in, out, s) -} - -func autoConvert_v1_PodTemplateList_To_api_PodTemplateList(in *PodTemplateList, out *api.PodTemplateList, 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([]api.PodTemplate, len(*in)) - for i := range *in { - if err := Convert_v1_PodTemplate_To_api_PodTemplate(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1_PodTemplateList_To_api_PodTemplateList(in *PodTemplateList, out *api.PodTemplateList, s conversion.Scope) error { - return autoConvert_v1_PodTemplateList_To_api_PodTemplateList(in, out, s) -} - -func autoConvert_api_PodTemplateList_To_v1_PodTemplateList(in *api.PodTemplateList, out *PodTemplateList, 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([]PodTemplate, len(*in)) - for i := range *in { - if err := Convert_api_PodTemplate_To_v1_PodTemplate(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_api_PodTemplateList_To_v1_PodTemplateList(in *api.PodTemplateList, out *PodTemplateList, s conversion.Scope) error { - return autoConvert_api_PodTemplateList_To_v1_PodTemplateList(in, out, s) -} - -func autoConvert_v1_PodTemplateSpec_To_api_PodTemplateSpec(in *PodTemplateSpec, out *api.PodTemplateSpec, s conversion.Scope) error { - if err := Convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - if err := Convert_v1_PodSpec_To_api_PodSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -func autoConvert_api_PodTemplateSpec_To_v1_PodTemplateSpec(in *api.PodTemplateSpec, out *PodTemplateSpec, s conversion.Scope) error { - if err := Convert_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - if err := Convert_api_PodSpec_To_v1_PodSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -func autoConvert_v1_Preconditions_To_api_Preconditions(in *Preconditions, out *api.Preconditions, s conversion.Scope) error { - out.UID = in.UID - return nil -} - -func Convert_v1_Preconditions_To_api_Preconditions(in *Preconditions, out *api.Preconditions, s conversion.Scope) error { - return autoConvert_v1_Preconditions_To_api_Preconditions(in, out, s) -} - -func autoConvert_api_Preconditions_To_v1_Preconditions(in *api.Preconditions, out *Preconditions, s conversion.Scope) error { - out.UID = in.UID - return nil -} - -func Convert_api_Preconditions_To_v1_Preconditions(in *api.Preconditions, out *Preconditions, s conversion.Scope) error { - return autoConvert_api_Preconditions_To_v1_Preconditions(in, out, s) -} - -func autoConvert_v1_PreferredSchedulingTerm_To_api_PreferredSchedulingTerm(in *PreferredSchedulingTerm, out *api.PreferredSchedulingTerm, s conversion.Scope) error { - out.Weight = in.Weight - if err := Convert_v1_NodeSelectorTerm_To_api_NodeSelectorTerm(&in.Preference, &out.Preference, s); err != nil { - return err - } - return nil -} - -func Convert_v1_PreferredSchedulingTerm_To_api_PreferredSchedulingTerm(in *PreferredSchedulingTerm, out *api.PreferredSchedulingTerm, s conversion.Scope) error { - return autoConvert_v1_PreferredSchedulingTerm_To_api_PreferredSchedulingTerm(in, out, s) -} - -func autoConvert_api_PreferredSchedulingTerm_To_v1_PreferredSchedulingTerm(in *api.PreferredSchedulingTerm, out *PreferredSchedulingTerm, s conversion.Scope) error { - out.Weight = in.Weight - if err := Convert_api_NodeSelectorTerm_To_v1_NodeSelectorTerm(&in.Preference, &out.Preference, s); err != nil { - return err - } - return nil -} - -func Convert_api_PreferredSchedulingTerm_To_v1_PreferredSchedulingTerm(in *api.PreferredSchedulingTerm, out *PreferredSchedulingTerm, s conversion.Scope) error { - return autoConvert_api_PreferredSchedulingTerm_To_v1_PreferredSchedulingTerm(in, out, s) -} - -func autoConvert_v1_Probe_To_api_Probe(in *Probe, out *api.Probe, s conversion.Scope) error { - SetDefaults_Probe(in) - if err := Convert_v1_Handler_To_api_Handler(&in.Handler, &out.Handler, s); err != nil { - return err - } - out.InitialDelaySeconds = in.InitialDelaySeconds - out.TimeoutSeconds = in.TimeoutSeconds - out.PeriodSeconds = in.PeriodSeconds - out.SuccessThreshold = in.SuccessThreshold - out.FailureThreshold = in.FailureThreshold - return nil -} - -func Convert_v1_Probe_To_api_Probe(in *Probe, out *api.Probe, s conversion.Scope) error { - return autoConvert_v1_Probe_To_api_Probe(in, out, s) -} - -func autoConvert_api_Probe_To_v1_Probe(in *api.Probe, out *Probe, s conversion.Scope) error { - if err := Convert_api_Handler_To_v1_Handler(&in.Handler, &out.Handler, s); err != nil { - return err - } - out.InitialDelaySeconds = in.InitialDelaySeconds - out.TimeoutSeconds = in.TimeoutSeconds - out.PeriodSeconds = in.PeriodSeconds - out.SuccessThreshold = in.SuccessThreshold - out.FailureThreshold = in.FailureThreshold - return nil -} - -func Convert_api_Probe_To_v1_Probe(in *api.Probe, out *Probe, s conversion.Scope) error { - return autoConvert_api_Probe_To_v1_Probe(in, out, s) -} - -func autoConvert_v1_RBDVolumeSource_To_api_RBDVolumeSource(in *RBDVolumeSource, out *api.RBDVolumeSource, s conversion.Scope) error { - SetDefaults_RBDVolumeSource(in) - out.CephMonitors = in.CephMonitors - out.RBDImage = in.RBDImage - out.FSType = in.FSType - out.RBDPool = in.RBDPool - out.RadosUser = in.RadosUser - out.Keyring = in.Keyring - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - *out = new(api.LocalObjectReference) - if err := Convert_v1_LocalObjectReference_To_api_LocalObjectReference(*in, *out, s); err != nil { - return err - } - } else { - out.SecretRef = nil - } - out.ReadOnly = in.ReadOnly - return nil -} - -func Convert_v1_RBDVolumeSource_To_api_RBDVolumeSource(in *RBDVolumeSource, out *api.RBDVolumeSource, s conversion.Scope) error { - return autoConvert_v1_RBDVolumeSource_To_api_RBDVolumeSource(in, out, s) -} - -func autoConvert_api_RBDVolumeSource_To_v1_RBDVolumeSource(in *api.RBDVolumeSource, out *RBDVolumeSource, s conversion.Scope) error { - out.CephMonitors = in.CephMonitors - out.RBDImage = in.RBDImage - out.FSType = in.FSType - out.RBDPool = in.RBDPool - out.RadosUser = in.RadosUser - out.Keyring = in.Keyring - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - *out = new(LocalObjectReference) - if err := Convert_api_LocalObjectReference_To_v1_LocalObjectReference(*in, *out, s); err != nil { - return err - } - } else { - out.SecretRef = nil - } - out.ReadOnly = in.ReadOnly - return nil -} - -func Convert_api_RBDVolumeSource_To_v1_RBDVolumeSource(in *api.RBDVolumeSource, out *RBDVolumeSource, s conversion.Scope) error { - return autoConvert_api_RBDVolumeSource_To_v1_RBDVolumeSource(in, out, s) -} - -func autoConvert_v1_RangeAllocation_To_api_RangeAllocation(in *RangeAllocation, out *api.RangeAllocation, 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_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - out.Range = in.Range - if err := conversion.Convert_Slice_byte_To_Slice_byte(&in.Data, &out.Data, s); err != nil { - return err - } - return nil -} - -func Convert_v1_RangeAllocation_To_api_RangeAllocation(in *RangeAllocation, out *api.RangeAllocation, s conversion.Scope) error { - return autoConvert_v1_RangeAllocation_To_api_RangeAllocation(in, out, s) -} - -func autoConvert_api_RangeAllocation_To_v1_RangeAllocation(in *api.RangeAllocation, out *RangeAllocation, 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_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - out.Range = in.Range - if err := conversion.Convert_Slice_byte_To_Slice_byte(&in.Data, &out.Data, s); err != nil { - return err - } - return nil -} - -func Convert_api_RangeAllocation_To_v1_RangeAllocation(in *api.RangeAllocation, out *RangeAllocation, s conversion.Scope) error { - return autoConvert_api_RangeAllocation_To_v1_RangeAllocation(in, out, s) -} - -func autoConvert_v1_ReplicationController_To_api_ReplicationController(in *ReplicationController, out *api.ReplicationController, s conversion.Scope) error { - SetDefaults_ReplicationController(in) - if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { - return err - } - if err := Convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - if err := Convert_v1_ReplicationControllerSpec_To_api_ReplicationControllerSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1_ReplicationControllerStatus_To_api_ReplicationControllerStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_v1_ReplicationController_To_api_ReplicationController(in *ReplicationController, out *api.ReplicationController, s conversion.Scope) error { - return autoConvert_v1_ReplicationController_To_api_ReplicationController(in, out, s) -} - -func autoConvert_api_ReplicationController_To_v1_ReplicationController(in *api.ReplicationController, out *ReplicationController, 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_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - if err := Convert_api_ReplicationControllerSpec_To_v1_ReplicationControllerSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_api_ReplicationControllerStatus_To_v1_ReplicationControllerStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_api_ReplicationController_To_v1_ReplicationController(in *api.ReplicationController, out *ReplicationController, s conversion.Scope) error { - return autoConvert_api_ReplicationController_To_v1_ReplicationController(in, out, s) -} - -func autoConvert_v1_ReplicationControllerList_To_api_ReplicationControllerList(in *ReplicationControllerList, out *api.ReplicationControllerList, 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([]api.ReplicationController, len(*in)) - for i := range *in { - if err := Convert_v1_ReplicationController_To_api_ReplicationController(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1_ReplicationControllerList_To_api_ReplicationControllerList(in *ReplicationControllerList, out *api.ReplicationControllerList, s conversion.Scope) error { - return autoConvert_v1_ReplicationControllerList_To_api_ReplicationControllerList(in, out, s) -} - -func autoConvert_api_ReplicationControllerList_To_v1_ReplicationControllerList(in *api.ReplicationControllerList, out *ReplicationControllerList, 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([]ReplicationController, len(*in)) - for i := range *in { - if err := Convert_api_ReplicationController_To_v1_ReplicationController(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_api_ReplicationControllerList_To_v1_ReplicationControllerList(in *api.ReplicationControllerList, out *ReplicationControllerList, s conversion.Scope) error { - return autoConvert_api_ReplicationControllerList_To_v1_ReplicationControllerList(in, out, s) -} - -func autoConvert_v1_ReplicationControllerStatus_To_api_ReplicationControllerStatus(in *ReplicationControllerStatus, out *api.ReplicationControllerStatus, s conversion.Scope) error { - out.Replicas = in.Replicas - out.FullyLabeledReplicas = in.FullyLabeledReplicas - out.ObservedGeneration = in.ObservedGeneration - return nil -} - -func Convert_v1_ReplicationControllerStatus_To_api_ReplicationControllerStatus(in *ReplicationControllerStatus, out *api.ReplicationControllerStatus, s conversion.Scope) error { - return autoConvert_v1_ReplicationControllerStatus_To_api_ReplicationControllerStatus(in, out, s) -} - -func autoConvert_api_ReplicationControllerStatus_To_v1_ReplicationControllerStatus(in *api.ReplicationControllerStatus, out *ReplicationControllerStatus, s conversion.Scope) error { - out.Replicas = in.Replicas - out.FullyLabeledReplicas = in.FullyLabeledReplicas - out.ObservedGeneration = in.ObservedGeneration - return nil -} - -func Convert_api_ReplicationControllerStatus_To_v1_ReplicationControllerStatus(in *api.ReplicationControllerStatus, out *ReplicationControllerStatus, s conversion.Scope) error { - return autoConvert_api_ReplicationControllerStatus_To_v1_ReplicationControllerStatus(in, out, s) -} - -func autoConvert_v1_ResourceFieldSelector_To_api_ResourceFieldSelector(in *ResourceFieldSelector, out *api.ResourceFieldSelector, s conversion.Scope) error { - out.ContainerName = in.ContainerName - out.Resource = in.Resource - if err := api.Convert_resource_Quantity_To_resource_Quantity(&in.Divisor, &out.Divisor, s); err != nil { - return err - } - return nil -} - -func Convert_v1_ResourceFieldSelector_To_api_ResourceFieldSelector(in *ResourceFieldSelector, out *api.ResourceFieldSelector, s conversion.Scope) error { - return autoConvert_v1_ResourceFieldSelector_To_api_ResourceFieldSelector(in, out, s) -} - -func autoConvert_api_ResourceFieldSelector_To_v1_ResourceFieldSelector(in *api.ResourceFieldSelector, out *ResourceFieldSelector, s conversion.Scope) error { - out.ContainerName = in.ContainerName - out.Resource = in.Resource - if err := api.Convert_resource_Quantity_To_resource_Quantity(&in.Divisor, &out.Divisor, s); err != nil { - return err - } - return nil -} - -func Convert_api_ResourceFieldSelector_To_v1_ResourceFieldSelector(in *api.ResourceFieldSelector, out *ResourceFieldSelector, s conversion.Scope) error { - return autoConvert_api_ResourceFieldSelector_To_v1_ResourceFieldSelector(in, out, s) -} - -func autoConvert_v1_ResourceQuota_To_api_ResourceQuota(in *ResourceQuota, out *api.ResourceQuota, 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_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - if err := Convert_v1_ResourceQuotaSpec_To_api_ResourceQuotaSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1_ResourceQuotaStatus_To_api_ResourceQuotaStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_v1_ResourceQuota_To_api_ResourceQuota(in *ResourceQuota, out *api.ResourceQuota, s conversion.Scope) error { - return autoConvert_v1_ResourceQuota_To_api_ResourceQuota(in, out, s) -} - -func autoConvert_api_ResourceQuota_To_v1_ResourceQuota(in *api.ResourceQuota, out *ResourceQuota, 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_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - if err := Convert_api_ResourceQuotaSpec_To_v1_ResourceQuotaSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_api_ResourceQuotaStatus_To_v1_ResourceQuotaStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_api_ResourceQuota_To_v1_ResourceQuota(in *api.ResourceQuota, out *ResourceQuota, s conversion.Scope) error { - return autoConvert_api_ResourceQuota_To_v1_ResourceQuota(in, out, s) -} - -func autoConvert_v1_ResourceQuotaList_To_api_ResourceQuotaList(in *ResourceQuotaList, out *api.ResourceQuotaList, 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([]api.ResourceQuota, len(*in)) - for i := range *in { - if err := Convert_v1_ResourceQuota_To_api_ResourceQuota(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1_ResourceQuotaList_To_api_ResourceQuotaList(in *ResourceQuotaList, out *api.ResourceQuotaList, s conversion.Scope) error { - return autoConvert_v1_ResourceQuotaList_To_api_ResourceQuotaList(in, out, s) -} - -func autoConvert_api_ResourceQuotaList_To_v1_ResourceQuotaList(in *api.ResourceQuotaList, out *ResourceQuotaList, 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([]ResourceQuota, len(*in)) - for i := range *in { - if err := Convert_api_ResourceQuota_To_v1_ResourceQuota(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_api_ResourceQuotaList_To_v1_ResourceQuotaList(in *api.ResourceQuotaList, out *ResourceQuotaList, s conversion.Scope) error { - return autoConvert_api_ResourceQuotaList_To_v1_ResourceQuotaList(in, out, s) -} - -func autoConvert_v1_ResourceQuotaSpec_To_api_ResourceQuotaSpec(in *ResourceQuotaSpec, out *api.ResourceQuotaSpec, s conversion.Scope) error { - if err := Convert_v1_ResourceList_To_api_ResourceList(&in.Hard, &out.Hard, s); err != nil { - return err - } - if in.Scopes != nil { - in, out := &in.Scopes, &out.Scopes - *out = make([]api.ResourceQuotaScope, len(*in)) - for i := range *in { - (*out)[i] = api.ResourceQuotaScope((*in)[i]) - } - } else { - out.Scopes = nil - } - return nil -} - -func Convert_v1_ResourceQuotaSpec_To_api_ResourceQuotaSpec(in *ResourceQuotaSpec, out *api.ResourceQuotaSpec, s conversion.Scope) error { - return autoConvert_v1_ResourceQuotaSpec_To_api_ResourceQuotaSpec(in, out, s) -} - -func autoConvert_api_ResourceQuotaSpec_To_v1_ResourceQuotaSpec(in *api.ResourceQuotaSpec, out *ResourceQuotaSpec, s conversion.Scope) error { - if in.Hard != nil { - in, out := &in.Hard, &out.Hard - *out = make(ResourceList, len(*in)) - for key, val := range *in { - newVal := new(resource.Quantity) - if err := api.Convert_resource_Quantity_To_resource_Quantity(&val, newVal, s); err != nil { - return err - } - (*out)[ResourceName(key)] = *newVal - } - } else { - out.Hard = nil - } - if in.Scopes != nil { - in, out := &in.Scopes, &out.Scopes - *out = make([]ResourceQuotaScope, len(*in)) - for i := range *in { - (*out)[i] = ResourceQuotaScope((*in)[i]) - } - } else { - out.Scopes = nil - } - return nil -} - -func Convert_api_ResourceQuotaSpec_To_v1_ResourceQuotaSpec(in *api.ResourceQuotaSpec, out *ResourceQuotaSpec, s conversion.Scope) error { - return autoConvert_api_ResourceQuotaSpec_To_v1_ResourceQuotaSpec(in, out, s) -} - -func autoConvert_v1_ResourceQuotaStatus_To_api_ResourceQuotaStatus(in *ResourceQuotaStatus, out *api.ResourceQuotaStatus, s conversion.Scope) error { - if err := Convert_v1_ResourceList_To_api_ResourceList(&in.Hard, &out.Hard, s); err != nil { - return err - } - if err := Convert_v1_ResourceList_To_api_ResourceList(&in.Used, &out.Used, s); err != nil { - return err - } - return nil -} - -func Convert_v1_ResourceQuotaStatus_To_api_ResourceQuotaStatus(in *ResourceQuotaStatus, out *api.ResourceQuotaStatus, s conversion.Scope) error { - return autoConvert_v1_ResourceQuotaStatus_To_api_ResourceQuotaStatus(in, out, s) -} - -func autoConvert_api_ResourceQuotaStatus_To_v1_ResourceQuotaStatus(in *api.ResourceQuotaStatus, out *ResourceQuotaStatus, s conversion.Scope) error { - if in.Hard != nil { - in, out := &in.Hard, &out.Hard - *out = make(ResourceList, len(*in)) - for key, val := range *in { - newVal := new(resource.Quantity) - if err := api.Convert_resource_Quantity_To_resource_Quantity(&val, newVal, s); err != nil { - return err - } - (*out)[ResourceName(key)] = *newVal - } - } else { - out.Hard = nil - } - if in.Used != nil { - in, out := &in.Used, &out.Used - *out = make(ResourceList, len(*in)) - for key, val := range *in { - newVal := new(resource.Quantity) - if err := api.Convert_resource_Quantity_To_resource_Quantity(&val, newVal, s); err != nil { - return err - } - (*out)[ResourceName(key)] = *newVal - } - } else { - out.Used = nil - } - return nil -} - -func Convert_api_ResourceQuotaStatus_To_v1_ResourceQuotaStatus(in *api.ResourceQuotaStatus, out *ResourceQuotaStatus, s conversion.Scope) error { - return autoConvert_api_ResourceQuotaStatus_To_v1_ResourceQuotaStatus(in, out, s) -} - -func autoConvert_v1_ResourceRequirements_To_api_ResourceRequirements(in *ResourceRequirements, out *api.ResourceRequirements, s conversion.Scope) error { - if err := Convert_v1_ResourceList_To_api_ResourceList(&in.Limits, &out.Limits, s); err != nil { - return err - } - if err := Convert_v1_ResourceList_To_api_ResourceList(&in.Requests, &out.Requests, s); err != nil { - return err - } - return nil -} - -func Convert_v1_ResourceRequirements_To_api_ResourceRequirements(in *ResourceRequirements, out *api.ResourceRequirements, s conversion.Scope) error { - return autoConvert_v1_ResourceRequirements_To_api_ResourceRequirements(in, out, s) -} - -func autoConvert_api_ResourceRequirements_To_v1_ResourceRequirements(in *api.ResourceRequirements, out *ResourceRequirements, s conversion.Scope) error { - if in.Limits != nil { - in, out := &in.Limits, &out.Limits - *out = make(ResourceList, len(*in)) - for key, val := range *in { - newVal := new(resource.Quantity) - if err := api.Convert_resource_Quantity_To_resource_Quantity(&val, newVal, s); err != nil { - return err - } - (*out)[ResourceName(key)] = *newVal - } - } else { - out.Limits = nil - } - if in.Requests != nil { - in, out := &in.Requests, &out.Requests - *out = make(ResourceList, len(*in)) - for key, val := range *in { - newVal := new(resource.Quantity) - if err := api.Convert_resource_Quantity_To_resource_Quantity(&val, newVal, s); err != nil { - return err - } - (*out)[ResourceName(key)] = *newVal - } - } else { - out.Requests = nil - } - return nil -} - -func Convert_api_ResourceRequirements_To_v1_ResourceRequirements(in *api.ResourceRequirements, out *ResourceRequirements, s conversion.Scope) error { - return autoConvert_api_ResourceRequirements_To_v1_ResourceRequirements(in, out, s) -} - -func autoConvert_v1_SELinuxOptions_To_api_SELinuxOptions(in *SELinuxOptions, out *api.SELinuxOptions, s conversion.Scope) error { - out.User = in.User - out.Role = in.Role - out.Type = in.Type - out.Level = in.Level - return nil -} - -func Convert_v1_SELinuxOptions_To_api_SELinuxOptions(in *SELinuxOptions, out *api.SELinuxOptions, s conversion.Scope) error { - return autoConvert_v1_SELinuxOptions_To_api_SELinuxOptions(in, out, s) -} - -func autoConvert_api_SELinuxOptions_To_v1_SELinuxOptions(in *api.SELinuxOptions, out *SELinuxOptions, s conversion.Scope) error { - out.User = in.User - out.Role = in.Role - out.Type = in.Type - out.Level = in.Level - return nil -} - -func Convert_api_SELinuxOptions_To_v1_SELinuxOptions(in *api.SELinuxOptions, out *SELinuxOptions, s conversion.Scope) error { - return autoConvert_api_SELinuxOptions_To_v1_SELinuxOptions(in, out, s) -} - -func autoConvert_v1_Secret_To_api_Secret(in *Secret, out *api.Secret, s conversion.Scope) error { - SetDefaults_Secret(in) - if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { - return err - } - if err := Convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - out.Data = in.Data - out.Type = api.SecretType(in.Type) - return nil -} - -func autoConvert_api_Secret_To_v1_Secret(in *api.Secret, out *Secret, 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_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - out.Data = in.Data - out.Type = SecretType(in.Type) - return nil -} - -func Convert_api_Secret_To_v1_Secret(in *api.Secret, out *Secret, s conversion.Scope) error { - return autoConvert_api_Secret_To_v1_Secret(in, out, s) -} - -func autoConvert_v1_SecretKeySelector_To_api_SecretKeySelector(in *SecretKeySelector, out *api.SecretKeySelector, s conversion.Scope) error { - if err := Convert_v1_LocalObjectReference_To_api_LocalObjectReference(&in.LocalObjectReference, &out.LocalObjectReference, s); err != nil { - return err - } - out.Key = in.Key - return nil -} - -func Convert_v1_SecretKeySelector_To_api_SecretKeySelector(in *SecretKeySelector, out *api.SecretKeySelector, s conversion.Scope) error { - return autoConvert_v1_SecretKeySelector_To_api_SecretKeySelector(in, out, s) -} - -func autoConvert_api_SecretKeySelector_To_v1_SecretKeySelector(in *api.SecretKeySelector, out *SecretKeySelector, s conversion.Scope) error { - if err := Convert_api_LocalObjectReference_To_v1_LocalObjectReference(&in.LocalObjectReference, &out.LocalObjectReference, s); err != nil { - return err - } - out.Key = in.Key - return nil -} - -func Convert_api_SecretKeySelector_To_v1_SecretKeySelector(in *api.SecretKeySelector, out *SecretKeySelector, s conversion.Scope) error { - return autoConvert_api_SecretKeySelector_To_v1_SecretKeySelector(in, out, s) -} - -func autoConvert_v1_SecretList_To_api_SecretList(in *SecretList, out *api.SecretList, 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([]api.Secret, len(*in)) - for i := range *in { - if err := Convert_v1_Secret_To_api_Secret(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1_SecretList_To_api_SecretList(in *SecretList, out *api.SecretList, s conversion.Scope) error { - return autoConvert_v1_SecretList_To_api_SecretList(in, out, s) -} - -func autoConvert_api_SecretList_To_v1_SecretList(in *api.SecretList, out *SecretList, 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([]Secret, len(*in)) - for i := range *in { - if err := Convert_api_Secret_To_v1_Secret(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_api_SecretList_To_v1_SecretList(in *api.SecretList, out *SecretList, s conversion.Scope) error { - return autoConvert_api_SecretList_To_v1_SecretList(in, out, s) -} - -func autoConvert_v1_SecretVolumeSource_To_api_SecretVolumeSource(in *SecretVolumeSource, out *api.SecretVolumeSource, s conversion.Scope) error { - out.SecretName = in.SecretName - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]api.KeyToPath, len(*in)) - for i := range *in { - if err := Convert_v1_KeyToPath_To_api_KeyToPath(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1_SecretVolumeSource_To_api_SecretVolumeSource(in *SecretVolumeSource, out *api.SecretVolumeSource, s conversion.Scope) error { - return autoConvert_v1_SecretVolumeSource_To_api_SecretVolumeSource(in, out, s) -} - -func autoConvert_api_SecretVolumeSource_To_v1_SecretVolumeSource(in *api.SecretVolumeSource, out *SecretVolumeSource, s conversion.Scope) error { - out.SecretName = in.SecretName - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]KeyToPath, len(*in)) - for i := range *in { - if err := Convert_api_KeyToPath_To_v1_KeyToPath(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_api_SecretVolumeSource_To_v1_SecretVolumeSource(in *api.SecretVolumeSource, out *SecretVolumeSource, s conversion.Scope) error { - return autoConvert_api_SecretVolumeSource_To_v1_SecretVolumeSource(in, out, s) -} - -func autoConvert_v1_SecurityContext_To_api_SecurityContext(in *SecurityContext, out *api.SecurityContext, s conversion.Scope) error { - if in.Capabilities != nil { - in, out := &in.Capabilities, &out.Capabilities - *out = new(api.Capabilities) - if err := Convert_v1_Capabilities_To_api_Capabilities(*in, *out, s); err != nil { - return err - } - } else { - out.Capabilities = nil - } - out.Privileged = in.Privileged - if in.SELinuxOptions != nil { - in, out := &in.SELinuxOptions, &out.SELinuxOptions - *out = new(api.SELinuxOptions) - if err := Convert_v1_SELinuxOptions_To_api_SELinuxOptions(*in, *out, s); err != nil { - return err - } - } else { - out.SELinuxOptions = nil - } - out.RunAsUser = in.RunAsUser - out.RunAsNonRoot = in.RunAsNonRoot - out.ReadOnlyRootFilesystem = in.ReadOnlyRootFilesystem - return nil -} - -func Convert_v1_SecurityContext_To_api_SecurityContext(in *SecurityContext, out *api.SecurityContext, s conversion.Scope) error { - return autoConvert_v1_SecurityContext_To_api_SecurityContext(in, out, s) -} - -func autoConvert_api_SecurityContext_To_v1_SecurityContext(in *api.SecurityContext, out *SecurityContext, s conversion.Scope) error { - if in.Capabilities != nil { - in, out := &in.Capabilities, &out.Capabilities - *out = new(Capabilities) - if err := Convert_api_Capabilities_To_v1_Capabilities(*in, *out, s); err != nil { - return err - } - } else { - out.Capabilities = nil - } - out.Privileged = in.Privileged - if in.SELinuxOptions != nil { - in, out := &in.SELinuxOptions, &out.SELinuxOptions - *out = new(SELinuxOptions) - if err := Convert_api_SELinuxOptions_To_v1_SELinuxOptions(*in, *out, s); err != nil { - return err - } - } else { - out.SELinuxOptions = nil - } - out.RunAsUser = in.RunAsUser - out.RunAsNonRoot = in.RunAsNonRoot - out.ReadOnlyRootFilesystem = in.ReadOnlyRootFilesystem - return nil -} - -func Convert_api_SecurityContext_To_v1_SecurityContext(in *api.SecurityContext, out *SecurityContext, s conversion.Scope) error { - return autoConvert_api_SecurityContext_To_v1_SecurityContext(in, out, s) -} - -func autoConvert_v1_SerializedReference_To_api_SerializedReference(in *SerializedReference, out *api.SerializedReference, 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_v1_ObjectReference_To_api_ObjectReference(&in.Reference, &out.Reference, s); err != nil { - return err - } - return nil -} - -func Convert_v1_SerializedReference_To_api_SerializedReference(in *SerializedReference, out *api.SerializedReference, s conversion.Scope) error { - return autoConvert_v1_SerializedReference_To_api_SerializedReference(in, out, s) -} - -func autoConvert_api_SerializedReference_To_v1_SerializedReference(in *api.SerializedReference, out *SerializedReference, 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_api_ObjectReference_To_v1_ObjectReference(&in.Reference, &out.Reference, s); err != nil { - return err - } - return nil -} - -func Convert_api_SerializedReference_To_v1_SerializedReference(in *api.SerializedReference, out *SerializedReference, s conversion.Scope) error { - return autoConvert_api_SerializedReference_To_v1_SerializedReference(in, out, s) -} - -func autoConvert_v1_Service_To_api_Service(in *Service, out *api.Service, 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_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - if err := Convert_v1_ServiceSpec_To_api_ServiceSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1_ServiceStatus_To_api_ServiceStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_v1_Service_To_api_Service(in *Service, out *api.Service, s conversion.Scope) error { - return autoConvert_v1_Service_To_api_Service(in, out, s) -} - -func autoConvert_api_Service_To_v1_Service(in *api.Service, out *Service, 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_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - if err := Convert_api_ServiceSpec_To_v1_ServiceSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_api_ServiceStatus_To_v1_ServiceStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_api_Service_To_v1_Service(in *api.Service, out *Service, s conversion.Scope) error { - return autoConvert_api_Service_To_v1_Service(in, out, s) -} - -func autoConvert_v1_ServiceAccount_To_api_ServiceAccount(in *ServiceAccount, out *api.ServiceAccount, 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_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - if in.Secrets != nil { - in, out := &in.Secrets, &out.Secrets - *out = make([]api.ObjectReference, len(*in)) - for i := range *in { - if err := Convert_v1_ObjectReference_To_api_ObjectReference(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Secrets = nil - } - if in.ImagePullSecrets != nil { - in, out := &in.ImagePullSecrets, &out.ImagePullSecrets - *out = make([]api.LocalObjectReference, len(*in)) - for i := range *in { - if err := Convert_v1_LocalObjectReference_To_api_LocalObjectReference(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.ImagePullSecrets = nil - } - return nil -} - -func Convert_v1_ServiceAccount_To_api_ServiceAccount(in *ServiceAccount, out *api.ServiceAccount, s conversion.Scope) error { - return autoConvert_v1_ServiceAccount_To_api_ServiceAccount(in, out, s) -} - -func autoConvert_api_ServiceAccount_To_v1_ServiceAccount(in *api.ServiceAccount, out *ServiceAccount, 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_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - if in.Secrets != nil { - in, out := &in.Secrets, &out.Secrets - *out = make([]ObjectReference, len(*in)) - for i := range *in { - if err := Convert_api_ObjectReference_To_v1_ObjectReference(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Secrets = nil - } - if in.ImagePullSecrets != nil { - in, out := &in.ImagePullSecrets, &out.ImagePullSecrets - *out = make([]LocalObjectReference, len(*in)) - for i := range *in { - if err := Convert_api_LocalObjectReference_To_v1_LocalObjectReference(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.ImagePullSecrets = nil - } - return nil -} - -func Convert_api_ServiceAccount_To_v1_ServiceAccount(in *api.ServiceAccount, out *ServiceAccount, s conversion.Scope) error { - return autoConvert_api_ServiceAccount_To_v1_ServiceAccount(in, out, s) -} - -func autoConvert_v1_ServiceAccountList_To_api_ServiceAccountList(in *ServiceAccountList, out *api.ServiceAccountList, 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([]api.ServiceAccount, len(*in)) - for i := range *in { - if err := Convert_v1_ServiceAccount_To_api_ServiceAccount(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1_ServiceAccountList_To_api_ServiceAccountList(in *ServiceAccountList, out *api.ServiceAccountList, s conversion.Scope) error { - return autoConvert_v1_ServiceAccountList_To_api_ServiceAccountList(in, out, s) -} - -func autoConvert_api_ServiceAccountList_To_v1_ServiceAccountList(in *api.ServiceAccountList, out *ServiceAccountList, 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([]ServiceAccount, len(*in)) - for i := range *in { - if err := Convert_api_ServiceAccount_To_v1_ServiceAccount(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_api_ServiceAccountList_To_v1_ServiceAccountList(in *api.ServiceAccountList, out *ServiceAccountList, s conversion.Scope) error { - return autoConvert_api_ServiceAccountList_To_v1_ServiceAccountList(in, out, s) -} - -func autoConvert_v1_ServiceList_To_api_ServiceList(in *ServiceList, out *api.ServiceList, 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([]api.Service, len(*in)) - for i := range *in { - if err := Convert_v1_Service_To_api_Service(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1_ServiceList_To_api_ServiceList(in *ServiceList, out *api.ServiceList, s conversion.Scope) error { - return autoConvert_v1_ServiceList_To_api_ServiceList(in, out, s) -} - -func autoConvert_api_ServiceList_To_v1_ServiceList(in *api.ServiceList, out *ServiceList, 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([]Service, len(*in)) - for i := range *in { - if err := Convert_api_Service_To_v1_Service(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_api_ServiceList_To_v1_ServiceList(in *api.ServiceList, out *ServiceList, s conversion.Scope) error { - return autoConvert_api_ServiceList_To_v1_ServiceList(in, out, s) -} - -func autoConvert_v1_ServicePort_To_api_ServicePort(in *ServicePort, out *api.ServicePort, s conversion.Scope) error { - out.Name = in.Name - out.Protocol = api.Protocol(in.Protocol) - out.Port = in.Port - if err := api.Convert_intstr_IntOrString_To_intstr_IntOrString(&in.TargetPort, &out.TargetPort, s); err != nil { - return err - } - out.NodePort = in.NodePort - return nil -} - -func Convert_v1_ServicePort_To_api_ServicePort(in *ServicePort, out *api.ServicePort, s conversion.Scope) error { - return autoConvert_v1_ServicePort_To_api_ServicePort(in, out, s) -} - -func autoConvert_api_ServicePort_To_v1_ServicePort(in *api.ServicePort, out *ServicePort, s conversion.Scope) error { - out.Name = in.Name - out.Protocol = Protocol(in.Protocol) - out.Port = in.Port - if err := api.Convert_intstr_IntOrString_To_intstr_IntOrString(&in.TargetPort, &out.TargetPort, s); err != nil { - return err - } - out.NodePort = in.NodePort - return nil -} - -func Convert_api_ServicePort_To_v1_ServicePort(in *api.ServicePort, out *ServicePort, s conversion.Scope) error { - return autoConvert_api_ServicePort_To_v1_ServicePort(in, out, s) -} - -func autoConvert_v1_ServiceProxyOptions_To_api_ServiceProxyOptions(in *ServiceProxyOptions, out *api.ServiceProxyOptions, s conversion.Scope) error { - if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { - return err - } - out.Path = in.Path - return nil -} - -func Convert_v1_ServiceProxyOptions_To_api_ServiceProxyOptions(in *ServiceProxyOptions, out *api.ServiceProxyOptions, s conversion.Scope) error { - return autoConvert_v1_ServiceProxyOptions_To_api_ServiceProxyOptions(in, out, s) -} - -func autoConvert_api_ServiceProxyOptions_To_v1_ServiceProxyOptions(in *api.ServiceProxyOptions, out *ServiceProxyOptions, s conversion.Scope) error { - if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { - return err - } - out.Path = in.Path - return nil -} - -func Convert_api_ServiceProxyOptions_To_v1_ServiceProxyOptions(in *api.ServiceProxyOptions, out *ServiceProxyOptions, s conversion.Scope) error { - return autoConvert_api_ServiceProxyOptions_To_v1_ServiceProxyOptions(in, out, s) -} - -func autoConvert_v1_ServiceSpec_To_api_ServiceSpec(in *ServiceSpec, out *api.ServiceSpec, s conversion.Scope) error { - SetDefaults_ServiceSpec(in) - if in.Ports != nil { - in, out := &in.Ports, &out.Ports - *out = make([]api.ServicePort, len(*in)) - for i := range *in { - if err := Convert_v1_ServicePort_To_api_ServicePort(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Ports = nil - } - out.Selector = in.Selector - out.ClusterIP = in.ClusterIP - out.Type = api.ServiceType(in.Type) - out.ExternalIPs = in.ExternalIPs - out.SessionAffinity = api.ServiceAffinity(in.SessionAffinity) - out.LoadBalancerIP = in.LoadBalancerIP - out.LoadBalancerSourceRanges = in.LoadBalancerSourceRanges - return nil -} - -func autoConvert_api_ServiceSpec_To_v1_ServiceSpec(in *api.ServiceSpec, out *ServiceSpec, s conversion.Scope) error { - out.Type = ServiceType(in.Type) - if in.Ports != nil { - in, out := &in.Ports, &out.Ports - *out = make([]ServicePort, len(*in)) - for i := range *in { - if err := Convert_api_ServicePort_To_v1_ServicePort(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Ports = nil - } - out.Selector = in.Selector - out.ClusterIP = in.ClusterIP - out.ExternalIPs = in.ExternalIPs - out.LoadBalancerIP = in.LoadBalancerIP - out.SessionAffinity = ServiceAffinity(in.SessionAffinity) - out.LoadBalancerSourceRanges = in.LoadBalancerSourceRanges - return nil -} - -func autoConvert_v1_ServiceStatus_To_api_ServiceStatus(in *ServiceStatus, out *api.ServiceStatus, s conversion.Scope) error { - if err := Convert_v1_LoadBalancerStatus_To_api_LoadBalancerStatus(&in.LoadBalancer, &out.LoadBalancer, s); err != nil { - return err - } - return nil -} - -func Convert_v1_ServiceStatus_To_api_ServiceStatus(in *ServiceStatus, out *api.ServiceStatus, s conversion.Scope) error { - return autoConvert_v1_ServiceStatus_To_api_ServiceStatus(in, out, s) -} - -func autoConvert_api_ServiceStatus_To_v1_ServiceStatus(in *api.ServiceStatus, out *ServiceStatus, s conversion.Scope) error { - if err := Convert_api_LoadBalancerStatus_To_v1_LoadBalancerStatus(&in.LoadBalancer, &out.LoadBalancer, s); err != nil { - return err - } - return nil -} - -func Convert_api_ServiceStatus_To_v1_ServiceStatus(in *api.ServiceStatus, out *ServiceStatus, s conversion.Scope) error { - return autoConvert_api_ServiceStatus_To_v1_ServiceStatus(in, out, s) -} - -func autoConvert_v1_TCPSocketAction_To_api_TCPSocketAction(in *TCPSocketAction, out *api.TCPSocketAction, s conversion.Scope) error { - if err := api.Convert_intstr_IntOrString_To_intstr_IntOrString(&in.Port, &out.Port, s); err != nil { - return err - } - return nil -} - -func Convert_v1_TCPSocketAction_To_api_TCPSocketAction(in *TCPSocketAction, out *api.TCPSocketAction, s conversion.Scope) error { - return autoConvert_v1_TCPSocketAction_To_api_TCPSocketAction(in, out, s) -} - -func autoConvert_api_TCPSocketAction_To_v1_TCPSocketAction(in *api.TCPSocketAction, out *TCPSocketAction, s conversion.Scope) error { - if err := api.Convert_intstr_IntOrString_To_intstr_IntOrString(&in.Port, &out.Port, s); err != nil { - return err - } - return nil -} - -func Convert_api_TCPSocketAction_To_v1_TCPSocketAction(in *api.TCPSocketAction, out *TCPSocketAction, s conversion.Scope) error { - return autoConvert_api_TCPSocketAction_To_v1_TCPSocketAction(in, out, s) -} - -func autoConvert_v1_Taint_To_api_Taint(in *Taint, out *api.Taint, s conversion.Scope) error { - out.Key = in.Key - out.Value = in.Value - out.Effect = api.TaintEffect(in.Effect) - return nil -} - -func Convert_v1_Taint_To_api_Taint(in *Taint, out *api.Taint, s conversion.Scope) error { - return autoConvert_v1_Taint_To_api_Taint(in, out, s) -} - -func autoConvert_api_Taint_To_v1_Taint(in *api.Taint, out *Taint, s conversion.Scope) error { - out.Key = in.Key - out.Value = in.Value - out.Effect = TaintEffect(in.Effect) - return nil -} - -func Convert_api_Taint_To_v1_Taint(in *api.Taint, out *Taint, s conversion.Scope) error { - return autoConvert_api_Taint_To_v1_Taint(in, out, s) -} - -func autoConvert_v1_Toleration_To_api_Toleration(in *Toleration, out *api.Toleration, s conversion.Scope) error { - out.Key = in.Key - out.Operator = api.TolerationOperator(in.Operator) - out.Value = in.Value - out.Effect = api.TaintEffect(in.Effect) - return nil -} - -func Convert_v1_Toleration_To_api_Toleration(in *Toleration, out *api.Toleration, s conversion.Scope) error { - return autoConvert_v1_Toleration_To_api_Toleration(in, out, s) -} - -func autoConvert_api_Toleration_To_v1_Toleration(in *api.Toleration, out *Toleration, s conversion.Scope) error { - out.Key = in.Key - out.Operator = TolerationOperator(in.Operator) - out.Value = in.Value - out.Effect = TaintEffect(in.Effect) - return nil -} - -func Convert_api_Toleration_To_v1_Toleration(in *api.Toleration, out *Toleration, s conversion.Scope) error { - return autoConvert_api_Toleration_To_v1_Toleration(in, out, s) -} - -func autoConvert_v1_Volume_To_api_Volume(in *Volume, out *api.Volume, s conversion.Scope) error { - SetDefaults_Volume(in) - out.Name = in.Name - if err := Convert_v1_VolumeSource_To_api_VolumeSource(&in.VolumeSource, &out.VolumeSource, s); err != nil { - return err - } - return nil -} - -func Convert_v1_Volume_To_api_Volume(in *Volume, out *api.Volume, s conversion.Scope) error { - return autoConvert_v1_Volume_To_api_Volume(in, out, s) -} - -func autoConvert_api_Volume_To_v1_Volume(in *api.Volume, out *Volume, s conversion.Scope) error { - out.Name = in.Name - if err := Convert_api_VolumeSource_To_v1_VolumeSource(&in.VolumeSource, &out.VolumeSource, s); err != nil { - return err - } - return nil -} - -func Convert_api_Volume_To_v1_Volume(in *api.Volume, out *Volume, s conversion.Scope) error { - return autoConvert_api_Volume_To_v1_Volume(in, out, s) -} - -func autoConvert_v1_VolumeMount_To_api_VolumeMount(in *VolumeMount, out *api.VolumeMount, s conversion.Scope) error { - out.Name = in.Name - out.ReadOnly = in.ReadOnly - out.MountPath = in.MountPath - out.SubPath = in.SubPath - return nil -} - -func Convert_v1_VolumeMount_To_api_VolumeMount(in *VolumeMount, out *api.VolumeMount, s conversion.Scope) error { - return autoConvert_v1_VolumeMount_To_api_VolumeMount(in, out, s) -} - -func autoConvert_api_VolumeMount_To_v1_VolumeMount(in *api.VolumeMount, out *VolumeMount, s conversion.Scope) error { - out.Name = in.Name - out.ReadOnly = in.ReadOnly - out.MountPath = in.MountPath - out.SubPath = in.SubPath - return nil -} - -func Convert_api_VolumeMount_To_v1_VolumeMount(in *api.VolumeMount, out *VolumeMount, s conversion.Scope) error { - return autoConvert_api_VolumeMount_To_v1_VolumeMount(in, out, s) -} - -func autoConvert_v1_VolumeSource_To_api_VolumeSource(in *VolumeSource, out *api.VolumeSource, s conversion.Scope) error { - if in.HostPath != nil { - in, out := &in.HostPath, &out.HostPath - *out = new(api.HostPathVolumeSource) - if err := Convert_v1_HostPathVolumeSource_To_api_HostPathVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.HostPath = nil - } - if in.EmptyDir != nil { - in, out := &in.EmptyDir, &out.EmptyDir - *out = new(api.EmptyDirVolumeSource) - if err := Convert_v1_EmptyDirVolumeSource_To_api_EmptyDirVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.EmptyDir = nil - } - if in.GCEPersistentDisk != nil { - in, out := &in.GCEPersistentDisk, &out.GCEPersistentDisk - *out = new(api.GCEPersistentDiskVolumeSource) - if err := Convert_v1_GCEPersistentDiskVolumeSource_To_api_GCEPersistentDiskVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.GCEPersistentDisk = nil - } - if in.AWSElasticBlockStore != nil { - in, out := &in.AWSElasticBlockStore, &out.AWSElasticBlockStore - *out = new(api.AWSElasticBlockStoreVolumeSource) - if err := Convert_v1_AWSElasticBlockStoreVolumeSource_To_api_AWSElasticBlockStoreVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.AWSElasticBlockStore = nil - } - if in.GitRepo != nil { - in, out := &in.GitRepo, &out.GitRepo - *out = new(api.GitRepoVolumeSource) - if err := Convert_v1_GitRepoVolumeSource_To_api_GitRepoVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.GitRepo = nil - } - if in.Secret != nil { - in, out := &in.Secret, &out.Secret - *out = new(api.SecretVolumeSource) - if err := Convert_v1_SecretVolumeSource_To_api_SecretVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.Secret = nil - } - if in.NFS != nil { - in, out := &in.NFS, &out.NFS - *out = new(api.NFSVolumeSource) - if err := Convert_v1_NFSVolumeSource_To_api_NFSVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.NFS = nil - } - if in.ISCSI != nil { - in, out := &in.ISCSI, &out.ISCSI - *out = new(api.ISCSIVolumeSource) - if err := Convert_v1_ISCSIVolumeSource_To_api_ISCSIVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.ISCSI = nil - } - if in.Glusterfs != nil { - in, out := &in.Glusterfs, &out.Glusterfs - *out = new(api.GlusterfsVolumeSource) - if err := Convert_v1_GlusterfsVolumeSource_To_api_GlusterfsVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.Glusterfs = nil - } - if in.PersistentVolumeClaim != nil { - in, out := &in.PersistentVolumeClaim, &out.PersistentVolumeClaim - *out = new(api.PersistentVolumeClaimVolumeSource) - if err := Convert_v1_PersistentVolumeClaimVolumeSource_To_api_PersistentVolumeClaimVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.PersistentVolumeClaim = nil - } - if in.RBD != nil { - in, out := &in.RBD, &out.RBD - *out = new(api.RBDVolumeSource) - if err := Convert_v1_RBDVolumeSource_To_api_RBDVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.RBD = nil - } - if in.FlexVolume != nil { - in, out := &in.FlexVolume, &out.FlexVolume - *out = new(api.FlexVolumeSource) - if err := Convert_v1_FlexVolumeSource_To_api_FlexVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.FlexVolume = nil - } - if in.Cinder != nil { - in, out := &in.Cinder, &out.Cinder - *out = new(api.CinderVolumeSource) - if err := Convert_v1_CinderVolumeSource_To_api_CinderVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.Cinder = nil - } - if in.CephFS != nil { - in, out := &in.CephFS, &out.CephFS - *out = new(api.CephFSVolumeSource) - if err := Convert_v1_CephFSVolumeSource_To_api_CephFSVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.CephFS = nil - } - if in.Flocker != nil { - in, out := &in.Flocker, &out.Flocker - *out = new(api.FlockerVolumeSource) - if err := Convert_v1_FlockerVolumeSource_To_api_FlockerVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.Flocker = nil - } - if in.DownwardAPI != nil { - in, out := &in.DownwardAPI, &out.DownwardAPI - *out = new(api.DownwardAPIVolumeSource) - if err := Convert_v1_DownwardAPIVolumeSource_To_api_DownwardAPIVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.DownwardAPI = nil - } - if in.FC != nil { - in, out := &in.FC, &out.FC - *out = new(api.FCVolumeSource) - if err := Convert_v1_FCVolumeSource_To_api_FCVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.FC = nil - } - if in.AzureFile != nil { - in, out := &in.AzureFile, &out.AzureFile - *out = new(api.AzureFileVolumeSource) - if err := Convert_v1_AzureFileVolumeSource_To_api_AzureFileVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.AzureFile = nil - } - if in.ConfigMap != nil { - in, out := &in.ConfigMap, &out.ConfigMap - *out = new(api.ConfigMapVolumeSource) - if err := Convert_v1_ConfigMapVolumeSource_To_api_ConfigMapVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.ConfigMap = nil - } - if in.VsphereVolume != nil { - in, out := &in.VsphereVolume, &out.VsphereVolume - *out = new(api.VsphereVirtualDiskVolumeSource) - if err := Convert_v1_VsphereVirtualDiskVolumeSource_To_api_VsphereVirtualDiskVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.VsphereVolume = nil - } - return nil -} - -func Convert_v1_VolumeSource_To_api_VolumeSource(in *VolumeSource, out *api.VolumeSource, s conversion.Scope) error { - return autoConvert_v1_VolumeSource_To_api_VolumeSource(in, out, s) -} - -func autoConvert_api_VolumeSource_To_v1_VolumeSource(in *api.VolumeSource, out *VolumeSource, s conversion.Scope) error { - if in.HostPath != nil { - in, out := &in.HostPath, &out.HostPath - *out = new(HostPathVolumeSource) - if err := Convert_api_HostPathVolumeSource_To_v1_HostPathVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.HostPath = nil - } - if in.EmptyDir != nil { - in, out := &in.EmptyDir, &out.EmptyDir - *out = new(EmptyDirVolumeSource) - if err := Convert_api_EmptyDirVolumeSource_To_v1_EmptyDirVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.EmptyDir = nil - } - if in.GCEPersistentDisk != nil { - in, out := &in.GCEPersistentDisk, &out.GCEPersistentDisk - *out = new(GCEPersistentDiskVolumeSource) - if err := Convert_api_GCEPersistentDiskVolumeSource_To_v1_GCEPersistentDiskVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.GCEPersistentDisk = nil - } - if in.AWSElasticBlockStore != nil { - in, out := &in.AWSElasticBlockStore, &out.AWSElasticBlockStore - *out = new(AWSElasticBlockStoreVolumeSource) - if err := Convert_api_AWSElasticBlockStoreVolumeSource_To_v1_AWSElasticBlockStoreVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.AWSElasticBlockStore = nil - } - if in.GitRepo != nil { - in, out := &in.GitRepo, &out.GitRepo - *out = new(GitRepoVolumeSource) - if err := Convert_api_GitRepoVolumeSource_To_v1_GitRepoVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.GitRepo = nil - } - if in.Secret != nil { - in, out := &in.Secret, &out.Secret - *out = new(SecretVolumeSource) - if err := Convert_api_SecretVolumeSource_To_v1_SecretVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.Secret = nil - } - if in.NFS != nil { - in, out := &in.NFS, &out.NFS - *out = new(NFSVolumeSource) - if err := Convert_api_NFSVolumeSource_To_v1_NFSVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.NFS = nil - } - if in.ISCSI != nil { - in, out := &in.ISCSI, &out.ISCSI - *out = new(ISCSIVolumeSource) - if err := Convert_api_ISCSIVolumeSource_To_v1_ISCSIVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.ISCSI = nil - } - if in.Glusterfs != nil { - in, out := &in.Glusterfs, &out.Glusterfs - *out = new(GlusterfsVolumeSource) - if err := Convert_api_GlusterfsVolumeSource_To_v1_GlusterfsVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.Glusterfs = nil - } - if in.PersistentVolumeClaim != nil { - in, out := &in.PersistentVolumeClaim, &out.PersistentVolumeClaim - *out = new(PersistentVolumeClaimVolumeSource) - if err := Convert_api_PersistentVolumeClaimVolumeSource_To_v1_PersistentVolumeClaimVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.PersistentVolumeClaim = nil - } - if in.RBD != nil { - in, out := &in.RBD, &out.RBD - *out = new(RBDVolumeSource) - if err := Convert_api_RBDVolumeSource_To_v1_RBDVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.RBD = nil - } - if in.FlexVolume != nil { - in, out := &in.FlexVolume, &out.FlexVolume - *out = new(FlexVolumeSource) - if err := Convert_api_FlexVolumeSource_To_v1_FlexVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.FlexVolume = nil - } - if in.Cinder != nil { - in, out := &in.Cinder, &out.Cinder - *out = new(CinderVolumeSource) - if err := Convert_api_CinderVolumeSource_To_v1_CinderVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.Cinder = nil - } - if in.CephFS != nil { - in, out := &in.CephFS, &out.CephFS - *out = new(CephFSVolumeSource) - if err := Convert_api_CephFSVolumeSource_To_v1_CephFSVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.CephFS = nil - } - if in.Flocker != nil { - in, out := &in.Flocker, &out.Flocker - *out = new(FlockerVolumeSource) - if err := Convert_api_FlockerVolumeSource_To_v1_FlockerVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.Flocker = nil - } - if in.DownwardAPI != nil { - in, out := &in.DownwardAPI, &out.DownwardAPI - *out = new(DownwardAPIVolumeSource) - if err := Convert_api_DownwardAPIVolumeSource_To_v1_DownwardAPIVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.DownwardAPI = nil - } - if in.FC != nil { - in, out := &in.FC, &out.FC - *out = new(FCVolumeSource) - if err := Convert_api_FCVolumeSource_To_v1_FCVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.FC = nil - } - if in.AzureFile != nil { - in, out := &in.AzureFile, &out.AzureFile - *out = new(AzureFileVolumeSource) - if err := Convert_api_AzureFileVolumeSource_To_v1_AzureFileVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.AzureFile = nil - } - if in.ConfigMap != nil { - in, out := &in.ConfigMap, &out.ConfigMap - *out = new(ConfigMapVolumeSource) - if err := Convert_api_ConfigMapVolumeSource_To_v1_ConfigMapVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.ConfigMap = nil - } - if in.VsphereVolume != nil { - in, out := &in.VsphereVolume, &out.VsphereVolume - *out = new(VsphereVirtualDiskVolumeSource) - if err := Convert_api_VsphereVirtualDiskVolumeSource_To_v1_VsphereVirtualDiskVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.VsphereVolume = nil - } - return nil -} - -func Convert_api_VolumeSource_To_v1_VolumeSource(in *api.VolumeSource, out *VolumeSource, s conversion.Scope) error { - return autoConvert_api_VolumeSource_To_v1_VolumeSource(in, out, s) -} - -func autoConvert_v1_VsphereVirtualDiskVolumeSource_To_api_VsphereVirtualDiskVolumeSource(in *VsphereVirtualDiskVolumeSource, out *api.VsphereVirtualDiskVolumeSource, s conversion.Scope) error { - out.VolumePath = in.VolumePath - out.FSType = in.FSType - return nil -} - -func Convert_v1_VsphereVirtualDiskVolumeSource_To_api_VsphereVirtualDiskVolumeSource(in *VsphereVirtualDiskVolumeSource, out *api.VsphereVirtualDiskVolumeSource, s conversion.Scope) error { - return autoConvert_v1_VsphereVirtualDiskVolumeSource_To_api_VsphereVirtualDiskVolumeSource(in, out, s) -} - -func autoConvert_api_VsphereVirtualDiskVolumeSource_To_v1_VsphereVirtualDiskVolumeSource(in *api.VsphereVirtualDiskVolumeSource, out *VsphereVirtualDiskVolumeSource, s conversion.Scope) error { - out.VolumePath = in.VolumePath - out.FSType = in.FSType - return nil -} - -func Convert_api_VsphereVirtualDiskVolumeSource_To_v1_VsphereVirtualDiskVolumeSource(in *api.VsphereVirtualDiskVolumeSource, out *VsphereVirtualDiskVolumeSource, s conversion.Scope) error { - return autoConvert_api_VsphereVirtualDiskVolumeSource_To_v1_VsphereVirtualDiskVolumeSource(in, out, s) -} - -func autoConvert_v1_WeightedPodAffinityTerm_To_api_WeightedPodAffinityTerm(in *WeightedPodAffinityTerm, out *api.WeightedPodAffinityTerm, s conversion.Scope) error { - out.Weight = int(in.Weight) - if err := Convert_v1_PodAffinityTerm_To_api_PodAffinityTerm(&in.PodAffinityTerm, &out.PodAffinityTerm, s); err != nil { - return err - } - return nil -} - -func Convert_v1_WeightedPodAffinityTerm_To_api_WeightedPodAffinityTerm(in *WeightedPodAffinityTerm, out *api.WeightedPodAffinityTerm, s conversion.Scope) error { - return autoConvert_v1_WeightedPodAffinityTerm_To_api_WeightedPodAffinityTerm(in, out, s) -} - -func autoConvert_api_WeightedPodAffinityTerm_To_v1_WeightedPodAffinityTerm(in *api.WeightedPodAffinityTerm, out *WeightedPodAffinityTerm, s conversion.Scope) error { - out.Weight = int32(in.Weight) - if err := Convert_api_PodAffinityTerm_To_v1_PodAffinityTerm(&in.PodAffinityTerm, &out.PodAffinityTerm, s); err != nil { - return err - } - return nil -} - -func Convert_api_WeightedPodAffinityTerm_To_v1_WeightedPodAffinityTerm(in *api.WeightedPodAffinityTerm, out *WeightedPodAffinityTerm, s conversion.Scope) error { - return autoConvert_api_WeightedPodAffinityTerm_To_v1_WeightedPodAffinityTerm(in, out, s) -} diff --git a/pkg/apis/apps/v1alpha1/conversion_generated.go b/pkg/apis/apps/v1alpha1/conversion_generated.go deleted file mode 100644 index 3cf4728102f..00000000000 --- a/pkg/apis/apps/v1alpha1/conversion_generated.go +++ /dev/null @@ -1,156 +0,0 @@ -// +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) -} diff --git a/pkg/apis/authentication.k8s.io/v1beta1/conversion_generated.go b/pkg/apis/authentication.k8s.io/v1beta1/conversion_generated.go deleted file mode 100644 index d60db5ed9d1..00000000000 --- a/pkg/apis/authentication.k8s.io/v1beta1/conversion_generated.go +++ /dev/null @@ -1,143 +0,0 @@ -// +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) -} diff --git a/pkg/apis/authorization/v1beta1/conversion_generated.go b/pkg/apis/authorization/v1beta1/conversion_generated.go deleted file mode 100644 index 18d11380bfa..00000000000 --- a/pkg/apis/authorization/v1beta1/conversion_generated.go +++ /dev/null @@ -1,333 +0,0 @@ -// +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" - authorization "k8s.io/kubernetes/pkg/apis/authorization" - conversion "k8s.io/kubernetes/pkg/conversion" -) - -func init() { - if err := api.Scheme.AddGeneratedConversionFuncs( - Convert_v1beta1_LocalSubjectAccessReview_To_authorization_LocalSubjectAccessReview, - Convert_authorization_LocalSubjectAccessReview_To_v1beta1_LocalSubjectAccessReview, - Convert_v1beta1_NonResourceAttributes_To_authorization_NonResourceAttributes, - Convert_authorization_NonResourceAttributes_To_v1beta1_NonResourceAttributes, - Convert_v1beta1_ResourceAttributes_To_authorization_ResourceAttributes, - Convert_authorization_ResourceAttributes_To_v1beta1_ResourceAttributes, - Convert_v1beta1_SelfSubjectAccessReview_To_authorization_SelfSubjectAccessReview, - Convert_authorization_SelfSubjectAccessReview_To_v1beta1_SelfSubjectAccessReview, - Convert_v1beta1_SelfSubjectAccessReviewSpec_To_authorization_SelfSubjectAccessReviewSpec, - Convert_authorization_SelfSubjectAccessReviewSpec_To_v1beta1_SelfSubjectAccessReviewSpec, - Convert_v1beta1_SubjectAccessReview_To_authorization_SubjectAccessReview, - Convert_authorization_SubjectAccessReview_To_v1beta1_SubjectAccessReview, - Convert_v1beta1_SubjectAccessReviewSpec_To_authorization_SubjectAccessReviewSpec, - Convert_authorization_SubjectAccessReviewSpec_To_v1beta1_SubjectAccessReviewSpec, - Convert_v1beta1_SubjectAccessReviewStatus_To_authorization_SubjectAccessReviewStatus, - Convert_authorization_SubjectAccessReviewStatus_To_v1beta1_SubjectAccessReviewStatus, - ); err != nil { - // if one of the conversion functions is malformed, detect it immediately. - panic(err) - } -} - -func autoConvert_v1beta1_LocalSubjectAccessReview_To_authorization_LocalSubjectAccessReview(in *LocalSubjectAccessReview, out *authorization.LocalSubjectAccessReview, 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_SubjectAccessReviewSpec_To_authorization_SubjectAccessReviewSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_SubjectAccessReviewStatus_To_authorization_SubjectAccessReviewStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_v1beta1_LocalSubjectAccessReview_To_authorization_LocalSubjectAccessReview(in *LocalSubjectAccessReview, out *authorization.LocalSubjectAccessReview, s conversion.Scope) error { - return autoConvert_v1beta1_LocalSubjectAccessReview_To_authorization_LocalSubjectAccessReview(in, out, s) -} - -func autoConvert_authorization_LocalSubjectAccessReview_To_v1beta1_LocalSubjectAccessReview(in *authorization.LocalSubjectAccessReview, out *LocalSubjectAccessReview, 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_authorization_SubjectAccessReviewSpec_To_v1beta1_SubjectAccessReviewSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_authorization_SubjectAccessReviewStatus_To_v1beta1_SubjectAccessReviewStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_authorization_LocalSubjectAccessReview_To_v1beta1_LocalSubjectAccessReview(in *authorization.LocalSubjectAccessReview, out *LocalSubjectAccessReview, s conversion.Scope) error { - return autoConvert_authorization_LocalSubjectAccessReview_To_v1beta1_LocalSubjectAccessReview(in, out, s) -} - -func autoConvert_v1beta1_NonResourceAttributes_To_authorization_NonResourceAttributes(in *NonResourceAttributes, out *authorization.NonResourceAttributes, s conversion.Scope) error { - out.Path = in.Path - out.Verb = in.Verb - return nil -} - -func Convert_v1beta1_NonResourceAttributes_To_authorization_NonResourceAttributes(in *NonResourceAttributes, out *authorization.NonResourceAttributes, s conversion.Scope) error { - return autoConvert_v1beta1_NonResourceAttributes_To_authorization_NonResourceAttributes(in, out, s) -} - -func autoConvert_authorization_NonResourceAttributes_To_v1beta1_NonResourceAttributes(in *authorization.NonResourceAttributes, out *NonResourceAttributes, s conversion.Scope) error { - out.Path = in.Path - out.Verb = in.Verb - return nil -} - -func Convert_authorization_NonResourceAttributes_To_v1beta1_NonResourceAttributes(in *authorization.NonResourceAttributes, out *NonResourceAttributes, s conversion.Scope) error { - return autoConvert_authorization_NonResourceAttributes_To_v1beta1_NonResourceAttributes(in, out, s) -} - -func autoConvert_v1beta1_ResourceAttributes_To_authorization_ResourceAttributes(in *ResourceAttributes, out *authorization.ResourceAttributes, s conversion.Scope) error { - 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 Convert_v1beta1_ResourceAttributes_To_authorization_ResourceAttributes(in *ResourceAttributes, out *authorization.ResourceAttributes, s conversion.Scope) error { - return autoConvert_v1beta1_ResourceAttributes_To_authorization_ResourceAttributes(in, out, s) -} - -func autoConvert_authorization_ResourceAttributes_To_v1beta1_ResourceAttributes(in *authorization.ResourceAttributes, out *ResourceAttributes, s conversion.Scope) error { - 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 Convert_authorization_ResourceAttributes_To_v1beta1_ResourceAttributes(in *authorization.ResourceAttributes, out *ResourceAttributes, s conversion.Scope) error { - return autoConvert_authorization_ResourceAttributes_To_v1beta1_ResourceAttributes(in, out, s) -} - -func autoConvert_v1beta1_SelfSubjectAccessReview_To_authorization_SelfSubjectAccessReview(in *SelfSubjectAccessReview, out *authorization.SelfSubjectAccessReview, 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_SelfSubjectAccessReviewSpec_To_authorization_SelfSubjectAccessReviewSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_SubjectAccessReviewStatus_To_authorization_SubjectAccessReviewStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_v1beta1_SelfSubjectAccessReview_To_authorization_SelfSubjectAccessReview(in *SelfSubjectAccessReview, out *authorization.SelfSubjectAccessReview, s conversion.Scope) error { - return autoConvert_v1beta1_SelfSubjectAccessReview_To_authorization_SelfSubjectAccessReview(in, out, s) -} - -func autoConvert_authorization_SelfSubjectAccessReview_To_v1beta1_SelfSubjectAccessReview(in *authorization.SelfSubjectAccessReview, out *SelfSubjectAccessReview, 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_authorization_SelfSubjectAccessReviewSpec_To_v1beta1_SelfSubjectAccessReviewSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_authorization_SubjectAccessReviewStatus_To_v1beta1_SubjectAccessReviewStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_authorization_SelfSubjectAccessReview_To_v1beta1_SelfSubjectAccessReview(in *authorization.SelfSubjectAccessReview, out *SelfSubjectAccessReview, s conversion.Scope) error { - return autoConvert_authorization_SelfSubjectAccessReview_To_v1beta1_SelfSubjectAccessReview(in, out, s) -} - -func autoConvert_v1beta1_SelfSubjectAccessReviewSpec_To_authorization_SelfSubjectAccessReviewSpec(in *SelfSubjectAccessReviewSpec, out *authorization.SelfSubjectAccessReviewSpec, s conversion.Scope) error { - if in.ResourceAttributes != nil { - in, out := &in.ResourceAttributes, &out.ResourceAttributes - *out = new(authorization.ResourceAttributes) - if err := Convert_v1beta1_ResourceAttributes_To_authorization_ResourceAttributes(*in, *out, s); err != nil { - return err - } - } else { - out.ResourceAttributes = nil - } - if in.NonResourceAttributes != nil { - in, out := &in.NonResourceAttributes, &out.NonResourceAttributes - *out = new(authorization.NonResourceAttributes) - if err := Convert_v1beta1_NonResourceAttributes_To_authorization_NonResourceAttributes(*in, *out, s); err != nil { - return err - } - } else { - out.NonResourceAttributes = nil - } - return nil -} - -func Convert_v1beta1_SelfSubjectAccessReviewSpec_To_authorization_SelfSubjectAccessReviewSpec(in *SelfSubjectAccessReviewSpec, out *authorization.SelfSubjectAccessReviewSpec, s conversion.Scope) error { - return autoConvert_v1beta1_SelfSubjectAccessReviewSpec_To_authorization_SelfSubjectAccessReviewSpec(in, out, s) -} - -func autoConvert_authorization_SelfSubjectAccessReviewSpec_To_v1beta1_SelfSubjectAccessReviewSpec(in *authorization.SelfSubjectAccessReviewSpec, out *SelfSubjectAccessReviewSpec, s conversion.Scope) error { - if in.ResourceAttributes != nil { - in, out := &in.ResourceAttributes, &out.ResourceAttributes - *out = new(ResourceAttributes) - if err := Convert_authorization_ResourceAttributes_To_v1beta1_ResourceAttributes(*in, *out, s); err != nil { - return err - } - } else { - out.ResourceAttributes = nil - } - if in.NonResourceAttributes != nil { - in, out := &in.NonResourceAttributes, &out.NonResourceAttributes - *out = new(NonResourceAttributes) - if err := Convert_authorization_NonResourceAttributes_To_v1beta1_NonResourceAttributes(*in, *out, s); err != nil { - return err - } - } else { - out.NonResourceAttributes = nil - } - return nil -} - -func Convert_authorization_SelfSubjectAccessReviewSpec_To_v1beta1_SelfSubjectAccessReviewSpec(in *authorization.SelfSubjectAccessReviewSpec, out *SelfSubjectAccessReviewSpec, s conversion.Scope) error { - return autoConvert_authorization_SelfSubjectAccessReviewSpec_To_v1beta1_SelfSubjectAccessReviewSpec(in, out, s) -} - -func autoConvert_v1beta1_SubjectAccessReview_To_authorization_SubjectAccessReview(in *SubjectAccessReview, out *authorization.SubjectAccessReview, 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_SubjectAccessReviewSpec_To_authorization_SubjectAccessReviewSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_SubjectAccessReviewStatus_To_authorization_SubjectAccessReviewStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_v1beta1_SubjectAccessReview_To_authorization_SubjectAccessReview(in *SubjectAccessReview, out *authorization.SubjectAccessReview, s conversion.Scope) error { - return autoConvert_v1beta1_SubjectAccessReview_To_authorization_SubjectAccessReview(in, out, s) -} - -func autoConvert_authorization_SubjectAccessReview_To_v1beta1_SubjectAccessReview(in *authorization.SubjectAccessReview, out *SubjectAccessReview, 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_authorization_SubjectAccessReviewSpec_To_v1beta1_SubjectAccessReviewSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_authorization_SubjectAccessReviewStatus_To_v1beta1_SubjectAccessReviewStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_authorization_SubjectAccessReview_To_v1beta1_SubjectAccessReview(in *authorization.SubjectAccessReview, out *SubjectAccessReview, s conversion.Scope) error { - return autoConvert_authorization_SubjectAccessReview_To_v1beta1_SubjectAccessReview(in, out, s) -} - -func autoConvert_v1beta1_SubjectAccessReviewSpec_To_authorization_SubjectAccessReviewSpec(in *SubjectAccessReviewSpec, out *authorization.SubjectAccessReviewSpec, s conversion.Scope) error { - if in.ResourceAttributes != nil { - in, out := &in.ResourceAttributes, &out.ResourceAttributes - *out = new(authorization.ResourceAttributes) - if err := Convert_v1beta1_ResourceAttributes_To_authorization_ResourceAttributes(*in, *out, s); err != nil { - return err - } - } else { - out.ResourceAttributes = nil - } - if in.NonResourceAttributes != nil { - in, out := &in.NonResourceAttributes, &out.NonResourceAttributes - *out = new(authorization.NonResourceAttributes) - if err := Convert_v1beta1_NonResourceAttributes_To_authorization_NonResourceAttributes(*in, *out, s); err != nil { - return err - } - } else { - out.NonResourceAttributes = nil - } - out.User = in.User - out.Groups = in.Groups - out.Extra = in.Extra - return nil -} - -func Convert_v1beta1_SubjectAccessReviewSpec_To_authorization_SubjectAccessReviewSpec(in *SubjectAccessReviewSpec, out *authorization.SubjectAccessReviewSpec, s conversion.Scope) error { - return autoConvert_v1beta1_SubjectAccessReviewSpec_To_authorization_SubjectAccessReviewSpec(in, out, s) -} - -func autoConvert_authorization_SubjectAccessReviewSpec_To_v1beta1_SubjectAccessReviewSpec(in *authorization.SubjectAccessReviewSpec, out *SubjectAccessReviewSpec, s conversion.Scope) error { - if in.ResourceAttributes != nil { - in, out := &in.ResourceAttributes, &out.ResourceAttributes - *out = new(ResourceAttributes) - if err := Convert_authorization_ResourceAttributes_To_v1beta1_ResourceAttributes(*in, *out, s); err != nil { - return err - } - } else { - out.ResourceAttributes = nil - } - if in.NonResourceAttributes != nil { - in, out := &in.NonResourceAttributes, &out.NonResourceAttributes - *out = new(NonResourceAttributes) - if err := Convert_authorization_NonResourceAttributes_To_v1beta1_NonResourceAttributes(*in, *out, s); err != nil { - return err - } - } else { - out.NonResourceAttributes = nil - } - out.User = in.User - out.Groups = in.Groups - out.Extra = in.Extra - return nil -} - -func Convert_authorization_SubjectAccessReviewSpec_To_v1beta1_SubjectAccessReviewSpec(in *authorization.SubjectAccessReviewSpec, out *SubjectAccessReviewSpec, s conversion.Scope) error { - return autoConvert_authorization_SubjectAccessReviewSpec_To_v1beta1_SubjectAccessReviewSpec(in, out, s) -} - -func autoConvert_v1beta1_SubjectAccessReviewStatus_To_authorization_SubjectAccessReviewStatus(in *SubjectAccessReviewStatus, out *authorization.SubjectAccessReviewStatus, s conversion.Scope) error { - out.Allowed = in.Allowed - out.Reason = in.Reason - return nil -} - -func Convert_v1beta1_SubjectAccessReviewStatus_To_authorization_SubjectAccessReviewStatus(in *SubjectAccessReviewStatus, out *authorization.SubjectAccessReviewStatus, s conversion.Scope) error { - return autoConvert_v1beta1_SubjectAccessReviewStatus_To_authorization_SubjectAccessReviewStatus(in, out, s) -} - -func autoConvert_authorization_SubjectAccessReviewStatus_To_v1beta1_SubjectAccessReviewStatus(in *authorization.SubjectAccessReviewStatus, out *SubjectAccessReviewStatus, s conversion.Scope) error { - out.Allowed = in.Allowed - out.Reason = in.Reason - return nil -} - -func Convert_authorization_SubjectAccessReviewStatus_To_v1beta1_SubjectAccessReviewStatus(in *authorization.SubjectAccessReviewStatus, out *SubjectAccessReviewStatus, s conversion.Scope) error { - return autoConvert_authorization_SubjectAccessReviewStatus_To_v1beta1_SubjectAccessReviewStatus(in, out, s) -} diff --git a/pkg/apis/autoscaling/v1/conversion_generated.go b/pkg/apis/autoscaling/v1/conversion_generated.go deleted file mode 100644 index 3d569928380..00000000000 --- a/pkg/apis/autoscaling/v1/conversion_generated.go +++ /dev/null @@ -1,300 +0,0 @@ -// +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 v1 - -import ( - api "k8s.io/kubernetes/pkg/api" - autoscaling "k8s.io/kubernetes/pkg/apis/autoscaling" - conversion "k8s.io/kubernetes/pkg/conversion" -) - -func init() { - if err := api.Scheme.AddGeneratedConversionFuncs( - Convert_v1_CrossVersionObjectReference_To_autoscaling_CrossVersionObjectReference, - Convert_autoscaling_CrossVersionObjectReference_To_v1_CrossVersionObjectReference, - Convert_v1_HorizontalPodAutoscaler_To_autoscaling_HorizontalPodAutoscaler, - Convert_autoscaling_HorizontalPodAutoscaler_To_v1_HorizontalPodAutoscaler, - Convert_v1_HorizontalPodAutoscalerList_To_autoscaling_HorizontalPodAutoscalerList, - Convert_autoscaling_HorizontalPodAutoscalerList_To_v1_HorizontalPodAutoscalerList, - Convert_v1_HorizontalPodAutoscalerSpec_To_autoscaling_HorizontalPodAutoscalerSpec, - Convert_autoscaling_HorizontalPodAutoscalerSpec_To_v1_HorizontalPodAutoscalerSpec, - Convert_v1_HorizontalPodAutoscalerStatus_To_autoscaling_HorizontalPodAutoscalerStatus, - Convert_autoscaling_HorizontalPodAutoscalerStatus_To_v1_HorizontalPodAutoscalerStatus, - Convert_v1_Scale_To_autoscaling_Scale, - Convert_autoscaling_Scale_To_v1_Scale, - Convert_v1_ScaleSpec_To_autoscaling_ScaleSpec, - Convert_autoscaling_ScaleSpec_To_v1_ScaleSpec, - Convert_v1_ScaleStatus_To_autoscaling_ScaleStatus, - Convert_autoscaling_ScaleStatus_To_v1_ScaleStatus, - ); err != nil { - // if one of the conversion functions is malformed, detect it immediately. - panic(err) - } -} - -func autoConvert_v1_CrossVersionObjectReference_To_autoscaling_CrossVersionObjectReference(in *CrossVersionObjectReference, out *autoscaling.CrossVersionObjectReference, s conversion.Scope) error { - out.Kind = in.Kind - out.Name = in.Name - out.APIVersion = in.APIVersion - return nil -} - -func Convert_v1_CrossVersionObjectReference_To_autoscaling_CrossVersionObjectReference(in *CrossVersionObjectReference, out *autoscaling.CrossVersionObjectReference, s conversion.Scope) error { - return autoConvert_v1_CrossVersionObjectReference_To_autoscaling_CrossVersionObjectReference(in, out, s) -} - -func autoConvert_autoscaling_CrossVersionObjectReference_To_v1_CrossVersionObjectReference(in *autoscaling.CrossVersionObjectReference, out *CrossVersionObjectReference, s conversion.Scope) error { - out.Kind = in.Kind - out.Name = in.Name - out.APIVersion = in.APIVersion - return nil -} - -func Convert_autoscaling_CrossVersionObjectReference_To_v1_CrossVersionObjectReference(in *autoscaling.CrossVersionObjectReference, out *CrossVersionObjectReference, s conversion.Scope) error { - return autoConvert_autoscaling_CrossVersionObjectReference_To_v1_CrossVersionObjectReference(in, out, s) -} - -func autoConvert_v1_HorizontalPodAutoscaler_To_autoscaling_HorizontalPodAutoscaler(in *HorizontalPodAutoscaler, out *autoscaling.HorizontalPodAutoscaler, s conversion.Scope) error { - SetDefaults_HorizontalPodAutoscaler(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_v1_HorizontalPodAutoscalerSpec_To_autoscaling_HorizontalPodAutoscalerSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1_HorizontalPodAutoscalerStatus_To_autoscaling_HorizontalPodAutoscalerStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_v1_HorizontalPodAutoscaler_To_autoscaling_HorizontalPodAutoscaler(in *HorizontalPodAutoscaler, out *autoscaling.HorizontalPodAutoscaler, s conversion.Scope) error { - return autoConvert_v1_HorizontalPodAutoscaler_To_autoscaling_HorizontalPodAutoscaler(in, out, s) -} - -func autoConvert_autoscaling_HorizontalPodAutoscaler_To_v1_HorizontalPodAutoscaler(in *autoscaling.HorizontalPodAutoscaler, out *HorizontalPodAutoscaler, 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_autoscaling_HorizontalPodAutoscalerSpec_To_v1_HorizontalPodAutoscalerSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_autoscaling_HorizontalPodAutoscalerStatus_To_v1_HorizontalPodAutoscalerStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_autoscaling_HorizontalPodAutoscaler_To_v1_HorizontalPodAutoscaler(in *autoscaling.HorizontalPodAutoscaler, out *HorizontalPodAutoscaler, s conversion.Scope) error { - return autoConvert_autoscaling_HorizontalPodAutoscaler_To_v1_HorizontalPodAutoscaler(in, out, s) -} - -func autoConvert_v1_HorizontalPodAutoscalerList_To_autoscaling_HorizontalPodAutoscalerList(in *HorizontalPodAutoscalerList, out *autoscaling.HorizontalPodAutoscalerList, 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([]autoscaling.HorizontalPodAutoscaler, len(*in)) - for i := range *in { - if err := Convert_v1_HorizontalPodAutoscaler_To_autoscaling_HorizontalPodAutoscaler(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1_HorizontalPodAutoscalerList_To_autoscaling_HorizontalPodAutoscalerList(in *HorizontalPodAutoscalerList, out *autoscaling.HorizontalPodAutoscalerList, s conversion.Scope) error { - return autoConvert_v1_HorizontalPodAutoscalerList_To_autoscaling_HorizontalPodAutoscalerList(in, out, s) -} - -func autoConvert_autoscaling_HorizontalPodAutoscalerList_To_v1_HorizontalPodAutoscalerList(in *autoscaling.HorizontalPodAutoscalerList, out *HorizontalPodAutoscalerList, 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([]HorizontalPodAutoscaler, len(*in)) - for i := range *in { - if err := Convert_autoscaling_HorizontalPodAutoscaler_To_v1_HorizontalPodAutoscaler(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_autoscaling_HorizontalPodAutoscalerList_To_v1_HorizontalPodAutoscalerList(in *autoscaling.HorizontalPodAutoscalerList, out *HorizontalPodAutoscalerList, s conversion.Scope) error { - return autoConvert_autoscaling_HorizontalPodAutoscalerList_To_v1_HorizontalPodAutoscalerList(in, out, s) -} - -func autoConvert_v1_HorizontalPodAutoscalerSpec_To_autoscaling_HorizontalPodAutoscalerSpec(in *HorizontalPodAutoscalerSpec, out *autoscaling.HorizontalPodAutoscalerSpec, s conversion.Scope) error { - if err := Convert_v1_CrossVersionObjectReference_To_autoscaling_CrossVersionObjectReference(&in.ScaleTargetRef, &out.ScaleTargetRef, s); err != nil { - return err - } - out.MinReplicas = in.MinReplicas - out.MaxReplicas = in.MaxReplicas - out.TargetCPUUtilizationPercentage = in.TargetCPUUtilizationPercentage - return nil -} - -func Convert_v1_HorizontalPodAutoscalerSpec_To_autoscaling_HorizontalPodAutoscalerSpec(in *HorizontalPodAutoscalerSpec, out *autoscaling.HorizontalPodAutoscalerSpec, s conversion.Scope) error { - return autoConvert_v1_HorizontalPodAutoscalerSpec_To_autoscaling_HorizontalPodAutoscalerSpec(in, out, s) -} - -func autoConvert_autoscaling_HorizontalPodAutoscalerSpec_To_v1_HorizontalPodAutoscalerSpec(in *autoscaling.HorizontalPodAutoscalerSpec, out *HorizontalPodAutoscalerSpec, s conversion.Scope) error { - if err := Convert_autoscaling_CrossVersionObjectReference_To_v1_CrossVersionObjectReference(&in.ScaleTargetRef, &out.ScaleTargetRef, s); err != nil { - return err - } - out.MinReplicas = in.MinReplicas - out.MaxReplicas = in.MaxReplicas - out.TargetCPUUtilizationPercentage = in.TargetCPUUtilizationPercentage - return nil -} - -func Convert_autoscaling_HorizontalPodAutoscalerSpec_To_v1_HorizontalPodAutoscalerSpec(in *autoscaling.HorizontalPodAutoscalerSpec, out *HorizontalPodAutoscalerSpec, s conversion.Scope) error { - return autoConvert_autoscaling_HorizontalPodAutoscalerSpec_To_v1_HorizontalPodAutoscalerSpec(in, out, s) -} - -func autoConvert_v1_HorizontalPodAutoscalerStatus_To_autoscaling_HorizontalPodAutoscalerStatus(in *HorizontalPodAutoscalerStatus, out *autoscaling.HorizontalPodAutoscalerStatus, s conversion.Scope) error { - out.ObservedGeneration = in.ObservedGeneration - out.LastScaleTime = in.LastScaleTime - out.CurrentReplicas = in.CurrentReplicas - out.DesiredReplicas = in.DesiredReplicas - out.CurrentCPUUtilizationPercentage = in.CurrentCPUUtilizationPercentage - return nil -} - -func Convert_v1_HorizontalPodAutoscalerStatus_To_autoscaling_HorizontalPodAutoscalerStatus(in *HorizontalPodAutoscalerStatus, out *autoscaling.HorizontalPodAutoscalerStatus, s conversion.Scope) error { - return autoConvert_v1_HorizontalPodAutoscalerStatus_To_autoscaling_HorizontalPodAutoscalerStatus(in, out, s) -} - -func autoConvert_autoscaling_HorizontalPodAutoscalerStatus_To_v1_HorizontalPodAutoscalerStatus(in *autoscaling.HorizontalPodAutoscalerStatus, out *HorizontalPodAutoscalerStatus, s conversion.Scope) error { - out.ObservedGeneration = in.ObservedGeneration - out.LastScaleTime = in.LastScaleTime - out.CurrentReplicas = in.CurrentReplicas - out.DesiredReplicas = in.DesiredReplicas - out.CurrentCPUUtilizationPercentage = in.CurrentCPUUtilizationPercentage - return nil -} - -func Convert_autoscaling_HorizontalPodAutoscalerStatus_To_v1_HorizontalPodAutoscalerStatus(in *autoscaling.HorizontalPodAutoscalerStatus, out *HorizontalPodAutoscalerStatus, s conversion.Scope) error { - return autoConvert_autoscaling_HorizontalPodAutoscalerStatus_To_v1_HorizontalPodAutoscalerStatus(in, out, s) -} - -func autoConvert_v1_Scale_To_autoscaling_Scale(in *Scale, out *autoscaling.Scale, 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_v1_ScaleSpec_To_autoscaling_ScaleSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1_ScaleStatus_To_autoscaling_ScaleStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_v1_Scale_To_autoscaling_Scale(in *Scale, out *autoscaling.Scale, s conversion.Scope) error { - return autoConvert_v1_Scale_To_autoscaling_Scale(in, out, s) -} - -func autoConvert_autoscaling_Scale_To_v1_Scale(in *autoscaling.Scale, out *Scale, 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_autoscaling_ScaleSpec_To_v1_ScaleSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_autoscaling_ScaleStatus_To_v1_ScaleStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_autoscaling_Scale_To_v1_Scale(in *autoscaling.Scale, out *Scale, s conversion.Scope) error { - return autoConvert_autoscaling_Scale_To_v1_Scale(in, out, s) -} - -func autoConvert_v1_ScaleSpec_To_autoscaling_ScaleSpec(in *ScaleSpec, out *autoscaling.ScaleSpec, s conversion.Scope) error { - out.Replicas = in.Replicas - return nil -} - -func Convert_v1_ScaleSpec_To_autoscaling_ScaleSpec(in *ScaleSpec, out *autoscaling.ScaleSpec, s conversion.Scope) error { - return autoConvert_v1_ScaleSpec_To_autoscaling_ScaleSpec(in, out, s) -} - -func autoConvert_autoscaling_ScaleSpec_To_v1_ScaleSpec(in *autoscaling.ScaleSpec, out *ScaleSpec, s conversion.Scope) error { - out.Replicas = in.Replicas - return nil -} - -func Convert_autoscaling_ScaleSpec_To_v1_ScaleSpec(in *autoscaling.ScaleSpec, out *ScaleSpec, s conversion.Scope) error { - return autoConvert_autoscaling_ScaleSpec_To_v1_ScaleSpec(in, out, s) -} - -func autoConvert_v1_ScaleStatus_To_autoscaling_ScaleStatus(in *ScaleStatus, out *autoscaling.ScaleStatus, s conversion.Scope) error { - out.Replicas = in.Replicas - out.Selector = in.Selector - return nil -} - -func Convert_v1_ScaleStatus_To_autoscaling_ScaleStatus(in *ScaleStatus, out *autoscaling.ScaleStatus, s conversion.Scope) error { - return autoConvert_v1_ScaleStatus_To_autoscaling_ScaleStatus(in, out, s) -} - -func autoConvert_autoscaling_ScaleStatus_To_v1_ScaleStatus(in *autoscaling.ScaleStatus, out *ScaleStatus, s conversion.Scope) error { - out.Replicas = in.Replicas - out.Selector = in.Selector - return nil -} - -func Convert_autoscaling_ScaleStatus_To_v1_ScaleStatus(in *autoscaling.ScaleStatus, out *ScaleStatus, s conversion.Scope) error { - return autoConvert_autoscaling_ScaleStatus_To_v1_ScaleStatus(in, out, s) -} diff --git a/pkg/apis/batch/v1/conversion_generated.go b/pkg/apis/batch/v1/conversion_generated.go deleted file mode 100644 index 88e6d961ffa..00000000000 --- a/pkg/apis/batch/v1/conversion_generated.go +++ /dev/null @@ -1,330 +0,0 @@ -// +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 v1 - -import ( - api "k8s.io/kubernetes/pkg/api" - unversioned "k8s.io/kubernetes/pkg/api/unversioned" - api_v1 "k8s.io/kubernetes/pkg/api/v1" - batch "k8s.io/kubernetes/pkg/apis/batch" - conversion "k8s.io/kubernetes/pkg/conversion" -) - -func init() { - if err := api.Scheme.AddGeneratedConversionFuncs( - Convert_v1_Job_To_batch_Job, - Convert_batch_Job_To_v1_Job, - Convert_v1_JobCondition_To_batch_JobCondition, - Convert_batch_JobCondition_To_v1_JobCondition, - Convert_v1_JobList_To_batch_JobList, - Convert_batch_JobList_To_v1_JobList, - Convert_v1_JobSpec_To_batch_JobSpec, - Convert_batch_JobSpec_To_v1_JobSpec, - Convert_v1_JobStatus_To_batch_JobStatus, - Convert_batch_JobStatus_To_v1_JobStatus, - Convert_v1_LabelSelector_To_unversioned_LabelSelector, - Convert_unversioned_LabelSelector_To_v1_LabelSelector, - Convert_v1_LabelSelectorRequirement_To_unversioned_LabelSelectorRequirement, - Convert_unversioned_LabelSelectorRequirement_To_v1_LabelSelectorRequirement, - ); err != nil { - // if one of the conversion functions is malformed, detect it immediately. - panic(err) - } -} - -func autoConvert_v1_Job_To_batch_Job(in *Job, out *batch.Job, s conversion.Scope) error { - SetDefaults_Job(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_v1_JobSpec_To_batch_JobSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1_JobStatus_To_batch_JobStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_v1_Job_To_batch_Job(in *Job, out *batch.Job, s conversion.Scope) error { - return autoConvert_v1_Job_To_batch_Job(in, out, s) -} - -func autoConvert_batch_Job_To_v1_Job(in *batch.Job, out *Job, 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_batch_JobSpec_To_v1_JobSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_batch_JobStatus_To_v1_JobStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_batch_Job_To_v1_Job(in *batch.Job, out *Job, s conversion.Scope) error { - return autoConvert_batch_Job_To_v1_Job(in, out, s) -} - -func autoConvert_v1_JobCondition_To_batch_JobCondition(in *JobCondition, out *batch.JobCondition, s conversion.Scope) error { - out.Type = batch.JobConditionType(in.Type) - out.Status = api.ConditionStatus(in.Status) - if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastProbeTime, &out.LastProbeTime, s); err != nil { - return err - } - if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastTransitionTime, &out.LastTransitionTime, s); err != nil { - return err - } - out.Reason = in.Reason - out.Message = in.Message - return nil -} - -func Convert_v1_JobCondition_To_batch_JobCondition(in *JobCondition, out *batch.JobCondition, s conversion.Scope) error { - return autoConvert_v1_JobCondition_To_batch_JobCondition(in, out, s) -} - -func autoConvert_batch_JobCondition_To_v1_JobCondition(in *batch.JobCondition, out *JobCondition, s conversion.Scope) error { - out.Type = JobConditionType(in.Type) - out.Status = api_v1.ConditionStatus(in.Status) - if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastProbeTime, &out.LastProbeTime, s); err != nil { - return err - } - if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastTransitionTime, &out.LastTransitionTime, s); err != nil { - return err - } - out.Reason = in.Reason - out.Message = in.Message - return nil -} - -func Convert_batch_JobCondition_To_v1_JobCondition(in *batch.JobCondition, out *JobCondition, s conversion.Scope) error { - return autoConvert_batch_JobCondition_To_v1_JobCondition(in, out, s) -} - -func autoConvert_v1_JobList_To_batch_JobList(in *JobList, out *batch.JobList, 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([]batch.Job, len(*in)) - for i := range *in { - if err := Convert_v1_Job_To_batch_Job(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1_JobList_To_batch_JobList(in *JobList, out *batch.JobList, s conversion.Scope) error { - return autoConvert_v1_JobList_To_batch_JobList(in, out, s) -} - -func autoConvert_batch_JobList_To_v1_JobList(in *batch.JobList, out *JobList, 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([]Job, len(*in)) - for i := range *in { - if err := Convert_batch_Job_To_v1_Job(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_batch_JobList_To_v1_JobList(in *batch.JobList, out *JobList, s conversion.Scope) error { - return autoConvert_batch_JobList_To_v1_JobList(in, out, s) -} - -func autoConvert_v1_JobSpec_To_batch_JobSpec(in *JobSpec, out *batch.JobSpec, s conversion.Scope) error { - out.Parallelism = in.Parallelism - out.Completions = in.Completions - out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds - if in.Selector != nil { - in, out := &in.Selector, &out.Selector - *out = new(unversioned.LabelSelector) - if err := Convert_v1_LabelSelector_To_unversioned_LabelSelector(*in, *out, s); err != nil { - return err - } - } else { - out.Selector = nil - } - out.ManualSelector = in.ManualSelector - if err := api_v1.Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -func autoConvert_batch_JobSpec_To_v1_JobSpec(in *batch.JobSpec, out *JobSpec, s conversion.Scope) error { - out.Parallelism = in.Parallelism - out.Completions = in.Completions - out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds - if in.Selector != nil { - in, out := &in.Selector, &out.Selector - *out = new(LabelSelector) - if err := Convert_unversioned_LabelSelector_To_v1_LabelSelector(*in, *out, s); err != nil { - return err - } - } else { - out.Selector = nil - } - out.ManualSelector = in.ManualSelector - if err := api_v1.Convert_api_PodTemplateSpec_To_v1_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -func autoConvert_v1_JobStatus_To_batch_JobStatus(in *JobStatus, out *batch.JobStatus, s conversion.Scope) error { - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]batch.JobCondition, len(*in)) - for i := range *in { - if err := Convert_v1_JobCondition_To_batch_JobCondition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - out.StartTime = in.StartTime - out.CompletionTime = in.CompletionTime - out.Active = in.Active - out.Succeeded = in.Succeeded - out.Failed = in.Failed - return nil -} - -func Convert_v1_JobStatus_To_batch_JobStatus(in *JobStatus, out *batch.JobStatus, s conversion.Scope) error { - return autoConvert_v1_JobStatus_To_batch_JobStatus(in, out, s) -} - -func autoConvert_batch_JobStatus_To_v1_JobStatus(in *batch.JobStatus, out *JobStatus, s conversion.Scope) error { - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]JobCondition, len(*in)) - for i := range *in { - if err := Convert_batch_JobCondition_To_v1_JobCondition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - out.StartTime = in.StartTime - out.CompletionTime = in.CompletionTime - out.Active = in.Active - out.Succeeded = in.Succeeded - out.Failed = in.Failed - return nil -} - -func Convert_batch_JobStatus_To_v1_JobStatus(in *batch.JobStatus, out *JobStatus, s conversion.Scope) error { - return autoConvert_batch_JobStatus_To_v1_JobStatus(in, out, s) -} - -func autoConvert_v1_LabelSelector_To_unversioned_LabelSelector(in *LabelSelector, out *unversioned.LabelSelector, s conversion.Scope) error { - out.MatchLabels = in.MatchLabels - if in.MatchExpressions != nil { - in, out := &in.MatchExpressions, &out.MatchExpressions - *out = make([]unversioned.LabelSelectorRequirement, len(*in)) - for i := range *in { - if err := Convert_v1_LabelSelectorRequirement_To_unversioned_LabelSelectorRequirement(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.MatchExpressions = nil - } - return nil -} - -func Convert_v1_LabelSelector_To_unversioned_LabelSelector(in *LabelSelector, out *unversioned.LabelSelector, s conversion.Scope) error { - return autoConvert_v1_LabelSelector_To_unversioned_LabelSelector(in, out, s) -} - -func autoConvert_unversioned_LabelSelector_To_v1_LabelSelector(in *unversioned.LabelSelector, out *LabelSelector, s conversion.Scope) error { - out.MatchLabels = in.MatchLabels - if in.MatchExpressions != nil { - in, out := &in.MatchExpressions, &out.MatchExpressions - *out = make([]LabelSelectorRequirement, len(*in)) - for i := range *in { - if err := Convert_unversioned_LabelSelectorRequirement_To_v1_LabelSelectorRequirement(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.MatchExpressions = nil - } - return nil -} - -func Convert_unversioned_LabelSelector_To_v1_LabelSelector(in *unversioned.LabelSelector, out *LabelSelector, s conversion.Scope) error { - return autoConvert_unversioned_LabelSelector_To_v1_LabelSelector(in, out, s) -} - -func autoConvert_v1_LabelSelectorRequirement_To_unversioned_LabelSelectorRequirement(in *LabelSelectorRequirement, out *unversioned.LabelSelectorRequirement, s conversion.Scope) error { - out.Key = in.Key - out.Operator = unversioned.LabelSelectorOperator(in.Operator) - out.Values = in.Values - return nil -} - -func Convert_v1_LabelSelectorRequirement_To_unversioned_LabelSelectorRequirement(in *LabelSelectorRequirement, out *unversioned.LabelSelectorRequirement, s conversion.Scope) error { - return autoConvert_v1_LabelSelectorRequirement_To_unversioned_LabelSelectorRequirement(in, out, s) -} - -func autoConvert_unversioned_LabelSelectorRequirement_To_v1_LabelSelectorRequirement(in *unversioned.LabelSelectorRequirement, out *LabelSelectorRequirement, s conversion.Scope) error { - out.Key = in.Key - out.Operator = LabelSelectorOperator(in.Operator) - out.Values = in.Values - return nil -} - -func Convert_unversioned_LabelSelectorRequirement_To_v1_LabelSelectorRequirement(in *unversioned.LabelSelectorRequirement, out *LabelSelectorRequirement, s conversion.Scope) error { - return autoConvert_unversioned_LabelSelectorRequirement_To_v1_LabelSelectorRequirement(in, out, s) -} diff --git a/pkg/apis/batch/v2alpha1/conversion_generated.go b/pkg/apis/batch/v2alpha1/conversion_generated.go deleted file mode 100644 index 3265269bdfb..00000000000 --- a/pkg/apis/batch/v2alpha1/conversion_generated.go +++ /dev/null @@ -1,573 +0,0 @@ -// +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 v2alpha1 - -import ( - api "k8s.io/kubernetes/pkg/api" - unversioned "k8s.io/kubernetes/pkg/api/unversioned" - v1 "k8s.io/kubernetes/pkg/api/v1" - batch "k8s.io/kubernetes/pkg/apis/batch" - conversion "k8s.io/kubernetes/pkg/conversion" -) - -func init() { - if err := api.Scheme.AddGeneratedConversionFuncs( - Convert_v2alpha1_Job_To_batch_Job, - Convert_batch_Job_To_v2alpha1_Job, - Convert_v2alpha1_JobCondition_To_batch_JobCondition, - Convert_batch_JobCondition_To_v2alpha1_JobCondition, - Convert_v2alpha1_JobList_To_batch_JobList, - Convert_batch_JobList_To_v2alpha1_JobList, - Convert_v2alpha1_JobSpec_To_batch_JobSpec, - Convert_batch_JobSpec_To_v2alpha1_JobSpec, - Convert_v2alpha1_JobStatus_To_batch_JobStatus, - Convert_batch_JobStatus_To_v2alpha1_JobStatus, - Convert_v2alpha1_JobTemplate_To_batch_JobTemplate, - Convert_batch_JobTemplate_To_v2alpha1_JobTemplate, - Convert_v2alpha1_JobTemplateSpec_To_batch_JobTemplateSpec, - Convert_batch_JobTemplateSpec_To_v2alpha1_JobTemplateSpec, - Convert_v2alpha1_LabelSelector_To_unversioned_LabelSelector, - Convert_unversioned_LabelSelector_To_v2alpha1_LabelSelector, - Convert_v2alpha1_LabelSelectorRequirement_To_unversioned_LabelSelectorRequirement, - Convert_unversioned_LabelSelectorRequirement_To_v2alpha1_LabelSelectorRequirement, - Convert_v2alpha1_ScheduledJob_To_batch_ScheduledJob, - Convert_batch_ScheduledJob_To_v2alpha1_ScheduledJob, - Convert_v2alpha1_ScheduledJobList_To_batch_ScheduledJobList, - Convert_batch_ScheduledJobList_To_v2alpha1_ScheduledJobList, - Convert_v2alpha1_ScheduledJobSpec_To_batch_ScheduledJobSpec, - Convert_batch_ScheduledJobSpec_To_v2alpha1_ScheduledJobSpec, - Convert_v2alpha1_ScheduledJobStatus_To_batch_ScheduledJobStatus, - Convert_batch_ScheduledJobStatus_To_v2alpha1_ScheduledJobStatus, - ); err != nil { - // if one of the conversion functions is malformed, detect it immediately. - panic(err) - } -} - -func autoConvert_v2alpha1_Job_To_batch_Job(in *Job, out *batch.Job, s conversion.Scope) error { - SetDefaults_Job(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_v2alpha1_JobSpec_To_batch_JobSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v2alpha1_JobStatus_To_batch_JobStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_v2alpha1_Job_To_batch_Job(in *Job, out *batch.Job, s conversion.Scope) error { - return autoConvert_v2alpha1_Job_To_batch_Job(in, out, s) -} - -func autoConvert_batch_Job_To_v2alpha1_Job(in *batch.Job, out *Job, 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_batch_JobSpec_To_v2alpha1_JobSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_batch_JobStatus_To_v2alpha1_JobStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_batch_Job_To_v2alpha1_Job(in *batch.Job, out *Job, s conversion.Scope) error { - return autoConvert_batch_Job_To_v2alpha1_Job(in, out, s) -} - -func autoConvert_v2alpha1_JobCondition_To_batch_JobCondition(in *JobCondition, out *batch.JobCondition, s conversion.Scope) error { - out.Type = batch.JobConditionType(in.Type) - out.Status = api.ConditionStatus(in.Status) - if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastProbeTime, &out.LastProbeTime, s); err != nil { - return err - } - if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastTransitionTime, &out.LastTransitionTime, s); err != nil { - return err - } - out.Reason = in.Reason - out.Message = in.Message - return nil -} - -func Convert_v2alpha1_JobCondition_To_batch_JobCondition(in *JobCondition, out *batch.JobCondition, s conversion.Scope) error { - return autoConvert_v2alpha1_JobCondition_To_batch_JobCondition(in, out, s) -} - -func autoConvert_batch_JobCondition_To_v2alpha1_JobCondition(in *batch.JobCondition, out *JobCondition, s conversion.Scope) error { - out.Type = JobConditionType(in.Type) - out.Status = v1.ConditionStatus(in.Status) - if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastProbeTime, &out.LastProbeTime, s); err != nil { - return err - } - if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastTransitionTime, &out.LastTransitionTime, s); err != nil { - return err - } - out.Reason = in.Reason - out.Message = in.Message - return nil -} - -func Convert_batch_JobCondition_To_v2alpha1_JobCondition(in *batch.JobCondition, out *JobCondition, s conversion.Scope) error { - return autoConvert_batch_JobCondition_To_v2alpha1_JobCondition(in, out, s) -} - -func autoConvert_v2alpha1_JobList_To_batch_JobList(in *JobList, out *batch.JobList, 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([]batch.Job, len(*in)) - for i := range *in { - if err := Convert_v2alpha1_Job_To_batch_Job(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v2alpha1_JobList_To_batch_JobList(in *JobList, out *batch.JobList, s conversion.Scope) error { - return autoConvert_v2alpha1_JobList_To_batch_JobList(in, out, s) -} - -func autoConvert_batch_JobList_To_v2alpha1_JobList(in *batch.JobList, out *JobList, 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([]Job, len(*in)) - for i := range *in { - if err := Convert_batch_Job_To_v2alpha1_Job(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_batch_JobList_To_v2alpha1_JobList(in *batch.JobList, out *JobList, s conversion.Scope) error { - return autoConvert_batch_JobList_To_v2alpha1_JobList(in, out, s) -} - -func autoConvert_v2alpha1_JobSpec_To_batch_JobSpec(in *JobSpec, out *batch.JobSpec, s conversion.Scope) error { - out.Parallelism = in.Parallelism - out.Completions = in.Completions - out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds - if in.Selector != nil { - in, out := &in.Selector, &out.Selector - *out = new(unversioned.LabelSelector) - if err := Convert_v2alpha1_LabelSelector_To_unversioned_LabelSelector(*in, *out, s); err != nil { - return err - } - } else { - out.Selector = nil - } - out.ManualSelector = in.ManualSelector - if err := v1.Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -func autoConvert_batch_JobSpec_To_v2alpha1_JobSpec(in *batch.JobSpec, out *JobSpec, s conversion.Scope) error { - out.Parallelism = in.Parallelism - out.Completions = in.Completions - out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds - if in.Selector != nil { - in, out := &in.Selector, &out.Selector - *out = new(LabelSelector) - if err := Convert_unversioned_LabelSelector_To_v2alpha1_LabelSelector(*in, *out, s); err != nil { - return err - } - } else { - out.Selector = nil - } - out.ManualSelector = in.ManualSelector - if err := v1.Convert_api_PodTemplateSpec_To_v1_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -func autoConvert_v2alpha1_JobStatus_To_batch_JobStatus(in *JobStatus, out *batch.JobStatus, s conversion.Scope) error { - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]batch.JobCondition, len(*in)) - for i := range *in { - if err := Convert_v2alpha1_JobCondition_To_batch_JobCondition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - out.StartTime = in.StartTime - out.CompletionTime = in.CompletionTime - out.Active = in.Active - out.Succeeded = in.Succeeded - out.Failed = in.Failed - return nil -} - -func Convert_v2alpha1_JobStatus_To_batch_JobStatus(in *JobStatus, out *batch.JobStatus, s conversion.Scope) error { - return autoConvert_v2alpha1_JobStatus_To_batch_JobStatus(in, out, s) -} - -func autoConvert_batch_JobStatus_To_v2alpha1_JobStatus(in *batch.JobStatus, out *JobStatus, s conversion.Scope) error { - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]JobCondition, len(*in)) - for i := range *in { - if err := Convert_batch_JobCondition_To_v2alpha1_JobCondition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - out.StartTime = in.StartTime - out.CompletionTime = in.CompletionTime - out.Active = in.Active - out.Succeeded = in.Succeeded - out.Failed = in.Failed - return nil -} - -func Convert_batch_JobStatus_To_v2alpha1_JobStatus(in *batch.JobStatus, out *JobStatus, s conversion.Scope) error { - return autoConvert_batch_JobStatus_To_v2alpha1_JobStatus(in, out, s) -} - -func autoConvert_v2alpha1_JobTemplate_To_batch_JobTemplate(in *JobTemplate, out *batch.JobTemplate, 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_v2alpha1_JobTemplateSpec_To_batch_JobTemplateSpec(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -func Convert_v2alpha1_JobTemplate_To_batch_JobTemplate(in *JobTemplate, out *batch.JobTemplate, s conversion.Scope) error { - return autoConvert_v2alpha1_JobTemplate_To_batch_JobTemplate(in, out, s) -} - -func autoConvert_batch_JobTemplate_To_v2alpha1_JobTemplate(in *batch.JobTemplate, out *JobTemplate, 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_batch_JobTemplateSpec_To_v2alpha1_JobTemplateSpec(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -func Convert_batch_JobTemplate_To_v2alpha1_JobTemplate(in *batch.JobTemplate, out *JobTemplate, s conversion.Scope) error { - return autoConvert_batch_JobTemplate_To_v2alpha1_JobTemplate(in, out, s) -} - -func autoConvert_v2alpha1_JobTemplateSpec_To_batch_JobTemplateSpec(in *JobTemplateSpec, out *batch.JobTemplateSpec, s conversion.Scope) error { - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil { - return err - } - if err := Convert_v2alpha1_JobSpec_To_batch_JobSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -func Convert_v2alpha1_JobTemplateSpec_To_batch_JobTemplateSpec(in *JobTemplateSpec, out *batch.JobTemplateSpec, s conversion.Scope) error { - return autoConvert_v2alpha1_JobTemplateSpec_To_batch_JobTemplateSpec(in, out, s) -} - -func autoConvert_batch_JobTemplateSpec_To_v2alpha1_JobTemplateSpec(in *batch.JobTemplateSpec, out *JobTemplateSpec, s conversion.Scope) error { - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil { - return err - } - if err := Convert_batch_JobSpec_To_v2alpha1_JobSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -func Convert_batch_JobTemplateSpec_To_v2alpha1_JobTemplateSpec(in *batch.JobTemplateSpec, out *JobTemplateSpec, s conversion.Scope) error { - return autoConvert_batch_JobTemplateSpec_To_v2alpha1_JobTemplateSpec(in, out, s) -} - -func autoConvert_v2alpha1_LabelSelector_To_unversioned_LabelSelector(in *LabelSelector, out *unversioned.LabelSelector, s conversion.Scope) error { - out.MatchLabels = in.MatchLabels - if in.MatchExpressions != nil { - in, out := &in.MatchExpressions, &out.MatchExpressions - *out = make([]unversioned.LabelSelectorRequirement, len(*in)) - for i := range *in { - if err := Convert_v2alpha1_LabelSelectorRequirement_To_unversioned_LabelSelectorRequirement(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.MatchExpressions = nil - } - return nil -} - -func Convert_v2alpha1_LabelSelector_To_unversioned_LabelSelector(in *LabelSelector, out *unversioned.LabelSelector, s conversion.Scope) error { - return autoConvert_v2alpha1_LabelSelector_To_unversioned_LabelSelector(in, out, s) -} - -func autoConvert_unversioned_LabelSelector_To_v2alpha1_LabelSelector(in *unversioned.LabelSelector, out *LabelSelector, s conversion.Scope) error { - out.MatchLabels = in.MatchLabels - if in.MatchExpressions != nil { - in, out := &in.MatchExpressions, &out.MatchExpressions - *out = make([]LabelSelectorRequirement, len(*in)) - for i := range *in { - if err := Convert_unversioned_LabelSelectorRequirement_To_v2alpha1_LabelSelectorRequirement(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.MatchExpressions = nil - } - return nil -} - -func Convert_unversioned_LabelSelector_To_v2alpha1_LabelSelector(in *unversioned.LabelSelector, out *LabelSelector, s conversion.Scope) error { - return autoConvert_unversioned_LabelSelector_To_v2alpha1_LabelSelector(in, out, s) -} - -func autoConvert_v2alpha1_LabelSelectorRequirement_To_unversioned_LabelSelectorRequirement(in *LabelSelectorRequirement, out *unversioned.LabelSelectorRequirement, s conversion.Scope) error { - out.Key = in.Key - out.Operator = unversioned.LabelSelectorOperator(in.Operator) - out.Values = in.Values - return nil -} - -func Convert_v2alpha1_LabelSelectorRequirement_To_unversioned_LabelSelectorRequirement(in *LabelSelectorRequirement, out *unversioned.LabelSelectorRequirement, s conversion.Scope) error { - return autoConvert_v2alpha1_LabelSelectorRequirement_To_unversioned_LabelSelectorRequirement(in, out, s) -} - -func autoConvert_unversioned_LabelSelectorRequirement_To_v2alpha1_LabelSelectorRequirement(in *unversioned.LabelSelectorRequirement, out *LabelSelectorRequirement, s conversion.Scope) error { - out.Key = in.Key - out.Operator = LabelSelectorOperator(in.Operator) - out.Values = in.Values - return nil -} - -func Convert_unversioned_LabelSelectorRequirement_To_v2alpha1_LabelSelectorRequirement(in *unversioned.LabelSelectorRequirement, out *LabelSelectorRequirement, s conversion.Scope) error { - return autoConvert_unversioned_LabelSelectorRequirement_To_v2alpha1_LabelSelectorRequirement(in, out, s) -} - -func autoConvert_v2alpha1_ScheduledJob_To_batch_ScheduledJob(in *ScheduledJob, out *batch.ScheduledJob, s conversion.Scope) error { - SetDefaults_ScheduledJob(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_v2alpha1_ScheduledJobSpec_To_batch_ScheduledJobSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v2alpha1_ScheduledJobStatus_To_batch_ScheduledJobStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_v2alpha1_ScheduledJob_To_batch_ScheduledJob(in *ScheduledJob, out *batch.ScheduledJob, s conversion.Scope) error { - return autoConvert_v2alpha1_ScheduledJob_To_batch_ScheduledJob(in, out, s) -} - -func autoConvert_batch_ScheduledJob_To_v2alpha1_ScheduledJob(in *batch.ScheduledJob, out *ScheduledJob, 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_batch_ScheduledJobSpec_To_v2alpha1_ScheduledJobSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_batch_ScheduledJobStatus_To_v2alpha1_ScheduledJobStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_batch_ScheduledJob_To_v2alpha1_ScheduledJob(in *batch.ScheduledJob, out *ScheduledJob, s conversion.Scope) error { - return autoConvert_batch_ScheduledJob_To_v2alpha1_ScheduledJob(in, out, s) -} - -func autoConvert_v2alpha1_ScheduledJobList_To_batch_ScheduledJobList(in *ScheduledJobList, out *batch.ScheduledJobList, 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([]batch.ScheduledJob, len(*in)) - for i := range *in { - if err := Convert_v2alpha1_ScheduledJob_To_batch_ScheduledJob(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v2alpha1_ScheduledJobList_To_batch_ScheduledJobList(in *ScheduledJobList, out *batch.ScheduledJobList, s conversion.Scope) error { - return autoConvert_v2alpha1_ScheduledJobList_To_batch_ScheduledJobList(in, out, s) -} - -func autoConvert_batch_ScheduledJobList_To_v2alpha1_ScheduledJobList(in *batch.ScheduledJobList, out *ScheduledJobList, 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([]ScheduledJob, len(*in)) - for i := range *in { - if err := Convert_batch_ScheduledJob_To_v2alpha1_ScheduledJob(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_batch_ScheduledJobList_To_v2alpha1_ScheduledJobList(in *batch.ScheduledJobList, out *ScheduledJobList, s conversion.Scope) error { - return autoConvert_batch_ScheduledJobList_To_v2alpha1_ScheduledJobList(in, out, s) -} - -func autoConvert_v2alpha1_ScheduledJobSpec_To_batch_ScheduledJobSpec(in *ScheduledJobSpec, out *batch.ScheduledJobSpec, s conversion.Scope) error { - out.Schedule = in.Schedule - out.StartingDeadlineSeconds = in.StartingDeadlineSeconds - out.ConcurrencyPolicy = batch.ConcurrencyPolicy(in.ConcurrencyPolicy) - out.Suspend = in.Suspend - if err := Convert_v2alpha1_JobTemplateSpec_To_batch_JobTemplateSpec(&in.JobTemplate, &out.JobTemplate, s); err != nil { - return err - } - return nil -} - -func Convert_v2alpha1_ScheduledJobSpec_To_batch_ScheduledJobSpec(in *ScheduledJobSpec, out *batch.ScheduledJobSpec, s conversion.Scope) error { - return autoConvert_v2alpha1_ScheduledJobSpec_To_batch_ScheduledJobSpec(in, out, s) -} - -func autoConvert_batch_ScheduledJobSpec_To_v2alpha1_ScheduledJobSpec(in *batch.ScheduledJobSpec, out *ScheduledJobSpec, s conversion.Scope) error { - out.Schedule = in.Schedule - out.StartingDeadlineSeconds = in.StartingDeadlineSeconds - out.ConcurrencyPolicy = ConcurrencyPolicy(in.ConcurrencyPolicy) - out.Suspend = in.Suspend - if err := Convert_batch_JobTemplateSpec_To_v2alpha1_JobTemplateSpec(&in.JobTemplate, &out.JobTemplate, s); err != nil { - return err - } - return nil -} - -func Convert_batch_ScheduledJobSpec_To_v2alpha1_ScheduledJobSpec(in *batch.ScheduledJobSpec, out *ScheduledJobSpec, s conversion.Scope) error { - return autoConvert_batch_ScheduledJobSpec_To_v2alpha1_ScheduledJobSpec(in, out, s) -} - -func autoConvert_v2alpha1_ScheduledJobStatus_To_batch_ScheduledJobStatus(in *ScheduledJobStatus, out *batch.ScheduledJobStatus, s conversion.Scope) error { - if in.Active != nil { - in, out := &in.Active, &out.Active - *out = make([]api.ObjectReference, len(*in)) - for i := range *in { - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&(*in)[i], &(*out)[i], 0); err != nil { - return err - } - } - } else { - out.Active = nil - } - out.LastScheduleTime = in.LastScheduleTime - return nil -} - -func Convert_v2alpha1_ScheduledJobStatus_To_batch_ScheduledJobStatus(in *ScheduledJobStatus, out *batch.ScheduledJobStatus, s conversion.Scope) error { - return autoConvert_v2alpha1_ScheduledJobStatus_To_batch_ScheduledJobStatus(in, out, s) -} - -func autoConvert_batch_ScheduledJobStatus_To_v2alpha1_ScheduledJobStatus(in *batch.ScheduledJobStatus, out *ScheduledJobStatus, s conversion.Scope) error { - if in.Active != nil { - in, out := &in.Active, &out.Active - *out = make([]v1.ObjectReference, len(*in)) - for i := range *in { - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&(*in)[i], &(*out)[i], 0); err != nil { - return err - } - } - } else { - out.Active = nil - } - out.LastScheduleTime = in.LastScheduleTime - return nil -} - -func Convert_batch_ScheduledJobStatus_To_v2alpha1_ScheduledJobStatus(in *batch.ScheduledJobStatus, out *ScheduledJobStatus, s conversion.Scope) error { - return autoConvert_batch_ScheduledJobStatus_To_v2alpha1_ScheduledJobStatus(in, out, s) -} diff --git a/pkg/apis/certificates/v1alpha1/conversion_generated.go b/pkg/apis/certificates/v1alpha1/conversion_generated.go deleted file mode 100644 index 454a98bf3b2..00000000000 --- a/pkg/apis/certificates/v1alpha1/conversion_generated.go +++ /dev/null @@ -1,237 +0,0 @@ -// +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" - certificates "k8s.io/kubernetes/pkg/apis/certificates" - conversion "k8s.io/kubernetes/pkg/conversion" -) - -func init() { - if err := api.Scheme.AddGeneratedConversionFuncs( - Convert_v1alpha1_CertificateSigningRequest_To_certificates_CertificateSigningRequest, - Convert_certificates_CertificateSigningRequest_To_v1alpha1_CertificateSigningRequest, - Convert_v1alpha1_CertificateSigningRequestCondition_To_certificates_CertificateSigningRequestCondition, - Convert_certificates_CertificateSigningRequestCondition_To_v1alpha1_CertificateSigningRequestCondition, - Convert_v1alpha1_CertificateSigningRequestList_To_certificates_CertificateSigningRequestList, - Convert_certificates_CertificateSigningRequestList_To_v1alpha1_CertificateSigningRequestList, - Convert_v1alpha1_CertificateSigningRequestSpec_To_certificates_CertificateSigningRequestSpec, - Convert_certificates_CertificateSigningRequestSpec_To_v1alpha1_CertificateSigningRequestSpec, - Convert_v1alpha1_CertificateSigningRequestStatus_To_certificates_CertificateSigningRequestStatus, - Convert_certificates_CertificateSigningRequestStatus_To_v1alpha1_CertificateSigningRequestStatus, - ); err != nil { - // if one of the conversion functions is malformed, detect it immediately. - panic(err) - } -} - -func autoConvert_v1alpha1_CertificateSigningRequest_To_certificates_CertificateSigningRequest(in *CertificateSigningRequest, out *certificates.CertificateSigningRequest, 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_v1alpha1_CertificateSigningRequestSpec_To_certificates_CertificateSigningRequestSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha1_CertificateSigningRequestStatus_To_certificates_CertificateSigningRequestStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_v1alpha1_CertificateSigningRequest_To_certificates_CertificateSigningRequest(in *CertificateSigningRequest, out *certificates.CertificateSigningRequest, s conversion.Scope) error { - return autoConvert_v1alpha1_CertificateSigningRequest_To_certificates_CertificateSigningRequest(in, out, s) -} - -func autoConvert_certificates_CertificateSigningRequest_To_v1alpha1_CertificateSigningRequest(in *certificates.CertificateSigningRequest, out *CertificateSigningRequest, 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_certificates_CertificateSigningRequestSpec_To_v1alpha1_CertificateSigningRequestSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_certificates_CertificateSigningRequestStatus_To_v1alpha1_CertificateSigningRequestStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_certificates_CertificateSigningRequest_To_v1alpha1_CertificateSigningRequest(in *certificates.CertificateSigningRequest, out *CertificateSigningRequest, s conversion.Scope) error { - return autoConvert_certificates_CertificateSigningRequest_To_v1alpha1_CertificateSigningRequest(in, out, s) -} - -func autoConvert_v1alpha1_CertificateSigningRequestCondition_To_certificates_CertificateSigningRequestCondition(in *CertificateSigningRequestCondition, out *certificates.CertificateSigningRequestCondition, s conversion.Scope) error { - out.Type = certificates.RequestConditionType(in.Type) - out.Reason = in.Reason - out.Message = in.Message - if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastUpdateTime, &out.LastUpdateTime, s); err != nil { - return err - } - return nil -} - -func Convert_v1alpha1_CertificateSigningRequestCondition_To_certificates_CertificateSigningRequestCondition(in *CertificateSigningRequestCondition, out *certificates.CertificateSigningRequestCondition, s conversion.Scope) error { - return autoConvert_v1alpha1_CertificateSigningRequestCondition_To_certificates_CertificateSigningRequestCondition(in, out, s) -} - -func autoConvert_certificates_CertificateSigningRequestCondition_To_v1alpha1_CertificateSigningRequestCondition(in *certificates.CertificateSigningRequestCondition, out *CertificateSigningRequestCondition, s conversion.Scope) error { - out.Type = RequestConditionType(in.Type) - out.Reason = in.Reason - out.Message = in.Message - if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastUpdateTime, &out.LastUpdateTime, s); err != nil { - return err - } - return nil -} - -func Convert_certificates_CertificateSigningRequestCondition_To_v1alpha1_CertificateSigningRequestCondition(in *certificates.CertificateSigningRequestCondition, out *CertificateSigningRequestCondition, s conversion.Scope) error { - return autoConvert_certificates_CertificateSigningRequestCondition_To_v1alpha1_CertificateSigningRequestCondition(in, out, s) -} - -func autoConvert_v1alpha1_CertificateSigningRequestList_To_certificates_CertificateSigningRequestList(in *CertificateSigningRequestList, out *certificates.CertificateSigningRequestList, 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([]certificates.CertificateSigningRequest, len(*in)) - for i := range *in { - if err := Convert_v1alpha1_CertificateSigningRequest_To_certificates_CertificateSigningRequest(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1alpha1_CertificateSigningRequestList_To_certificates_CertificateSigningRequestList(in *CertificateSigningRequestList, out *certificates.CertificateSigningRequestList, s conversion.Scope) error { - return autoConvert_v1alpha1_CertificateSigningRequestList_To_certificates_CertificateSigningRequestList(in, out, s) -} - -func autoConvert_certificates_CertificateSigningRequestList_To_v1alpha1_CertificateSigningRequestList(in *certificates.CertificateSigningRequestList, out *CertificateSigningRequestList, 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([]CertificateSigningRequest, len(*in)) - for i := range *in { - if err := Convert_certificates_CertificateSigningRequest_To_v1alpha1_CertificateSigningRequest(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_certificates_CertificateSigningRequestList_To_v1alpha1_CertificateSigningRequestList(in *certificates.CertificateSigningRequestList, out *CertificateSigningRequestList, s conversion.Scope) error { - return autoConvert_certificates_CertificateSigningRequestList_To_v1alpha1_CertificateSigningRequestList(in, out, s) -} - -func autoConvert_v1alpha1_CertificateSigningRequestSpec_To_certificates_CertificateSigningRequestSpec(in *CertificateSigningRequestSpec, out *certificates.CertificateSigningRequestSpec, s conversion.Scope) error { - if err := conversion.Convert_Slice_byte_To_Slice_byte(&in.Request, &out.Request, s); err != nil { - return err - } - out.Username = in.Username - out.UID = in.UID - out.Groups = in.Groups - return nil -} - -func Convert_v1alpha1_CertificateSigningRequestSpec_To_certificates_CertificateSigningRequestSpec(in *CertificateSigningRequestSpec, out *certificates.CertificateSigningRequestSpec, s conversion.Scope) error { - return autoConvert_v1alpha1_CertificateSigningRequestSpec_To_certificates_CertificateSigningRequestSpec(in, out, s) -} - -func autoConvert_certificates_CertificateSigningRequestSpec_To_v1alpha1_CertificateSigningRequestSpec(in *certificates.CertificateSigningRequestSpec, out *CertificateSigningRequestSpec, s conversion.Scope) error { - if err := conversion.Convert_Slice_byte_To_Slice_byte(&in.Request, &out.Request, s); err != nil { - return err - } - out.Username = in.Username - out.UID = in.UID - out.Groups = in.Groups - return nil -} - -func Convert_certificates_CertificateSigningRequestSpec_To_v1alpha1_CertificateSigningRequestSpec(in *certificates.CertificateSigningRequestSpec, out *CertificateSigningRequestSpec, s conversion.Scope) error { - return autoConvert_certificates_CertificateSigningRequestSpec_To_v1alpha1_CertificateSigningRequestSpec(in, out, s) -} - -func autoConvert_v1alpha1_CertificateSigningRequestStatus_To_certificates_CertificateSigningRequestStatus(in *CertificateSigningRequestStatus, out *certificates.CertificateSigningRequestStatus, s conversion.Scope) error { - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]certificates.CertificateSigningRequestCondition, len(*in)) - for i := range *in { - if err := Convert_v1alpha1_CertificateSigningRequestCondition_To_certificates_CertificateSigningRequestCondition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - if err := conversion.Convert_Slice_byte_To_Slice_byte(&in.Certificate, &out.Certificate, s); err != nil { - return err - } - return nil -} - -func Convert_v1alpha1_CertificateSigningRequestStatus_To_certificates_CertificateSigningRequestStatus(in *CertificateSigningRequestStatus, out *certificates.CertificateSigningRequestStatus, s conversion.Scope) error { - return autoConvert_v1alpha1_CertificateSigningRequestStatus_To_certificates_CertificateSigningRequestStatus(in, out, s) -} - -func autoConvert_certificates_CertificateSigningRequestStatus_To_v1alpha1_CertificateSigningRequestStatus(in *certificates.CertificateSigningRequestStatus, out *CertificateSigningRequestStatus, s conversion.Scope) error { - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]CertificateSigningRequestCondition, len(*in)) - for i := range *in { - if err := Convert_certificates_CertificateSigningRequestCondition_To_v1alpha1_CertificateSigningRequestCondition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - if err := conversion.Convert_Slice_byte_To_Slice_byte(&in.Certificate, &out.Certificate, s); err != nil { - return err - } - return nil -} - -func Convert_certificates_CertificateSigningRequestStatus_To_v1alpha1_CertificateSigningRequestStatus(in *certificates.CertificateSigningRequestStatus, out *CertificateSigningRequestStatus, s conversion.Scope) error { - return autoConvert_certificates_CertificateSigningRequestStatus_To_v1alpha1_CertificateSigningRequestStatus(in, out, s) -} diff --git a/pkg/apis/componentconfig/v1alpha1/conversion_generated.go b/pkg/apis/componentconfig/v1alpha1/conversion_generated.go deleted file mode 100644 index 160b0f91838..00000000000 --- a/pkg/apis/componentconfig/v1alpha1/conversion_generated.go +++ /dev/null @@ -1,182 +0,0 @@ -// +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" - componentconfig "k8s.io/kubernetes/pkg/apis/componentconfig" - conversion "k8s.io/kubernetes/pkg/conversion" -) - -func init() { - if err := api.Scheme.AddGeneratedConversionFuncs( - Convert_v1alpha1_KubeProxyConfiguration_To_componentconfig_KubeProxyConfiguration, - Convert_componentconfig_KubeProxyConfiguration_To_v1alpha1_KubeProxyConfiguration, - Convert_v1alpha1_KubeSchedulerConfiguration_To_componentconfig_KubeSchedulerConfiguration, - Convert_componentconfig_KubeSchedulerConfiguration_To_v1alpha1_KubeSchedulerConfiguration, - Convert_v1alpha1_LeaderElectionConfiguration_To_componentconfig_LeaderElectionConfiguration, - Convert_componentconfig_LeaderElectionConfiguration_To_v1alpha1_LeaderElectionConfiguration, - ); err != nil { - // if one of the conversion functions is malformed, detect it immediately. - panic(err) - } -} - -func autoConvert_v1alpha1_KubeProxyConfiguration_To_componentconfig_KubeProxyConfiguration(in *KubeProxyConfiguration, out *componentconfig.KubeProxyConfiguration, s conversion.Scope) error { - SetDefaults_KubeProxyConfiguration(in) - if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { - return err - } - out.BindAddress = in.BindAddress - out.ClusterCIDR = in.ClusterCIDR - out.HealthzBindAddress = in.HealthzBindAddress - out.HealthzPort = in.HealthzPort - out.HostnameOverride = in.HostnameOverride - out.IPTablesMasqueradeBit = in.IPTablesMasqueradeBit - out.IPTablesSyncPeriod = in.IPTablesSyncPeriod - out.KubeconfigPath = in.KubeconfigPath - out.MasqueradeAll = in.MasqueradeAll - out.Master = in.Master - out.OOMScoreAdj = in.OOMScoreAdj - out.Mode = componentconfig.ProxyMode(in.Mode) - out.PortRange = in.PortRange - out.ResourceContainer = in.ResourceContainer - out.UDPIdleTimeout = in.UDPIdleTimeout - out.ConntrackMax = in.ConntrackMax - out.ConntrackTCPEstablishedTimeout = in.ConntrackTCPEstablishedTimeout - return nil -} - -func Convert_v1alpha1_KubeProxyConfiguration_To_componentconfig_KubeProxyConfiguration(in *KubeProxyConfiguration, out *componentconfig.KubeProxyConfiguration, s conversion.Scope) error { - return autoConvert_v1alpha1_KubeProxyConfiguration_To_componentconfig_KubeProxyConfiguration(in, out, s) -} - -func autoConvert_componentconfig_KubeProxyConfiguration_To_v1alpha1_KubeProxyConfiguration(in *componentconfig.KubeProxyConfiguration, out *KubeProxyConfiguration, s conversion.Scope) error { - if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { - return err - } - out.BindAddress = in.BindAddress - out.ClusterCIDR = in.ClusterCIDR - out.HealthzBindAddress = in.HealthzBindAddress - out.HealthzPort = in.HealthzPort - out.HostnameOverride = in.HostnameOverride - out.IPTablesMasqueradeBit = in.IPTablesMasqueradeBit - out.IPTablesSyncPeriod = in.IPTablesSyncPeriod - out.KubeconfigPath = in.KubeconfigPath - out.MasqueradeAll = in.MasqueradeAll - out.Master = in.Master - out.OOMScoreAdj = in.OOMScoreAdj - out.Mode = ProxyMode(in.Mode) - out.PortRange = in.PortRange - out.ResourceContainer = in.ResourceContainer - out.UDPIdleTimeout = in.UDPIdleTimeout - out.ConntrackMax = in.ConntrackMax - out.ConntrackTCPEstablishedTimeout = in.ConntrackTCPEstablishedTimeout - return nil -} - -func Convert_componentconfig_KubeProxyConfiguration_To_v1alpha1_KubeProxyConfiguration(in *componentconfig.KubeProxyConfiguration, out *KubeProxyConfiguration, s conversion.Scope) error { - return autoConvert_componentconfig_KubeProxyConfiguration_To_v1alpha1_KubeProxyConfiguration(in, out, s) -} - -func autoConvert_v1alpha1_KubeSchedulerConfiguration_To_componentconfig_KubeSchedulerConfiguration(in *KubeSchedulerConfiguration, out *componentconfig.KubeSchedulerConfiguration, s conversion.Scope) error { - SetDefaults_KubeSchedulerConfiguration(in) - if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { - return err - } - out.Port = int32(in.Port) - out.Address = in.Address - out.AlgorithmProvider = in.AlgorithmProvider - out.PolicyConfigFile = in.PolicyConfigFile - if err := api.Convert_Pointer_bool_To_bool(&in.EnableProfiling, &out.EnableProfiling, s); err != nil { - return err - } - out.ContentType = in.ContentType - out.KubeAPIQPS = in.KubeAPIQPS - out.KubeAPIBurst = int32(in.KubeAPIBurst) - out.SchedulerName = in.SchedulerName - out.HardPodAffinitySymmetricWeight = in.HardPodAffinitySymmetricWeight - out.FailureDomains = in.FailureDomains - if err := Convert_v1alpha1_LeaderElectionConfiguration_To_componentconfig_LeaderElectionConfiguration(&in.LeaderElection, &out.LeaderElection, s); err != nil { - return err - } - return nil -} - -func Convert_v1alpha1_KubeSchedulerConfiguration_To_componentconfig_KubeSchedulerConfiguration(in *KubeSchedulerConfiguration, out *componentconfig.KubeSchedulerConfiguration, s conversion.Scope) error { - return autoConvert_v1alpha1_KubeSchedulerConfiguration_To_componentconfig_KubeSchedulerConfiguration(in, out, s) -} - -func autoConvert_componentconfig_KubeSchedulerConfiguration_To_v1alpha1_KubeSchedulerConfiguration(in *componentconfig.KubeSchedulerConfiguration, out *KubeSchedulerConfiguration, s conversion.Scope) error { - if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { - return err - } - out.Port = int(in.Port) - out.Address = in.Address - out.AlgorithmProvider = in.AlgorithmProvider - out.PolicyConfigFile = in.PolicyConfigFile - if err := api.Convert_bool_To_Pointer_bool(&in.EnableProfiling, &out.EnableProfiling, s); err != nil { - return err - } - out.ContentType = in.ContentType - out.KubeAPIQPS = in.KubeAPIQPS - out.KubeAPIBurst = int(in.KubeAPIBurst) - out.SchedulerName = in.SchedulerName - out.HardPodAffinitySymmetricWeight = in.HardPodAffinitySymmetricWeight - out.FailureDomains = in.FailureDomains - if err := Convert_componentconfig_LeaderElectionConfiguration_To_v1alpha1_LeaderElectionConfiguration(&in.LeaderElection, &out.LeaderElection, s); err != nil { - return err - } - return nil -} - -func Convert_componentconfig_KubeSchedulerConfiguration_To_v1alpha1_KubeSchedulerConfiguration(in *componentconfig.KubeSchedulerConfiguration, out *KubeSchedulerConfiguration, s conversion.Scope) error { - return autoConvert_componentconfig_KubeSchedulerConfiguration_To_v1alpha1_KubeSchedulerConfiguration(in, out, s) -} - -func autoConvert_v1alpha1_LeaderElectionConfiguration_To_componentconfig_LeaderElectionConfiguration(in *LeaderElectionConfiguration, out *componentconfig.LeaderElectionConfiguration, s conversion.Scope) error { - SetDefaults_LeaderElectionConfiguration(in) - if err := api.Convert_Pointer_bool_To_bool(&in.LeaderElect, &out.LeaderElect, s); err != nil { - return err - } - out.LeaseDuration = in.LeaseDuration - out.RenewDeadline = in.RenewDeadline - out.RetryPeriod = in.RetryPeriod - return nil -} - -func Convert_v1alpha1_LeaderElectionConfiguration_To_componentconfig_LeaderElectionConfiguration(in *LeaderElectionConfiguration, out *componentconfig.LeaderElectionConfiguration, s conversion.Scope) error { - return autoConvert_v1alpha1_LeaderElectionConfiguration_To_componentconfig_LeaderElectionConfiguration(in, out, s) -} - -func autoConvert_componentconfig_LeaderElectionConfiguration_To_v1alpha1_LeaderElectionConfiguration(in *componentconfig.LeaderElectionConfiguration, out *LeaderElectionConfiguration, s conversion.Scope) error { - if err := api.Convert_bool_To_Pointer_bool(&in.LeaderElect, &out.LeaderElect, s); err != nil { - return err - } - out.LeaseDuration = in.LeaseDuration - out.RenewDeadline = in.RenewDeadline - out.RetryPeriod = in.RetryPeriod - return nil -} - -func Convert_componentconfig_LeaderElectionConfiguration_To_v1alpha1_LeaderElectionConfiguration(in *componentconfig.LeaderElectionConfiguration, out *LeaderElectionConfiguration, s conversion.Scope) error { - return autoConvert_componentconfig_LeaderElectionConfiguration_To_v1alpha1_LeaderElectionConfiguration(in, out, s) -} diff --git a/pkg/apis/extensions/v1beta1/conversion_generated.go b/pkg/apis/extensions/v1beta1/conversion_generated.go deleted file mode 100644 index 6f4ff538bfa..00000000000 --- a/pkg/apis/extensions/v1beta1/conversion_generated.go +++ /dev/null @@ -1,2539 +0,0 @@ -// +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" - unversioned "k8s.io/kubernetes/pkg/api/unversioned" - v1 "k8s.io/kubernetes/pkg/api/v1" - autoscaling "k8s.io/kubernetes/pkg/apis/autoscaling" - batch "k8s.io/kubernetes/pkg/apis/batch" - extensions "k8s.io/kubernetes/pkg/apis/extensions" - conversion "k8s.io/kubernetes/pkg/conversion" -) - -func init() { - if err := api.Scheme.AddGeneratedConversionFuncs( - Convert_v1beta1_APIVersion_To_extensions_APIVersion, - Convert_extensions_APIVersion_To_v1beta1_APIVersion, - Convert_v1beta1_CustomMetricCurrentStatus_To_extensions_CustomMetricCurrentStatus, - Convert_extensions_CustomMetricCurrentStatus_To_v1beta1_CustomMetricCurrentStatus, - Convert_v1beta1_CustomMetricCurrentStatusList_To_extensions_CustomMetricCurrentStatusList, - Convert_extensions_CustomMetricCurrentStatusList_To_v1beta1_CustomMetricCurrentStatusList, - Convert_v1beta1_CustomMetricTarget_To_extensions_CustomMetricTarget, - Convert_extensions_CustomMetricTarget_To_v1beta1_CustomMetricTarget, - Convert_v1beta1_CustomMetricTargetList_To_extensions_CustomMetricTargetList, - Convert_extensions_CustomMetricTargetList_To_v1beta1_CustomMetricTargetList, - Convert_v1beta1_DaemonSet_To_extensions_DaemonSet, - Convert_extensions_DaemonSet_To_v1beta1_DaemonSet, - Convert_v1beta1_DaemonSetList_To_extensions_DaemonSetList, - Convert_extensions_DaemonSetList_To_v1beta1_DaemonSetList, - Convert_v1beta1_DaemonSetSpec_To_extensions_DaemonSetSpec, - Convert_extensions_DaemonSetSpec_To_v1beta1_DaemonSetSpec, - Convert_v1beta1_DaemonSetStatus_To_extensions_DaemonSetStatus, - Convert_extensions_DaemonSetStatus_To_v1beta1_DaemonSetStatus, - Convert_v1beta1_Deployment_To_extensions_Deployment, - Convert_extensions_Deployment_To_v1beta1_Deployment, - Convert_v1beta1_DeploymentList_To_extensions_DeploymentList, - Convert_extensions_DeploymentList_To_v1beta1_DeploymentList, - Convert_v1beta1_DeploymentRollback_To_extensions_DeploymentRollback, - Convert_extensions_DeploymentRollback_To_v1beta1_DeploymentRollback, - Convert_v1beta1_DeploymentSpec_To_extensions_DeploymentSpec, - Convert_extensions_DeploymentSpec_To_v1beta1_DeploymentSpec, - Convert_v1beta1_DeploymentStatus_To_extensions_DeploymentStatus, - Convert_extensions_DeploymentStatus_To_v1beta1_DeploymentStatus, - Convert_v1beta1_DeploymentStrategy_To_extensions_DeploymentStrategy, - Convert_extensions_DeploymentStrategy_To_v1beta1_DeploymentStrategy, - Convert_v1beta1_ExportOptions_To_api_ExportOptions, - Convert_api_ExportOptions_To_v1beta1_ExportOptions, - Convert_v1beta1_FSGroupStrategyOptions_To_extensions_FSGroupStrategyOptions, - Convert_extensions_FSGroupStrategyOptions_To_v1beta1_FSGroupStrategyOptions, - Convert_v1beta1_HTTPIngressPath_To_extensions_HTTPIngressPath, - Convert_extensions_HTTPIngressPath_To_v1beta1_HTTPIngressPath, - Convert_v1beta1_HTTPIngressRuleValue_To_extensions_HTTPIngressRuleValue, - Convert_extensions_HTTPIngressRuleValue_To_v1beta1_HTTPIngressRuleValue, - Convert_v1beta1_HorizontalPodAutoscaler_To_autoscaling_HorizontalPodAutoscaler, - Convert_autoscaling_HorizontalPodAutoscaler_To_v1beta1_HorizontalPodAutoscaler, - Convert_v1beta1_HorizontalPodAutoscalerList_To_autoscaling_HorizontalPodAutoscalerList, - Convert_autoscaling_HorizontalPodAutoscalerList_To_v1beta1_HorizontalPodAutoscalerList, - Convert_v1beta1_HorizontalPodAutoscalerSpec_To_autoscaling_HorizontalPodAutoscalerSpec, - Convert_autoscaling_HorizontalPodAutoscalerSpec_To_v1beta1_HorizontalPodAutoscalerSpec, - Convert_v1beta1_HorizontalPodAutoscalerStatus_To_autoscaling_HorizontalPodAutoscalerStatus, - Convert_autoscaling_HorizontalPodAutoscalerStatus_To_v1beta1_HorizontalPodAutoscalerStatus, - Convert_v1beta1_HostPortRange_To_extensions_HostPortRange, - Convert_extensions_HostPortRange_To_v1beta1_HostPortRange, - Convert_v1beta1_IDRange_To_extensions_IDRange, - Convert_extensions_IDRange_To_v1beta1_IDRange, - Convert_v1beta1_Ingress_To_extensions_Ingress, - Convert_extensions_Ingress_To_v1beta1_Ingress, - Convert_v1beta1_IngressBackend_To_extensions_IngressBackend, - Convert_extensions_IngressBackend_To_v1beta1_IngressBackend, - Convert_v1beta1_IngressList_To_extensions_IngressList, - Convert_extensions_IngressList_To_v1beta1_IngressList, - Convert_v1beta1_IngressRule_To_extensions_IngressRule, - Convert_extensions_IngressRule_To_v1beta1_IngressRule, - Convert_v1beta1_IngressRuleValue_To_extensions_IngressRuleValue, - Convert_extensions_IngressRuleValue_To_v1beta1_IngressRuleValue, - Convert_v1beta1_IngressSpec_To_extensions_IngressSpec, - Convert_extensions_IngressSpec_To_v1beta1_IngressSpec, - Convert_v1beta1_IngressStatus_To_extensions_IngressStatus, - Convert_extensions_IngressStatus_To_v1beta1_IngressStatus, - Convert_v1beta1_IngressTLS_To_extensions_IngressTLS, - Convert_extensions_IngressTLS_To_v1beta1_IngressTLS, - Convert_v1beta1_Job_To_batch_Job, - Convert_batch_Job_To_v1beta1_Job, - Convert_v1beta1_JobCondition_To_batch_JobCondition, - Convert_batch_JobCondition_To_v1beta1_JobCondition, - Convert_v1beta1_JobList_To_batch_JobList, - Convert_batch_JobList_To_v1beta1_JobList, - Convert_v1beta1_JobSpec_To_batch_JobSpec, - Convert_batch_JobSpec_To_v1beta1_JobSpec, - Convert_v1beta1_JobStatus_To_batch_JobStatus, - Convert_batch_JobStatus_To_v1beta1_JobStatus, - Convert_v1beta1_LabelSelector_To_unversioned_LabelSelector, - Convert_unversioned_LabelSelector_To_v1beta1_LabelSelector, - Convert_v1beta1_LabelSelectorRequirement_To_unversioned_LabelSelectorRequirement, - Convert_unversioned_LabelSelectorRequirement_To_v1beta1_LabelSelectorRequirement, - Convert_v1beta1_ListOptions_To_api_ListOptions, - Convert_api_ListOptions_To_v1beta1_ListOptions, - Convert_v1beta1_NetworkPolicy_To_extensions_NetworkPolicy, - Convert_extensions_NetworkPolicy_To_v1beta1_NetworkPolicy, - Convert_v1beta1_NetworkPolicyIngressRule_To_extensions_NetworkPolicyIngressRule, - Convert_extensions_NetworkPolicyIngressRule_To_v1beta1_NetworkPolicyIngressRule, - Convert_v1beta1_NetworkPolicyList_To_extensions_NetworkPolicyList, - Convert_extensions_NetworkPolicyList_To_v1beta1_NetworkPolicyList, - Convert_v1beta1_NetworkPolicyPeer_To_extensions_NetworkPolicyPeer, - Convert_extensions_NetworkPolicyPeer_To_v1beta1_NetworkPolicyPeer, - Convert_v1beta1_NetworkPolicyPort_To_extensions_NetworkPolicyPort, - Convert_extensions_NetworkPolicyPort_To_v1beta1_NetworkPolicyPort, - Convert_v1beta1_NetworkPolicySpec_To_extensions_NetworkPolicySpec, - Convert_extensions_NetworkPolicySpec_To_v1beta1_NetworkPolicySpec, - Convert_v1beta1_PodSecurityPolicy_To_extensions_PodSecurityPolicy, - Convert_extensions_PodSecurityPolicy_To_v1beta1_PodSecurityPolicy, - Convert_v1beta1_PodSecurityPolicyList_To_extensions_PodSecurityPolicyList, - Convert_extensions_PodSecurityPolicyList_To_v1beta1_PodSecurityPolicyList, - Convert_v1beta1_PodSecurityPolicySpec_To_extensions_PodSecurityPolicySpec, - Convert_extensions_PodSecurityPolicySpec_To_v1beta1_PodSecurityPolicySpec, - Convert_v1beta1_ReplicaSet_To_extensions_ReplicaSet, - Convert_extensions_ReplicaSet_To_v1beta1_ReplicaSet, - Convert_v1beta1_ReplicaSetList_To_extensions_ReplicaSetList, - Convert_extensions_ReplicaSetList_To_v1beta1_ReplicaSetList, - Convert_v1beta1_ReplicaSetSpec_To_extensions_ReplicaSetSpec, - Convert_extensions_ReplicaSetSpec_To_v1beta1_ReplicaSetSpec, - Convert_v1beta1_ReplicaSetStatus_To_extensions_ReplicaSetStatus, - Convert_extensions_ReplicaSetStatus_To_v1beta1_ReplicaSetStatus, - Convert_v1beta1_ReplicationControllerDummy_To_extensions_ReplicationControllerDummy, - Convert_extensions_ReplicationControllerDummy_To_v1beta1_ReplicationControllerDummy, - Convert_v1beta1_RollbackConfig_To_extensions_RollbackConfig, - Convert_extensions_RollbackConfig_To_v1beta1_RollbackConfig, - Convert_v1beta1_RollingUpdateDeployment_To_extensions_RollingUpdateDeployment, - Convert_extensions_RollingUpdateDeployment_To_v1beta1_RollingUpdateDeployment, - Convert_v1beta1_RunAsUserStrategyOptions_To_extensions_RunAsUserStrategyOptions, - Convert_extensions_RunAsUserStrategyOptions_To_v1beta1_RunAsUserStrategyOptions, - Convert_v1beta1_SELinuxStrategyOptions_To_extensions_SELinuxStrategyOptions, - Convert_extensions_SELinuxStrategyOptions_To_v1beta1_SELinuxStrategyOptions, - Convert_v1beta1_Scale_To_extensions_Scale, - Convert_extensions_Scale_To_v1beta1_Scale, - Convert_v1beta1_ScaleSpec_To_extensions_ScaleSpec, - Convert_extensions_ScaleSpec_To_v1beta1_ScaleSpec, - Convert_v1beta1_ScaleStatus_To_extensions_ScaleStatus, - Convert_extensions_ScaleStatus_To_v1beta1_ScaleStatus, - Convert_v1beta1_SupplementalGroupsStrategyOptions_To_extensions_SupplementalGroupsStrategyOptions, - Convert_extensions_SupplementalGroupsStrategyOptions_To_v1beta1_SupplementalGroupsStrategyOptions, - Convert_v1beta1_ThirdPartyResource_To_extensions_ThirdPartyResource, - Convert_extensions_ThirdPartyResource_To_v1beta1_ThirdPartyResource, - Convert_v1beta1_ThirdPartyResourceData_To_extensions_ThirdPartyResourceData, - Convert_extensions_ThirdPartyResourceData_To_v1beta1_ThirdPartyResourceData, - Convert_v1beta1_ThirdPartyResourceDataList_To_extensions_ThirdPartyResourceDataList, - Convert_extensions_ThirdPartyResourceDataList_To_v1beta1_ThirdPartyResourceDataList, - Convert_v1beta1_ThirdPartyResourceList_To_extensions_ThirdPartyResourceList, - Convert_extensions_ThirdPartyResourceList_To_v1beta1_ThirdPartyResourceList, - ); err != nil { - // if one of the conversion functions is malformed, detect it immediately. - panic(err) - } -} - -func autoConvert_v1beta1_APIVersion_To_extensions_APIVersion(in *APIVersion, out *extensions.APIVersion, s conversion.Scope) error { - out.Name = in.Name - return nil -} - -func Convert_v1beta1_APIVersion_To_extensions_APIVersion(in *APIVersion, out *extensions.APIVersion, s conversion.Scope) error { - return autoConvert_v1beta1_APIVersion_To_extensions_APIVersion(in, out, s) -} - -func autoConvert_extensions_APIVersion_To_v1beta1_APIVersion(in *extensions.APIVersion, out *APIVersion, s conversion.Scope) error { - out.Name = in.Name - return nil -} - -func Convert_extensions_APIVersion_To_v1beta1_APIVersion(in *extensions.APIVersion, out *APIVersion, s conversion.Scope) error { - return autoConvert_extensions_APIVersion_To_v1beta1_APIVersion(in, out, s) -} - -func autoConvert_v1beta1_CustomMetricCurrentStatus_To_extensions_CustomMetricCurrentStatus(in *CustomMetricCurrentStatus, out *extensions.CustomMetricCurrentStatus, s conversion.Scope) error { - out.Name = in.Name - if err := api.Convert_resource_Quantity_To_resource_Quantity(&in.CurrentValue, &out.CurrentValue, s); err != nil { - return err - } - return nil -} - -func Convert_v1beta1_CustomMetricCurrentStatus_To_extensions_CustomMetricCurrentStatus(in *CustomMetricCurrentStatus, out *extensions.CustomMetricCurrentStatus, s conversion.Scope) error { - return autoConvert_v1beta1_CustomMetricCurrentStatus_To_extensions_CustomMetricCurrentStatus(in, out, s) -} - -func autoConvert_extensions_CustomMetricCurrentStatus_To_v1beta1_CustomMetricCurrentStatus(in *extensions.CustomMetricCurrentStatus, out *CustomMetricCurrentStatus, s conversion.Scope) error { - out.Name = in.Name - if err := api.Convert_resource_Quantity_To_resource_Quantity(&in.CurrentValue, &out.CurrentValue, s); err != nil { - return err - } - return nil -} - -func Convert_extensions_CustomMetricCurrentStatus_To_v1beta1_CustomMetricCurrentStatus(in *extensions.CustomMetricCurrentStatus, out *CustomMetricCurrentStatus, s conversion.Scope) error { - return autoConvert_extensions_CustomMetricCurrentStatus_To_v1beta1_CustomMetricCurrentStatus(in, out, s) -} - -func autoConvert_v1beta1_CustomMetricCurrentStatusList_To_extensions_CustomMetricCurrentStatusList(in *CustomMetricCurrentStatusList, out *extensions.CustomMetricCurrentStatusList, s conversion.Scope) error { - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]extensions.CustomMetricCurrentStatus, len(*in)) - for i := range *in { - if err := Convert_v1beta1_CustomMetricCurrentStatus_To_extensions_CustomMetricCurrentStatus(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1beta1_CustomMetricCurrentStatusList_To_extensions_CustomMetricCurrentStatusList(in *CustomMetricCurrentStatusList, out *extensions.CustomMetricCurrentStatusList, s conversion.Scope) error { - return autoConvert_v1beta1_CustomMetricCurrentStatusList_To_extensions_CustomMetricCurrentStatusList(in, out, s) -} - -func autoConvert_extensions_CustomMetricCurrentStatusList_To_v1beta1_CustomMetricCurrentStatusList(in *extensions.CustomMetricCurrentStatusList, out *CustomMetricCurrentStatusList, s conversion.Scope) error { - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]CustomMetricCurrentStatus, len(*in)) - for i := range *in { - if err := Convert_extensions_CustomMetricCurrentStatus_To_v1beta1_CustomMetricCurrentStatus(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_extensions_CustomMetricCurrentStatusList_To_v1beta1_CustomMetricCurrentStatusList(in *extensions.CustomMetricCurrentStatusList, out *CustomMetricCurrentStatusList, s conversion.Scope) error { - return autoConvert_extensions_CustomMetricCurrentStatusList_To_v1beta1_CustomMetricCurrentStatusList(in, out, s) -} - -func autoConvert_v1beta1_CustomMetricTarget_To_extensions_CustomMetricTarget(in *CustomMetricTarget, out *extensions.CustomMetricTarget, s conversion.Scope) error { - out.Name = in.Name - if err := api.Convert_resource_Quantity_To_resource_Quantity(&in.TargetValue, &out.TargetValue, s); err != nil { - return err - } - return nil -} - -func Convert_v1beta1_CustomMetricTarget_To_extensions_CustomMetricTarget(in *CustomMetricTarget, out *extensions.CustomMetricTarget, s conversion.Scope) error { - return autoConvert_v1beta1_CustomMetricTarget_To_extensions_CustomMetricTarget(in, out, s) -} - -func autoConvert_extensions_CustomMetricTarget_To_v1beta1_CustomMetricTarget(in *extensions.CustomMetricTarget, out *CustomMetricTarget, s conversion.Scope) error { - out.Name = in.Name - if err := api.Convert_resource_Quantity_To_resource_Quantity(&in.TargetValue, &out.TargetValue, s); err != nil { - return err - } - return nil -} - -func Convert_extensions_CustomMetricTarget_To_v1beta1_CustomMetricTarget(in *extensions.CustomMetricTarget, out *CustomMetricTarget, s conversion.Scope) error { - return autoConvert_extensions_CustomMetricTarget_To_v1beta1_CustomMetricTarget(in, out, s) -} - -func autoConvert_v1beta1_CustomMetricTargetList_To_extensions_CustomMetricTargetList(in *CustomMetricTargetList, out *extensions.CustomMetricTargetList, s conversion.Scope) error { - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]extensions.CustomMetricTarget, len(*in)) - for i := range *in { - if err := Convert_v1beta1_CustomMetricTarget_To_extensions_CustomMetricTarget(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1beta1_CustomMetricTargetList_To_extensions_CustomMetricTargetList(in *CustomMetricTargetList, out *extensions.CustomMetricTargetList, s conversion.Scope) error { - return autoConvert_v1beta1_CustomMetricTargetList_To_extensions_CustomMetricTargetList(in, out, s) -} - -func autoConvert_extensions_CustomMetricTargetList_To_v1beta1_CustomMetricTargetList(in *extensions.CustomMetricTargetList, out *CustomMetricTargetList, s conversion.Scope) error { - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]CustomMetricTarget, len(*in)) - for i := range *in { - if err := Convert_extensions_CustomMetricTarget_To_v1beta1_CustomMetricTarget(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_extensions_CustomMetricTargetList_To_v1beta1_CustomMetricTargetList(in *extensions.CustomMetricTargetList, out *CustomMetricTargetList, s conversion.Scope) error { - return autoConvert_extensions_CustomMetricTargetList_To_v1beta1_CustomMetricTargetList(in, out, s) -} - -func autoConvert_v1beta1_DaemonSet_To_extensions_DaemonSet(in *DaemonSet, out *extensions.DaemonSet, s conversion.Scope) error { - SetDefaults_DaemonSet(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_v1beta1_DaemonSetSpec_To_extensions_DaemonSetSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_DaemonSetStatus_To_extensions_DaemonSetStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_v1beta1_DaemonSet_To_extensions_DaemonSet(in *DaemonSet, out *extensions.DaemonSet, s conversion.Scope) error { - return autoConvert_v1beta1_DaemonSet_To_extensions_DaemonSet(in, out, s) -} - -func autoConvert_extensions_DaemonSet_To_v1beta1_DaemonSet(in *extensions.DaemonSet, out *DaemonSet, 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_extensions_DaemonSetSpec_To_v1beta1_DaemonSetSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_extensions_DaemonSetStatus_To_v1beta1_DaemonSetStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_extensions_DaemonSet_To_v1beta1_DaemonSet(in *extensions.DaemonSet, out *DaemonSet, s conversion.Scope) error { - return autoConvert_extensions_DaemonSet_To_v1beta1_DaemonSet(in, out, s) -} - -func autoConvert_v1beta1_DaemonSetList_To_extensions_DaemonSetList(in *DaemonSetList, out *extensions.DaemonSetList, 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([]extensions.DaemonSet, len(*in)) - for i := range *in { - if err := Convert_v1beta1_DaemonSet_To_extensions_DaemonSet(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1beta1_DaemonSetList_To_extensions_DaemonSetList(in *DaemonSetList, out *extensions.DaemonSetList, s conversion.Scope) error { - return autoConvert_v1beta1_DaemonSetList_To_extensions_DaemonSetList(in, out, s) -} - -func autoConvert_extensions_DaemonSetList_To_v1beta1_DaemonSetList(in *extensions.DaemonSetList, out *DaemonSetList, 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([]DaemonSet, len(*in)) - for i := range *in { - if err := Convert_extensions_DaemonSet_To_v1beta1_DaemonSet(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_extensions_DaemonSetList_To_v1beta1_DaemonSetList(in *extensions.DaemonSetList, out *DaemonSetList, s conversion.Scope) error { - return autoConvert_extensions_DaemonSetList_To_v1beta1_DaemonSetList(in, out, s) -} - -func autoConvert_v1beta1_DaemonSetSpec_To_extensions_DaemonSetSpec(in *DaemonSetSpec, out *extensions.DaemonSetSpec, s conversion.Scope) error { - if in.Selector != nil { - in, out := &in.Selector, &out.Selector - *out = new(unversioned.LabelSelector) - if err := Convert_v1beta1_LabelSelector_To_unversioned_LabelSelector(*in, *out, s); err != nil { - return err - } - } else { - out.Selector = nil - } - if err := v1.Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -func Convert_v1beta1_DaemonSetSpec_To_extensions_DaemonSetSpec(in *DaemonSetSpec, out *extensions.DaemonSetSpec, s conversion.Scope) error { - return autoConvert_v1beta1_DaemonSetSpec_To_extensions_DaemonSetSpec(in, out, s) -} - -func autoConvert_extensions_DaemonSetSpec_To_v1beta1_DaemonSetSpec(in *extensions.DaemonSetSpec, out *DaemonSetSpec, s conversion.Scope) error { - if in.Selector != nil { - in, out := &in.Selector, &out.Selector - *out = new(LabelSelector) - if err := Convert_unversioned_LabelSelector_To_v1beta1_LabelSelector(*in, *out, s); err != nil { - return err - } - } else { - out.Selector = nil - } - if err := v1.Convert_api_PodTemplateSpec_To_v1_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -func Convert_extensions_DaemonSetSpec_To_v1beta1_DaemonSetSpec(in *extensions.DaemonSetSpec, out *DaemonSetSpec, s conversion.Scope) error { - return autoConvert_extensions_DaemonSetSpec_To_v1beta1_DaemonSetSpec(in, out, s) -} - -func autoConvert_v1beta1_DaemonSetStatus_To_extensions_DaemonSetStatus(in *DaemonSetStatus, out *extensions.DaemonSetStatus, s conversion.Scope) error { - out.CurrentNumberScheduled = in.CurrentNumberScheduled - out.NumberMisscheduled = in.NumberMisscheduled - out.DesiredNumberScheduled = in.DesiredNumberScheduled - return nil -} - -func Convert_v1beta1_DaemonSetStatus_To_extensions_DaemonSetStatus(in *DaemonSetStatus, out *extensions.DaemonSetStatus, s conversion.Scope) error { - return autoConvert_v1beta1_DaemonSetStatus_To_extensions_DaemonSetStatus(in, out, s) -} - -func autoConvert_extensions_DaemonSetStatus_To_v1beta1_DaemonSetStatus(in *extensions.DaemonSetStatus, out *DaemonSetStatus, s conversion.Scope) error { - out.CurrentNumberScheduled = in.CurrentNumberScheduled - out.NumberMisscheduled = in.NumberMisscheduled - out.DesiredNumberScheduled = in.DesiredNumberScheduled - return nil -} - -func Convert_extensions_DaemonSetStatus_To_v1beta1_DaemonSetStatus(in *extensions.DaemonSetStatus, out *DaemonSetStatus, s conversion.Scope) error { - return autoConvert_extensions_DaemonSetStatus_To_v1beta1_DaemonSetStatus(in, out, s) -} - -func autoConvert_v1beta1_Deployment_To_extensions_Deployment(in *Deployment, out *extensions.Deployment, s conversion.Scope) error { - SetDefaults_Deployment(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_v1beta1_DeploymentSpec_To_extensions_DeploymentSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_DeploymentStatus_To_extensions_DeploymentStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_v1beta1_Deployment_To_extensions_Deployment(in *Deployment, out *extensions.Deployment, s conversion.Scope) error { - return autoConvert_v1beta1_Deployment_To_extensions_Deployment(in, out, s) -} - -func autoConvert_extensions_Deployment_To_v1beta1_Deployment(in *extensions.Deployment, out *Deployment, 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_extensions_DeploymentSpec_To_v1beta1_DeploymentSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_extensions_DeploymentStatus_To_v1beta1_DeploymentStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_extensions_Deployment_To_v1beta1_Deployment(in *extensions.Deployment, out *Deployment, s conversion.Scope) error { - return autoConvert_extensions_Deployment_To_v1beta1_Deployment(in, out, s) -} - -func autoConvert_v1beta1_DeploymentList_To_extensions_DeploymentList(in *DeploymentList, out *extensions.DeploymentList, 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([]extensions.Deployment, len(*in)) - for i := range *in { - if err := Convert_v1beta1_Deployment_To_extensions_Deployment(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1beta1_DeploymentList_To_extensions_DeploymentList(in *DeploymentList, out *extensions.DeploymentList, s conversion.Scope) error { - return autoConvert_v1beta1_DeploymentList_To_extensions_DeploymentList(in, out, s) -} - -func autoConvert_extensions_DeploymentList_To_v1beta1_DeploymentList(in *extensions.DeploymentList, out *DeploymentList, 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([]Deployment, len(*in)) - for i := range *in { - if err := Convert_extensions_Deployment_To_v1beta1_Deployment(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_extensions_DeploymentList_To_v1beta1_DeploymentList(in *extensions.DeploymentList, out *DeploymentList, s conversion.Scope) error { - return autoConvert_extensions_DeploymentList_To_v1beta1_DeploymentList(in, out, s) -} - -func autoConvert_v1beta1_DeploymentRollback_To_extensions_DeploymentRollback(in *DeploymentRollback, out *extensions.DeploymentRollback, s conversion.Scope) error { - if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { - return err - } - out.Name = in.Name - out.UpdatedAnnotations = in.UpdatedAnnotations - if err := Convert_v1beta1_RollbackConfig_To_extensions_RollbackConfig(&in.RollbackTo, &out.RollbackTo, s); err != nil { - return err - } - return nil -} - -func Convert_v1beta1_DeploymentRollback_To_extensions_DeploymentRollback(in *DeploymentRollback, out *extensions.DeploymentRollback, s conversion.Scope) error { - return autoConvert_v1beta1_DeploymentRollback_To_extensions_DeploymentRollback(in, out, s) -} - -func autoConvert_extensions_DeploymentRollback_To_v1beta1_DeploymentRollback(in *extensions.DeploymentRollback, out *DeploymentRollback, s conversion.Scope) error { - if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { - return err - } - out.Name = in.Name - out.UpdatedAnnotations = in.UpdatedAnnotations - if err := Convert_extensions_RollbackConfig_To_v1beta1_RollbackConfig(&in.RollbackTo, &out.RollbackTo, s); err != nil { - return err - } - return nil -} - -func Convert_extensions_DeploymentRollback_To_v1beta1_DeploymentRollback(in *extensions.DeploymentRollback, out *DeploymentRollback, s conversion.Scope) error { - return autoConvert_extensions_DeploymentRollback_To_v1beta1_DeploymentRollback(in, out, s) -} - -func autoConvert_v1beta1_DeploymentStatus_To_extensions_DeploymentStatus(in *DeploymentStatus, out *extensions.DeploymentStatus, s conversion.Scope) error { - out.ObservedGeneration = in.ObservedGeneration - out.Replicas = in.Replicas - out.UpdatedReplicas = in.UpdatedReplicas - out.AvailableReplicas = in.AvailableReplicas - out.UnavailableReplicas = in.UnavailableReplicas - return nil -} - -func Convert_v1beta1_DeploymentStatus_To_extensions_DeploymentStatus(in *DeploymentStatus, out *extensions.DeploymentStatus, s conversion.Scope) error { - return autoConvert_v1beta1_DeploymentStatus_To_extensions_DeploymentStatus(in, out, s) -} - -func autoConvert_extensions_DeploymentStatus_To_v1beta1_DeploymentStatus(in *extensions.DeploymentStatus, out *DeploymentStatus, s conversion.Scope) error { - out.ObservedGeneration = in.ObservedGeneration - out.Replicas = in.Replicas - out.UpdatedReplicas = in.UpdatedReplicas - out.AvailableReplicas = in.AvailableReplicas - out.UnavailableReplicas = in.UnavailableReplicas - return nil -} - -func Convert_extensions_DeploymentStatus_To_v1beta1_DeploymentStatus(in *extensions.DeploymentStatus, out *DeploymentStatus, s conversion.Scope) error { - return autoConvert_extensions_DeploymentStatus_To_v1beta1_DeploymentStatus(in, out, s) -} - -func autoConvert_v1beta1_DeploymentStrategy_To_extensions_DeploymentStrategy(in *DeploymentStrategy, out *extensions.DeploymentStrategy, s conversion.Scope) error { - out.Type = extensions.DeploymentStrategyType(in.Type) - if in.RollingUpdate != nil { - in, out := &in.RollingUpdate, &out.RollingUpdate - *out = new(extensions.RollingUpdateDeployment) - if err := Convert_v1beta1_RollingUpdateDeployment_To_extensions_RollingUpdateDeployment(*in, *out, s); err != nil { - return err - } - } else { - out.RollingUpdate = nil - } - return nil -} - -func autoConvert_extensions_DeploymentStrategy_To_v1beta1_DeploymentStrategy(in *extensions.DeploymentStrategy, out *DeploymentStrategy, s conversion.Scope) error { - out.Type = DeploymentStrategyType(in.Type) - if in.RollingUpdate != nil { - in, out := &in.RollingUpdate, &out.RollingUpdate - *out = new(RollingUpdateDeployment) - if err := Convert_extensions_RollingUpdateDeployment_To_v1beta1_RollingUpdateDeployment(*in, *out, s); err != nil { - return err - } - } else { - out.RollingUpdate = nil - } - return nil -} - -func autoConvert_v1beta1_ExportOptions_To_api_ExportOptions(in *ExportOptions, out *api.ExportOptions, s conversion.Scope) error { - if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { - return err - } - out.Export = in.Export - out.Exact = in.Exact - return nil -} - -func Convert_v1beta1_ExportOptions_To_api_ExportOptions(in *ExportOptions, out *api.ExportOptions, s conversion.Scope) error { - return autoConvert_v1beta1_ExportOptions_To_api_ExportOptions(in, out, s) -} - -func autoConvert_api_ExportOptions_To_v1beta1_ExportOptions(in *api.ExportOptions, out *ExportOptions, s conversion.Scope) error { - if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { - return err - } - out.Export = in.Export - out.Exact = in.Exact - return nil -} - -func Convert_api_ExportOptions_To_v1beta1_ExportOptions(in *api.ExportOptions, out *ExportOptions, s conversion.Scope) error { - return autoConvert_api_ExportOptions_To_v1beta1_ExportOptions(in, out, s) -} - -func autoConvert_v1beta1_FSGroupStrategyOptions_To_extensions_FSGroupStrategyOptions(in *FSGroupStrategyOptions, out *extensions.FSGroupStrategyOptions, s conversion.Scope) error { - out.Rule = extensions.FSGroupStrategyType(in.Rule) - if in.Ranges != nil { - in, out := &in.Ranges, &out.Ranges - *out = make([]extensions.IDRange, len(*in)) - for i := range *in { - if err := Convert_v1beta1_IDRange_To_extensions_IDRange(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Ranges = nil - } - return nil -} - -func Convert_v1beta1_FSGroupStrategyOptions_To_extensions_FSGroupStrategyOptions(in *FSGroupStrategyOptions, out *extensions.FSGroupStrategyOptions, s conversion.Scope) error { - return autoConvert_v1beta1_FSGroupStrategyOptions_To_extensions_FSGroupStrategyOptions(in, out, s) -} - -func autoConvert_extensions_FSGroupStrategyOptions_To_v1beta1_FSGroupStrategyOptions(in *extensions.FSGroupStrategyOptions, out *FSGroupStrategyOptions, s conversion.Scope) error { - out.Rule = FSGroupStrategyType(in.Rule) - if in.Ranges != nil { - in, out := &in.Ranges, &out.Ranges - *out = make([]IDRange, len(*in)) - for i := range *in { - if err := Convert_extensions_IDRange_To_v1beta1_IDRange(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Ranges = nil - } - return nil -} - -func Convert_extensions_FSGroupStrategyOptions_To_v1beta1_FSGroupStrategyOptions(in *extensions.FSGroupStrategyOptions, out *FSGroupStrategyOptions, s conversion.Scope) error { - return autoConvert_extensions_FSGroupStrategyOptions_To_v1beta1_FSGroupStrategyOptions(in, out, s) -} - -func autoConvert_v1beta1_HTTPIngressPath_To_extensions_HTTPIngressPath(in *HTTPIngressPath, out *extensions.HTTPIngressPath, s conversion.Scope) error { - out.Path = in.Path - if err := Convert_v1beta1_IngressBackend_To_extensions_IngressBackend(&in.Backend, &out.Backend, s); err != nil { - return err - } - return nil -} - -func Convert_v1beta1_HTTPIngressPath_To_extensions_HTTPIngressPath(in *HTTPIngressPath, out *extensions.HTTPIngressPath, s conversion.Scope) error { - return autoConvert_v1beta1_HTTPIngressPath_To_extensions_HTTPIngressPath(in, out, s) -} - -func autoConvert_extensions_HTTPIngressPath_To_v1beta1_HTTPIngressPath(in *extensions.HTTPIngressPath, out *HTTPIngressPath, s conversion.Scope) error { - out.Path = in.Path - if err := Convert_extensions_IngressBackend_To_v1beta1_IngressBackend(&in.Backend, &out.Backend, s); err != nil { - return err - } - return nil -} - -func Convert_extensions_HTTPIngressPath_To_v1beta1_HTTPIngressPath(in *extensions.HTTPIngressPath, out *HTTPIngressPath, s conversion.Scope) error { - return autoConvert_extensions_HTTPIngressPath_To_v1beta1_HTTPIngressPath(in, out, s) -} - -func autoConvert_v1beta1_HTTPIngressRuleValue_To_extensions_HTTPIngressRuleValue(in *HTTPIngressRuleValue, out *extensions.HTTPIngressRuleValue, s conversion.Scope) error { - if in.Paths != nil { - in, out := &in.Paths, &out.Paths - *out = make([]extensions.HTTPIngressPath, len(*in)) - for i := range *in { - if err := Convert_v1beta1_HTTPIngressPath_To_extensions_HTTPIngressPath(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Paths = nil - } - return nil -} - -func Convert_v1beta1_HTTPIngressRuleValue_To_extensions_HTTPIngressRuleValue(in *HTTPIngressRuleValue, out *extensions.HTTPIngressRuleValue, s conversion.Scope) error { - return autoConvert_v1beta1_HTTPIngressRuleValue_To_extensions_HTTPIngressRuleValue(in, out, s) -} - -func autoConvert_extensions_HTTPIngressRuleValue_To_v1beta1_HTTPIngressRuleValue(in *extensions.HTTPIngressRuleValue, out *HTTPIngressRuleValue, s conversion.Scope) error { - if in.Paths != nil { - in, out := &in.Paths, &out.Paths - *out = make([]HTTPIngressPath, len(*in)) - for i := range *in { - if err := Convert_extensions_HTTPIngressPath_To_v1beta1_HTTPIngressPath(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Paths = nil - } - return nil -} - -func Convert_extensions_HTTPIngressRuleValue_To_v1beta1_HTTPIngressRuleValue(in *extensions.HTTPIngressRuleValue, out *HTTPIngressRuleValue, s conversion.Scope) error { - return autoConvert_extensions_HTTPIngressRuleValue_To_v1beta1_HTTPIngressRuleValue(in, out, s) -} - -func autoConvert_v1beta1_HorizontalPodAutoscaler_To_autoscaling_HorizontalPodAutoscaler(in *HorizontalPodAutoscaler, out *autoscaling.HorizontalPodAutoscaler, s conversion.Scope) error { - SetDefaults_HorizontalPodAutoscaler(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_v1beta1_HorizontalPodAutoscalerSpec_To_autoscaling_HorizontalPodAutoscalerSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_HorizontalPodAutoscalerStatus_To_autoscaling_HorizontalPodAutoscalerStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_v1beta1_HorizontalPodAutoscaler_To_autoscaling_HorizontalPodAutoscaler(in *HorizontalPodAutoscaler, out *autoscaling.HorizontalPodAutoscaler, s conversion.Scope) error { - return autoConvert_v1beta1_HorizontalPodAutoscaler_To_autoscaling_HorizontalPodAutoscaler(in, out, s) -} - -func autoConvert_autoscaling_HorizontalPodAutoscaler_To_v1beta1_HorizontalPodAutoscaler(in *autoscaling.HorizontalPodAutoscaler, out *HorizontalPodAutoscaler, 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_autoscaling_HorizontalPodAutoscalerSpec_To_v1beta1_HorizontalPodAutoscalerSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_autoscaling_HorizontalPodAutoscalerStatus_To_v1beta1_HorizontalPodAutoscalerStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_autoscaling_HorizontalPodAutoscaler_To_v1beta1_HorizontalPodAutoscaler(in *autoscaling.HorizontalPodAutoscaler, out *HorizontalPodAutoscaler, s conversion.Scope) error { - return autoConvert_autoscaling_HorizontalPodAutoscaler_To_v1beta1_HorizontalPodAutoscaler(in, out, s) -} - -func autoConvert_v1beta1_HorizontalPodAutoscalerList_To_autoscaling_HorizontalPodAutoscalerList(in *HorizontalPodAutoscalerList, out *autoscaling.HorizontalPodAutoscalerList, 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([]autoscaling.HorizontalPodAutoscaler, len(*in)) - for i := range *in { - if err := Convert_v1beta1_HorizontalPodAutoscaler_To_autoscaling_HorizontalPodAutoscaler(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1beta1_HorizontalPodAutoscalerList_To_autoscaling_HorizontalPodAutoscalerList(in *HorizontalPodAutoscalerList, out *autoscaling.HorizontalPodAutoscalerList, s conversion.Scope) error { - return autoConvert_v1beta1_HorizontalPodAutoscalerList_To_autoscaling_HorizontalPodAutoscalerList(in, out, s) -} - -func autoConvert_autoscaling_HorizontalPodAutoscalerList_To_v1beta1_HorizontalPodAutoscalerList(in *autoscaling.HorizontalPodAutoscalerList, out *HorizontalPodAutoscalerList, 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([]HorizontalPodAutoscaler, len(*in)) - for i := range *in { - if err := Convert_autoscaling_HorizontalPodAutoscaler_To_v1beta1_HorizontalPodAutoscaler(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_autoscaling_HorizontalPodAutoscalerList_To_v1beta1_HorizontalPodAutoscalerList(in *autoscaling.HorizontalPodAutoscalerList, out *HorizontalPodAutoscalerList, s conversion.Scope) error { - return autoConvert_autoscaling_HorizontalPodAutoscalerList_To_v1beta1_HorizontalPodAutoscalerList(in, out, s) -} - -func autoConvert_v1beta1_HorizontalPodAutoscalerStatus_To_autoscaling_HorizontalPodAutoscalerStatus(in *HorizontalPodAutoscalerStatus, out *autoscaling.HorizontalPodAutoscalerStatus, s conversion.Scope) error { - out.ObservedGeneration = in.ObservedGeneration - out.LastScaleTime = in.LastScaleTime - out.CurrentReplicas = in.CurrentReplicas - out.DesiredReplicas = in.DesiredReplicas - out.CurrentCPUUtilizationPercentage = in.CurrentCPUUtilizationPercentage - return nil -} - -func Convert_v1beta1_HorizontalPodAutoscalerStatus_To_autoscaling_HorizontalPodAutoscalerStatus(in *HorizontalPodAutoscalerStatus, out *autoscaling.HorizontalPodAutoscalerStatus, s conversion.Scope) error { - return autoConvert_v1beta1_HorizontalPodAutoscalerStatus_To_autoscaling_HorizontalPodAutoscalerStatus(in, out, s) -} - -func autoConvert_autoscaling_HorizontalPodAutoscalerStatus_To_v1beta1_HorizontalPodAutoscalerStatus(in *autoscaling.HorizontalPodAutoscalerStatus, out *HorizontalPodAutoscalerStatus, s conversion.Scope) error { - out.ObservedGeneration = in.ObservedGeneration - out.LastScaleTime = in.LastScaleTime - out.CurrentReplicas = in.CurrentReplicas - out.DesiredReplicas = in.DesiredReplicas - out.CurrentCPUUtilizationPercentage = in.CurrentCPUUtilizationPercentage - return nil -} - -func Convert_autoscaling_HorizontalPodAutoscalerStatus_To_v1beta1_HorizontalPodAutoscalerStatus(in *autoscaling.HorizontalPodAutoscalerStatus, out *HorizontalPodAutoscalerStatus, s conversion.Scope) error { - return autoConvert_autoscaling_HorizontalPodAutoscalerStatus_To_v1beta1_HorizontalPodAutoscalerStatus(in, out, s) -} - -func autoConvert_v1beta1_HostPortRange_To_extensions_HostPortRange(in *HostPortRange, out *extensions.HostPortRange, s conversion.Scope) error { - out.Min = int(in.Min) - out.Max = int(in.Max) - return nil -} - -func Convert_v1beta1_HostPortRange_To_extensions_HostPortRange(in *HostPortRange, out *extensions.HostPortRange, s conversion.Scope) error { - return autoConvert_v1beta1_HostPortRange_To_extensions_HostPortRange(in, out, s) -} - -func autoConvert_extensions_HostPortRange_To_v1beta1_HostPortRange(in *extensions.HostPortRange, out *HostPortRange, s conversion.Scope) error { - out.Min = int32(in.Min) - out.Max = int32(in.Max) - return nil -} - -func Convert_extensions_HostPortRange_To_v1beta1_HostPortRange(in *extensions.HostPortRange, out *HostPortRange, s conversion.Scope) error { - return autoConvert_extensions_HostPortRange_To_v1beta1_HostPortRange(in, out, s) -} - -func autoConvert_v1beta1_IDRange_To_extensions_IDRange(in *IDRange, out *extensions.IDRange, s conversion.Scope) error { - out.Min = in.Min - out.Max = in.Max - return nil -} - -func Convert_v1beta1_IDRange_To_extensions_IDRange(in *IDRange, out *extensions.IDRange, s conversion.Scope) error { - return autoConvert_v1beta1_IDRange_To_extensions_IDRange(in, out, s) -} - -func autoConvert_extensions_IDRange_To_v1beta1_IDRange(in *extensions.IDRange, out *IDRange, s conversion.Scope) error { - out.Min = in.Min - out.Max = in.Max - return nil -} - -func Convert_extensions_IDRange_To_v1beta1_IDRange(in *extensions.IDRange, out *IDRange, s conversion.Scope) error { - return autoConvert_extensions_IDRange_To_v1beta1_IDRange(in, out, s) -} - -func autoConvert_v1beta1_Ingress_To_extensions_Ingress(in *Ingress, out *extensions.Ingress, 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_v1beta1_IngressSpec_To_extensions_IngressSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_IngressStatus_To_extensions_IngressStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_v1beta1_Ingress_To_extensions_Ingress(in *Ingress, out *extensions.Ingress, s conversion.Scope) error { - return autoConvert_v1beta1_Ingress_To_extensions_Ingress(in, out, s) -} - -func autoConvert_extensions_Ingress_To_v1beta1_Ingress(in *extensions.Ingress, out *Ingress, 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_extensions_IngressSpec_To_v1beta1_IngressSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_extensions_IngressStatus_To_v1beta1_IngressStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_extensions_Ingress_To_v1beta1_Ingress(in *extensions.Ingress, out *Ingress, s conversion.Scope) error { - return autoConvert_extensions_Ingress_To_v1beta1_Ingress(in, out, s) -} - -func autoConvert_v1beta1_IngressBackend_To_extensions_IngressBackend(in *IngressBackend, out *extensions.IngressBackend, s conversion.Scope) error { - out.ServiceName = in.ServiceName - if err := api.Convert_intstr_IntOrString_To_intstr_IntOrString(&in.ServicePort, &out.ServicePort, s); err != nil { - return err - } - return nil -} - -func Convert_v1beta1_IngressBackend_To_extensions_IngressBackend(in *IngressBackend, out *extensions.IngressBackend, s conversion.Scope) error { - return autoConvert_v1beta1_IngressBackend_To_extensions_IngressBackend(in, out, s) -} - -func autoConvert_extensions_IngressBackend_To_v1beta1_IngressBackend(in *extensions.IngressBackend, out *IngressBackend, s conversion.Scope) error { - out.ServiceName = in.ServiceName - if err := api.Convert_intstr_IntOrString_To_intstr_IntOrString(&in.ServicePort, &out.ServicePort, s); err != nil { - return err - } - return nil -} - -func Convert_extensions_IngressBackend_To_v1beta1_IngressBackend(in *extensions.IngressBackend, out *IngressBackend, s conversion.Scope) error { - return autoConvert_extensions_IngressBackend_To_v1beta1_IngressBackend(in, out, s) -} - -func autoConvert_v1beta1_IngressList_To_extensions_IngressList(in *IngressList, out *extensions.IngressList, 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([]extensions.Ingress, len(*in)) - for i := range *in { - if err := Convert_v1beta1_Ingress_To_extensions_Ingress(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1beta1_IngressList_To_extensions_IngressList(in *IngressList, out *extensions.IngressList, s conversion.Scope) error { - return autoConvert_v1beta1_IngressList_To_extensions_IngressList(in, out, s) -} - -func autoConvert_extensions_IngressList_To_v1beta1_IngressList(in *extensions.IngressList, out *IngressList, 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([]Ingress, len(*in)) - for i := range *in { - if err := Convert_extensions_Ingress_To_v1beta1_Ingress(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_extensions_IngressList_To_v1beta1_IngressList(in *extensions.IngressList, out *IngressList, s conversion.Scope) error { - return autoConvert_extensions_IngressList_To_v1beta1_IngressList(in, out, s) -} - -func autoConvert_v1beta1_IngressRule_To_extensions_IngressRule(in *IngressRule, out *extensions.IngressRule, s conversion.Scope) error { - out.Host = in.Host - if err := Convert_v1beta1_IngressRuleValue_To_extensions_IngressRuleValue(&in.IngressRuleValue, &out.IngressRuleValue, s); err != nil { - return err - } - return nil -} - -func Convert_v1beta1_IngressRule_To_extensions_IngressRule(in *IngressRule, out *extensions.IngressRule, s conversion.Scope) error { - return autoConvert_v1beta1_IngressRule_To_extensions_IngressRule(in, out, s) -} - -func autoConvert_extensions_IngressRule_To_v1beta1_IngressRule(in *extensions.IngressRule, out *IngressRule, s conversion.Scope) error { - out.Host = in.Host - if err := Convert_extensions_IngressRuleValue_To_v1beta1_IngressRuleValue(&in.IngressRuleValue, &out.IngressRuleValue, s); err != nil { - return err - } - return nil -} - -func Convert_extensions_IngressRule_To_v1beta1_IngressRule(in *extensions.IngressRule, out *IngressRule, s conversion.Scope) error { - return autoConvert_extensions_IngressRule_To_v1beta1_IngressRule(in, out, s) -} - -func autoConvert_v1beta1_IngressRuleValue_To_extensions_IngressRuleValue(in *IngressRuleValue, out *extensions.IngressRuleValue, s conversion.Scope) error { - if in.HTTP != nil { - in, out := &in.HTTP, &out.HTTP - *out = new(extensions.HTTPIngressRuleValue) - if err := Convert_v1beta1_HTTPIngressRuleValue_To_extensions_HTTPIngressRuleValue(*in, *out, s); err != nil { - return err - } - } else { - out.HTTP = nil - } - return nil -} - -func Convert_v1beta1_IngressRuleValue_To_extensions_IngressRuleValue(in *IngressRuleValue, out *extensions.IngressRuleValue, s conversion.Scope) error { - return autoConvert_v1beta1_IngressRuleValue_To_extensions_IngressRuleValue(in, out, s) -} - -func autoConvert_extensions_IngressRuleValue_To_v1beta1_IngressRuleValue(in *extensions.IngressRuleValue, out *IngressRuleValue, s conversion.Scope) error { - if in.HTTP != nil { - in, out := &in.HTTP, &out.HTTP - *out = new(HTTPIngressRuleValue) - if err := Convert_extensions_HTTPIngressRuleValue_To_v1beta1_HTTPIngressRuleValue(*in, *out, s); err != nil { - return err - } - } else { - out.HTTP = nil - } - return nil -} - -func Convert_extensions_IngressRuleValue_To_v1beta1_IngressRuleValue(in *extensions.IngressRuleValue, out *IngressRuleValue, s conversion.Scope) error { - return autoConvert_extensions_IngressRuleValue_To_v1beta1_IngressRuleValue(in, out, s) -} - -func autoConvert_v1beta1_IngressSpec_To_extensions_IngressSpec(in *IngressSpec, out *extensions.IngressSpec, s conversion.Scope) error { - if in.Backend != nil { - in, out := &in.Backend, &out.Backend - *out = new(extensions.IngressBackend) - if err := Convert_v1beta1_IngressBackend_To_extensions_IngressBackend(*in, *out, s); err != nil { - return err - } - } else { - out.Backend = nil - } - if in.TLS != nil { - in, out := &in.TLS, &out.TLS - *out = make([]extensions.IngressTLS, len(*in)) - for i := range *in { - if err := Convert_v1beta1_IngressTLS_To_extensions_IngressTLS(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.TLS = nil - } - if in.Rules != nil { - in, out := &in.Rules, &out.Rules - *out = make([]extensions.IngressRule, len(*in)) - for i := range *in { - if err := Convert_v1beta1_IngressRule_To_extensions_IngressRule(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Rules = nil - } - return nil -} - -func Convert_v1beta1_IngressSpec_To_extensions_IngressSpec(in *IngressSpec, out *extensions.IngressSpec, s conversion.Scope) error { - return autoConvert_v1beta1_IngressSpec_To_extensions_IngressSpec(in, out, s) -} - -func autoConvert_extensions_IngressSpec_To_v1beta1_IngressSpec(in *extensions.IngressSpec, out *IngressSpec, s conversion.Scope) error { - if in.Backend != nil { - in, out := &in.Backend, &out.Backend - *out = new(IngressBackend) - if err := Convert_extensions_IngressBackend_To_v1beta1_IngressBackend(*in, *out, s); err != nil { - return err - } - } else { - out.Backend = nil - } - if in.TLS != nil { - in, out := &in.TLS, &out.TLS - *out = make([]IngressTLS, len(*in)) - for i := range *in { - if err := Convert_extensions_IngressTLS_To_v1beta1_IngressTLS(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.TLS = nil - } - if in.Rules != nil { - in, out := &in.Rules, &out.Rules - *out = make([]IngressRule, len(*in)) - for i := range *in { - if err := Convert_extensions_IngressRule_To_v1beta1_IngressRule(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Rules = nil - } - return nil -} - -func Convert_extensions_IngressSpec_To_v1beta1_IngressSpec(in *extensions.IngressSpec, out *IngressSpec, s conversion.Scope) error { - return autoConvert_extensions_IngressSpec_To_v1beta1_IngressSpec(in, out, s) -} - -func autoConvert_v1beta1_IngressStatus_To_extensions_IngressStatus(in *IngressStatus, out *extensions.IngressStatus, s conversion.Scope) error { - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.LoadBalancer, &out.LoadBalancer, 0); err != nil { - return err - } - return nil -} - -func Convert_v1beta1_IngressStatus_To_extensions_IngressStatus(in *IngressStatus, out *extensions.IngressStatus, s conversion.Scope) error { - return autoConvert_v1beta1_IngressStatus_To_extensions_IngressStatus(in, out, s) -} - -func autoConvert_extensions_IngressStatus_To_v1beta1_IngressStatus(in *extensions.IngressStatus, out *IngressStatus, s conversion.Scope) error { - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.LoadBalancer, &out.LoadBalancer, 0); err != nil { - return err - } - return nil -} - -func Convert_extensions_IngressStatus_To_v1beta1_IngressStatus(in *extensions.IngressStatus, out *IngressStatus, s conversion.Scope) error { - return autoConvert_extensions_IngressStatus_To_v1beta1_IngressStatus(in, out, s) -} - -func autoConvert_v1beta1_IngressTLS_To_extensions_IngressTLS(in *IngressTLS, out *extensions.IngressTLS, s conversion.Scope) error { - out.Hosts = in.Hosts - out.SecretName = in.SecretName - return nil -} - -func Convert_v1beta1_IngressTLS_To_extensions_IngressTLS(in *IngressTLS, out *extensions.IngressTLS, s conversion.Scope) error { - return autoConvert_v1beta1_IngressTLS_To_extensions_IngressTLS(in, out, s) -} - -func autoConvert_extensions_IngressTLS_To_v1beta1_IngressTLS(in *extensions.IngressTLS, out *IngressTLS, s conversion.Scope) error { - out.Hosts = in.Hosts - out.SecretName = in.SecretName - return nil -} - -func Convert_extensions_IngressTLS_To_v1beta1_IngressTLS(in *extensions.IngressTLS, out *IngressTLS, s conversion.Scope) error { - return autoConvert_extensions_IngressTLS_To_v1beta1_IngressTLS(in, out, s) -} - -func autoConvert_v1beta1_Job_To_batch_Job(in *Job, out *batch.Job, s conversion.Scope) error { - SetDefaults_Job(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_v1beta1_JobSpec_To_batch_JobSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_JobStatus_To_batch_JobStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_v1beta1_Job_To_batch_Job(in *Job, out *batch.Job, s conversion.Scope) error { - return autoConvert_v1beta1_Job_To_batch_Job(in, out, s) -} - -func autoConvert_batch_Job_To_v1beta1_Job(in *batch.Job, out *Job, 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_batch_JobSpec_To_v1beta1_JobSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_batch_JobStatus_To_v1beta1_JobStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_batch_Job_To_v1beta1_Job(in *batch.Job, out *Job, s conversion.Scope) error { - return autoConvert_batch_Job_To_v1beta1_Job(in, out, s) -} - -func autoConvert_v1beta1_JobCondition_To_batch_JobCondition(in *JobCondition, out *batch.JobCondition, s conversion.Scope) error { - out.Type = batch.JobConditionType(in.Type) - out.Status = api.ConditionStatus(in.Status) - if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastProbeTime, &out.LastProbeTime, s); err != nil { - return err - } - if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastTransitionTime, &out.LastTransitionTime, s); err != nil { - return err - } - out.Reason = in.Reason - out.Message = in.Message - return nil -} - -func Convert_v1beta1_JobCondition_To_batch_JobCondition(in *JobCondition, out *batch.JobCondition, s conversion.Scope) error { - return autoConvert_v1beta1_JobCondition_To_batch_JobCondition(in, out, s) -} - -func autoConvert_batch_JobCondition_To_v1beta1_JobCondition(in *batch.JobCondition, out *JobCondition, s conversion.Scope) error { - out.Type = JobConditionType(in.Type) - out.Status = v1.ConditionStatus(in.Status) - if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastProbeTime, &out.LastProbeTime, s); err != nil { - return err - } - if err := api.Convert_unversioned_Time_To_unversioned_Time(&in.LastTransitionTime, &out.LastTransitionTime, s); err != nil { - return err - } - out.Reason = in.Reason - out.Message = in.Message - return nil -} - -func Convert_batch_JobCondition_To_v1beta1_JobCondition(in *batch.JobCondition, out *JobCondition, s conversion.Scope) error { - return autoConvert_batch_JobCondition_To_v1beta1_JobCondition(in, out, s) -} - -func autoConvert_v1beta1_JobList_To_batch_JobList(in *JobList, out *batch.JobList, 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([]batch.Job, len(*in)) - for i := range *in { - if err := Convert_v1beta1_Job_To_batch_Job(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1beta1_JobList_To_batch_JobList(in *JobList, out *batch.JobList, s conversion.Scope) error { - return autoConvert_v1beta1_JobList_To_batch_JobList(in, out, s) -} - -func autoConvert_batch_JobList_To_v1beta1_JobList(in *batch.JobList, out *JobList, 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([]Job, len(*in)) - for i := range *in { - if err := Convert_batch_Job_To_v1beta1_Job(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_batch_JobList_To_v1beta1_JobList(in *batch.JobList, out *JobList, s conversion.Scope) error { - return autoConvert_batch_JobList_To_v1beta1_JobList(in, out, s) -} - -func autoConvert_v1beta1_JobStatus_To_batch_JobStatus(in *JobStatus, out *batch.JobStatus, s conversion.Scope) error { - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]batch.JobCondition, len(*in)) - for i := range *in { - if err := Convert_v1beta1_JobCondition_To_batch_JobCondition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - out.StartTime = in.StartTime - out.CompletionTime = in.CompletionTime - out.Active = in.Active - out.Succeeded = in.Succeeded - out.Failed = in.Failed - return nil -} - -func Convert_v1beta1_JobStatus_To_batch_JobStatus(in *JobStatus, out *batch.JobStatus, s conversion.Scope) error { - return autoConvert_v1beta1_JobStatus_To_batch_JobStatus(in, out, s) -} - -func autoConvert_batch_JobStatus_To_v1beta1_JobStatus(in *batch.JobStatus, out *JobStatus, s conversion.Scope) error { - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]JobCondition, len(*in)) - for i := range *in { - if err := Convert_batch_JobCondition_To_v1beta1_JobCondition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - out.StartTime = in.StartTime - out.CompletionTime = in.CompletionTime - out.Active = in.Active - out.Succeeded = in.Succeeded - out.Failed = in.Failed - return nil -} - -func Convert_batch_JobStatus_To_v1beta1_JobStatus(in *batch.JobStatus, out *JobStatus, s conversion.Scope) error { - return autoConvert_batch_JobStatus_To_v1beta1_JobStatus(in, out, s) -} - -func autoConvert_v1beta1_LabelSelector_To_unversioned_LabelSelector(in *LabelSelector, out *unversioned.LabelSelector, s conversion.Scope) error { - out.MatchLabels = in.MatchLabels - if in.MatchExpressions != nil { - in, out := &in.MatchExpressions, &out.MatchExpressions - *out = make([]unversioned.LabelSelectorRequirement, len(*in)) - for i := range *in { - if err := Convert_v1beta1_LabelSelectorRequirement_To_unversioned_LabelSelectorRequirement(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.MatchExpressions = nil - } - return nil -} - -func Convert_v1beta1_LabelSelector_To_unversioned_LabelSelector(in *LabelSelector, out *unversioned.LabelSelector, s conversion.Scope) error { - return autoConvert_v1beta1_LabelSelector_To_unversioned_LabelSelector(in, out, s) -} - -func autoConvert_unversioned_LabelSelector_To_v1beta1_LabelSelector(in *unversioned.LabelSelector, out *LabelSelector, s conversion.Scope) error { - out.MatchLabels = in.MatchLabels - if in.MatchExpressions != nil { - in, out := &in.MatchExpressions, &out.MatchExpressions - *out = make([]LabelSelectorRequirement, len(*in)) - for i := range *in { - if err := Convert_unversioned_LabelSelectorRequirement_To_v1beta1_LabelSelectorRequirement(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.MatchExpressions = nil - } - return nil -} - -func Convert_unversioned_LabelSelector_To_v1beta1_LabelSelector(in *unversioned.LabelSelector, out *LabelSelector, s conversion.Scope) error { - return autoConvert_unversioned_LabelSelector_To_v1beta1_LabelSelector(in, out, s) -} - -func autoConvert_v1beta1_LabelSelectorRequirement_To_unversioned_LabelSelectorRequirement(in *LabelSelectorRequirement, out *unversioned.LabelSelectorRequirement, s conversion.Scope) error { - out.Key = in.Key - out.Operator = unversioned.LabelSelectorOperator(in.Operator) - out.Values = in.Values - return nil -} - -func Convert_v1beta1_LabelSelectorRequirement_To_unversioned_LabelSelectorRequirement(in *LabelSelectorRequirement, out *unversioned.LabelSelectorRequirement, s conversion.Scope) error { - return autoConvert_v1beta1_LabelSelectorRequirement_To_unversioned_LabelSelectorRequirement(in, out, s) -} - -func autoConvert_unversioned_LabelSelectorRequirement_To_v1beta1_LabelSelectorRequirement(in *unversioned.LabelSelectorRequirement, out *LabelSelectorRequirement, s conversion.Scope) error { - out.Key = in.Key - out.Operator = LabelSelectorOperator(in.Operator) - out.Values = in.Values - return nil -} - -func Convert_unversioned_LabelSelectorRequirement_To_v1beta1_LabelSelectorRequirement(in *unversioned.LabelSelectorRequirement, out *LabelSelectorRequirement, s conversion.Scope) error { - return autoConvert_unversioned_LabelSelectorRequirement_To_v1beta1_LabelSelectorRequirement(in, out, s) -} - -func autoConvert_v1beta1_ListOptions_To_api_ListOptions(in *ListOptions, out *api.ListOptions, 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_string_To_labels_Selector(&in.LabelSelector, &out.LabelSelector, s); err != nil { - return err - } - if err := api.Convert_string_To_fields_Selector(&in.FieldSelector, &out.FieldSelector, s); err != nil { - return err - } - out.Watch = in.Watch - out.ResourceVersion = in.ResourceVersion - out.TimeoutSeconds = in.TimeoutSeconds - return nil -} - -func Convert_v1beta1_ListOptions_To_api_ListOptions(in *ListOptions, out *api.ListOptions, s conversion.Scope) error { - return autoConvert_v1beta1_ListOptions_To_api_ListOptions(in, out, s) -} - -func autoConvert_api_ListOptions_To_v1beta1_ListOptions(in *api.ListOptions, out *ListOptions, 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_labels_Selector_To_string(&in.LabelSelector, &out.LabelSelector, s); err != nil { - return err - } - if err := api.Convert_fields_Selector_To_string(&in.FieldSelector, &out.FieldSelector, s); err != nil { - return err - } - out.Watch = in.Watch - out.ResourceVersion = in.ResourceVersion - out.TimeoutSeconds = in.TimeoutSeconds - return nil -} - -func Convert_api_ListOptions_To_v1beta1_ListOptions(in *api.ListOptions, out *ListOptions, s conversion.Scope) error { - return autoConvert_api_ListOptions_To_v1beta1_ListOptions(in, out, s) -} - -func autoConvert_v1beta1_NetworkPolicy_To_extensions_NetworkPolicy(in *NetworkPolicy, out *extensions.NetworkPolicy, s conversion.Scope) error { - SetDefaults_NetworkPolicy(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_v1beta1_NetworkPolicySpec_To_extensions_NetworkPolicySpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -func Convert_v1beta1_NetworkPolicy_To_extensions_NetworkPolicy(in *NetworkPolicy, out *extensions.NetworkPolicy, s conversion.Scope) error { - return autoConvert_v1beta1_NetworkPolicy_To_extensions_NetworkPolicy(in, out, s) -} - -func autoConvert_extensions_NetworkPolicy_To_v1beta1_NetworkPolicy(in *extensions.NetworkPolicy, out *NetworkPolicy, 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_extensions_NetworkPolicySpec_To_v1beta1_NetworkPolicySpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -func Convert_extensions_NetworkPolicy_To_v1beta1_NetworkPolicy(in *extensions.NetworkPolicy, out *NetworkPolicy, s conversion.Scope) error { - return autoConvert_extensions_NetworkPolicy_To_v1beta1_NetworkPolicy(in, out, s) -} - -func autoConvert_v1beta1_NetworkPolicyIngressRule_To_extensions_NetworkPolicyIngressRule(in *NetworkPolicyIngressRule, out *extensions.NetworkPolicyIngressRule, s conversion.Scope) error { - if in.Ports != nil { - in, out := &in.Ports, &out.Ports - *out = make([]extensions.NetworkPolicyPort, len(*in)) - for i := range *in { - if err := Convert_v1beta1_NetworkPolicyPort_To_extensions_NetworkPolicyPort(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Ports = nil - } - if in.From != nil { - in, out := &in.From, &out.From - *out = make([]extensions.NetworkPolicyPeer, len(*in)) - for i := range *in { - if err := Convert_v1beta1_NetworkPolicyPeer_To_extensions_NetworkPolicyPeer(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.From = nil - } - return nil -} - -func Convert_v1beta1_NetworkPolicyIngressRule_To_extensions_NetworkPolicyIngressRule(in *NetworkPolicyIngressRule, out *extensions.NetworkPolicyIngressRule, s conversion.Scope) error { - return autoConvert_v1beta1_NetworkPolicyIngressRule_To_extensions_NetworkPolicyIngressRule(in, out, s) -} - -func autoConvert_extensions_NetworkPolicyIngressRule_To_v1beta1_NetworkPolicyIngressRule(in *extensions.NetworkPolicyIngressRule, out *NetworkPolicyIngressRule, s conversion.Scope) error { - if in.Ports != nil { - in, out := &in.Ports, &out.Ports - *out = make([]NetworkPolicyPort, len(*in)) - for i := range *in { - if err := Convert_extensions_NetworkPolicyPort_To_v1beta1_NetworkPolicyPort(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Ports = nil - } - if in.From != nil { - in, out := &in.From, &out.From - *out = make([]NetworkPolicyPeer, len(*in)) - for i := range *in { - if err := Convert_extensions_NetworkPolicyPeer_To_v1beta1_NetworkPolicyPeer(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.From = nil - } - return nil -} - -func Convert_extensions_NetworkPolicyIngressRule_To_v1beta1_NetworkPolicyIngressRule(in *extensions.NetworkPolicyIngressRule, out *NetworkPolicyIngressRule, s conversion.Scope) error { - return autoConvert_extensions_NetworkPolicyIngressRule_To_v1beta1_NetworkPolicyIngressRule(in, out, s) -} - -func autoConvert_v1beta1_NetworkPolicyList_To_extensions_NetworkPolicyList(in *NetworkPolicyList, out *extensions.NetworkPolicyList, 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([]extensions.NetworkPolicy, len(*in)) - for i := range *in { - if err := Convert_v1beta1_NetworkPolicy_To_extensions_NetworkPolicy(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1beta1_NetworkPolicyList_To_extensions_NetworkPolicyList(in *NetworkPolicyList, out *extensions.NetworkPolicyList, s conversion.Scope) error { - return autoConvert_v1beta1_NetworkPolicyList_To_extensions_NetworkPolicyList(in, out, s) -} - -func autoConvert_extensions_NetworkPolicyList_To_v1beta1_NetworkPolicyList(in *extensions.NetworkPolicyList, out *NetworkPolicyList, 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([]NetworkPolicy, len(*in)) - for i := range *in { - if err := Convert_extensions_NetworkPolicy_To_v1beta1_NetworkPolicy(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_extensions_NetworkPolicyList_To_v1beta1_NetworkPolicyList(in *extensions.NetworkPolicyList, out *NetworkPolicyList, s conversion.Scope) error { - return autoConvert_extensions_NetworkPolicyList_To_v1beta1_NetworkPolicyList(in, out, s) -} - -func autoConvert_v1beta1_NetworkPolicyPeer_To_extensions_NetworkPolicyPeer(in *NetworkPolicyPeer, out *extensions.NetworkPolicyPeer, s conversion.Scope) error { - if in.PodSelector != nil { - in, out := &in.PodSelector, &out.PodSelector - *out = new(unversioned.LabelSelector) - if err := Convert_v1beta1_LabelSelector_To_unversioned_LabelSelector(*in, *out, s); err != nil { - return err - } - } else { - out.PodSelector = nil - } - if in.NamespaceSelector != nil { - in, out := &in.NamespaceSelector, &out.NamespaceSelector - *out = new(unversioned.LabelSelector) - if err := Convert_v1beta1_LabelSelector_To_unversioned_LabelSelector(*in, *out, s); err != nil { - return err - } - } else { - out.NamespaceSelector = nil - } - return nil -} - -func Convert_v1beta1_NetworkPolicyPeer_To_extensions_NetworkPolicyPeer(in *NetworkPolicyPeer, out *extensions.NetworkPolicyPeer, s conversion.Scope) error { - return autoConvert_v1beta1_NetworkPolicyPeer_To_extensions_NetworkPolicyPeer(in, out, s) -} - -func autoConvert_extensions_NetworkPolicyPeer_To_v1beta1_NetworkPolicyPeer(in *extensions.NetworkPolicyPeer, out *NetworkPolicyPeer, s conversion.Scope) error { - if in.PodSelector != nil { - in, out := &in.PodSelector, &out.PodSelector - *out = new(LabelSelector) - if err := Convert_unversioned_LabelSelector_To_v1beta1_LabelSelector(*in, *out, s); err != nil { - return err - } - } else { - out.PodSelector = nil - } - if in.NamespaceSelector != nil { - in, out := &in.NamespaceSelector, &out.NamespaceSelector - *out = new(LabelSelector) - if err := Convert_unversioned_LabelSelector_To_v1beta1_LabelSelector(*in, *out, s); err != nil { - return err - } - } else { - out.NamespaceSelector = nil - } - return nil -} - -func Convert_extensions_NetworkPolicyPeer_To_v1beta1_NetworkPolicyPeer(in *extensions.NetworkPolicyPeer, out *NetworkPolicyPeer, s conversion.Scope) error { - return autoConvert_extensions_NetworkPolicyPeer_To_v1beta1_NetworkPolicyPeer(in, out, s) -} - -func autoConvert_v1beta1_NetworkPolicyPort_To_extensions_NetworkPolicyPort(in *NetworkPolicyPort, out *extensions.NetworkPolicyPort, s conversion.Scope) error { - if in.Protocol != nil { - in, out := &in.Protocol, &out.Protocol - *out = new(api.Protocol) - **out = api.Protocol(**in) - } else { - out.Protocol = nil - } - out.Port = in.Port - return nil -} - -func Convert_v1beta1_NetworkPolicyPort_To_extensions_NetworkPolicyPort(in *NetworkPolicyPort, out *extensions.NetworkPolicyPort, s conversion.Scope) error { - return autoConvert_v1beta1_NetworkPolicyPort_To_extensions_NetworkPolicyPort(in, out, s) -} - -func autoConvert_extensions_NetworkPolicyPort_To_v1beta1_NetworkPolicyPort(in *extensions.NetworkPolicyPort, out *NetworkPolicyPort, s conversion.Scope) error { - if in.Protocol != nil { - in, out := &in.Protocol, &out.Protocol - *out = new(v1.Protocol) - **out = v1.Protocol(**in) - } else { - out.Protocol = nil - } - out.Port = in.Port - return nil -} - -func Convert_extensions_NetworkPolicyPort_To_v1beta1_NetworkPolicyPort(in *extensions.NetworkPolicyPort, out *NetworkPolicyPort, s conversion.Scope) error { - return autoConvert_extensions_NetworkPolicyPort_To_v1beta1_NetworkPolicyPort(in, out, s) -} - -func autoConvert_v1beta1_NetworkPolicySpec_To_extensions_NetworkPolicySpec(in *NetworkPolicySpec, out *extensions.NetworkPolicySpec, s conversion.Scope) error { - if err := Convert_v1beta1_LabelSelector_To_unversioned_LabelSelector(&in.PodSelector, &out.PodSelector, s); err != nil { - return err - } - if in.Ingress != nil { - in, out := &in.Ingress, &out.Ingress - *out = make([]extensions.NetworkPolicyIngressRule, len(*in)) - for i := range *in { - if err := Convert_v1beta1_NetworkPolicyIngressRule_To_extensions_NetworkPolicyIngressRule(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Ingress = nil - } - return nil -} - -func Convert_v1beta1_NetworkPolicySpec_To_extensions_NetworkPolicySpec(in *NetworkPolicySpec, out *extensions.NetworkPolicySpec, s conversion.Scope) error { - return autoConvert_v1beta1_NetworkPolicySpec_To_extensions_NetworkPolicySpec(in, out, s) -} - -func autoConvert_extensions_NetworkPolicySpec_To_v1beta1_NetworkPolicySpec(in *extensions.NetworkPolicySpec, out *NetworkPolicySpec, s conversion.Scope) error { - if err := Convert_unversioned_LabelSelector_To_v1beta1_LabelSelector(&in.PodSelector, &out.PodSelector, s); err != nil { - return err - } - if in.Ingress != nil { - in, out := &in.Ingress, &out.Ingress - *out = make([]NetworkPolicyIngressRule, len(*in)) - for i := range *in { - if err := Convert_extensions_NetworkPolicyIngressRule_To_v1beta1_NetworkPolicyIngressRule(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Ingress = nil - } - return nil -} - -func Convert_extensions_NetworkPolicySpec_To_v1beta1_NetworkPolicySpec(in *extensions.NetworkPolicySpec, out *NetworkPolicySpec, s conversion.Scope) error { - return autoConvert_extensions_NetworkPolicySpec_To_v1beta1_NetworkPolicySpec(in, out, s) -} - -func autoConvert_v1beta1_PodSecurityPolicy_To_extensions_PodSecurityPolicy(in *PodSecurityPolicy, out *extensions.PodSecurityPolicy, 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_v1beta1_PodSecurityPolicySpec_To_extensions_PodSecurityPolicySpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -func Convert_v1beta1_PodSecurityPolicy_To_extensions_PodSecurityPolicy(in *PodSecurityPolicy, out *extensions.PodSecurityPolicy, s conversion.Scope) error { - return autoConvert_v1beta1_PodSecurityPolicy_To_extensions_PodSecurityPolicy(in, out, s) -} - -func autoConvert_extensions_PodSecurityPolicy_To_v1beta1_PodSecurityPolicy(in *extensions.PodSecurityPolicy, out *PodSecurityPolicy, 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_extensions_PodSecurityPolicySpec_To_v1beta1_PodSecurityPolicySpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -func Convert_extensions_PodSecurityPolicy_To_v1beta1_PodSecurityPolicy(in *extensions.PodSecurityPolicy, out *PodSecurityPolicy, s conversion.Scope) error { - return autoConvert_extensions_PodSecurityPolicy_To_v1beta1_PodSecurityPolicy(in, out, s) -} - -func autoConvert_v1beta1_PodSecurityPolicyList_To_extensions_PodSecurityPolicyList(in *PodSecurityPolicyList, out *extensions.PodSecurityPolicyList, 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([]extensions.PodSecurityPolicy, len(*in)) - for i := range *in { - if err := Convert_v1beta1_PodSecurityPolicy_To_extensions_PodSecurityPolicy(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1beta1_PodSecurityPolicyList_To_extensions_PodSecurityPolicyList(in *PodSecurityPolicyList, out *extensions.PodSecurityPolicyList, s conversion.Scope) error { - return autoConvert_v1beta1_PodSecurityPolicyList_To_extensions_PodSecurityPolicyList(in, out, s) -} - -func autoConvert_extensions_PodSecurityPolicyList_To_v1beta1_PodSecurityPolicyList(in *extensions.PodSecurityPolicyList, out *PodSecurityPolicyList, 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([]PodSecurityPolicy, len(*in)) - for i := range *in { - if err := Convert_extensions_PodSecurityPolicy_To_v1beta1_PodSecurityPolicy(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_extensions_PodSecurityPolicyList_To_v1beta1_PodSecurityPolicyList(in *extensions.PodSecurityPolicyList, out *PodSecurityPolicyList, s conversion.Scope) error { - return autoConvert_extensions_PodSecurityPolicyList_To_v1beta1_PodSecurityPolicyList(in, out, s) -} - -func autoConvert_v1beta1_PodSecurityPolicySpec_To_extensions_PodSecurityPolicySpec(in *PodSecurityPolicySpec, out *extensions.PodSecurityPolicySpec, s conversion.Scope) error { - out.Privileged = in.Privileged - if in.DefaultAddCapabilities != nil { - in, out := &in.DefaultAddCapabilities, &out.DefaultAddCapabilities - *out = make([]api.Capability, len(*in)) - for i := range *in { - (*out)[i] = api.Capability((*in)[i]) - } - } else { - out.DefaultAddCapabilities = nil - } - if in.RequiredDropCapabilities != nil { - in, out := &in.RequiredDropCapabilities, &out.RequiredDropCapabilities - *out = make([]api.Capability, len(*in)) - for i := range *in { - (*out)[i] = api.Capability((*in)[i]) - } - } else { - out.RequiredDropCapabilities = nil - } - if in.AllowedCapabilities != nil { - in, out := &in.AllowedCapabilities, &out.AllowedCapabilities - *out = make([]api.Capability, len(*in)) - for i := range *in { - (*out)[i] = api.Capability((*in)[i]) - } - } else { - out.AllowedCapabilities = nil - } - if in.Volumes != nil { - in, out := &in.Volumes, &out.Volumes - *out = make([]extensions.FSType, len(*in)) - for i := range *in { - (*out)[i] = extensions.FSType((*in)[i]) - } - } else { - out.Volumes = nil - } - out.HostNetwork = in.HostNetwork - if in.HostPorts != nil { - in, out := &in.HostPorts, &out.HostPorts - *out = make([]extensions.HostPortRange, len(*in)) - for i := range *in { - if err := Convert_v1beta1_HostPortRange_To_extensions_HostPortRange(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.HostPorts = nil - } - out.HostPID = in.HostPID - out.HostIPC = in.HostIPC - if err := Convert_v1beta1_SELinuxStrategyOptions_To_extensions_SELinuxStrategyOptions(&in.SELinux, &out.SELinux, s); err != nil { - return err - } - if err := Convert_v1beta1_RunAsUserStrategyOptions_To_extensions_RunAsUserStrategyOptions(&in.RunAsUser, &out.RunAsUser, s); err != nil { - return err - } - if err := Convert_v1beta1_SupplementalGroupsStrategyOptions_To_extensions_SupplementalGroupsStrategyOptions(&in.SupplementalGroups, &out.SupplementalGroups, s); err != nil { - return err - } - if err := Convert_v1beta1_FSGroupStrategyOptions_To_extensions_FSGroupStrategyOptions(&in.FSGroup, &out.FSGroup, s); err != nil { - return err - } - out.ReadOnlyRootFilesystem = in.ReadOnlyRootFilesystem - return nil -} - -func Convert_v1beta1_PodSecurityPolicySpec_To_extensions_PodSecurityPolicySpec(in *PodSecurityPolicySpec, out *extensions.PodSecurityPolicySpec, s conversion.Scope) error { - return autoConvert_v1beta1_PodSecurityPolicySpec_To_extensions_PodSecurityPolicySpec(in, out, s) -} - -func autoConvert_extensions_PodSecurityPolicySpec_To_v1beta1_PodSecurityPolicySpec(in *extensions.PodSecurityPolicySpec, out *PodSecurityPolicySpec, s conversion.Scope) error { - out.Privileged = in.Privileged - if in.DefaultAddCapabilities != nil { - in, out := &in.DefaultAddCapabilities, &out.DefaultAddCapabilities - *out = make([]v1.Capability, len(*in)) - for i := range *in { - (*out)[i] = v1.Capability((*in)[i]) - } - } else { - out.DefaultAddCapabilities = nil - } - if in.RequiredDropCapabilities != nil { - in, out := &in.RequiredDropCapabilities, &out.RequiredDropCapabilities - *out = make([]v1.Capability, len(*in)) - for i := range *in { - (*out)[i] = v1.Capability((*in)[i]) - } - } else { - out.RequiredDropCapabilities = nil - } - if in.AllowedCapabilities != nil { - in, out := &in.AllowedCapabilities, &out.AllowedCapabilities - *out = make([]v1.Capability, len(*in)) - for i := range *in { - (*out)[i] = v1.Capability((*in)[i]) - } - } else { - out.AllowedCapabilities = nil - } - if in.Volumes != nil { - in, out := &in.Volumes, &out.Volumes - *out = make([]FSType, len(*in)) - for i := range *in { - (*out)[i] = FSType((*in)[i]) - } - } else { - out.Volumes = nil - } - out.HostNetwork = in.HostNetwork - if in.HostPorts != nil { - in, out := &in.HostPorts, &out.HostPorts - *out = make([]HostPortRange, len(*in)) - for i := range *in { - if err := Convert_extensions_HostPortRange_To_v1beta1_HostPortRange(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.HostPorts = nil - } - out.HostPID = in.HostPID - out.HostIPC = in.HostIPC - if err := Convert_extensions_SELinuxStrategyOptions_To_v1beta1_SELinuxStrategyOptions(&in.SELinux, &out.SELinux, s); err != nil { - return err - } - if err := Convert_extensions_RunAsUserStrategyOptions_To_v1beta1_RunAsUserStrategyOptions(&in.RunAsUser, &out.RunAsUser, s); err != nil { - return err - } - if err := Convert_extensions_SupplementalGroupsStrategyOptions_To_v1beta1_SupplementalGroupsStrategyOptions(&in.SupplementalGroups, &out.SupplementalGroups, s); err != nil { - return err - } - if err := Convert_extensions_FSGroupStrategyOptions_To_v1beta1_FSGroupStrategyOptions(&in.FSGroup, &out.FSGroup, s); err != nil { - return err - } - out.ReadOnlyRootFilesystem = in.ReadOnlyRootFilesystem - return nil -} - -func Convert_extensions_PodSecurityPolicySpec_To_v1beta1_PodSecurityPolicySpec(in *extensions.PodSecurityPolicySpec, out *PodSecurityPolicySpec, s conversion.Scope) error { - return autoConvert_extensions_PodSecurityPolicySpec_To_v1beta1_PodSecurityPolicySpec(in, out, s) -} - -func autoConvert_v1beta1_ReplicaSet_To_extensions_ReplicaSet(in *ReplicaSet, out *extensions.ReplicaSet, s conversion.Scope) error { - SetDefaults_ReplicaSet(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_v1beta1_ReplicaSetSpec_To_extensions_ReplicaSetSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_ReplicaSetStatus_To_extensions_ReplicaSetStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_v1beta1_ReplicaSet_To_extensions_ReplicaSet(in *ReplicaSet, out *extensions.ReplicaSet, s conversion.Scope) error { - return autoConvert_v1beta1_ReplicaSet_To_extensions_ReplicaSet(in, out, s) -} - -func autoConvert_extensions_ReplicaSet_To_v1beta1_ReplicaSet(in *extensions.ReplicaSet, out *ReplicaSet, 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_extensions_ReplicaSetSpec_To_v1beta1_ReplicaSetSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_extensions_ReplicaSetStatus_To_v1beta1_ReplicaSetStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_extensions_ReplicaSet_To_v1beta1_ReplicaSet(in *extensions.ReplicaSet, out *ReplicaSet, s conversion.Scope) error { - return autoConvert_extensions_ReplicaSet_To_v1beta1_ReplicaSet(in, out, s) -} - -func autoConvert_v1beta1_ReplicaSetList_To_extensions_ReplicaSetList(in *ReplicaSetList, out *extensions.ReplicaSetList, 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([]extensions.ReplicaSet, len(*in)) - for i := range *in { - if err := Convert_v1beta1_ReplicaSet_To_extensions_ReplicaSet(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1beta1_ReplicaSetList_To_extensions_ReplicaSetList(in *ReplicaSetList, out *extensions.ReplicaSetList, s conversion.Scope) error { - return autoConvert_v1beta1_ReplicaSetList_To_extensions_ReplicaSetList(in, out, s) -} - -func autoConvert_extensions_ReplicaSetList_To_v1beta1_ReplicaSetList(in *extensions.ReplicaSetList, out *ReplicaSetList, 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([]ReplicaSet, len(*in)) - for i := range *in { - if err := Convert_extensions_ReplicaSet_To_v1beta1_ReplicaSet(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_extensions_ReplicaSetList_To_v1beta1_ReplicaSetList(in *extensions.ReplicaSetList, out *ReplicaSetList, s conversion.Scope) error { - return autoConvert_extensions_ReplicaSetList_To_v1beta1_ReplicaSetList(in, out, s) -} - -func autoConvert_v1beta1_ReplicaSetStatus_To_extensions_ReplicaSetStatus(in *ReplicaSetStatus, out *extensions.ReplicaSetStatus, s conversion.Scope) error { - out.Replicas = in.Replicas - out.FullyLabeledReplicas = in.FullyLabeledReplicas - out.ObservedGeneration = in.ObservedGeneration - return nil -} - -func Convert_v1beta1_ReplicaSetStatus_To_extensions_ReplicaSetStatus(in *ReplicaSetStatus, out *extensions.ReplicaSetStatus, s conversion.Scope) error { - return autoConvert_v1beta1_ReplicaSetStatus_To_extensions_ReplicaSetStatus(in, out, s) -} - -func autoConvert_extensions_ReplicaSetStatus_To_v1beta1_ReplicaSetStatus(in *extensions.ReplicaSetStatus, out *ReplicaSetStatus, s conversion.Scope) error { - out.Replicas = in.Replicas - out.FullyLabeledReplicas = in.FullyLabeledReplicas - out.ObservedGeneration = in.ObservedGeneration - return nil -} - -func Convert_extensions_ReplicaSetStatus_To_v1beta1_ReplicaSetStatus(in *extensions.ReplicaSetStatus, out *ReplicaSetStatus, s conversion.Scope) error { - return autoConvert_extensions_ReplicaSetStatus_To_v1beta1_ReplicaSetStatus(in, out, s) -} - -func autoConvert_v1beta1_ReplicationControllerDummy_To_extensions_ReplicationControllerDummy(in *ReplicationControllerDummy, out *extensions.ReplicationControllerDummy, s conversion.Scope) error { - if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { - return err - } - return nil -} - -func Convert_v1beta1_ReplicationControllerDummy_To_extensions_ReplicationControllerDummy(in *ReplicationControllerDummy, out *extensions.ReplicationControllerDummy, s conversion.Scope) error { - return autoConvert_v1beta1_ReplicationControllerDummy_To_extensions_ReplicationControllerDummy(in, out, s) -} - -func autoConvert_extensions_ReplicationControllerDummy_To_v1beta1_ReplicationControllerDummy(in *extensions.ReplicationControllerDummy, out *ReplicationControllerDummy, s conversion.Scope) error { - if err := api.Convert_unversioned_TypeMeta_To_unversioned_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil { - return err - } - return nil -} - -func Convert_extensions_ReplicationControllerDummy_To_v1beta1_ReplicationControllerDummy(in *extensions.ReplicationControllerDummy, out *ReplicationControllerDummy, s conversion.Scope) error { - return autoConvert_extensions_ReplicationControllerDummy_To_v1beta1_ReplicationControllerDummy(in, out, s) -} - -func autoConvert_v1beta1_RollbackConfig_To_extensions_RollbackConfig(in *RollbackConfig, out *extensions.RollbackConfig, s conversion.Scope) error { - out.Revision = in.Revision - return nil -} - -func Convert_v1beta1_RollbackConfig_To_extensions_RollbackConfig(in *RollbackConfig, out *extensions.RollbackConfig, s conversion.Scope) error { - return autoConvert_v1beta1_RollbackConfig_To_extensions_RollbackConfig(in, out, s) -} - -func autoConvert_extensions_RollbackConfig_To_v1beta1_RollbackConfig(in *extensions.RollbackConfig, out *RollbackConfig, s conversion.Scope) error { - out.Revision = in.Revision - return nil -} - -func Convert_extensions_RollbackConfig_To_v1beta1_RollbackConfig(in *extensions.RollbackConfig, out *RollbackConfig, s conversion.Scope) error { - return autoConvert_extensions_RollbackConfig_To_v1beta1_RollbackConfig(in, out, s) -} - -func autoConvert_v1beta1_RunAsUserStrategyOptions_To_extensions_RunAsUserStrategyOptions(in *RunAsUserStrategyOptions, out *extensions.RunAsUserStrategyOptions, s conversion.Scope) error { - out.Rule = extensions.RunAsUserStrategy(in.Rule) - if in.Ranges != nil { - in, out := &in.Ranges, &out.Ranges - *out = make([]extensions.IDRange, len(*in)) - for i := range *in { - if err := Convert_v1beta1_IDRange_To_extensions_IDRange(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Ranges = nil - } - return nil -} - -func Convert_v1beta1_RunAsUserStrategyOptions_To_extensions_RunAsUserStrategyOptions(in *RunAsUserStrategyOptions, out *extensions.RunAsUserStrategyOptions, s conversion.Scope) error { - return autoConvert_v1beta1_RunAsUserStrategyOptions_To_extensions_RunAsUserStrategyOptions(in, out, s) -} - -func autoConvert_extensions_RunAsUserStrategyOptions_To_v1beta1_RunAsUserStrategyOptions(in *extensions.RunAsUserStrategyOptions, out *RunAsUserStrategyOptions, s conversion.Scope) error { - out.Rule = RunAsUserStrategy(in.Rule) - if in.Ranges != nil { - in, out := &in.Ranges, &out.Ranges - *out = make([]IDRange, len(*in)) - for i := range *in { - if err := Convert_extensions_IDRange_To_v1beta1_IDRange(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Ranges = nil - } - return nil -} - -func Convert_extensions_RunAsUserStrategyOptions_To_v1beta1_RunAsUserStrategyOptions(in *extensions.RunAsUserStrategyOptions, out *RunAsUserStrategyOptions, s conversion.Scope) error { - return autoConvert_extensions_RunAsUserStrategyOptions_To_v1beta1_RunAsUserStrategyOptions(in, out, s) -} - -func autoConvert_v1beta1_SELinuxStrategyOptions_To_extensions_SELinuxStrategyOptions(in *SELinuxStrategyOptions, out *extensions.SELinuxStrategyOptions, s conversion.Scope) error { - out.Rule = extensions.SELinuxStrategy(in.Rule) - if in.SELinuxOptions != nil { - in, out := &in.SELinuxOptions, &out.SELinuxOptions - *out = new(api.SELinuxOptions) - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(*in, *out, 0); err != nil { - return err - } - } else { - out.SELinuxOptions = nil - } - return nil -} - -func Convert_v1beta1_SELinuxStrategyOptions_To_extensions_SELinuxStrategyOptions(in *SELinuxStrategyOptions, out *extensions.SELinuxStrategyOptions, s conversion.Scope) error { - return autoConvert_v1beta1_SELinuxStrategyOptions_To_extensions_SELinuxStrategyOptions(in, out, s) -} - -func autoConvert_extensions_SELinuxStrategyOptions_To_v1beta1_SELinuxStrategyOptions(in *extensions.SELinuxStrategyOptions, out *SELinuxStrategyOptions, s conversion.Scope) error { - out.Rule = SELinuxStrategy(in.Rule) - if in.SELinuxOptions != nil { - in, out := &in.SELinuxOptions, &out.SELinuxOptions - *out = new(v1.SELinuxOptions) - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(*in, *out, 0); err != nil { - return err - } - } else { - out.SELinuxOptions = nil - } - return nil -} - -func Convert_extensions_SELinuxStrategyOptions_To_v1beta1_SELinuxStrategyOptions(in *extensions.SELinuxStrategyOptions, out *SELinuxStrategyOptions, s conversion.Scope) error { - return autoConvert_extensions_SELinuxStrategyOptions_To_v1beta1_SELinuxStrategyOptions(in, out, s) -} - -func autoConvert_v1beta1_Scale_To_extensions_Scale(in *Scale, out *extensions.Scale, 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_v1beta1_ScaleSpec_To_extensions_ScaleSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_ScaleStatus_To_extensions_ScaleStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_v1beta1_Scale_To_extensions_Scale(in *Scale, out *extensions.Scale, s conversion.Scope) error { - return autoConvert_v1beta1_Scale_To_extensions_Scale(in, out, s) -} - -func autoConvert_extensions_Scale_To_v1beta1_Scale(in *extensions.Scale, out *Scale, 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_extensions_ScaleSpec_To_v1beta1_ScaleSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_extensions_ScaleStatus_To_v1beta1_ScaleStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_extensions_Scale_To_v1beta1_Scale(in *extensions.Scale, out *Scale, s conversion.Scope) error { - return autoConvert_extensions_Scale_To_v1beta1_Scale(in, out, s) -} - -func autoConvert_v1beta1_ScaleSpec_To_extensions_ScaleSpec(in *ScaleSpec, out *extensions.ScaleSpec, s conversion.Scope) error { - out.Replicas = in.Replicas - return nil -} - -func Convert_v1beta1_ScaleSpec_To_extensions_ScaleSpec(in *ScaleSpec, out *extensions.ScaleSpec, s conversion.Scope) error { - return autoConvert_v1beta1_ScaleSpec_To_extensions_ScaleSpec(in, out, s) -} - -func autoConvert_extensions_ScaleSpec_To_v1beta1_ScaleSpec(in *extensions.ScaleSpec, out *ScaleSpec, s conversion.Scope) error { - out.Replicas = in.Replicas - return nil -} - -func Convert_extensions_ScaleSpec_To_v1beta1_ScaleSpec(in *extensions.ScaleSpec, out *ScaleSpec, s conversion.Scope) error { - return autoConvert_extensions_ScaleSpec_To_v1beta1_ScaleSpec(in, out, s) -} - -func autoConvert_v1beta1_SupplementalGroupsStrategyOptions_To_extensions_SupplementalGroupsStrategyOptions(in *SupplementalGroupsStrategyOptions, out *extensions.SupplementalGroupsStrategyOptions, s conversion.Scope) error { - out.Rule = extensions.SupplementalGroupsStrategyType(in.Rule) - if in.Ranges != nil { - in, out := &in.Ranges, &out.Ranges - *out = make([]extensions.IDRange, len(*in)) - for i := range *in { - if err := Convert_v1beta1_IDRange_To_extensions_IDRange(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Ranges = nil - } - return nil -} - -func Convert_v1beta1_SupplementalGroupsStrategyOptions_To_extensions_SupplementalGroupsStrategyOptions(in *SupplementalGroupsStrategyOptions, out *extensions.SupplementalGroupsStrategyOptions, s conversion.Scope) error { - return autoConvert_v1beta1_SupplementalGroupsStrategyOptions_To_extensions_SupplementalGroupsStrategyOptions(in, out, s) -} - -func autoConvert_extensions_SupplementalGroupsStrategyOptions_To_v1beta1_SupplementalGroupsStrategyOptions(in *extensions.SupplementalGroupsStrategyOptions, out *SupplementalGroupsStrategyOptions, s conversion.Scope) error { - out.Rule = SupplementalGroupsStrategyType(in.Rule) - if in.Ranges != nil { - in, out := &in.Ranges, &out.Ranges - *out = make([]IDRange, len(*in)) - for i := range *in { - if err := Convert_extensions_IDRange_To_v1beta1_IDRange(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Ranges = nil - } - return nil -} - -func Convert_extensions_SupplementalGroupsStrategyOptions_To_v1beta1_SupplementalGroupsStrategyOptions(in *extensions.SupplementalGroupsStrategyOptions, out *SupplementalGroupsStrategyOptions, s conversion.Scope) error { - return autoConvert_extensions_SupplementalGroupsStrategyOptions_To_v1beta1_SupplementalGroupsStrategyOptions(in, out, s) -} - -func autoConvert_v1beta1_ThirdPartyResource_To_extensions_ThirdPartyResource(in *ThirdPartyResource, out *extensions.ThirdPartyResource, 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 - } - out.Description = in.Description - if in.Versions != nil { - in, out := &in.Versions, &out.Versions - *out = make([]extensions.APIVersion, len(*in)) - for i := range *in { - if err := Convert_v1beta1_APIVersion_To_extensions_APIVersion(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Versions = nil - } - return nil -} - -func Convert_v1beta1_ThirdPartyResource_To_extensions_ThirdPartyResource(in *ThirdPartyResource, out *extensions.ThirdPartyResource, s conversion.Scope) error { - return autoConvert_v1beta1_ThirdPartyResource_To_extensions_ThirdPartyResource(in, out, s) -} - -func autoConvert_extensions_ThirdPartyResource_To_v1beta1_ThirdPartyResource(in *extensions.ThirdPartyResource, out *ThirdPartyResource, 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 - } - out.Description = in.Description - if in.Versions != nil { - in, out := &in.Versions, &out.Versions - *out = make([]APIVersion, len(*in)) - for i := range *in { - if err := Convert_extensions_APIVersion_To_v1beta1_APIVersion(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Versions = nil - } - return nil -} - -func Convert_extensions_ThirdPartyResource_To_v1beta1_ThirdPartyResource(in *extensions.ThirdPartyResource, out *ThirdPartyResource, s conversion.Scope) error { - return autoConvert_extensions_ThirdPartyResource_To_v1beta1_ThirdPartyResource(in, out, s) -} - -func autoConvert_v1beta1_ThirdPartyResourceData_To_extensions_ThirdPartyResourceData(in *ThirdPartyResourceData, out *extensions.ThirdPartyResourceData, 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 := conversion.Convert_Slice_byte_To_Slice_byte(&in.Data, &out.Data, s); err != nil { - return err - } - return nil -} - -func Convert_v1beta1_ThirdPartyResourceData_To_extensions_ThirdPartyResourceData(in *ThirdPartyResourceData, out *extensions.ThirdPartyResourceData, s conversion.Scope) error { - return autoConvert_v1beta1_ThirdPartyResourceData_To_extensions_ThirdPartyResourceData(in, out, s) -} - -func autoConvert_extensions_ThirdPartyResourceData_To_v1beta1_ThirdPartyResourceData(in *extensions.ThirdPartyResourceData, out *ThirdPartyResourceData, 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 := conversion.Convert_Slice_byte_To_Slice_byte(&in.Data, &out.Data, s); err != nil { - return err - } - return nil -} - -func Convert_extensions_ThirdPartyResourceData_To_v1beta1_ThirdPartyResourceData(in *extensions.ThirdPartyResourceData, out *ThirdPartyResourceData, s conversion.Scope) error { - return autoConvert_extensions_ThirdPartyResourceData_To_v1beta1_ThirdPartyResourceData(in, out, s) -} - -func autoConvert_v1beta1_ThirdPartyResourceDataList_To_extensions_ThirdPartyResourceDataList(in *ThirdPartyResourceDataList, out *extensions.ThirdPartyResourceDataList, 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([]extensions.ThirdPartyResourceData, len(*in)) - for i := range *in { - if err := Convert_v1beta1_ThirdPartyResourceData_To_extensions_ThirdPartyResourceData(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1beta1_ThirdPartyResourceDataList_To_extensions_ThirdPartyResourceDataList(in *ThirdPartyResourceDataList, out *extensions.ThirdPartyResourceDataList, s conversion.Scope) error { - return autoConvert_v1beta1_ThirdPartyResourceDataList_To_extensions_ThirdPartyResourceDataList(in, out, s) -} - -func autoConvert_extensions_ThirdPartyResourceDataList_To_v1beta1_ThirdPartyResourceDataList(in *extensions.ThirdPartyResourceDataList, out *ThirdPartyResourceDataList, 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([]ThirdPartyResourceData, len(*in)) - for i := range *in { - if err := Convert_extensions_ThirdPartyResourceData_To_v1beta1_ThirdPartyResourceData(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_extensions_ThirdPartyResourceDataList_To_v1beta1_ThirdPartyResourceDataList(in *extensions.ThirdPartyResourceDataList, out *ThirdPartyResourceDataList, s conversion.Scope) error { - return autoConvert_extensions_ThirdPartyResourceDataList_To_v1beta1_ThirdPartyResourceDataList(in, out, s) -} - -func autoConvert_v1beta1_ThirdPartyResourceList_To_extensions_ThirdPartyResourceList(in *ThirdPartyResourceList, out *extensions.ThirdPartyResourceList, 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([]extensions.ThirdPartyResource, len(*in)) - for i := range *in { - if err := Convert_v1beta1_ThirdPartyResource_To_extensions_ThirdPartyResource(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1beta1_ThirdPartyResourceList_To_extensions_ThirdPartyResourceList(in *ThirdPartyResourceList, out *extensions.ThirdPartyResourceList, s conversion.Scope) error { - return autoConvert_v1beta1_ThirdPartyResourceList_To_extensions_ThirdPartyResourceList(in, out, s) -} - -func autoConvert_extensions_ThirdPartyResourceList_To_v1beta1_ThirdPartyResourceList(in *extensions.ThirdPartyResourceList, out *ThirdPartyResourceList, 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([]ThirdPartyResource, len(*in)) - for i := range *in { - if err := Convert_extensions_ThirdPartyResource_To_v1beta1_ThirdPartyResource(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_extensions_ThirdPartyResourceList_To_v1beta1_ThirdPartyResourceList(in *extensions.ThirdPartyResourceList, out *ThirdPartyResourceList, s conversion.Scope) error { - return autoConvert_extensions_ThirdPartyResourceList_To_v1beta1_ThirdPartyResourceList(in, out, s) -} diff --git a/pkg/apis/policy/v1alpha1/conversion_generated.go b/pkg/apis/policy/v1alpha1/conversion_generated.go deleted file mode 100644 index c524ca24a3d..00000000000 --- a/pkg/apis/policy/v1alpha1/conversion_generated.go +++ /dev/null @@ -1,183 +0,0 @@ -// +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" - policy "k8s.io/kubernetes/pkg/apis/policy" - conversion "k8s.io/kubernetes/pkg/conversion" -) - -func init() { - if err := api.Scheme.AddGeneratedConversionFuncs( - Convert_v1alpha1_PodDisruptionBudget_To_policy_PodDisruptionBudget, - Convert_policy_PodDisruptionBudget_To_v1alpha1_PodDisruptionBudget, - Convert_v1alpha1_PodDisruptionBudgetList_To_policy_PodDisruptionBudgetList, - Convert_policy_PodDisruptionBudgetList_To_v1alpha1_PodDisruptionBudgetList, - Convert_v1alpha1_PodDisruptionBudgetSpec_To_policy_PodDisruptionBudgetSpec, - Convert_policy_PodDisruptionBudgetSpec_To_v1alpha1_PodDisruptionBudgetSpec, - Convert_v1alpha1_PodDisruptionBudgetStatus_To_policy_PodDisruptionBudgetStatus, - Convert_policy_PodDisruptionBudgetStatus_To_v1alpha1_PodDisruptionBudgetStatus, - ); err != nil { - // if one of the conversion functions is malformed, detect it immediately. - panic(err) - } -} - -func autoConvert_v1alpha1_PodDisruptionBudget_To_policy_PodDisruptionBudget(in *PodDisruptionBudget, out *policy.PodDisruptionBudget, 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_v1alpha1_PodDisruptionBudgetSpec_To_policy_PodDisruptionBudgetSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha1_PodDisruptionBudgetStatus_To_policy_PodDisruptionBudgetStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_v1alpha1_PodDisruptionBudget_To_policy_PodDisruptionBudget(in *PodDisruptionBudget, out *policy.PodDisruptionBudget, s conversion.Scope) error { - return autoConvert_v1alpha1_PodDisruptionBudget_To_policy_PodDisruptionBudget(in, out, s) -} - -func autoConvert_policy_PodDisruptionBudget_To_v1alpha1_PodDisruptionBudget(in *policy.PodDisruptionBudget, out *PodDisruptionBudget, 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_policy_PodDisruptionBudgetSpec_To_v1alpha1_PodDisruptionBudgetSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_policy_PodDisruptionBudgetStatus_To_v1alpha1_PodDisruptionBudgetStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func Convert_policy_PodDisruptionBudget_To_v1alpha1_PodDisruptionBudget(in *policy.PodDisruptionBudget, out *PodDisruptionBudget, s conversion.Scope) error { - return autoConvert_policy_PodDisruptionBudget_To_v1alpha1_PodDisruptionBudget(in, out, s) -} - -func autoConvert_v1alpha1_PodDisruptionBudgetList_To_policy_PodDisruptionBudgetList(in *PodDisruptionBudgetList, out *policy.PodDisruptionBudgetList, 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([]policy.PodDisruptionBudget, len(*in)) - for i := range *in { - if err := Convert_v1alpha1_PodDisruptionBudget_To_policy_PodDisruptionBudget(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1alpha1_PodDisruptionBudgetList_To_policy_PodDisruptionBudgetList(in *PodDisruptionBudgetList, out *policy.PodDisruptionBudgetList, s conversion.Scope) error { - return autoConvert_v1alpha1_PodDisruptionBudgetList_To_policy_PodDisruptionBudgetList(in, out, s) -} - -func autoConvert_policy_PodDisruptionBudgetList_To_v1alpha1_PodDisruptionBudgetList(in *policy.PodDisruptionBudgetList, out *PodDisruptionBudgetList, 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([]PodDisruptionBudget, len(*in)) - for i := range *in { - if err := Convert_policy_PodDisruptionBudget_To_v1alpha1_PodDisruptionBudget(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_policy_PodDisruptionBudgetList_To_v1alpha1_PodDisruptionBudgetList(in *policy.PodDisruptionBudgetList, out *PodDisruptionBudgetList, s conversion.Scope) error { - return autoConvert_policy_PodDisruptionBudgetList_To_v1alpha1_PodDisruptionBudgetList(in, out, s) -} - -func autoConvert_v1alpha1_PodDisruptionBudgetSpec_To_policy_PodDisruptionBudgetSpec(in *PodDisruptionBudgetSpec, out *policy.PodDisruptionBudgetSpec, s conversion.Scope) error { - if err := api.Convert_intstr_IntOrString_To_intstr_IntOrString(&in.MinAvailable, &out.MinAvailable, s); err != nil { - return err - } - out.Selector = in.Selector - return nil -} - -func Convert_v1alpha1_PodDisruptionBudgetSpec_To_policy_PodDisruptionBudgetSpec(in *PodDisruptionBudgetSpec, out *policy.PodDisruptionBudgetSpec, s conversion.Scope) error { - return autoConvert_v1alpha1_PodDisruptionBudgetSpec_To_policy_PodDisruptionBudgetSpec(in, out, s) -} - -func autoConvert_policy_PodDisruptionBudgetSpec_To_v1alpha1_PodDisruptionBudgetSpec(in *policy.PodDisruptionBudgetSpec, out *PodDisruptionBudgetSpec, s conversion.Scope) error { - if err := api.Convert_intstr_IntOrString_To_intstr_IntOrString(&in.MinAvailable, &out.MinAvailable, s); err != nil { - return err - } - out.Selector = in.Selector - return nil -} - -func Convert_policy_PodDisruptionBudgetSpec_To_v1alpha1_PodDisruptionBudgetSpec(in *policy.PodDisruptionBudgetSpec, out *PodDisruptionBudgetSpec, s conversion.Scope) error { - return autoConvert_policy_PodDisruptionBudgetSpec_To_v1alpha1_PodDisruptionBudgetSpec(in, out, s) -} - -func autoConvert_v1alpha1_PodDisruptionBudgetStatus_To_policy_PodDisruptionBudgetStatus(in *PodDisruptionBudgetStatus, out *policy.PodDisruptionBudgetStatus, s conversion.Scope) error { - out.PodDisruptionAllowed = in.PodDisruptionAllowed - out.CurrentHealthy = in.CurrentHealthy - out.DesiredHealthy = in.DesiredHealthy - out.ExpectedPods = in.ExpectedPods - return nil -} - -func Convert_v1alpha1_PodDisruptionBudgetStatus_To_policy_PodDisruptionBudgetStatus(in *PodDisruptionBudgetStatus, out *policy.PodDisruptionBudgetStatus, s conversion.Scope) error { - return autoConvert_v1alpha1_PodDisruptionBudgetStatus_To_policy_PodDisruptionBudgetStatus(in, out, s) -} - -func autoConvert_policy_PodDisruptionBudgetStatus_To_v1alpha1_PodDisruptionBudgetStatus(in *policy.PodDisruptionBudgetStatus, out *PodDisruptionBudgetStatus, s conversion.Scope) error { - out.PodDisruptionAllowed = in.PodDisruptionAllowed - out.CurrentHealthy = in.CurrentHealthy - out.DesiredHealthy = in.DesiredHealthy - out.ExpectedPods = in.ExpectedPods - return nil -} - -func Convert_policy_PodDisruptionBudgetStatus_To_v1alpha1_PodDisruptionBudgetStatus(in *policy.PodDisruptionBudgetStatus, out *PodDisruptionBudgetStatus, s conversion.Scope) error { - return autoConvert_policy_PodDisruptionBudgetStatus_To_v1alpha1_PodDisruptionBudgetStatus(in, out, s) -} diff --git a/pkg/apis/rbac/v1alpha1/conversion_generated.go b/pkg/apis/rbac/v1alpha1/conversion_generated.go deleted file mode 100644 index 55881467710..00000000000 --- a/pkg/apis/rbac/v1alpha1/conversion_generated.go +++ /dev/null @@ -1,536 +0,0 @@ -// +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" - rbac "k8s.io/kubernetes/pkg/apis/rbac" - conversion "k8s.io/kubernetes/pkg/conversion" - runtime "k8s.io/kubernetes/pkg/runtime" -) - -func init() { - if err := api.Scheme.AddGeneratedConversionFuncs( - Convert_v1alpha1_ClusterRole_To_rbac_ClusterRole, - Convert_rbac_ClusterRole_To_v1alpha1_ClusterRole, - Convert_v1alpha1_ClusterRoleBinding_To_rbac_ClusterRoleBinding, - Convert_rbac_ClusterRoleBinding_To_v1alpha1_ClusterRoleBinding, - Convert_v1alpha1_ClusterRoleBindingList_To_rbac_ClusterRoleBindingList, - Convert_rbac_ClusterRoleBindingList_To_v1alpha1_ClusterRoleBindingList, - Convert_v1alpha1_ClusterRoleList_To_rbac_ClusterRoleList, - Convert_rbac_ClusterRoleList_To_v1alpha1_ClusterRoleList, - Convert_v1alpha1_PolicyRule_To_rbac_PolicyRule, - Convert_rbac_PolicyRule_To_v1alpha1_PolicyRule, - Convert_v1alpha1_Role_To_rbac_Role, - Convert_rbac_Role_To_v1alpha1_Role, - Convert_v1alpha1_RoleBinding_To_rbac_RoleBinding, - Convert_rbac_RoleBinding_To_v1alpha1_RoleBinding, - Convert_v1alpha1_RoleBindingList_To_rbac_RoleBindingList, - Convert_rbac_RoleBindingList_To_v1alpha1_RoleBindingList, - Convert_v1alpha1_RoleList_To_rbac_RoleList, - Convert_rbac_RoleList_To_v1alpha1_RoleList, - Convert_v1alpha1_Subject_To_rbac_Subject, - Convert_rbac_Subject_To_v1alpha1_Subject, - ); err != nil { - // if one of the conversion functions is malformed, detect it immediately. - panic(err) - } -} - -func autoConvert_v1alpha1_ClusterRole_To_rbac_ClusterRole(in *ClusterRole, out *rbac.ClusterRole, 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 in.Rules != nil { - in, out := &in.Rules, &out.Rules - *out = make([]rbac.PolicyRule, len(*in)) - for i := range *in { - if err := Convert_v1alpha1_PolicyRule_To_rbac_PolicyRule(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Rules = nil - } - return nil -} - -func Convert_v1alpha1_ClusterRole_To_rbac_ClusterRole(in *ClusterRole, out *rbac.ClusterRole, s conversion.Scope) error { - return autoConvert_v1alpha1_ClusterRole_To_rbac_ClusterRole(in, out, s) -} - -func autoConvert_rbac_ClusterRole_To_v1alpha1_ClusterRole(in *rbac.ClusterRole, out *ClusterRole, 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 in.Rules != nil { - in, out := &in.Rules, &out.Rules - *out = make([]PolicyRule, len(*in)) - for i := range *in { - if err := Convert_rbac_PolicyRule_To_v1alpha1_PolicyRule(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Rules = nil - } - return nil -} - -func Convert_rbac_ClusterRole_To_v1alpha1_ClusterRole(in *rbac.ClusterRole, out *ClusterRole, s conversion.Scope) error { - return autoConvert_rbac_ClusterRole_To_v1alpha1_ClusterRole(in, out, s) -} - -func autoConvert_v1alpha1_ClusterRoleBinding_To_rbac_ClusterRoleBinding(in *ClusterRoleBinding, out *rbac.ClusterRoleBinding, 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 in.Subjects != nil { - in, out := &in.Subjects, &out.Subjects - *out = make([]rbac.Subject, len(*in)) - for i := range *in { - if err := Convert_v1alpha1_Subject_To_rbac_Subject(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Subjects = nil - } - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.RoleRef, &out.RoleRef, 0); err != nil { - return err - } - return nil -} - -func Convert_v1alpha1_ClusterRoleBinding_To_rbac_ClusterRoleBinding(in *ClusterRoleBinding, out *rbac.ClusterRoleBinding, s conversion.Scope) error { - return autoConvert_v1alpha1_ClusterRoleBinding_To_rbac_ClusterRoleBinding(in, out, s) -} - -func autoConvert_rbac_ClusterRoleBinding_To_v1alpha1_ClusterRoleBinding(in *rbac.ClusterRoleBinding, out *ClusterRoleBinding, 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 in.Subjects != nil { - in, out := &in.Subjects, &out.Subjects - *out = make([]Subject, len(*in)) - for i := range *in { - if err := Convert_rbac_Subject_To_v1alpha1_Subject(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Subjects = nil - } - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.RoleRef, &out.RoleRef, 0); err != nil { - return err - } - return nil -} - -func Convert_rbac_ClusterRoleBinding_To_v1alpha1_ClusterRoleBinding(in *rbac.ClusterRoleBinding, out *ClusterRoleBinding, s conversion.Scope) error { - return autoConvert_rbac_ClusterRoleBinding_To_v1alpha1_ClusterRoleBinding(in, out, s) -} - -func autoConvert_v1alpha1_ClusterRoleBindingList_To_rbac_ClusterRoleBindingList(in *ClusterRoleBindingList, out *rbac.ClusterRoleBindingList, 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([]rbac.ClusterRoleBinding, len(*in)) - for i := range *in { - if err := Convert_v1alpha1_ClusterRoleBinding_To_rbac_ClusterRoleBinding(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1alpha1_ClusterRoleBindingList_To_rbac_ClusterRoleBindingList(in *ClusterRoleBindingList, out *rbac.ClusterRoleBindingList, s conversion.Scope) error { - return autoConvert_v1alpha1_ClusterRoleBindingList_To_rbac_ClusterRoleBindingList(in, out, s) -} - -func autoConvert_rbac_ClusterRoleBindingList_To_v1alpha1_ClusterRoleBindingList(in *rbac.ClusterRoleBindingList, out *ClusterRoleBindingList, 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([]ClusterRoleBinding, len(*in)) - for i := range *in { - if err := Convert_rbac_ClusterRoleBinding_To_v1alpha1_ClusterRoleBinding(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_rbac_ClusterRoleBindingList_To_v1alpha1_ClusterRoleBindingList(in *rbac.ClusterRoleBindingList, out *ClusterRoleBindingList, s conversion.Scope) error { - return autoConvert_rbac_ClusterRoleBindingList_To_v1alpha1_ClusterRoleBindingList(in, out, s) -} - -func autoConvert_v1alpha1_ClusterRoleList_To_rbac_ClusterRoleList(in *ClusterRoleList, out *rbac.ClusterRoleList, 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([]rbac.ClusterRole, len(*in)) - for i := range *in { - if err := Convert_v1alpha1_ClusterRole_To_rbac_ClusterRole(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1alpha1_ClusterRoleList_To_rbac_ClusterRoleList(in *ClusterRoleList, out *rbac.ClusterRoleList, s conversion.Scope) error { - return autoConvert_v1alpha1_ClusterRoleList_To_rbac_ClusterRoleList(in, out, s) -} - -func autoConvert_rbac_ClusterRoleList_To_v1alpha1_ClusterRoleList(in *rbac.ClusterRoleList, out *ClusterRoleList, 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([]ClusterRole, len(*in)) - for i := range *in { - if err := Convert_rbac_ClusterRole_To_v1alpha1_ClusterRole(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_rbac_ClusterRoleList_To_v1alpha1_ClusterRoleList(in *rbac.ClusterRoleList, out *ClusterRoleList, s conversion.Scope) error { - return autoConvert_rbac_ClusterRoleList_To_v1alpha1_ClusterRoleList(in, out, s) -} - -func autoConvert_v1alpha1_PolicyRule_To_rbac_PolicyRule(in *PolicyRule, out *rbac.PolicyRule, s conversion.Scope) error { - out.Verbs = in.Verbs - if err := runtime.Convert_runtime_RawExtension_To_runtime_Object(&in.AttributeRestrictions, &out.AttributeRestrictions, s); err != nil { - return err - } - out.APIGroups = in.APIGroups - out.Resources = in.Resources - out.ResourceNames = in.ResourceNames - out.NonResourceURLs = in.NonResourceURLs - return nil -} - -func Convert_v1alpha1_PolicyRule_To_rbac_PolicyRule(in *PolicyRule, out *rbac.PolicyRule, s conversion.Scope) error { - return autoConvert_v1alpha1_PolicyRule_To_rbac_PolicyRule(in, out, s) -} - -func autoConvert_rbac_PolicyRule_To_v1alpha1_PolicyRule(in *rbac.PolicyRule, out *PolicyRule, s conversion.Scope) error { - out.Verbs = in.Verbs - if err := runtime.Convert_runtime_Object_To_runtime_RawExtension(&in.AttributeRestrictions, &out.AttributeRestrictions, s); err != nil { - return err - } - out.APIGroups = in.APIGroups - out.Resources = in.Resources - out.ResourceNames = in.ResourceNames - out.NonResourceURLs = in.NonResourceURLs - return nil -} - -func Convert_rbac_PolicyRule_To_v1alpha1_PolicyRule(in *rbac.PolicyRule, out *PolicyRule, s conversion.Scope) error { - return autoConvert_rbac_PolicyRule_To_v1alpha1_PolicyRule(in, out, s) -} - -func autoConvert_v1alpha1_Role_To_rbac_Role(in *Role, out *rbac.Role, 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 in.Rules != nil { - in, out := &in.Rules, &out.Rules - *out = make([]rbac.PolicyRule, len(*in)) - for i := range *in { - if err := Convert_v1alpha1_PolicyRule_To_rbac_PolicyRule(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Rules = nil - } - return nil -} - -func Convert_v1alpha1_Role_To_rbac_Role(in *Role, out *rbac.Role, s conversion.Scope) error { - return autoConvert_v1alpha1_Role_To_rbac_Role(in, out, s) -} - -func autoConvert_rbac_Role_To_v1alpha1_Role(in *rbac.Role, out *Role, 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 in.Rules != nil { - in, out := &in.Rules, &out.Rules - *out = make([]PolicyRule, len(*in)) - for i := range *in { - if err := Convert_rbac_PolicyRule_To_v1alpha1_PolicyRule(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Rules = nil - } - return nil -} - -func Convert_rbac_Role_To_v1alpha1_Role(in *rbac.Role, out *Role, s conversion.Scope) error { - return autoConvert_rbac_Role_To_v1alpha1_Role(in, out, s) -} - -func autoConvert_v1alpha1_RoleBinding_To_rbac_RoleBinding(in *RoleBinding, out *rbac.RoleBinding, 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 in.Subjects != nil { - in, out := &in.Subjects, &out.Subjects - *out = make([]rbac.Subject, len(*in)) - for i := range *in { - if err := Convert_v1alpha1_Subject_To_rbac_Subject(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Subjects = nil - } - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.RoleRef, &out.RoleRef, 0); err != nil { - return err - } - return nil -} - -func Convert_v1alpha1_RoleBinding_To_rbac_RoleBinding(in *RoleBinding, out *rbac.RoleBinding, s conversion.Scope) error { - return autoConvert_v1alpha1_RoleBinding_To_rbac_RoleBinding(in, out, s) -} - -func autoConvert_rbac_RoleBinding_To_v1alpha1_RoleBinding(in *rbac.RoleBinding, out *RoleBinding, 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 in.Subjects != nil { - in, out := &in.Subjects, &out.Subjects - *out = make([]Subject, len(*in)) - for i := range *in { - if err := Convert_rbac_Subject_To_v1alpha1_Subject(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Subjects = nil - } - // TODO: Inefficient conversion - can we improve it? - if err := s.Convert(&in.RoleRef, &out.RoleRef, 0); err != nil { - return err - } - return nil -} - -func Convert_rbac_RoleBinding_To_v1alpha1_RoleBinding(in *rbac.RoleBinding, out *RoleBinding, s conversion.Scope) error { - return autoConvert_rbac_RoleBinding_To_v1alpha1_RoleBinding(in, out, s) -} - -func autoConvert_v1alpha1_RoleBindingList_To_rbac_RoleBindingList(in *RoleBindingList, out *rbac.RoleBindingList, 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([]rbac.RoleBinding, len(*in)) - for i := range *in { - if err := Convert_v1alpha1_RoleBinding_To_rbac_RoleBinding(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1alpha1_RoleBindingList_To_rbac_RoleBindingList(in *RoleBindingList, out *rbac.RoleBindingList, s conversion.Scope) error { - return autoConvert_v1alpha1_RoleBindingList_To_rbac_RoleBindingList(in, out, s) -} - -func autoConvert_rbac_RoleBindingList_To_v1alpha1_RoleBindingList(in *rbac.RoleBindingList, out *RoleBindingList, 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([]RoleBinding, len(*in)) - for i := range *in { - if err := Convert_rbac_RoleBinding_To_v1alpha1_RoleBinding(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_rbac_RoleBindingList_To_v1alpha1_RoleBindingList(in *rbac.RoleBindingList, out *RoleBindingList, s conversion.Scope) error { - return autoConvert_rbac_RoleBindingList_To_v1alpha1_RoleBindingList(in, out, s) -} - -func autoConvert_v1alpha1_RoleList_To_rbac_RoleList(in *RoleList, out *rbac.RoleList, 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([]rbac.Role, len(*in)) - for i := range *in { - if err := Convert_v1alpha1_Role_To_rbac_Role(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_v1alpha1_RoleList_To_rbac_RoleList(in *RoleList, out *rbac.RoleList, s conversion.Scope) error { - return autoConvert_v1alpha1_RoleList_To_rbac_RoleList(in, out, s) -} - -func autoConvert_rbac_RoleList_To_v1alpha1_RoleList(in *rbac.RoleList, out *RoleList, 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([]Role, len(*in)) - for i := range *in { - if err := Convert_rbac_Role_To_v1alpha1_Role(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -func Convert_rbac_RoleList_To_v1alpha1_RoleList(in *rbac.RoleList, out *RoleList, s conversion.Scope) error { - return autoConvert_rbac_RoleList_To_v1alpha1_RoleList(in, out, s) -} - -func autoConvert_v1alpha1_Subject_To_rbac_Subject(in *Subject, out *rbac.Subject, s conversion.Scope) error { - out.Kind = in.Kind - out.APIVersion = in.APIVersion - out.Name = in.Name - out.Namespace = in.Namespace - return nil -} - -func Convert_v1alpha1_Subject_To_rbac_Subject(in *Subject, out *rbac.Subject, s conversion.Scope) error { - return autoConvert_v1alpha1_Subject_To_rbac_Subject(in, out, s) -} - -func autoConvert_rbac_Subject_To_v1alpha1_Subject(in *rbac.Subject, out *Subject, s conversion.Scope) error { - out.Kind = in.Kind - out.APIVersion = in.APIVersion - out.Name = in.Name - out.Namespace = in.Namespace - return nil -} - -func Convert_rbac_Subject_To_v1alpha1_Subject(in *rbac.Subject, out *Subject, s conversion.Scope) error { - return autoConvert_rbac_Subject_To_v1alpha1_Subject(in, out, s) -} From 2a7b2fd37e52dbeeca2d7bdee1897a4e060e2564 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Thu, 2 Jun 2016 21:47:34 -0700 Subject: [PATCH 06/18] Tighten up Makefile Default SHELL and some other variables for max correctness. --- Makefile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4cb737befed..f6f0b52e1fa 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. +# 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 --warn-undefined-variables +.SUFFIXES: + # Old-skool build tools. # # Targets (see each target for more information): @@ -20,15 +27,17 @@ # test: Run tests. # clean: Clean up. -OUT_DIR = _output +OUT_DIR ?= _output BIN_DIR := $(OUT_DIR)/bin PRJ_SRC_PATH := k8s.io/kubernetes GENERATED_FILE_PREFIX := zz_generated. MAKE_METAFILE_PREFIX := .make. +GOFLAGS ?= KUBE_GOFLAGS = $(GOFLAGS) export KUBE_GOFLAGS +GOLDFLAGS ?= KUBE_GOLDFLAGS = $(GOLDFLAGS) export KUBE_GOLDFLAGS From 7e5b59b08c73a8cb546a07a7cffbf5e3f57fa6ac Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Mon, 30 May 2016 18:47:04 -0700 Subject: [PATCH 07/18] Include almost the whole tree in the build img --- build/common.sh | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/build/common.sh b/build/common.sh index 194cd882f36..6ec69677849 100755 --- a/build/common.sh +++ b/build/common.sh @@ -481,24 +481,9 @@ function kube::build::build_image_built() { # The set of source targets to include in the kube-build image function kube::build::source_targets() { local targets=( - api - build - cluster - cmd - docs - examples - federation - Godeps/Godeps.json - hack - LICENSE - pkg - plugin - DESIGN.md - README.md - test - third_party - vendor - contrib/mesos + $(find . -mindepth 1 -maxdepth 1 -not \( \ + \( -path ./_\* -o -path ./.git\* \) -prune \ + \)) ) if [ -n "${KUBERNETES_CONTRIB:-}" ]; then for contrib in "${KUBERNETES_CONTRIB}"; do From 9613e15801ebe9c5a484a80397dd0b800d442eaa Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Mon, 30 May 2016 17:22:53 -0700 Subject: [PATCH 08/18] Make releases work --- Makefile | 8 +++++++ build/README.md | 2 +- build/release.sh | 2 +- cluster/images/hyperkube/README.md | 2 +- cluster/kubectl.sh | 2 +- docs/devel/development.md | 2 +- hack/build-cross.sh | 21 +++++++----------- hack/lib/golang.sh | 2 +- hack/make-rules/cross.sh | 34 ++++++++++++++++++++++++++++++ 9 files changed, 56 insertions(+), 19 deletions(-) create mode 100755 hack/make-rules/cross.sh diff --git a/Makefile b/Makefile index f6f0b52e1fa..2fb175a5e5a 100644 --- a/Makefile +++ b/Makefile @@ -206,6 +206,14 @@ release-skip-tests quick-release: gen_deepcopy gen_conversion @KUBE_RELEASE_RUN_TESTS=n KUBE_FASTBUILD=true build/release.sh .PHONY: release-skip-tests quick-release +# Cross-compile for all platforms +# +# Example: +# make cross +.PHONY: cross +cross: + @hack/make-rules/cross.sh + # # Code-generation logic. # diff --git a/build/README.md b/build/README.md index 2c9a964295c..951ea14559f 100644 --- a/build/README.md +++ b/build/README.md @@ -25,7 +25,7 @@ The following scripts are found in the `build/` directory: * `run.sh`: Run a command in a build docker container. Common invocations: * `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 make test`: Run all unit tests * `run.sh make test-integration`: Run integration test * `run.sh make test-cmd`: Run CLI tests diff --git a/build/release.sh b/build/release.sh index 14856298698..ac9d2c3d1d4 100755 --- a/build/release.sh +++ b/build/release.sh @@ -30,7 +30,7 @@ KUBE_RELEASE_RUN_TESTS=${KUBE_RELEASE_RUN_TESTS-y} kube::build::verify_prereqs 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 kube::build::run_build_command make test diff --git a/cluster/images/hyperkube/README.md b/cluster/images/hyperkube/README.md index 52a39b2e852..9e0ae41397e 100644 --- a/cluster/images/hyperkube/README.md +++ b/cluster/images/hyperkube/README.md @@ -10,7 +10,7 @@ See http://kubernetes.io/docs/getting-started-guides/docker/ for up-to-date comm ```console # First, build the binaries -$ build/run.sh hack/build-cross.sh +$ build/run.sh make cross # Build for linux/amd64 (default) $ make push VERSION={target_version} ARCH=amd64 diff --git a/cluster/kubectl.sh b/cluster/kubectl.sh index 8280badff8a..7c37f28f835 100755 --- a/cluster/kubectl.sh +++ b/cluster/kubectl.sh @@ -97,7 +97,7 @@ if [[ -z "${KUBECTL_PATH:-}" ]]; then echo "It looks as if you don't have a compiled kubectl binary" echo 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 echo "If you are running from a binary release tarball, something is wrong. " diff --git a/docs/devel/development.md b/docs/devel/development.md index 4c00072e57b..571028c2fa9 100644 --- a/docs/devel/development.md +++ b/docs/devel/development.md @@ -79,7 +79,7 @@ You may pass build options and packages to the script as necessary. To build binaries for all platforms: ```sh - hack/build-cross.sh + make cross ``` ## Workflow diff --git a/hack/build-cross.sh b/hack/build-cross.sh index 30cc0faee38..d4cc70b303d 100755 --- a/hack/build-cross.sh +++ b/hack/build-cross.sh @@ -14,23 +14,18 @@ # 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. +# This script is a vestigial redirection. Please do not add "real" logic. set -o errexit set -o nounset set -o pipefail KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. -source "${KUBE_ROOT}/hack/lib/init.sh" -KUBE_BUILD_PLATFORMS=("${KUBE_SERVER_PLATFORMS[@]}") -kube::golang::build_binaries "${KUBE_SERVER_TARGETS[@]}" - -KUBE_BUILD_PLATFORMS=("${KUBE_CLIENT_PLATFORMS[@]}") -kube::golang::build_binaries "${KUBE_CLIENT_TARGETS[@]}" - -KUBE_BUILD_PLATFORMS=("${KUBE_TEST_PLATFORMS[@]}") -kube::golang::build_binaries "${KUBE_TEST_TARGETS[@]}" - -kube::golang::place_bins +echo "NOTE: $0 has been replaced by 'make cross'" +echo +echo "The equivalent of this invocation is: " +echo " make cross" +echo +echo +make --no-print-directory -C "${KUBE_ROOT}" cross diff --git a/hack/lib/golang.sh b/hack/lib/golang.sh index e08b895d87a..4f01d81d1fc 100755 --- a/hack/lib/golang.sh +++ b/hack/lib/golang.sh @@ -617,7 +617,7 @@ kube::golang::build_binaries() { targets=("${KUBE_ALL_TARGETS[@]}") fi - local -a platforms=("${KUBE_BUILD_PLATFORMS[@]:+${KUBE_BUILD_PLATFORMS[@]}}") + local -a platforms=(${KUBE_BUILD_PLATFORMS:-}) if [[ ${#platforms[@]} -eq 0 ]]; then platforms=("${host_platform}") fi diff --git a/hack/make-rules/cross.sh b/hack/make-rules/cross.sh new file mode 100755 index 00000000000..46bb4cf0217 --- /dev/null +++ b/hack/make-rules/cross.sh @@ -0,0 +1,34 @@ +#!/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[*]}" From a9f3ccdaa4eb41efb2597483860b9c0386f1c0b6 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Thu, 2 Jun 2016 21:28:31 -0700 Subject: [PATCH 09/18] Fix Makefile deps to rebuild less often This should only rebuild when ACTUALLY needed. --- .gitignore | 2 +- Makefile | 136 ++++++++++++++++++++++---------- hack/verify-flags-underscore.py | 2 + 3 files changed, 98 insertions(+), 42 deletions(-) diff --git a/.gitignore b/.gitignore index 40660628ca2..6963755c90b 100644 --- a/.gitignore +++ b/.gitignore @@ -102,4 +102,4 @@ kubernetes.tar.gz zz_generated.* # make-related metadata -.make.* +/.make/ diff --git a/Makefile b/Makefile index 2fb175a5e5a..51a485907c8 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. +DBG_MAKEFILE ?= +ifeq ($(DBG_MAKEFILE),1) + $(warning ***** starting makefile for goal(s) "$(MAKECMDGOALS)") + $(warning ***** $(shell date)) +endif + # It's necessary to set this because some docker images don't make sh -> bash. SHELL := /bin/bash @@ -31,7 +37,9 @@ OUT_DIR ?= _output BIN_DIR := $(OUT_DIR)/bin PRJ_SRC_PATH := k8s.io/kubernetes GENERATED_FILE_PREFIX := zz_generated. -MAKE_METAFILE_PREFIX := .make. + +# Metadata for driving the build lives here. +META_DIR := .make GOFLAGS ?= KUBE_GOFLAGS = $(GOFLAGS) @@ -165,7 +173,7 @@ clean: clean_generated clean_meta # Example: # make clean_meta clean_meta: - find . -type f -name $(MAKE_METAFILE_PREFIX)\* | xargs rm -f + rm -rf $(META_DIR) .PHONE: clean_meta # Remove all auto-generated artifacts. @@ -221,6 +229,9 @@ cross: # This variable holds a list of every directory that contains Go files in this # project. Other rules and variables can use this as a starting point to # reduce filesystem accesses. +ifeq ($(DBG_MAKEFILE),1) + $(warning ***** finding all *.go dirs) +endif ALL_GO_DIRS := $(shell \ find . \ -not \( \ @@ -237,21 +248,24 @@ ALL_GO_DIRS := $(shell \ ) # The name of the make metadata file listing Go files. -GOFILES_METAFILE := $(MAKE_METAFILE_PREFIX)gofiles +GOFILES_META := gofiles.mk # Establish a dependency between the deps file and the dir. Whenever a dir # changes (files added or removed) the deps file will be considered stale. # +# The variable value was set in $(GOFILES_META) and included as part of the +# dependency management logic. +# # This is looser than we really need (e.g. we don't really care about non *.go # files or even *_test.go files), but this is much easier to represent. # # Because we 'sinclude' the deps file, it is considered for rebuilding, as part -# of make's normal evaluation. +# of make's normal evaluation. If it gets rebuilt, make will restart. # # The '$(eval)' is needed because this has a different RHS for each LHS, and # would otherwise produce results that make can't parse. -$(foreach dir, $(ALL_GO_DIRS), $(eval \ - $(dir)/$(GOFILES_METAFILE): $(dir) \ +$(foreach dir, $(ALL_GO_DIRS), $(eval \ + $(META_DIR)/$(dir)/$(GOFILES_META): $(dir) \ )) # How to rebuild a deps file. When make determines that the deps file is stale @@ -259,18 +273,30 @@ $(foreach dir, $(ALL_GO_DIRS), $(eval \ # # This is looser than we really need (e.g. we don't really care about test # files), but this is MUCH faster than calling `go list`. -$(foreach dir, $(ALL_GO_DIRS), $(dir)/$(GOFILES_METAFILE)): - @FILES=$$(ls $(@D)/*.go | grep -v $(GENERATED_FILE_PREFIX)); \ - echo "gofiles__$(@D) := $$(echo $${FILES})" >$@ +# +# We regenerate the output file in order to satisfy make's "newer than" rules, +# but we only need to rebuild targets if the contents actually changed. That +# is what the .stamp file represents. +$(foreach dir, $(ALL_GO_DIRS), $(META_DIR)/$(dir)/$(GOFILES_META)): + @FILES=$$(ls $$@.tmp; \ + cmp -s $@.tmp $@ || touch $@.stamp; \ + mv $@.tmp $@ # Include any deps files as additional Makefile rules. This triggers make to # consider the deps files for rebuild, which makes the whole # dependency-management logic work. 'sinclude' is "silent include" which does # not fail if the file does not exist. -$(foreach dir, $(ALL_GO_DIRS), $(eval sinclude $(dir)/$(GOFILES_METAFILE))) +$(foreach dir, $(ALL_GO_DIRS), $(eval \ + sinclude $(META_DIR)/$(dir)/$(GOFILES_META) \ +)) # Generate a list of all files that have a `+k8s:` comment-tag. This will be # used to derive lists of files/dirs for generation tools. +ifeq ($(DBG_MAKEFILE),1) + $(warning ***** finding all +k8s: tags) +endif ALL_K8S_TAG_FILES := $(shell \ find $(ALL_GO_DIRS) -maxdepth 1 -type f -name \*.go \ | xargs grep -l '^// *+k8s:' \ @@ -289,6 +315,9 @@ ALL_K8S_TAG_FILES := $(shell \ # scheme # Find all the directories that request deep-copy generation. +ifeq ($(DBG_MAKEFILE),1) + $(warning ***** finding all +k8s:deepcopy-gen tags) +endif DEEP_COPY_DIRS := $(shell \ grep -l '+k8s:deepcopy-gen=' $(ALL_K8S_TAG_FILES) \ | xargs dirname \ @@ -305,8 +334,8 @@ gen_deepcopy: @$(MAKE) -s build WHAT=cmd/libs/go2idl/deepcopy-gen @$(MAKE) -s $(addsuffix /$(DEEP_COPY_FILENAME), $(DEEP_COPY_DIRS)) -# For each dir in DEEP_COPY_DIRS, this generates a statement of the form: -# path/to/dir/$(DEEP_COPY_FILENAME): +# For each dir in DEEP_COPY_DIRS, this establishes a dependency between the +# output file and the input files that should trigger a rebuild. # # Note that this is a deps-only statement, not a full rule (see below). # This has to be done in a distinct step because wildcards don't seem to work @@ -314,9 +343,13 @@ gen_deepcopy: # # The '$(eval)' is needed because this has a different RHS for each LHS, and # would otherwise produce results that make can't parse. -$(foreach dir, $(DEEP_COPY_DIRS), $(eval \ - $(dir)/$(DEEP_COPY_FILENAME): $(dir)/$(GOFILES_METAFILE) \ - $(gofiles__$(dir)) \ +# +# We depend on the $(GOFILES_META).stamp to detect when the set of input files +# has changed. This allows us to detect deleted input files. +$(foreach dir, $(DEEP_COPY_DIRS), $(eval \ + $(dir)/$(DEEP_COPY_FILENAME): $(META_DIR)/$(dir)/$(GOFILES_META).stamp \ + $(gofiles__$(dir)) \ + $(BIN_DIR)/deepcopy-gen \ )) # For each dir in DEEP_COPY_DIRS, handle deep-copy generation. @@ -345,19 +378,22 @@ $(addsuffix /$(DEEP_COPY_FILENAME), $(DEEP_COPY_DIRS)): # IDL. # All directories that request any form of conversion generation. +ifeq ($(DBG_MAKEFILE),1) + $(warning ***** finding all +k8s:conversion-gen tags) +endif CONVERSION_DIRS := $(shell \ grep '^// *+k8s:conversion-gen=' $(ALL_K8S_TAG_FILES) \ | cut -f1 -d: \ | xargs dirname \ | sort -u \ - ) +) # The result file, in each pkg, of conversion generation. CONVERSION_BASENAME := $(GENERATED_FILE_PREFIX)conversion CONVERSION_FILENAME := $(CONVERSION_BASENAME).go # The name of the make metadata file controlling conversions. -CONVERSIONS_METAFILE := $(MAKE_METAFILE_PREFIX)conversions +CONVERSIONS_META := conversions.mk # Unfortunately there's not a good way to use Go's build tools to check # if a binary needs to be rebuilt. We just have to try it. @@ -372,33 +408,44 @@ gen_conversion: # files or even *_test.go files), but this is much easier to represent. # # Because we 'sinclude' the deps file, it is considered for rebuilding, as part -# of make's normal evaluation. +# of make's normal evaluation. If it gets rebuilt, make will restart. # # The '$(eval)' is needed because this has a different RHS for each LHS, and # would otherwise produce results that make can't parse. -$(foreach dir, $(CONVERSION_DIRS), $(eval $(dir)/$(CONVERSIONS_METAFILE): $(dir))) +$(foreach dir, $(CONVERSION_DIRS), $(eval \ + $(META_DIR)/$(dir)/$(CONVERSIONS_META): $(dir) \ +)) # How to rebuild a deps file. When make determines that the deps file is stale # (see above), it executes this rule, and then re-loads the deps file. # # This is looser than we really need (e.g. we don't really care about test # files), but this is MUCH faster than calling `go list`. -$(foreach dir, $(CONVERSION_DIRS), $(dir)/$(CONVERSIONS_METAFILE)): - @TAGS=$$(grep -h '^// *+k8s:conversion-gen=' $(@D)/*.go \ - | cut -f2- -d= \ - | sed 's|$(PRJ_SRC_PATH)/||'); \ - echo "conversions__$(@D) := $$(echo $${TAGS})" >$@ +# +# We regenerate the output file in order to satisfy make's "newer than" rules, +# but we only need to rebuild targets if the contents actually changed. That +# is what the .stamp file represents. +$(foreach dir, $(CONVERSION_DIRS), $(META_DIR)/$(dir)/$(CONVERSIONS_META)): + @TAGS=$$(grep -h '^// *+k8s:conversion-gen=' $$@.tmp; \ + cmp -s $@.tmp $@ || touch $@.stamp; \ + mv $@.tmp $@ # Include any deps files as additional Makefile rules. This triggers make to # consider the deps files for rebuild, which makes the whole # dependency-management logic work. 'sinclude' is "silent include" which does # not fail if the file does not exist. -$(foreach dir, $(CONVERSION_DIRS), $(eval sinclude $(dir)/$(CONVERSIONS_METAFILE))) +$(foreach dir, $(CONVERSION_DIRS), $(eval \ + sinclude $(META_DIR)/$(dir)/$(CONVERSIONS_META) \ +)) -# For each dir in CONVERSION_DIRS, this generates a statement of the form: -# path/to/dir/$(CONVERSION_FILENAME): path/to/dir/$(GOFILES_METAFILE) \ -# $(gofiles__path/to/dir) -# The variable value was set in $(GOFILES_METAFILE) and included as part of the +# For each dir in CONVERSION_DIRS, this establishes a dependency between the +# output file and the input files that should trigger a rebuild. +# +# The variable value was set in $(GOFILES_META) and included as part of the # dependency management logic. # # Note that this is a deps-only statement, not a full rule (see below). @@ -407,16 +454,20 @@ $(foreach dir, $(CONVERSION_DIRS), $(eval sinclude $(dir)/$(CONVERSIONS_METAFILE # # The '$(eval)' is needed because this has a different RHS for each LHS, and # would otherwise produce results that make can't parse. -$(foreach dir, $(CONVERSION_DIRS), $(eval \ - $(dir)/$(CONVERSION_FILENAME): $(dir)/$(GOFILES_METAFILE) \ - $(gofiles__$(dir)) \ +# +# We depend on the $(GOFILES_META).stamp to detect when the set of input files +# has changed. This allows us to detect deleted input files. +$(foreach dir, $(CONVERSION_DIRS), $(eval \ + $(dir)/$(CONVERSION_FILENAME): $(META_DIR)/$(dir)/$(GOFILES_META).stamp \ + $(gofiles__$(dir)) \ + $(BIN_DIR)/conversion-gen \ )) # For each dir in CONVERSION_DIRS, for each target in $(conversions__$(dir)), -# this generates a statement of the form: -# path/to/dir/$(CONVERSION_FILENAME): /path/to/target/$(GOFILES_METAFILE) \ -# $(gofiles__path/to/target/) -# The variable value was set in $(GOFILES_METAFILE) and included as part of the +# this establishes a dependency between the output file and the input files +# that should trigger a rebuild. +# +# The variable value was set in $(GOFILES_META) and included as part of the # dependency management logic. # # Note that this is a deps-only statement, not a full rule (see below). @@ -425,11 +476,14 @@ $(foreach dir, $(CONVERSION_DIRS), $(eval \ # # The '$(eval)' is needed because this has a different RHS for each LHS, and # would otherwise produce results that make can't parse. -$(foreach dir, $(CONVERSION_DIRS), \ - $(foreach tgt, $(conversions__$(dir)), $(eval \ - $(dir)/$(CONVERSION_FILENAME): $(tgt)/$(GOFILES_METAFILE) \ - $(gofiles__$(tgt)) \ - )) \ +# +# We depend on the $(GOFILES_META).stamp to detect when the set of input files +# has changed. This allows us to detect deleted input files. +$(foreach dir, $(CONVERSION_DIRS), \ + $(foreach tgt, $(conversions__$(dir)), $(eval \ + $(dir)/$(CONVERSION_FILENAME): $(META_DIR)/$(tgt)/$(GOFILES_META).stamp \ + $(gofiles__$(tgt)) \ + )) \ ) # For each dir in CONVERSION_DIRS, this generates a rule to auto-generate diff --git a/hack/verify-flags-underscore.py b/hack/verify-flags-underscore.py index 94b61da1d46..1e8b4f8fa26 100755 --- a/hack/verify-flags-underscore.py +++ b/hack/verify-flags-underscore.py @@ -63,6 +63,8 @@ def get_all_files(rootdir): dirs.remove('third_party') if '.git' in dirs: dirs.remove('.git') + if '.make' in dirs: + dirs.remove('.make') if 'exceptions.txt' in files: files.remove('exceptions.txt') if 'known-flags.txt' in files: From 1bd3918c1595c3287f0b77aa2b0edb5773d1200a Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Fri, 3 Jun 2016 22:10:10 -0700 Subject: [PATCH 10/18] Overhaul deps on generator tools This forces a regeneration if the generation tools are rebuilt. Also clean up Makefile a bit. --- Makefile | 275 +++++++++++++++++++++----------- hack/jenkins/test-dockerized.sh | 1 + hack/make-rules/vet.sh | 1 + hack/update-codecgen.sh | 1 + 4 files changed, 183 insertions(+), 95 deletions(-) diff --git a/Makefile b/Makefile index 51a485907c8..bd7ff6d5cab 100644 --- a/Makefile +++ b/Makefile @@ -18,21 +18,24 @@ ifeq ($(DBG_MAKEFILE),1) $(warning ***** $(shell date)) endif +# Old-skool build tools. +# +# Commonly used targets (see each target for more information): +# all: Build code. +# test: Run tests. +# clean: Clean up. + # 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 --warn-undefined-variables +MAKEFLAGS += --no-builtin-rules .SUFFIXES: -# Old-skool build tools. -# -# Targets (see each target for more information): -# all: Build code. -# check: Run tests. -# test: Run tests. -# clean: Clean up. +# 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 @@ -41,13 +44,20 @@ GENERATED_FILE_PREFIX := zz_generated. # 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) -export KUBE_GOFLAGS +export KUBE_GOFLAGS GOFLAGS GOLDFLAGS ?= KUBE_GOLDFLAGS = $(GOLDFLAGS) -export KUBE_GOLDFLAGS +export KUBE_GOLDFLAGS GOLDFLAGS # Build code. # @@ -62,10 +72,9 @@ export KUBE_GOLDFLAGS # make # make all # make all WHAT=cmd/kubelet GOFLAGS=-v -# -# TODO: It's a not ideal that we build the tools on every invocation. -all: gen_deepcopy gen_conversion build .PHONY: all +all: generated_files + @hack/make-rules/build.sh $(WHAT) # Build ginkgo # @@ -75,11 +84,6 @@ ginkgo: hack/make-rules/build.sh vendor/github.com/onsi/ginkgo/ginkgo .PHONY: ginkgo -# This is a helper to break circular dependencies with recursive `make` calls. -build: - @hack/make-rules/build.sh $(WHAT) -.PHONY: build - # Runs all the presubmission verifications. # # Args: @@ -88,9 +92,9 @@ build: # Example: # make verify # make verify BRANCH=branch_x +.PHONY: verify verify: @KUBE_VERIFY_GIT_BRANCH=$(BRANCH) hack/make-rules/verify.sh -v -.PHONY: verify # Build and run tests. # @@ -105,50 +109,62 @@ verify: # make check # make test # make check WHAT=pkg/kubelet GOFLAGS=-v -check test: gen_deepcopy gen_conversion - @hack/make-rules/test.sh $(WHAT) $(TESTS) .PHONY: check test +check test: generated_files + @hack/make-rules/test.sh $(WHAT) $(TESTS) # Build and run integration tests. # # Example: # make test-integration -test-integration: gen_deepcopy gen_conversion - @hack/make-rules/test-integration.sh .PHONY: test-integration +test-integration: generated_files + @hack/make-rules/test-integration.sh # Build and run end-to-end tests. # # Example: # make test-e2e -test-e2e: ginkgo gen_deepcopy gen_conversion - @go run hack/e2e.go -v --build --up --test --down .PHONY: test-e2e +test-e2e: ginkgo generated_files + @go run hack/e2e.go -v --build --up --test --down # Build and run node end-to-end tests. # # Args: -# FOCUS: regexp that matches the tests to be run. Defaults to "". -# SKIP: regexp that matches the tests that needs to be skipped. Defaults to "". -# RUN_UNTIL_FAILURE: Ff true, pass --untilItFails to ginkgo so tests are run repeatedly until they fail. Defaults to false. -# REMOTE: If true, run the tests on a remote host instance on GCE. Defaults to false. -# 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". -# LIST_IMAGES: If true, don't run tests. Just output the list of available images for testing. Defaults to false. -# HOSTS: for REMOTE=true only. Comma delimited list of running gce hosts to 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"/ +# FOCUS: Regexp that matches the tests to be run. Defaults to "". +# SKIP: Regexp that matches the tests that needs to be skipped. Defaults +# to "". +# RUN_UNTIL_FAILURE: If true, pass --untilItFails to ginkgo so tests are run +# repeatedly until they fail. Defaults to false. +# REMOTE: If true, run the tests on a remote host instance on GCE. Defaults +# to false. +# IMAGES: For REMOTE=true only. Comma delimited list of images for creating +# remote hosts to run tests against. Defaults to a recent image. +# LIST_IMAGES: If true, don't run tests. Just output the list of available +# images for testing. Defaults to false. +# HOSTS: For REMOTE=true only. Comma delimited list of running gce hosts to +# 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: # make test-e2e-node FOCUS=kubelet SKIP=container # make test-e2e-node REMOTE=true DELETE_INSTANCES=true # Build and run tests. -test-e2e_node: ginkgo gen_deepcopy gen_conversion - @hack/make-rules/test-e2e_node.sh -.PHONY: test-e2e_node +.PHONY: test-e2e-node +test-e2e-node: ginkgo generated_files + @hack/make-rules/test-e2e-node.sh # Build and run cmdline tests. # @@ -162,27 +178,27 @@ test-cmd: # # Example: # make clean +.PHONY: clean clean: clean_generated clean_meta build/make-clean.sh rm -rf $(OUT_DIR) 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) -.PHONE: clean_meta # Remove all auto-generated artifacts. # # Example: # make clean_generated +.PHONY: clean_generated clean_generated: find . -type f -name $(GENERATED_FILE_PREFIX)\* | xargs rm -f -.PHONY: clean_generated # Run 'go vet'. # @@ -194,25 +210,25 @@ clean_generated: # Example: # make vet # make vet WHAT=pkg/kubelet +.PHONY: vet vet: @hack/make-rules/vet.sh $(WHAT) -.PHONY: vet # Build a release # # Example: # make release -release: gen_deepcopy gen_conversion - @build/release.sh .PHONY: release +release: generated_files + @build/release.sh # Build a release, but skip tests # # Example: # make release-skip-tests -release-skip-tests quick-release: gen_deepcopy gen_conversion - @KUBE_RELEASE_RUN_TESTS=n KUBE_FASTBUILD=true build/release.sh .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 # @@ -238,7 +254,9 @@ ALL_GO_DIRS := $(shell \ \( \ -path ./vendor -o \ -path ./_\* -o \ - -path ./.\* \ + -path ./.\* -o \ + -path ./docs -o \ + -path ./examples \ \) -prune \ \) \ -type f -name \*.go \ @@ -314,6 +332,13 @@ ALL_K8S_TAG_FILES := $(shell \ # register: generate deep-copy functions and register them with a # scheme +# The result file, in each pkg, of deep-copy generation. +DEEP_COPY_BASENAME := $(GENERATED_FILE_PREFIX)deep_copy +DEEP_COPY_FILENAME := $(DEEP_COPY_BASENAME).go + +# The tool used to generate deep copies. +DEEP_COPY_GEN := $(BIN_DIR)/deepcopy-gen + # Find all the directories that request deep-copy generation. ifeq ($(DBG_MAKEFILE),1) $(warning ***** finding all +k8s:deepcopy-gen tags) @@ -323,23 +348,14 @@ DEEP_COPY_DIRS := $(shell \ | xargs dirname \ | sort -u \ ) - -# The result file, in each pkg, of deep-copy generation. -DEEP_COPY_BASENAME := $(GENERATED_FILE_PREFIX)deep_copy -DEEP_COPY_FILENAME := $(DEEP_COPY_BASENAME).go - -# Unfortunately there's not a good way to use Go's build tools to check -# if a binary needs to be rebuilt. We just have to try it. -gen_deepcopy: - @$(MAKE) -s build WHAT=cmd/libs/go2idl/deepcopy-gen - @$(MAKE) -s $(addsuffix /$(DEEP_COPY_FILENAME), $(DEEP_COPY_DIRS)) +DEEP_COPY_FILES := $(addsuffix /$(DEEP_COPY_FILENAME), $(DEEP_COPY_DIRS)) # For each dir in DEEP_COPY_DIRS, this establishes a dependency between the # output file and the input files that should trigger a rebuild. # -# Note that this is a deps-only statement, not a full rule (see below). -# This has to be done in a distinct step because wildcards don't seem to work -# in static pattern rules. +# Note that this is a deps-only statement, not a full rule (see below). This +# has to be done in a distinct step because wildcards don't work in static +# pattern rules. # # The '$(eval)' is needed because this has a different RHS for each LHS, and # would otherwise produce results that make can't parse. @@ -349,18 +365,50 @@ gen_deepcopy: $(foreach dir, $(DEEP_COPY_DIRS), $(eval \ $(dir)/$(DEEP_COPY_FILENAME): $(META_DIR)/$(dir)/$(GOFILES_META).stamp \ $(gofiles__$(dir)) \ - $(BIN_DIR)/deepcopy-gen \ )) -# For each dir in DEEP_COPY_DIRS, handle deep-copy generation. -# This has to be done in two steps because wildcards don't seem to work in -# static pattern rules. -$(addsuffix /$(DEEP_COPY_FILENAME), $(DEEP_COPY_DIRS)): - $(BIN_DIR)/deepcopy-gen \ - -i $(PRJ_SRC_PATH)/$$(dirname $@) \ - --bounding-dirs $(PRJ_SRC_PATH) \ +# How to regenerate deep-copy code. +$(DEEP_COPY_FILES): $(DEEP_COPY_GEN) + @$(DEEP_COPY_GEN) \ + -i $(PRJ_SRC_PATH)/$$(dirname $@) \ + --bounding-dirs $(PRJ_SRC_PATH) \ -O $(DEEP_COPY_BASENAME) +# This calculates the dependencies for the generator tool, so we only rebuild +# it when needed. It is PHONY so that it always runs, but it only updates the +# file if the contents have actually changed. We 'sinclude' this later. +.PHONY: $(META_DIR)/$(DEEP_COPY_GEN).mk +$(META_DIR)/$(DEEP_COPY_GEN).mk: + @mkdir -p $(@D); \ + (echo -n "$(DEEP_COPY_GEN): "; \ + DIRECT=$$(go list -e -f '{{.Dir}} {{.Dir}}/*.go' \ + ./cmd/libs/go2idl/deepcopy-gen); \ + INDIRECT=$$(go list -e \ + -f '{{range .Deps}}{{.}}{{"\n"}}{{end}}' \ + ./cmd/libs/go2idl/deepcopy-gen \ + | grep "^$(PRJ_SRC_PATH)" \ + | xargs go list -e -f '{{.Dir}} {{.Dir}}/*.go'); \ + echo $$DIRECT $$INDIRECT | sed 's/ / \\\n\t/g'; \ + ) | sed "s|$$(pwd -P)/||" > $@.tmp; \ + cmp -s $@.tmp $@ || cat $@.tmp > $@ && rm -f $@.tmp + +# Include dependency info for the generator tool. This will cause the rule of +# the same name to be considered and if it is updated, make will restart. +sinclude $(META_DIR)/$(DEEP_COPY_GEN).mk + +# How to build the generator tool. The deps for this are defined in +# the $(DEEP_COPY_GEN).mk, above. +# +# A word on the need to touch: This rule might trigger if, for example, a +# non-Go file was added or deleted from a directory on which this depends. +# This target needs to be reconsidered, but Go realizes it doesn't actually +# have to be rebuilt. In that case, make will forever see the dependency as +# newer than the binary, and try to rebuild it over and over. So we touch it, +# and make is happy. +$(DEEP_COPY_GEN): + @hack/make-rules/build.sh cmd/libs/go2idl/deepcopy-gen + @touch $@ + # # Conversion generation # @@ -377,6 +425,16 @@ $(addsuffix /$(DEEP_COPY_FILENAME), $(DEEP_COPY_DIRS)): # TODO: it might be better in the long term to make peer-types explicit in the # IDL. +# The result file, in each pkg, of conversion generation. +CONVERSION_BASENAME := $(GENERATED_FILE_PREFIX)conversion +CONVERSION_FILENAME := $(CONVERSION_BASENAME).go + +# The tool used to generate conversions. +CONVERSION_GEN := $(BIN_DIR)/conversion-gen + +# The name of the make metadata file controlling conversions. +CONVERSIONS_META := conversions.mk + # All directories that request any form of conversion generation. ifeq ($(DBG_MAKEFILE),1) $(warning ***** finding all +k8s:conversion-gen tags) @@ -388,18 +446,7 @@ CONVERSION_DIRS := $(shell \ | sort -u \ ) -# The result file, in each pkg, of conversion generation. -CONVERSION_BASENAME := $(GENERATED_FILE_PREFIX)conversion -CONVERSION_FILENAME := $(CONVERSION_BASENAME).go - -# The name of the make metadata file controlling conversions. -CONVERSIONS_META := conversions.mk - -# Unfortunately there's not a good way to use Go's build tools to check -# if a binary needs to be rebuilt. We just have to try it. -gen_conversion: - @$(MAKE) -s build WHAT=cmd/libs/go2idl/conversion-gen - @$(MAKE) -s $(addsuffix /$(CONVERSION_FILENAME), $(CONVERSION_DIRS)) +CONVERSION_FILES := $(addsuffix /$(CONVERSION_FILENAME), $(CONVERSION_DIRS)) # Establish a dependency between the deps file and the dir. Whenever a dir # changes (files added or removed) the deps file will be considered stale. @@ -448,9 +495,9 @@ $(foreach dir, $(CONVERSION_DIRS), $(eval \ # The variable value was set in $(GOFILES_META) and included as part of the # dependency management logic. # -# Note that this is a deps-only statement, not a full rule (see below). -# This has to be done in a distinct step because wildcards don't seem to work -# in static pattern rules. +# Note that this is a deps-only statement, not a full rule (see below). This +# has to be done in a distinct step because wildcards don't work in static +# pattern rules. # # The '$(eval)' is needed because this has a different RHS for each LHS, and # would otherwise produce results that make can't parse. @@ -460,7 +507,6 @@ $(foreach dir, $(CONVERSION_DIRS), $(eval \ $(foreach dir, $(CONVERSION_DIRS), $(eval \ $(dir)/$(CONVERSION_FILENAME): $(META_DIR)/$(dir)/$(GOFILES_META).stamp \ $(gofiles__$(dir)) \ - $(BIN_DIR)/conversion-gen \ )) # For each dir in CONVERSION_DIRS, for each target in $(conversions__$(dir)), @@ -470,9 +516,9 @@ $(foreach dir, $(CONVERSION_DIRS), $(eval \ # The variable value was set in $(GOFILES_META) and included as part of the # dependency management logic. # -# Note that this is a deps-only statement, not a full rule (see below). -# This has to be done in a distinct step because wildcards don't seem to work -# in static pattern rules. +# Note that this is a deps-only statement, not a full rule (see below). This +# has to be done in a distinct step because wildcards don't work in static +# pattern rules. # # The '$(eval)' is needed because this has a different RHS for each LHS, and # would otherwise produce results that make can't parse. @@ -486,9 +532,48 @@ $(foreach dir, $(CONVERSION_DIRS), )) \ ) -# For each dir in CONVERSION_DIRS, this generates a rule to auto-generate -# conversion code. Dependencies of the target have been populated above. -$(addsuffix /$(CONVERSION_FILENAME), $(CONVERSION_DIRS)): - @$(BIN_DIR)/conversion-gen \ - -i $(PRJ_SRC_PATH)/$(@D) \ +# How to regenerate conversion code. +$(CONVERSION_FILES): $(CONVERSION_GEN) + @$(CONVERSION_GEN) \ + -i $(PRJ_SRC_PATH)/$(@D) \ -O $(CONVERSION_BASENAME) + +# This calculates the dependencies for the generator tool, so we only rebuild +# it when needed. It is PHONY so that it always runs, but it only updates the +# file if the contents have actually changed. We 'sinclude' this later. +.PHONY: $(META_DIR)/$(CONVERSION_GEN).mk +$(META_DIR)/$(CONVERSION_GEN).mk: + @mkdir -p $(@D); \ + (echo -n "$(CONVERSION_GEN): "; \ + DIRECT=$$(go list -e -f '{{.Dir}} {{.Dir}}/*.go' \ + ./cmd/libs/go2idl/conversion-gen); \ + INDIRECT=$$(go list -e \ + -f '{{range .Deps}}{{.}}{{"\n"}}{{end}}' \ + ./cmd/libs/go2idl/conversion-gen \ + | grep "^$(PRJ_SRC_PATH)" \ + | xargs go list -e -f '{{.Dir}} {{.Dir}}/*.go'); \ + echo $$DIRECT $$INDIRECT | sed 's/ / \\\n\t/g'; \ + ) | sed "s|$$(pwd -P)/||" > $@.tmp; \ + cmp -s $@.tmp $@ || cat $@.tmp > $@ && rm -f $@.tmp + +# Include dependency info for the generator tool. This will cause the rule of +# the same name to be considered and if it is updated, make will restart. +sinclude $(META_DIR)/$(CONVERSION_GEN).mk + +# How to build the generator tool. The deps for this are defined in +# the $(CONVERSION_GEN).mk, above. +# +# +# A word on the need to touch: This rule might trigger if, for example, a +# non-Go file was added or deleted from a directory on which this depends. +# This target needs to be reconsidered, but Go realizes it doesn't actually +# have to be rebuilt. In that case, make will forever see the dependency as +# newer than the binary, and try to rebuild it over and over. So we touch it, +# and make is happy. +$(CONVERSION_GEN): + @hack/make-rules/build.sh cmd/libs/go2idl/conversion-gen + @touch $@ + +# This rule collects all the generated file sets into a single dep, which is +# defined BELOW the *_FILES variables and leaves higher-level rules clean. +generated_files: $(DEEP_COPY_FILES) $(CONVERSION_FILES) diff --git a/hack/jenkins/test-dockerized.sh b/hack/jenkins/test-dockerized.sh index 85317b84031..9b8f44f26ad 100755 --- a/hack/jenkins/test-dockerized.sh +++ b/hack/jenkins/test-dockerized.sh @@ -52,6 +52,7 @@ export LOG_LEVEL=4 cd /go/src/k8s.io/kubernetes rm -rf Godeps/_workspace # Temporary until _workspace is fully obliterated +make generated_files go install ./cmd/... ./hack/install-etcd.sh diff --git a/hack/make-rules/vet.sh b/hack/make-rules/vet.sh index 2c0c329fd8e..fc0e264a590 100755 --- a/hack/make-rules/vet.sh +++ b/hack/make-rules/vet.sh @@ -25,6 +25,7 @@ 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. diff --git a/hack/update-codecgen.sh b/hack/update-codecgen.sh index 8b6f9c95163..a09feee16d2 100755 --- a/hack/update-codecgen.sh +++ b/hack/update-codecgen.sh @@ -117,6 +117,7 @@ if [[ -z ${haveindex} ]]; then fi echo "Building codecgen" +make generated_files CODECGEN="${PWD}/codecgen_binary" go build -o "${CODECGEN}" ./vendor/github.com/ugorji/go/codec/codecgen From 9dd337d1190a665731e3f73397dc1590b6541937 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Sat, 4 Jun 2016 21:53:58 -0700 Subject: [PATCH 11/18] s/deep_copy/deepcopy/ Just a naming nit that was too hard to fixup-and-rebase. --- Makefile | 42 ++++++++++++++-------------- cmd/libs/go2idl/deepcopy-gen/main.go | 2 +- docs/devel/api_changes.md | 2 +- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/Makefile b/Makefile index bd7ff6d5cab..0a52c563241 100644 --- a/Makefile +++ b/Makefile @@ -333,24 +333,24 @@ ALL_K8S_TAG_FILES := $(shell \ # scheme # The result file, in each pkg, of deep-copy generation. -DEEP_COPY_BASENAME := $(GENERATED_FILE_PREFIX)deep_copy -DEEP_COPY_FILENAME := $(DEEP_COPY_BASENAME).go +DEEPCOPY_BASENAME := $(GENERATED_FILE_PREFIX)deepcopy +DEEPCOPY_FILENAME := $(DEEPCOPY_BASENAME).go # The tool used to generate deep copies. -DEEP_COPY_GEN := $(BIN_DIR)/deepcopy-gen +DEEPCOPY_GEN := $(BIN_DIR)/deepcopy-gen # Find all the directories that request deep-copy generation. ifeq ($(DBG_MAKEFILE),1) $(warning ***** finding all +k8s:deepcopy-gen tags) endif -DEEP_COPY_DIRS := $(shell \ +DEEPCOPY_DIRS := $(shell \ grep -l '+k8s:deepcopy-gen=' $(ALL_K8S_TAG_FILES) \ | xargs dirname \ | sort -u \ ) -DEEP_COPY_FILES := $(addsuffix /$(DEEP_COPY_FILENAME), $(DEEP_COPY_DIRS)) +DEEPCOPY_FILES := $(addsuffix /$(DEEPCOPY_FILENAME), $(DEEPCOPY_DIRS)) -# For each dir in DEEP_COPY_DIRS, this establishes a dependency between the +# For each dir in DEEPCOPY_DIRS, this establishes a dependency between the # output file and the input files that should trigger a rebuild. # # Note that this is a deps-only statement, not a full rule (see below). This @@ -362,25 +362,25 @@ DEEP_COPY_FILES := $(addsuffix /$(DEEP_COPY_FILENAME), $(DEEP_COPY_DIRS)) # # We depend on the $(GOFILES_META).stamp to detect when the set of input files # has changed. This allows us to detect deleted input files. -$(foreach dir, $(DEEP_COPY_DIRS), $(eval \ - $(dir)/$(DEEP_COPY_FILENAME): $(META_DIR)/$(dir)/$(GOFILES_META).stamp \ - $(gofiles__$(dir)) \ +$(foreach dir, $(DEEPCOPY_DIRS), $(eval \ + $(dir)/$(DEEPCOPY_FILENAME): $(META_DIR)/$(dir)/$(GOFILES_META).stamp \ + $(gofiles__$(dir)) \ )) # How to regenerate deep-copy code. -$(DEEP_COPY_FILES): $(DEEP_COPY_GEN) - @$(DEEP_COPY_GEN) \ - -i $(PRJ_SRC_PATH)/$$(dirname $@) \ - --bounding-dirs $(PRJ_SRC_PATH) \ - -O $(DEEP_COPY_BASENAME) +$(DEEPCOPY_FILES): $(DEEPCOPY_GEN) + @$(DEEPCOPY_GEN) \ + -i $(PRJ_SRC_PATH)/$$(dirname $@) \ + --bounding-dirs $(PRJ_SRC_PATH) \ + -O $(DEEPCOPY_BASENAME) # This calculates the dependencies for the generator tool, so we only rebuild # it when needed. It is PHONY so that it always runs, but it only updates the # file if the contents have actually changed. We 'sinclude' this later. -.PHONY: $(META_DIR)/$(DEEP_COPY_GEN).mk -$(META_DIR)/$(DEEP_COPY_GEN).mk: +.PHONY: $(META_DIR)/$(DEEPCOPY_GEN).mk +$(META_DIR)/$(DEEPCOPY_GEN).mk: @mkdir -p $(@D); \ - (echo -n "$(DEEP_COPY_GEN): "; \ + (echo -n "$(DEEPCOPY_GEN): "; \ DIRECT=$$(go list -e -f '{{.Dir}} {{.Dir}}/*.go' \ ./cmd/libs/go2idl/deepcopy-gen); \ INDIRECT=$$(go list -e \ @@ -394,10 +394,10 @@ $(META_DIR)/$(DEEP_COPY_GEN).mk: # Include dependency info for the generator tool. This will cause the rule of # the same name to be considered and if it is updated, make will restart. -sinclude $(META_DIR)/$(DEEP_COPY_GEN).mk +sinclude $(META_DIR)/$(DEEPCOPY_GEN).mk # How to build the generator tool. The deps for this are defined in -# the $(DEEP_COPY_GEN).mk, above. +# the $(DEEPCOPY_GEN).mk, above. # # A word on the need to touch: This rule might trigger if, for example, a # non-Go file was added or deleted from a directory on which this depends. @@ -405,7 +405,7 @@ sinclude $(META_DIR)/$(DEEP_COPY_GEN).mk # have to be rebuilt. In that case, make will forever see the dependency as # newer than the binary, and try to rebuild it over and over. So we touch it, # and make is happy. -$(DEEP_COPY_GEN): +$(DEEPCOPY_GEN): @hack/make-rules/build.sh cmd/libs/go2idl/deepcopy-gen @touch $@ @@ -576,4 +576,4 @@ $(CONVERSION_GEN): # This rule collects all the generated file sets into a single dep, which is # defined BELOW the *_FILES variables and leaves higher-level rules clean. -generated_files: $(DEEP_COPY_FILES) $(CONVERSION_FILES) +generated_files: $(DEEPCOPY_FILES) $(CONVERSION_FILES) diff --git a/cmd/libs/go2idl/deepcopy-gen/main.go b/cmd/libs/go2idl/deepcopy-gen/main.go index b89580d4d3f..057bdc76fb8 100644 --- a/cmd/libs/go2idl/deepcopy-gen/main.go +++ b/cmd/libs/go2idl/deepcopy-gen/main.go @@ -59,7 +59,7 @@ func main() { arguments := args.Default() // Override defaults. - arguments.OutputFileBaseName = "deep_copy_generated" + arguments.OutputFileBaseName = "deepcopy_generated" // Custom args. customArgs := &generators.CustomArgs{} diff --git a/docs/devel/api_changes.md b/docs/devel/api_changes.md index 35d7a545cb6..57787c723f8 100644 --- a/docs/devel/api_changes.md +++ b/docs/devel/api_changes.md @@ -470,7 +470,7 @@ hack/update-codegen.sh 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: - - `/zz_generated.deep_copy.go` containing auto-generated copy functions + - `/zz_generated.deepcopy.go` containing auto-generated copy functions 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 From 08546e5016fa30e61c3495ef519446d15d96baa7 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Sat, 4 Jun 2016 22:50:30 -0700 Subject: [PATCH 12/18] Run code-gen in a batch This makes code generation MUCH MUCH faster. --- Makefile | 47 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 0a52c563241..d0dd0efae29 100644 --- a/Makefile +++ b/Makefile @@ -350,6 +350,17 @@ DEEPCOPY_DIRS := $(shell \ ) DEEPCOPY_FILES := $(addsuffix /$(DEEPCOPY_FILENAME), $(DEEPCOPY_DIRS)) +# This rule aggregates the set of files to generate and then generates them all +# in a single run of the tool. +.PHONY: gen_deepcopy +gen_deepcopy: $(DEEPCOPY_FILES) + @if [[ -f $(META_DIR)/$(DEEPCOPY_GEN).todo ]]; then \ + $(DEEPCOPY_GEN) \ + -i $$(cat $(META_DIR)/$(DEEPCOPY_GEN).todo | paste -sd,) \ + --bounding-dirs $(PRJ_SRC_PATH) \ + -O $(DEEPCOPY_BASENAME); \ + fi + # For each dir in DEEPCOPY_DIRS, this establishes a dependency between the # output file and the input files that should trigger a rebuild. # @@ -367,12 +378,13 @@ $(foreach dir, $(DEEPCOPY_DIRS), $(eval \ $(gofiles__$(dir)) \ )) -# How to regenerate deep-copy code. +# Unilaterally remove any leftovers from previous runs. +$(shell rm -f $(META_DIR)/$(DEEPCOPY_GEN)*.todo) + +# How to regenerate deep-copy code. This is a little slow to run, so we batch +# it up and trigger the batch from the 'generated_files' target. $(DEEPCOPY_FILES): $(DEEPCOPY_GEN) - @$(DEEPCOPY_GEN) \ - -i $(PRJ_SRC_PATH)/$$(dirname $@) \ - --bounding-dirs $(PRJ_SRC_PATH) \ - -O $(DEEPCOPY_BASENAME) + @echo $(PRJ_SRC_PATH)/$(@D) >> $(META_DIR)/$(DEEPCOPY_GEN).todo # This calculates the dependencies for the generator tool, so we only rebuild # it when needed. It is PHONY so that it always runs, but it only updates the @@ -448,6 +460,16 @@ CONVERSION_DIRS := $(shell \ CONVERSION_FILES := $(addsuffix /$(CONVERSION_FILENAME), $(CONVERSION_DIRS)) +# This rule aggregates the set of files to generate and then generates them all +# in a single run of the tool. +.PHONY: gen_conversion +gen_conversion: $(CONVERSION_FILES) + @if [[ -f $(META_DIR)/$(CONVERSION_GEN).todo ]]; then \ + $(CONVERSION_GEN) \ + -i $$(cat $(META_DIR)/$(CONVERSION_GEN).todo | paste -sd,) \ + -O $(CONVERSION_BASENAME); \ + fi + # Establish a dependency between the deps file and the dir. Whenever a dir # changes (files added or removed) the deps file will be considered stale. # @@ -532,11 +554,13 @@ $(foreach dir, $(CONVERSION_DIRS), )) \ ) -# How to regenerate conversion code. +# Unilaterally remove any leftovers from previous runs. +$(shell rm -f $(META_DIR)/$(CONVERSION_GEN)*.todo) + +# How to regenerate conversion code. This is a little slow to run, so we batch +# it up and trigger the batch from the 'generated_files' target. $(CONVERSION_FILES): $(CONVERSION_GEN) - @$(CONVERSION_GEN) \ - -i $(PRJ_SRC_PATH)/$(@D) \ - -O $(CONVERSION_BASENAME) + @echo $(PRJ_SRC_PATH)/$(@D) >> $(META_DIR)/$(CONVERSION_GEN).todo # This calculates the dependencies for the generator tool, so we only rebuild # it when needed. It is PHONY so that it always runs, but it only updates the @@ -563,7 +587,6 @@ sinclude $(META_DIR)/$(CONVERSION_GEN).mk # How to build the generator tool. The deps for this are defined in # the $(CONVERSION_GEN).mk, above. # -# # A word on the need to touch: This rule might trigger if, for example, a # non-Go file was added or deleted from a directory on which this depends. # This target needs to be reconsidered, but Go realizes it doesn't actually @@ -576,4 +599,6 @@ $(CONVERSION_GEN): # This rule collects all the generated file sets into a single dep, which is # defined BELOW the *_FILES variables and leaves higher-level rules clean. -generated_files: $(DEEPCOPY_FILES) $(CONVERSION_FILES) +# Top-level rules should depend on this to ensure generated files are rebuilt. +.PHONY: generated_files +generated_files: gen_deepcopy gen_conversion From 23bbf477f863b7723c0afc18927c2a00ce6fac49 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Sun, 5 Jun 2016 21:10:10 -0700 Subject: [PATCH 13/18] Document test procedures for Makefile --- Makefile | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/Makefile b/Makefile index d0dd0efae29..ff5873accb4 100644 --- a/Makefile +++ b/Makefile @@ -241,6 +241,74 @@ cross: # # Code-generation logic. # +# This stuff can be pretty tricky, and there's probably some corner cases that +# we don't handle well. That said, here's a straightforward test to prove that +# the most common cases work. Sadly, it is manual. +# +# make clean +# find . -name .make\* | xargs rm -f +# find . -name zz_generated\* | xargs rm -f +# # verify `find . -name zz_generated.deepcopy.go | wc -l` is 0 +# # verify `find . -name .make | wc -l` is 0 +# +# make nonexistent +# # expect "No rule to make target" +# # verify `find .make/ -type f | wc -l` has many files +# +# make gen_deepcopy +# # expect deepcopy-gen is built exactly once +# # expect many files to be regenerated +# # verify `find . -name zz_generated.deepcopy.go | wc -l` has files +# make gen_deepcopy +# # expect nothing to be rebuilt, finish in O(seconds) +# touch pkg/api/types.go +# make gen_deepcopy +# # expect one file to be regenerated +# make gen_deepcopy +# # expect nothing to be rebuilt, finish in O(seconds) +# touch cmd/libs/go2idl/deepcopy-gen/main.go +# make gen_deepcopy +# # expect deepcopy-gen is built exactly once +# # expect many files to be regenerated +# # verify `find . -name zz_generated.deepcopy.go | wc -l` has files +# make gen_deepcopy +# # expect nothing to be rebuilt, finish in O(seconds) +# +# make gen_conversion +# # expect conversion-gen is built exactly once +# # expect many files to be regenerated +# # verify `find . -name zz_generated.conversion.go | wc -l` has files +# make gen_conversion +# # expect nothing to be rebuilt, finish in O(seconds) +# touch pkg/api/types.go +# make gen_conversion +# # expect one file to be regenerated +# make gen_conversion +# # expect nothing to be rebuilt, finish in O(seconds) +# touch cmd/libs/go2idl/conversion-gen/main.go +# make gen_conversion +# # expect conversion-gen is built exactly once +# # expect many files to be regenerated +# # verify `find . -name zz_generated.conversion.go | wc -l` has files +# make gen_conversion +# # expect nothing to be rebuilt, finish in O(seconds) +# +# make all +# # expect it to build +# +# make test +# # expect it to pass +# +# make clean +# # verify `find . -name zz_generated.deepcopy.go | wc -l` is 0 +# # verify `find . -name .make | wc -l` is 0 +# +# make all WHAT=cmd/kube-proxy +# # expect it to build +# +# make clean +# make test WHAT=cmd/kube-proxy +# # expect it to pass # This variable holds a list of every directory that contains Go files in this # project. Other rules and variables can use this as a starting point to From 6e516e1c8a884148e935fa133d118217ec268a39 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Tue, 7 Jun 2016 22:04:54 -0700 Subject: [PATCH 14/18] make Jenkins pass --- Makefile | 6 +++--- test/e2e_node/jenkins/e2e-node-jenkins.sh | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index ff5873accb4..fd2c9ba3b09 100644 --- a/Makefile +++ b/Makefile @@ -329,7 +329,7 @@ ALL_GO_DIRS := $(shell \ \) \ -type f -name \*.go \ | sed 's|^./||' \ - | xargs dirname \ + | xargs -n1 dirname \ | sort -u \ ) @@ -413,7 +413,7 @@ ifeq ($(DBG_MAKEFILE),1) endif DEEPCOPY_DIRS := $(shell \ grep -l '+k8s:deepcopy-gen=' $(ALL_K8S_TAG_FILES) \ - | xargs dirname \ + | xargs -n1 dirname \ | sort -u \ ) DEEPCOPY_FILES := $(addsuffix /$(DEEPCOPY_FILENAME), $(DEEPCOPY_DIRS)) @@ -522,7 +522,7 @@ endif CONVERSION_DIRS := $(shell \ grep '^// *+k8s:conversion-gen=' $(ALL_K8S_TAG_FILES) \ | cut -f1 -d: \ - | xargs dirname \ + | xargs -n1 dirname \ | sort -u \ ) diff --git a/test/e2e_node/jenkins/e2e-node-jenkins.sh b/test/e2e_node/jenkins/e2e-node-jenkins.sh index 31bce7561ac..02ad86e333f 100755 --- a/test/e2e_node/jenkins/e2e-node-jenkins.sh +++ b/test/e2e_node/jenkins/e2e-node-jenkins.sh @@ -28,6 +28,7 @@ set -x . $1 +make generated_files go build test/e2e_node/environment/conformance.go WORKSPACE=${WORKSPACE:-"/tmp/"} From f0ef7268137bf4fafb6c1fec79c040330d5ac18f Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Wed, 8 Jun 2016 23:01:34 -0700 Subject: [PATCH 15/18] Make debugging Makefile a bit easier --- Makefile | 58 ++++++++++++++++++++++++++++++-------------------------- 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/Makefile b/Makefile index fd2c9ba3b09..45575275188 100644 --- a/Makefile +++ b/Makefile @@ -16,8 +16,12 @@ 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. # # Commonly used targets (see each target for more information): @@ -74,7 +78,7 @@ export KUBE_GOLDFLAGS GOLDFLAGS # make all WHAT=cmd/kubelet GOFLAGS=-v .PHONY: all all: generated_files - @hack/make-rules/build.sh $(WHAT) + hack/make-rules/build.sh $(WHAT) # Build ginkgo # @@ -94,7 +98,7 @@ ginkgo: # make verify BRANCH=branch_x .PHONY: verify verify: - @KUBE_VERIFY_GIT_BRANCH=$(BRANCH) hack/make-rules/verify.sh -v + KUBE_VERIFY_GIT_BRANCH=$(BRANCH) hack/make-rules/verify.sh -v # Build and run tests. # @@ -111,7 +115,7 @@ verify: # make check WHAT=pkg/kubelet GOFLAGS=-v .PHONY: check test check test: generated_files - @hack/make-rules/test.sh $(WHAT) $(TESTS) + hack/make-rules/test.sh $(WHAT) $(TESTS) # Build and run integration tests. # @@ -119,7 +123,7 @@ check test: generated_files # make test-integration .PHONY: test-integration test-integration: generated_files - @hack/make-rules/test-integration.sh + hack/make-rules/test-integration.sh # Build and run end-to-end tests. # @@ -127,7 +131,7 @@ test-integration: generated_files # make 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 # Build and run node end-to-end tests. # @@ -164,7 +168,7 @@ test-e2e: ginkgo generated_files # Build and run tests. .PHONY: test-e2e-node test-e2e-node: ginkgo generated_files - @hack/make-rules/test-e2e-node.sh + hack/make-rules/test-e2e-node.sh # Build and run cmdline tests. # @@ -212,7 +216,7 @@ clean_generated: # make vet WHAT=pkg/kubelet .PHONY: vet vet: - @hack/make-rules/vet.sh $(WHAT) + hack/make-rules/vet.sh $(WHAT) # Build a release # @@ -220,7 +224,7 @@ vet: # make release .PHONY: release release: generated_files - @build/release.sh + build/release.sh # Build a release, but skip tests # @@ -228,7 +232,7 @@ release: generated_files # make release-skip-tests .PHONY: release-skip-tests quick-release release-skip-tests quick-release: generated_files - @KUBE_RELEASE_RUN_TESTS=n KUBE_FASTBUILD=true build/release.sh + KUBE_RELEASE_RUN_TESTS=n KUBE_FASTBUILD=true build/release.sh # Cross-compile for all platforms # @@ -236,7 +240,7 @@ release-skip-tests quick-release: generated_files # make cross .PHONY: cross cross: - @hack/make-rules/cross.sh + hack/make-rules/cross.sh # # Code-generation logic. @@ -364,7 +368,7 @@ $(foreach dir, $(ALL_GO_DIRS), $(eval \ # but we only need to rebuild targets if the contents actually changed. That # is what the .stamp file represents. $(foreach dir, $(ALL_GO_DIRS), $(META_DIR)/$(dir)/$(GOFILES_META)): - @FILES=$$(ls $$@.tmp; \ cmp -s $@.tmp $@ || touch $@.stamp; \ @@ -422,7 +426,7 @@ DEEPCOPY_FILES := $(addsuffix /$(DEEPCOPY_FILENAME), $(DEEPCOPY_DIRS)) # in a single run of the tool. .PHONY: gen_deepcopy gen_deepcopy: $(DEEPCOPY_FILES) - @if [[ -f $(META_DIR)/$(DEEPCOPY_GEN).todo ]]; then \ + if [[ -f $(META_DIR)/$(DEEPCOPY_GEN).todo ]]; then \ $(DEEPCOPY_GEN) \ -i $$(cat $(META_DIR)/$(DEEPCOPY_GEN).todo | paste -sd,) \ --bounding-dirs $(PRJ_SRC_PATH) \ @@ -452,14 +456,14 @@ $(shell rm -f $(META_DIR)/$(DEEPCOPY_GEN)*.todo) # How to regenerate deep-copy code. This is a little slow to run, so we batch # it up and trigger the batch from the 'generated_files' target. $(DEEPCOPY_FILES): $(DEEPCOPY_GEN) - @echo $(PRJ_SRC_PATH)/$(@D) >> $(META_DIR)/$(DEEPCOPY_GEN).todo + echo $(PRJ_SRC_PATH)/$(@D) >> $(META_DIR)/$(DEEPCOPY_GEN).todo # This calculates the dependencies for the generator tool, so we only rebuild # it when needed. It is PHONY so that it always runs, but it only updates the # file if the contents have actually changed. We 'sinclude' this later. .PHONY: $(META_DIR)/$(DEEPCOPY_GEN).mk $(META_DIR)/$(DEEPCOPY_GEN).mk: - @mkdir -p $(@D); \ + mkdir -p $(@D); \ (echo -n "$(DEEPCOPY_GEN): "; \ DIRECT=$$(go list -e -f '{{.Dir}} {{.Dir}}/*.go' \ ./cmd/libs/go2idl/deepcopy-gen); \ @@ -486,8 +490,8 @@ sinclude $(META_DIR)/$(DEEPCOPY_GEN).mk # newer than the binary, and try to rebuild it over and over. So we touch it, # and make is happy. $(DEEPCOPY_GEN): - @hack/make-rules/build.sh cmd/libs/go2idl/deepcopy-gen - @touch $@ + hack/make-rules/build.sh cmd/libs/go2idl/deepcopy-gen + touch $@ # # Conversion generation @@ -532,7 +536,7 @@ CONVERSION_FILES := $(addsuffix /$(CONVERSION_FILENAME), $(CONVERSION_DIRS)) # in a single run of the tool. .PHONY: gen_conversion gen_conversion: $(CONVERSION_FILES) - @if [[ -f $(META_DIR)/$(CONVERSION_GEN).todo ]]; then \ + if [[ -f $(META_DIR)/$(CONVERSION_GEN).todo ]]; then \ $(CONVERSION_GEN) \ -i $$(cat $(META_DIR)/$(CONVERSION_GEN).todo | paste -sd,) \ -O $(CONVERSION_BASENAME); \ @@ -563,12 +567,12 @@ $(foreach dir, $(CONVERSION_DIRS), $(eval \ # but we only need to rebuild targets if the contents actually changed. That # is what the .stamp file represents. $(foreach dir, $(CONVERSION_DIRS), $(META_DIR)/$(dir)/$(CONVERSIONS_META)): - @TAGS=$$(grep -h '^// *+k8s:conversion-gen=' $$@.tmp; \ - cmp -s $@.tmp $@ || touch $@.stamp; \ + TAGS=$$(grep -h '^// *+k8s:conversion-gen=' $$@.tmp; \ + cmp -s $@.tmp $@ || touch $@.stamp; \ mv $@.tmp $@ # Include any deps files as additional Makefile rules. This triggers make to @@ -628,14 +632,14 @@ $(shell rm -f $(META_DIR)/$(CONVERSION_GEN)*.todo) # How to regenerate conversion code. This is a little slow to run, so we batch # it up and trigger the batch from the 'generated_files' target. $(CONVERSION_FILES): $(CONVERSION_GEN) - @echo $(PRJ_SRC_PATH)/$(@D) >> $(META_DIR)/$(CONVERSION_GEN).todo + echo $(PRJ_SRC_PATH)/$(@D) >> $(META_DIR)/$(CONVERSION_GEN).todo # This calculates the dependencies for the generator tool, so we only rebuild # it when needed. It is PHONY so that it always runs, but it only updates the # file if the contents have actually changed. We 'sinclude' this later. .PHONY: $(META_DIR)/$(CONVERSION_GEN).mk $(META_DIR)/$(CONVERSION_GEN).mk: - @mkdir -p $(@D); \ + mkdir -p $(@D); \ (echo -n "$(CONVERSION_GEN): "; \ DIRECT=$$(go list -e -f '{{.Dir}} {{.Dir}}/*.go' \ ./cmd/libs/go2idl/conversion-gen); \ @@ -662,8 +666,8 @@ sinclude $(META_DIR)/$(CONVERSION_GEN).mk # newer than the binary, and try to rebuild it over and over. So we touch it, # and make is happy. $(CONVERSION_GEN): - @hack/make-rules/build.sh cmd/libs/go2idl/conversion-gen - @touch $@ + hack/make-rules/build.sh cmd/libs/go2idl/conversion-gen + touch $@ # This rule collects all the generated file sets into a single dep, which is # defined BELOW the *_FILES variables and leaves higher-level rules clean. From 6ee6cc843a95027f78ed83546b898ee7aa1f08b9 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Sun, 12 Jun 2016 14:42:03 -0700 Subject: [PATCH 16/18] Add rules for all cmd/* subdirs This is sort of gravy. There's no good way to do this for arbitrary directories because of the way Make works (we'd have to declare them all PHONY). If people hate using make directly we could wrap it in another level of indirection, but I didn't yet. E.g. build/make-all.sh -> make -> make-rules/all.sh -> go install This would insulate people from 'make' atthe cost of custom build tools. I prefer being able to say 'make' and having it just work. --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Makefile b/Makefile index 45575275188..84c5cc64303 100644 --- a/Makefile +++ b/Makefile @@ -242,6 +242,14 @@ release-skip-tests quick-release: generated_files 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/$@ + # # Code-generation logic. # From 0fc46afda6eaf32c1e746f0f86217b265d39ca86 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Tue, 5 Jul 2016 21:53:18 -0700 Subject: [PATCH 17/18] Move make logic for generated files into a helper This makes it a little easier to look at the main Makefile without getting overwhelmed by code-generation stuff. --- Makefile | 443 +------------------------------------ Makefile.generated_files | 456 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 458 insertions(+), 441 deletions(-) create mode 100644 Makefile.generated_files diff --git a/Makefile b/Makefile index 84c5cc64303..4aa693e01b2 100644 --- a/Makefile +++ b/Makefile @@ -43,7 +43,6 @@ MAKEFLAGS += --warn-undefined-variables OUT_DIR ?= _output BIN_DIR := $(OUT_DIR)/bin PRJ_SRC_PATH := k8s.io/kubernetes -GENERATED_FILE_PREFIX := zz_generated. # Metadata for driving the build lives here. META_DIR := .make @@ -196,14 +195,6 @@ clean: clean_generated clean_meta clean_meta: rm -rf $(META_DIR) -# Remove all auto-generated artifacts. -# -# Example: -# make clean_generated -.PHONY: clean_generated -clean_generated: - find . -type f -name $(GENERATED_FILE_PREFIX)\* | xargs rm -f - # Run 'go vet'. # # Args: @@ -250,435 +241,5 @@ cross: $(notdir $(abspath $(wildcard cmd/*/))): generated_files hack/make-rules/build.sh cmd/$@ -# -# Code-generation logic. -# -# This stuff can be pretty tricky, and there's probably some corner cases that -# we don't handle well. That said, here's a straightforward test to prove that -# the most common cases work. Sadly, it is manual. -# -# make clean -# find . -name .make\* | xargs rm -f -# find . -name zz_generated\* | xargs rm -f -# # verify `find . -name zz_generated.deepcopy.go | wc -l` is 0 -# # verify `find . -name .make | wc -l` is 0 -# -# make nonexistent -# # expect "No rule to make target" -# # verify `find .make/ -type f | wc -l` has many files -# -# make gen_deepcopy -# # expect deepcopy-gen is built exactly once -# # expect many files to be regenerated -# # verify `find . -name zz_generated.deepcopy.go | wc -l` has files -# make gen_deepcopy -# # expect nothing to be rebuilt, finish in O(seconds) -# touch pkg/api/types.go -# make gen_deepcopy -# # expect one file to be regenerated -# make gen_deepcopy -# # expect nothing to be rebuilt, finish in O(seconds) -# touch cmd/libs/go2idl/deepcopy-gen/main.go -# make gen_deepcopy -# # expect deepcopy-gen is built exactly once -# # expect many files to be regenerated -# # verify `find . -name zz_generated.deepcopy.go | wc -l` has files -# make gen_deepcopy -# # expect nothing to be rebuilt, finish in O(seconds) -# -# make gen_conversion -# # expect conversion-gen is built exactly once -# # expect many files to be regenerated -# # verify `find . -name zz_generated.conversion.go | wc -l` has files -# make gen_conversion -# # expect nothing to be rebuilt, finish in O(seconds) -# touch pkg/api/types.go -# make gen_conversion -# # expect one file to be regenerated -# make gen_conversion -# # expect nothing to be rebuilt, finish in O(seconds) -# touch cmd/libs/go2idl/conversion-gen/main.go -# make gen_conversion -# # expect conversion-gen is built exactly once -# # expect many files to be regenerated -# # verify `find . -name zz_generated.conversion.go | wc -l` has files -# make gen_conversion -# # expect nothing to be rebuilt, finish in O(seconds) -# -# make all -# # expect it to build -# -# make test -# # expect it to pass -# -# make clean -# # verify `find . -name zz_generated.deepcopy.go | wc -l` is 0 -# # verify `find . -name .make | wc -l` is 0 -# -# make all WHAT=cmd/kube-proxy -# # expect it to build -# -# make clean -# make test WHAT=cmd/kube-proxy -# # expect it to pass - -# This variable holds a list of every directory that contains Go files in this -# project. Other rules and variables can use this as a starting point to -# reduce filesystem accesses. -ifeq ($(DBG_MAKEFILE),1) - $(warning ***** finding all *.go dirs) -endif -ALL_GO_DIRS := $(shell \ - find . \ - -not \( \ - \( \ - -path ./vendor -o \ - -path ./_\* -o \ - -path ./.\* -o \ - -path ./docs -o \ - -path ./examples \ - \) -prune \ - \) \ - -type f -name \*.go \ - | sed 's|^./||' \ - | xargs -n1 dirname \ - | sort -u \ -) - -# The name of the make metadata file listing Go files. -GOFILES_META := gofiles.mk - -# Establish a dependency between the deps file and the dir. Whenever a dir -# changes (files added or removed) the deps file will be considered stale. -# -# The variable value was set in $(GOFILES_META) and included as part of the -# dependency management logic. -# -# This is looser than we really need (e.g. we don't really care about non *.go -# files or even *_test.go files), but this is much easier to represent. -# -# Because we 'sinclude' the deps file, it is considered for rebuilding, as part -# of make's normal evaluation. If it gets rebuilt, make will restart. -# -# The '$(eval)' is needed because this has a different RHS for each LHS, and -# would otherwise produce results that make can't parse. -$(foreach dir, $(ALL_GO_DIRS), $(eval \ - $(META_DIR)/$(dir)/$(GOFILES_META): $(dir) \ -)) - -# How to rebuild a deps file. When make determines that the deps file is stale -# (see above), it executes this rule, and then re-loads the deps file. -# -# This is looser than we really need (e.g. we don't really care about test -# files), but this is MUCH faster than calling `go list`. -# -# We regenerate the output file in order to satisfy make's "newer than" rules, -# but we only need to rebuild targets if the contents actually changed. That -# is what the .stamp file represents. -$(foreach dir, $(ALL_GO_DIRS), $(META_DIR)/$(dir)/$(GOFILES_META)): - FILES=$$(ls $$@.tmp; \ - cmp -s $@.tmp $@ || touch $@.stamp; \ - mv $@.tmp $@ - -# Include any deps files as additional Makefile rules. This triggers make to -# consider the deps files for rebuild, which makes the whole -# dependency-management logic work. 'sinclude' is "silent include" which does -# not fail if the file does not exist. -$(foreach dir, $(ALL_GO_DIRS), $(eval \ - sinclude $(META_DIR)/$(dir)/$(GOFILES_META) \ -)) - -# Generate a list of all files that have a `+k8s:` comment-tag. This will be -# used to derive lists of files/dirs for generation tools. -ifeq ($(DBG_MAKEFILE),1) - $(warning ***** finding all +k8s: tags) -endif -ALL_K8S_TAG_FILES := $(shell \ - find $(ALL_GO_DIRS) -maxdepth 1 -type f -name \*.go \ - | xargs grep -l '^// *+k8s:' \ -) - -# -# Deep-copy generation -# -# Any package that wants deep-copy functions generated must include a -# comment-tag in column 0 of one file of the form: -# // +k8s:deepcopy-gen= -# -# The may be one of: -# generate: generate deep-copy functions into the package -# register: generate deep-copy functions and register them with a -# scheme - -# The result file, in each pkg, of deep-copy generation. -DEEPCOPY_BASENAME := $(GENERATED_FILE_PREFIX)deepcopy -DEEPCOPY_FILENAME := $(DEEPCOPY_BASENAME).go - -# The tool used to generate deep copies. -DEEPCOPY_GEN := $(BIN_DIR)/deepcopy-gen - -# Find all the directories that request deep-copy generation. -ifeq ($(DBG_MAKEFILE),1) - $(warning ***** finding all +k8s:deepcopy-gen tags) -endif -DEEPCOPY_DIRS := $(shell \ - grep -l '+k8s:deepcopy-gen=' $(ALL_K8S_TAG_FILES) \ - | xargs -n1 dirname \ - | sort -u \ -) -DEEPCOPY_FILES := $(addsuffix /$(DEEPCOPY_FILENAME), $(DEEPCOPY_DIRS)) - -# This rule aggregates the set of files to generate and then generates them all -# in a single run of the tool. -.PHONY: gen_deepcopy -gen_deepcopy: $(DEEPCOPY_FILES) - if [[ -f $(META_DIR)/$(DEEPCOPY_GEN).todo ]]; then \ - $(DEEPCOPY_GEN) \ - -i $$(cat $(META_DIR)/$(DEEPCOPY_GEN).todo | paste -sd,) \ - --bounding-dirs $(PRJ_SRC_PATH) \ - -O $(DEEPCOPY_BASENAME); \ - fi - -# For each dir in DEEPCOPY_DIRS, this establishes a dependency between the -# output file and the input files that should trigger a rebuild. -# -# Note that this is a deps-only statement, not a full rule (see below). This -# has to be done in a distinct step because wildcards don't work in static -# pattern rules. -# -# The '$(eval)' is needed because this has a different RHS for each LHS, and -# would otherwise produce results that make can't parse. -# -# We depend on the $(GOFILES_META).stamp to detect when the set of input files -# has changed. This allows us to detect deleted input files. -$(foreach dir, $(DEEPCOPY_DIRS), $(eval \ - $(dir)/$(DEEPCOPY_FILENAME): $(META_DIR)/$(dir)/$(GOFILES_META).stamp \ - $(gofiles__$(dir)) \ -)) - -# Unilaterally remove any leftovers from previous runs. -$(shell rm -f $(META_DIR)/$(DEEPCOPY_GEN)*.todo) - -# How to regenerate deep-copy code. This is a little slow to run, so we batch -# it up and trigger the batch from the 'generated_files' target. -$(DEEPCOPY_FILES): $(DEEPCOPY_GEN) - echo $(PRJ_SRC_PATH)/$(@D) >> $(META_DIR)/$(DEEPCOPY_GEN).todo - -# This calculates the dependencies for the generator tool, so we only rebuild -# it when needed. It is PHONY so that it always runs, but it only updates the -# file if the contents have actually changed. We 'sinclude' this later. -.PHONY: $(META_DIR)/$(DEEPCOPY_GEN).mk -$(META_DIR)/$(DEEPCOPY_GEN).mk: - mkdir -p $(@D); \ - (echo -n "$(DEEPCOPY_GEN): "; \ - DIRECT=$$(go list -e -f '{{.Dir}} {{.Dir}}/*.go' \ - ./cmd/libs/go2idl/deepcopy-gen); \ - INDIRECT=$$(go list -e \ - -f '{{range .Deps}}{{.}}{{"\n"}}{{end}}' \ - ./cmd/libs/go2idl/deepcopy-gen \ - | grep "^$(PRJ_SRC_PATH)" \ - | xargs go list -e -f '{{.Dir}} {{.Dir}}/*.go'); \ - echo $$DIRECT $$INDIRECT | sed 's/ / \\\n\t/g'; \ - ) | sed "s|$$(pwd -P)/||" > $@.tmp; \ - cmp -s $@.tmp $@ || cat $@.tmp > $@ && rm -f $@.tmp - -# Include dependency info for the generator tool. This will cause the rule of -# the same name to be considered and if it is updated, make will restart. -sinclude $(META_DIR)/$(DEEPCOPY_GEN).mk - -# How to build the generator tool. The deps for this are defined in -# the $(DEEPCOPY_GEN).mk, above. -# -# A word on the need to touch: This rule might trigger if, for example, a -# non-Go file was added or deleted from a directory on which this depends. -# This target needs to be reconsidered, but Go realizes it doesn't actually -# have to be rebuilt. In that case, make will forever see the dependency as -# newer than the binary, and try to rebuild it over and over. So we touch it, -# and make is happy. -$(DEEPCOPY_GEN): - hack/make-rules/build.sh cmd/libs/go2idl/deepcopy-gen - touch $@ - -# -# Conversion generation -# -# Any package that wants conversion functions generated must include one or -# more comment-tags in any .go file, in column 0, of the form: -# // +k8s:conversion-gen= -# -# The CONVERSION_TARGET_DIR is a project-local path to another directory which -# should be considered when evaluating peer types for conversions. Types which -# are found in the source package (where conversions are being generated) -# but do not have a peer in one of the target directories will not have -# conversions generated. -# -# TODO: it might be better in the long term to make peer-types explicit in the -# IDL. - -# The result file, in each pkg, of conversion generation. -CONVERSION_BASENAME := $(GENERATED_FILE_PREFIX)conversion -CONVERSION_FILENAME := $(CONVERSION_BASENAME).go - -# The tool used to generate conversions. -CONVERSION_GEN := $(BIN_DIR)/conversion-gen - -# The name of the make metadata file controlling conversions. -CONVERSIONS_META := conversions.mk - -# All directories that request any form of conversion generation. -ifeq ($(DBG_MAKEFILE),1) - $(warning ***** finding all +k8s:conversion-gen tags) -endif -CONVERSION_DIRS := $(shell \ - grep '^// *+k8s:conversion-gen=' $(ALL_K8S_TAG_FILES) \ - | cut -f1 -d: \ - | xargs -n1 dirname \ - | sort -u \ -) - -CONVERSION_FILES := $(addsuffix /$(CONVERSION_FILENAME), $(CONVERSION_DIRS)) - -# This rule aggregates the set of files to generate and then generates them all -# in a single run of the tool. -.PHONY: gen_conversion -gen_conversion: $(CONVERSION_FILES) - if [[ -f $(META_DIR)/$(CONVERSION_GEN).todo ]]; then \ - $(CONVERSION_GEN) \ - -i $$(cat $(META_DIR)/$(CONVERSION_GEN).todo | paste -sd,) \ - -O $(CONVERSION_BASENAME); \ - fi - -# Establish a dependency between the deps file and the dir. Whenever a dir -# changes (files added or removed) the deps file will be considered stale. -# -# This is looser than we really need (e.g. we don't really care about non *.go -# files or even *_test.go files), but this is much easier to represent. -# -# Because we 'sinclude' the deps file, it is considered for rebuilding, as part -# of make's normal evaluation. If it gets rebuilt, make will restart. -# -# The '$(eval)' is needed because this has a different RHS for each LHS, and -# would otherwise produce results that make can't parse. -$(foreach dir, $(CONVERSION_DIRS), $(eval \ - $(META_DIR)/$(dir)/$(CONVERSIONS_META): $(dir) \ -)) - -# How to rebuild a deps file. When make determines that the deps file is stale -# (see above), it executes this rule, and then re-loads the deps file. -# -# This is looser than we really need (e.g. we don't really care about test -# files), but this is MUCH faster than calling `go list`. -# -# We regenerate the output file in order to satisfy make's "newer than" rules, -# but we only need to rebuild targets if the contents actually changed. That -# is what the .stamp file represents. -$(foreach dir, $(CONVERSION_DIRS), $(META_DIR)/$(dir)/$(CONVERSIONS_META)): - TAGS=$$(grep -h '^// *+k8s:conversion-gen=' $$@.tmp; \ - cmp -s $@.tmp $@ || touch $@.stamp; \ - mv $@.tmp $@ - -# Include any deps files as additional Makefile rules. This triggers make to -# consider the deps files for rebuild, which makes the whole -# dependency-management logic work. 'sinclude' is "silent include" which does -# not fail if the file does not exist. -$(foreach dir, $(CONVERSION_DIRS), $(eval \ - sinclude $(META_DIR)/$(dir)/$(CONVERSIONS_META) \ -)) - -# For each dir in CONVERSION_DIRS, this establishes a dependency between the -# output file and the input files that should trigger a rebuild. -# -# The variable value was set in $(GOFILES_META) and included as part of the -# dependency management logic. -# -# Note that this is a deps-only statement, not a full rule (see below). This -# has to be done in a distinct step because wildcards don't work in static -# pattern rules. -# -# The '$(eval)' is needed because this has a different RHS for each LHS, and -# would otherwise produce results that make can't parse. -# -# We depend on the $(GOFILES_META).stamp to detect when the set of input files -# has changed. This allows us to detect deleted input files. -$(foreach dir, $(CONVERSION_DIRS), $(eval \ - $(dir)/$(CONVERSION_FILENAME): $(META_DIR)/$(dir)/$(GOFILES_META).stamp \ - $(gofiles__$(dir)) \ -)) - -# For each dir in CONVERSION_DIRS, for each target in $(conversions__$(dir)), -# this establishes a dependency between the output file and the input files -# that should trigger a rebuild. -# -# The variable value was set in $(GOFILES_META) and included as part of the -# dependency management logic. -# -# Note that this is a deps-only statement, not a full rule (see below). This -# has to be done in a distinct step because wildcards don't work in static -# pattern rules. -# -# The '$(eval)' is needed because this has a different RHS for each LHS, and -# would otherwise produce results that make can't parse. -# -# We depend on the $(GOFILES_META).stamp to detect when the set of input files -# has changed. This allows us to detect deleted input files. -$(foreach dir, $(CONVERSION_DIRS), \ - $(foreach tgt, $(conversions__$(dir)), $(eval \ - $(dir)/$(CONVERSION_FILENAME): $(META_DIR)/$(tgt)/$(GOFILES_META).stamp \ - $(gofiles__$(tgt)) \ - )) \ -) - -# Unilaterally remove any leftovers from previous runs. -$(shell rm -f $(META_DIR)/$(CONVERSION_GEN)*.todo) - -# How to regenerate conversion code. This is a little slow to run, so we batch -# it up and trigger the batch from the 'generated_files' target. -$(CONVERSION_FILES): $(CONVERSION_GEN) - echo $(PRJ_SRC_PATH)/$(@D) >> $(META_DIR)/$(CONVERSION_GEN).todo - -# This calculates the dependencies for the generator tool, so we only rebuild -# it when needed. It is PHONY so that it always runs, but it only updates the -# file if the contents have actually changed. We 'sinclude' this later. -.PHONY: $(META_DIR)/$(CONVERSION_GEN).mk -$(META_DIR)/$(CONVERSION_GEN).mk: - mkdir -p $(@D); \ - (echo -n "$(CONVERSION_GEN): "; \ - DIRECT=$$(go list -e -f '{{.Dir}} {{.Dir}}/*.go' \ - ./cmd/libs/go2idl/conversion-gen); \ - INDIRECT=$$(go list -e \ - -f '{{range .Deps}}{{.}}{{"\n"}}{{end}}' \ - ./cmd/libs/go2idl/conversion-gen \ - | grep "^$(PRJ_SRC_PATH)" \ - | xargs go list -e -f '{{.Dir}} {{.Dir}}/*.go'); \ - echo $$DIRECT $$INDIRECT | sed 's/ / \\\n\t/g'; \ - ) | sed "s|$$(pwd -P)/||" > $@.tmp; \ - cmp -s $@.tmp $@ || cat $@.tmp > $@ && rm -f $@.tmp - -# Include dependency info for the generator tool. This will cause the rule of -# the same name to be considered and if it is updated, make will restart. -sinclude $(META_DIR)/$(CONVERSION_GEN).mk - -# How to build the generator tool. The deps for this are defined in -# the $(CONVERSION_GEN).mk, above. -# -# A word on the need to touch: This rule might trigger if, for example, a -# non-Go file was added or deleted from a directory on which this depends. -# This target needs to be reconsidered, but Go realizes it doesn't actually -# have to be rebuilt. In that case, make will forever see the dependency as -# newer than the binary, and try to rebuild it over and over. So we touch it, -# and make is happy. -$(CONVERSION_GEN): - hack/make-rules/build.sh cmd/libs/go2idl/conversion-gen - touch $@ - -# This rule collects all the generated file sets into a single dep, which is -# defined BELOW the *_FILES variables and leaves higher-level rules clean. -# Top-level rules should depend on this to ensure generated files are rebuilt. -.PHONY: generated_files -generated_files: gen_deepcopy gen_conversion +# Include logic for generated files. +include Makefile.generated_files diff --git a/Makefile.generated_files b/Makefile.generated_files new file mode 100644 index 00000000000..cddfc94ea22 --- /dev/null +++ b/Makefile.generated_files @@ -0,0 +1,456 @@ +# 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. + +# Constants used throughout. +GENERATED_FILE_PREFIX := zz_generated. + +# Code-generation logic. +# +# This stuff can be pretty tricky, and there's probably some corner cases that +# we don't handle well. That said, here's a straightforward test to prove that +# the most common cases work. Sadly, it is manual. +# +# make clean +# find . -name .make\* | xargs rm -f +# find . -name zz_generated\* | xargs rm -f +# # verify `find . -name zz_generated.deepcopy.go | wc -l` is 0 +# # verify `find . -name .make | wc -l` is 0 +# +# make nonexistent +# # expect "No rule to make target" +# # verify `find .make/ -type f | wc -l` has many files +# +# make gen_deepcopy +# # expect deepcopy-gen is built exactly once +# # expect many files to be regenerated +# # verify `find . -name zz_generated.deepcopy.go | wc -l` has files +# make gen_deepcopy +# # expect nothing to be rebuilt, finish in O(seconds) +# touch pkg/api/types.go +# make gen_deepcopy +# # expect one file to be regenerated +# make gen_deepcopy +# # expect nothing to be rebuilt, finish in O(seconds) +# touch cmd/libs/go2idl/deepcopy-gen/main.go +# make gen_deepcopy +# # expect deepcopy-gen is built exactly once +# # expect many files to be regenerated +# # verify `find . -name zz_generated.deepcopy.go | wc -l` has files +# make gen_deepcopy +# # expect nothing to be rebuilt, finish in O(seconds) +# +# make gen_conversion +# # expect conversion-gen is built exactly once +# # expect many files to be regenerated +# # verify `find . -name zz_generated.conversion.go | wc -l` has files +# make gen_conversion +# # expect nothing to be rebuilt, finish in O(seconds) +# touch pkg/api/types.go +# make gen_conversion +# # expect one file to be regenerated +# make gen_conversion +# # expect nothing to be rebuilt, finish in O(seconds) +# touch cmd/libs/go2idl/conversion-gen/main.go +# make gen_conversion +# # expect conversion-gen is built exactly once +# # expect many files to be regenerated +# # verify `find . -name zz_generated.conversion.go | wc -l` has files +# make gen_conversion +# # expect nothing to be rebuilt, finish in O(seconds) +# +# make all +# # expect it to build +# +# make test +# # expect it to pass +# +# make clean +# # verify `find . -name zz_generated.deepcopy.go | wc -l` is 0 +# # verify `find . -name .make | wc -l` is 0 +# +# make all WHAT=cmd/kube-proxy +# # expect it to build +# +# make clean +# make test WHAT=cmd/kube-proxy +# # expect it to pass + +# This variable holds a list of every directory that contains Go files in this +# project. Other rules and variables can use this as a starting point to +# reduce filesystem accesses. +ifeq ($(DBG_MAKEFILE),1) + $(warning ***** finding all *.go dirs) +endif +ALL_GO_DIRS := $(shell \ + find . \ + -not \( \ + \( \ + -path ./vendor -o \ + -path ./_\* -o \ + -path ./.\* -o \ + -path ./docs -o \ + -path ./examples \ + \) -prune \ + \) \ + -type f -name \*.go \ + | sed 's|^./||' \ + | xargs -n1 dirname \ + | sort -u \ +) + +# The name of the make metadata file listing Go files. +GOFILES_META := gofiles.mk + +# Establish a dependency between the deps file and the dir. Whenever a dir +# changes (files added or removed) the deps file will be considered stale. +# +# The variable value was set in $(GOFILES_META) and included as part of the +# dependency management logic. +# +# This is looser than we really need (e.g. we don't really care about non *.go +# files or even *_test.go files), but this is much easier to represent. +# +# Because we 'sinclude' the deps file, it is considered for rebuilding, as part +# of make's normal evaluation. If it gets rebuilt, make will restart. +# +# The '$(eval)' is needed because this has a different RHS for each LHS, and +# would otherwise produce results that make can't parse. +$(foreach dir, $(ALL_GO_DIRS), $(eval \ + $(META_DIR)/$(dir)/$(GOFILES_META): $(dir) \ +)) + +# How to rebuild a deps file. When make determines that the deps file is stale +# (see above), it executes this rule, and then re-loads the deps file. +# +# This is looser than we really need (e.g. we don't really care about test +# files), but this is MUCH faster than calling `go list`. +# +# We regenerate the output file in order to satisfy make's "newer than" rules, +# but we only need to rebuild targets if the contents actually changed. That +# is what the .stamp file represents. +$(foreach dir, $(ALL_GO_DIRS), $(META_DIR)/$(dir)/$(GOFILES_META)): + FILES=$$(ls $$@.tmp; \ + cmp -s $@.tmp $@ || touch $@.stamp; \ + mv $@.tmp $@ + +# Include any deps files as additional Makefile rules. This triggers make to +# consider the deps files for rebuild, which makes the whole +# dependency-management logic work. 'sinclude' is "silent include" which does +# not fail if the file does not exist. +$(foreach dir, $(ALL_GO_DIRS), $(eval \ + sinclude $(META_DIR)/$(dir)/$(GOFILES_META) \ +)) + +# Generate a list of all files that have a `+k8s:` comment-tag. This will be +# used to derive lists of files/dirs for generation tools. +ifeq ($(DBG_MAKEFILE),1) + $(warning ***** finding all +k8s: tags) +endif +ALL_K8S_TAG_FILES := $(shell \ + find $(ALL_GO_DIRS) -maxdepth 1 -type f -name \*.go \ + | xargs grep -l '^// *+k8s:' \ +) + +# +# Deep-copy generation +# +# Any package that wants deep-copy functions generated must include a +# comment-tag in column 0 of one file of the form: +# // +k8s:deepcopy-gen= +# +# The may be one of: +# generate: generate deep-copy functions into the package +# register: generate deep-copy functions and register them with a +# scheme + +# The result file, in each pkg, of deep-copy generation. +DEEPCOPY_BASENAME := $(GENERATED_FILE_PREFIX)deepcopy +DEEPCOPY_FILENAME := $(DEEPCOPY_BASENAME).go + +# The tool used to generate deep copies. +DEEPCOPY_GEN := $(BIN_DIR)/deepcopy-gen + +# Find all the directories that request deep-copy generation. +ifeq ($(DBG_MAKEFILE),1) + $(warning ***** finding all +k8s:deepcopy-gen tags) +endif +DEEPCOPY_DIRS := $(shell \ + grep -l '+k8s:deepcopy-gen=' $(ALL_K8S_TAG_FILES) \ + | xargs -n1 dirname \ + | sort -u \ +) +DEEPCOPY_FILES := $(addsuffix /$(DEEPCOPY_FILENAME), $(DEEPCOPY_DIRS)) + +# This rule aggregates the set of files to generate and then generates them all +# in a single run of the tool. +.PHONY: gen_deepcopy +gen_deepcopy: $(DEEPCOPY_FILES) + if [[ -f $(META_DIR)/$(DEEPCOPY_GEN).todo ]]; then \ + $(DEEPCOPY_GEN) \ + -i $$(cat $(META_DIR)/$(DEEPCOPY_GEN).todo | paste -sd,) \ + --bounding-dirs $(PRJ_SRC_PATH) \ + -O $(DEEPCOPY_BASENAME); \ + fi + +# For each dir in DEEPCOPY_DIRS, this establishes a dependency between the +# output file and the input files that should trigger a rebuild. +# +# Note that this is a deps-only statement, not a full rule (see below). This +# has to be done in a distinct step because wildcards don't work in static +# pattern rules. +# +# The '$(eval)' is needed because this has a different RHS for each LHS, and +# would otherwise produce results that make can't parse. +# +# We depend on the $(GOFILES_META).stamp to detect when the set of input files +# has changed. This allows us to detect deleted input files. +$(foreach dir, $(DEEPCOPY_DIRS), $(eval \ + $(dir)/$(DEEPCOPY_FILENAME): $(META_DIR)/$(dir)/$(GOFILES_META).stamp \ + $(gofiles__$(dir)) \ +)) + +# Unilaterally remove any leftovers from previous runs. +$(shell rm -f $(META_DIR)/$(DEEPCOPY_GEN)*.todo) + +# How to regenerate deep-copy code. This is a little slow to run, so we batch +# it up and trigger the batch from the 'generated_files' target. +$(DEEPCOPY_FILES): $(DEEPCOPY_GEN) + echo $(PRJ_SRC_PATH)/$(@D) >> $(META_DIR)/$(DEEPCOPY_GEN).todo + +# This calculates the dependencies for the generator tool, so we only rebuild +# it when needed. It is PHONY so that it always runs, but it only updates the +# file if the contents have actually changed. We 'sinclude' this later. +.PHONY: $(META_DIR)/$(DEEPCOPY_GEN).mk +$(META_DIR)/$(DEEPCOPY_GEN).mk: + mkdir -p $(@D); \ + (echo -n "$(DEEPCOPY_GEN): "; \ + DIRECT=$$(go list -e -f '{{.Dir}} {{.Dir}}/*.go' \ + ./cmd/libs/go2idl/deepcopy-gen); \ + INDIRECT=$$(go list -e \ + -f '{{range .Deps}}{{.}}{{"\n"}}{{end}}' \ + ./cmd/libs/go2idl/deepcopy-gen \ + | grep "^$(PRJ_SRC_PATH)" \ + | xargs go list -e -f '{{.Dir}} {{.Dir}}/*.go'); \ + echo $$DIRECT $$INDIRECT | sed 's/ / \\\n\t/g'; \ + ) | sed "s|$$(pwd -P)/||" > $@.tmp; \ + cmp -s $@.tmp $@ || cat $@.tmp > $@ && rm -f $@.tmp + +# Include dependency info for the generator tool. This will cause the rule of +# the same name to be considered and if it is updated, make will restart. +sinclude $(META_DIR)/$(DEEPCOPY_GEN).mk + +# How to build the generator tool. The deps for this are defined in +# the $(DEEPCOPY_GEN).mk, above. +# +# A word on the need to touch: This rule might trigger if, for example, a +# non-Go file was added or deleted from a directory on which this depends. +# This target needs to be reconsidered, but Go realizes it doesn't actually +# have to be rebuilt. In that case, make will forever see the dependency as +# newer than the binary, and try to rebuild it over and over. So we touch it, +# and make is happy. +$(DEEPCOPY_GEN): + hack/make-rules/build.sh cmd/libs/go2idl/deepcopy-gen + touch $@ + +# +# Conversion generation +# +# Any package that wants conversion functions generated must include one or +# more comment-tags in any .go file, in column 0, of the form: +# // +k8s:conversion-gen= +# +# The CONVERSION_TARGET_DIR is a project-local path to another directory which +# should be considered when evaluating peer types for conversions. Types which +# are found in the source package (where conversions are being generated) +# but do not have a peer in one of the target directories will not have +# conversions generated. +# +# TODO: it might be better in the long term to make peer-types explicit in the +# IDL. + +# The result file, in each pkg, of conversion generation. +CONVERSION_BASENAME := $(GENERATED_FILE_PREFIX)conversion +CONVERSION_FILENAME := $(CONVERSION_BASENAME).go + +# The tool used to generate conversions. +CONVERSION_GEN := $(BIN_DIR)/conversion-gen + +# The name of the make metadata file controlling conversions. +CONVERSIONS_META := conversions.mk + +# All directories that request any form of conversion generation. +ifeq ($(DBG_MAKEFILE),1) + $(warning ***** finding all +k8s:conversion-gen tags) +endif +CONVERSION_DIRS := $(shell \ + grep '^// *+k8s:conversion-gen=' $(ALL_K8S_TAG_FILES) \ + | cut -f1 -d: \ + | xargs -n1 dirname \ + | sort -u \ +) + +CONVERSION_FILES := $(addsuffix /$(CONVERSION_FILENAME), $(CONVERSION_DIRS)) + +# This rule aggregates the set of files to generate and then generates them all +# in a single run of the tool. +.PHONY: gen_conversion +gen_conversion: $(CONVERSION_FILES) + if [[ -f $(META_DIR)/$(CONVERSION_GEN).todo ]]; then \ + $(CONVERSION_GEN) \ + -i $$(cat $(META_DIR)/$(CONVERSION_GEN).todo | paste -sd,) \ + -O $(CONVERSION_BASENAME); \ + fi + +# Establish a dependency between the deps file and the dir. Whenever a dir +# changes (files added or removed) the deps file will be considered stale. +# +# This is looser than we really need (e.g. we don't really care about non *.go +# files or even *_test.go files), but this is much easier to represent. +# +# Because we 'sinclude' the deps file, it is considered for rebuilding, as part +# of make's normal evaluation. If it gets rebuilt, make will restart. +# +# The '$(eval)' is needed because this has a different RHS for each LHS, and +# would otherwise produce results that make can't parse. +$(foreach dir, $(CONVERSION_DIRS), $(eval \ + $(META_DIR)/$(dir)/$(CONVERSIONS_META): $(dir) \ +)) + +# How to rebuild a deps file. When make determines that the deps file is stale +# (see above), it executes this rule, and then re-loads the deps file. +# +# This is looser than we really need (e.g. we don't really care about test +# files), but this is MUCH faster than calling `go list`. +# +# We regenerate the output file in order to satisfy make's "newer than" rules, +# but we only need to rebuild targets if the contents actually changed. That +# is what the .stamp file represents. +$(foreach dir, $(CONVERSION_DIRS), $(META_DIR)/$(dir)/$(CONVERSIONS_META)): + TAGS=$$(grep -h '^// *+k8s:conversion-gen=' $$@.tmp; \ + cmp -s $@.tmp $@ || touch $@.stamp; \ + mv $@.tmp $@ + +# Include any deps files as additional Makefile rules. This triggers make to +# consider the deps files for rebuild, which makes the whole +# dependency-management logic work. 'sinclude' is "silent include" which does +# not fail if the file does not exist. +$(foreach dir, $(CONVERSION_DIRS), $(eval \ + sinclude $(META_DIR)/$(dir)/$(CONVERSIONS_META) \ +)) + +# For each dir in CONVERSION_DIRS, this establishes a dependency between the +# output file and the input files that should trigger a rebuild. +# +# The variable value was set in $(GOFILES_META) and included as part of the +# dependency management logic. +# +# Note that this is a deps-only statement, not a full rule (see below). This +# has to be done in a distinct step because wildcards don't work in static +# pattern rules. +# +# The '$(eval)' is needed because this has a different RHS for each LHS, and +# would otherwise produce results that make can't parse. +# +# We depend on the $(GOFILES_META).stamp to detect when the set of input files +# has changed. This allows us to detect deleted input files. +$(foreach dir, $(CONVERSION_DIRS), $(eval \ + $(dir)/$(CONVERSION_FILENAME): $(META_DIR)/$(dir)/$(GOFILES_META).stamp \ + $(gofiles__$(dir)) \ +)) + +# For each dir in CONVERSION_DIRS, for each target in $(conversions__$(dir)), +# this establishes a dependency between the output file and the input files +# that should trigger a rebuild. +# +# The variable value was set in $(GOFILES_META) and included as part of the +# dependency management logic. +# +# Note that this is a deps-only statement, not a full rule (see below). This +# has to be done in a distinct step because wildcards don't work in static +# pattern rules. +# +# The '$(eval)' is needed because this has a different RHS for each LHS, and +# would otherwise produce results that make can't parse. +# +# We depend on the $(GOFILES_META).stamp to detect when the set of input files +# has changed. This allows us to detect deleted input files. +$(foreach dir, $(CONVERSION_DIRS), \ + $(foreach tgt, $(conversions__$(dir)), $(eval \ + $(dir)/$(CONVERSION_FILENAME): $(META_DIR)/$(tgt)/$(GOFILES_META).stamp \ + $(gofiles__$(tgt)) \ + )) \ +) + +# Unilaterally remove any leftovers from previous runs. +$(shell rm -f $(META_DIR)/$(CONVERSION_GEN)*.todo) + +# How to regenerate conversion code. This is a little slow to run, so we batch +# it up and trigger the batch from the 'generated_files' target. +$(CONVERSION_FILES): $(CONVERSION_GEN) + echo $(PRJ_SRC_PATH)/$(@D) >> $(META_DIR)/$(CONVERSION_GEN).todo + +# This calculates the dependencies for the generator tool, so we only rebuild +# it when needed. It is PHONY so that it always runs, but it only updates the +# file if the contents have actually changed. We 'sinclude' this later. +.PHONY: $(META_DIR)/$(CONVERSION_GEN).mk +$(META_DIR)/$(CONVERSION_GEN).mk: + mkdir -p $(@D); \ + (echo -n "$(CONVERSION_GEN): "; \ + DIRECT=$$(go list -e -f '{{.Dir}} {{.Dir}}/*.go' \ + ./cmd/libs/go2idl/conversion-gen); \ + INDIRECT=$$(go list -e \ + -f '{{range .Deps}}{{.}}{{"\n"}}{{end}}' \ + ./cmd/libs/go2idl/conversion-gen \ + | grep "^$(PRJ_SRC_PATH)" \ + | xargs go list -e -f '{{.Dir}} {{.Dir}}/*.go'); \ + echo $$DIRECT $$INDIRECT | sed 's/ / \\\n\t/g'; \ + ) | sed "s|$$(pwd -P)/||" > $@.tmp; \ + cmp -s $@.tmp $@ || cat $@.tmp > $@ && rm -f $@.tmp + +# Include dependency info for the generator tool. This will cause the rule of +# the same name to be considered and if it is updated, make will restart. +sinclude $(META_DIR)/$(CONVERSION_GEN).mk + +# How to build the generator tool. The deps for this are defined in +# the $(CONVERSION_GEN).mk, above. +# +# A word on the need to touch: This rule might trigger if, for example, a +# non-Go file was added or deleted from a directory on which this depends. +# This target needs to be reconsidered, but Go realizes it doesn't actually +# have to be rebuilt. In that case, make will forever see the dependency as +# newer than the binary, and try to rebuild it over and over. So we touch it, +# and make is happy. +$(CONVERSION_GEN): + hack/make-rules/build.sh cmd/libs/go2idl/conversion-gen + touch $@ + +# This rule collects all the generated file sets into a single dep, which is +# defined BELOW the *_FILES variables and leaves higher-level rules clean. +# Top-level rules should depend on this to ensure generated files are rebuilt. +.PHONY: generated_files +generated_files: gen_deepcopy gen_conversion + +# Remove all auto-generated artifacts. +# +# Example: +# make clean_generated +.PHONY: clean_generated +clean_generated: + find . -type f -name $(GENERATED_FILE_PREFIX)\* | xargs rm -f From fef16dd541356b9de3df1d180d0d96daebb874d2 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Mon, 11 Jul 2016 22:00:45 -0700 Subject: [PATCH 18/18] Make update-generated-runtime work --- hack/update-generated-runtime-dockerized.sh | 5 ++++- hack/update-generated-runtime.sh | 8 +------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/hack/update-generated-runtime-dockerized.sh b/hack/update-generated-runtime-dockerized.sh index 90fbea746c3..7816dc3b926 100755 --- a/hack/update-generated-runtime-dockerized.sh +++ b/hack/update-generated-runtime-dockerized.sh @@ -24,7 +24,10 @@ source "${KUBE_ROOT}/hack/lib/init.sh" 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 echo "Generating protobuf requires protoc 3.0.0-beta1 or newer. Please download and" diff --git a/hack/update-generated-runtime.sh b/hack/update-generated-runtime.sh index 0a283193a75..4360cb81643 100755 --- a/hack/update-generated-runtime.sh +++ b/hack/update-generated-runtime.sh @@ -37,13 +37,7 @@ function prereqs() { KUBE_BUILD_CONTAINER_NAME="kube-build-${KUBE_ROOT_HASH}" KUBE_BUILD_DATA_CONTAINER_NAME="kube-build-data-${KUBE_ROOT_HASH}" DOCKER_MOUNT_ARGS=( - --volume "${REPO_DIR:-${KUBE_ROOT}}/cluster:/go/src/${KUBE_GO_PACKAGE}/cluster" - --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 "${REPO_DIR:-${KUBE_ROOT}}:/go/src/${KUBE_GO_PACKAGE}" --volume /etc/localtime:/etc/localtime:ro --volumes-from "${KUBE_BUILD_DATA_CONTAINER_NAME}" )