Merge pull request #13777 from lavalamp/moveExp
Move expapi to apis/experimental; fix conversion generators
This commit is contained in:
@@ -27,8 +27,8 @@ import (
|
||||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
_ "k8s.io/kubernetes/pkg/api/v1"
|
||||
_ "k8s.io/kubernetes/pkg/expapi"
|
||||
_ "k8s.io/kubernetes/pkg/expapi/v1"
|
||||
_ "k8s.io/kubernetes/pkg/apis/experimental"
|
||||
_ "k8s.io/kubernetes/pkg/apis/experimental/v1"
|
||||
pkg_runtime "k8s.io/kubernetes/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/util/sets"
|
||||
|
||||
@@ -44,6 +44,24 @@ var (
|
||||
groupVersion = flag.StringP("version", "v", "api/v1", "groupPath/version for conversion.")
|
||||
)
|
||||
|
||||
// We're moving to pkg/apis/group/version. This handles new and legacy packages.
|
||||
func pkgPath(group, version string) string {
|
||||
if group == "" {
|
||||
group = "api"
|
||||
}
|
||||
gv := group
|
||||
if version != "" {
|
||||
gv = path.Join(group, version)
|
||||
}
|
||||
switch {
|
||||
case group == "api":
|
||||
// TODO(lavalamp): remove this special case when we move api to apis/api
|
||||
return path.Join(pkgBase, gv)
|
||||
default:
|
||||
return path.Join(pkgBase, "apis", gv)
|
||||
}
|
||||
}
|
||||
|
||||
func main() {
|
||||
runtime.GOMAXPROCS(runtime.NumCPU())
|
||||
flag.Parse()
|
||||
@@ -70,14 +88,14 @@ func main() {
|
||||
glog.Fatalf("error writing package line: %v", err)
|
||||
}
|
||||
|
||||
versionPath := path.Join(pkgBase, group, version)
|
||||
versionPath := pkgPath(group, version)
|
||||
generator := pkg_runtime.NewConversionGenerator(api.Scheme.Raw(), versionPath)
|
||||
apiShort := generator.AddImport(path.Join(pkgBase, "api"))
|
||||
generator.AddImport(path.Join(pkgBase, "api/resource"))
|
||||
// TODO(wojtek-t): Change the overwrites to a flag.
|
||||
generator.OverwritePackage(version, "")
|
||||
for _, knownType := range api.Scheme.KnownTypes(version) {
|
||||
if !strings.HasPrefix(knownType.PkgPath(), versionPath) {
|
||||
if knownType.PkgPath() != versionPath {
|
||||
continue
|
||||
}
|
||||
if err := generator.GenerateConversionsForType(version, knownType); err != nil {
|
||||
|
@@ -27,8 +27,8 @@ import (
|
||||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
_ "k8s.io/kubernetes/pkg/api/v1"
|
||||
_ "k8s.io/kubernetes/pkg/expapi"
|
||||
_ "k8s.io/kubernetes/pkg/expapi/v1"
|
||||
_ "k8s.io/kubernetes/pkg/apis/experimental"
|
||||
_ "k8s.io/kubernetes/pkg/apis/experimental/v1"
|
||||
pkg_runtime "k8s.io/kubernetes/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/util/sets"
|
||||
|
||||
@@ -45,6 +45,32 @@ var (
|
||||
overwrites = flag.StringP("overwrites", "o", "", "Comma-separated overwrites for package names")
|
||||
)
|
||||
|
||||
// types inside the api package don't need to say "api.Scheme"; all others do.
|
||||
func destScheme(group, version string) string {
|
||||
if group == "api" && version == "" {
|
||||
return "Scheme"
|
||||
}
|
||||
return "api.Scheme"
|
||||
}
|
||||
|
||||
// We're moving to pkg/apis/group/version. This handles new and legacy packages.
|
||||
func pkgPath(group, version string) string {
|
||||
if group == "" {
|
||||
group = "api"
|
||||
}
|
||||
gv := group
|
||||
if version != "" {
|
||||
gv = path.Join(group, version)
|
||||
}
|
||||
switch {
|
||||
case group == "api":
|
||||
// TODO(lavalamp): remove this special case when we move api to apis/api
|
||||
return path.Join(pkgBase, gv)
|
||||
default:
|
||||
return path.Join(pkgBase, "apis", gv)
|
||||
}
|
||||
}
|
||||
|
||||
func main() {
|
||||
runtime.GOMAXPROCS(runtime.NumCPU())
|
||||
flag.Parse()
|
||||
@@ -65,10 +91,7 @@ func main() {
|
||||
|
||||
group, version := path.Split(*groupVersion)
|
||||
group = strings.TrimRight(group, "/")
|
||||
registerTo := "api.Scheme"
|
||||
if *groupVersion == "api/" {
|
||||
registerTo = "Scheme"
|
||||
}
|
||||
registerTo := destScheme(group, version)
|
||||
pkgname := group
|
||||
if len(version) != 0 {
|
||||
pkgname = version
|
||||
@@ -79,7 +102,7 @@ func main() {
|
||||
glog.Fatalf("error writing package line: %v", err)
|
||||
}
|
||||
|
||||
versionPath := path.Join(pkgBase, group, version)
|
||||
versionPath := pkgPath(group, version)
|
||||
generator := pkg_runtime.NewDeepCopyGenerator(api.Scheme.Raw(), versionPath, sets.NewString("k8s.io/kubernetes"))
|
||||
generator.AddImport(path.Join(pkgBase, "api"))
|
||||
|
||||
@@ -93,7 +116,7 @@ func main() {
|
||||
}
|
||||
}
|
||||
for _, knownType := range api.Scheme.KnownTypes(version) {
|
||||
if !strings.HasPrefix(knownType.PkgPath(), versionPath) {
|
||||
if knownType.PkgPath() != versionPath {
|
||||
continue
|
||||
}
|
||||
if err := generator.AddType(knownType); err != nil {
|
||||
|
@@ -39,13 +39,13 @@ import (
|
||||
apierrors "k8s.io/kubernetes/pkg/api/errors"
|
||||
"k8s.io/kubernetes/pkg/api/latest"
|
||||
"k8s.io/kubernetes/pkg/api/testapi"
|
||||
explatest "k8s.io/kubernetes/pkg/apis/experimental/latest"
|
||||
"k8s.io/kubernetes/pkg/apiserver"
|
||||
"k8s.io/kubernetes/pkg/client/record"
|
||||
client "k8s.io/kubernetes/pkg/client/unversioned"
|
||||
"k8s.io/kubernetes/pkg/controller/endpoint"
|
||||
"k8s.io/kubernetes/pkg/controller/node"
|
||||
replicationControllerPkg "k8s.io/kubernetes/pkg/controller/replication"
|
||||
explatest "k8s.io/kubernetes/pkg/expapi/latest"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/kubelet"
|
||||
"k8s.io/kubernetes/pkg/kubelet/cadvisor"
|
||||
|
@@ -35,11 +35,11 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/latest"
|
||||
"k8s.io/kubernetes/pkg/api/meta"
|
||||
explatest "k8s.io/kubernetes/pkg/apis/experimental/latest"
|
||||
"k8s.io/kubernetes/pkg/apiserver"
|
||||
"k8s.io/kubernetes/pkg/capabilities"
|
||||
client "k8s.io/kubernetes/pkg/client/unversioned"
|
||||
"k8s.io/kubernetes/pkg/cloudprovider"
|
||||
explatest "k8s.io/kubernetes/pkg/expapi/latest"
|
||||
"k8s.io/kubernetes/pkg/master"
|
||||
"k8s.io/kubernetes/pkg/master/ports"
|
||||
"k8s.io/kubernetes/pkg/storage"
|
||||
|
@@ -38,7 +38,7 @@ with a number of existing API types and with the [API
|
||||
conventions](api-conventions.md). If creating a new API
|
||||
type/resource, we also recommend that you first send a PR containing
|
||||
just a proposal for the new API types, and that you initially target
|
||||
the experimental API (pkg/expapi).
|
||||
the experimental API (pkg/apis/experimental).
|
||||
|
||||
The Kubernetes API has two major components - the internal structures and
|
||||
the versioned APIs. The versioned APIs are intended to be stable, while the
|
||||
@@ -399,10 +399,10 @@ The conversion code resides with each versioned API. There are two files:
|
||||
functions
|
||||
- `pkg/api/<version>/conversion_generated.go` containing auto-generated
|
||||
conversion functions
|
||||
- `pkg/expapi/<version>/conversion.go` containing manually written conversion
|
||||
functions
|
||||
- `pkg/expapi/<version>/conversion_generated.go` containing auto-generated
|
||||
- `pkg/apis/experimental/<version>/conversion.go` containing manually written
|
||||
conversion functions
|
||||
- `pkg/apis/experimental/<version>/conversion_generated.go` containing
|
||||
auto-generated conversion functions
|
||||
|
||||
Since auto-generated conversion functions are using manually written ones,
|
||||
those manually written should be named with a defined convention, i.e. a function
|
||||
@@ -437,7 +437,7 @@ of your versioned api objects.
|
||||
|
||||
The deep copy code resides with each versioned API:
|
||||
- `pkg/api/<version>/deep_copy_generated.go` containing auto-generated copy functions
|
||||
- `pkg/expapi/<version>/deep_copy_generated.go` containing auto-generated copy functions
|
||||
- `pkg/apis/experimental/<version>/deep_copy_generated.go` containing auto-generated copy functions
|
||||
|
||||
To regenerate them:
|
||||
- run
|
||||
@@ -446,6 +446,23 @@ To regenerate them:
|
||||
hack/update-generated-deep-copies.sh
|
||||
```
|
||||
|
||||
## Making a new API Group
|
||||
|
||||
This section is under construction, as we make the tooling completely generic.
|
||||
|
||||
At the moment, you'll have to make a new directory under pkg/apis/; copy the
|
||||
directory structure from pkg/apis/experimental. Add the new group/version to all
|
||||
of the hack/{verify,update}-generated-{deep-copy,conversions,swagger}.sh files
|
||||
in the appropriate places--it should just require adding your new group/version
|
||||
to a bash array. You will also need to make sure your new types are imported by
|
||||
the generation commands (cmd/gendeepcopy/ & cmd/genconversion). These
|
||||
instructions may not be complete and will be updated as we gain experience.
|
||||
|
||||
Adding API groups outside of the pkg/apis/ directory is not currently supported,
|
||||
but is clearly desirable. The deep copy & conversion generators need to work by
|
||||
parsing go files instead of by reflection; then they will be easy to point at
|
||||
arbitrary directories: see issue [#13775](http://issue.k8s.io/13775).
|
||||
|
||||
## Update the fuzzer
|
||||
|
||||
Part of our testing regimen for APIs is to "fuzz" (fill with random values) API
|
||||
|
@@ -26,26 +26,27 @@ kube::golang::setup_env
|
||||
genconversion=$(kube::util::find-binary "genconversion")
|
||||
|
||||
function generate_version() {
|
||||
local version=$1
|
||||
local TMPFILE="/tmp/conversion_generated.$(date +%s).go"
|
||||
local group_version=$1
|
||||
local TMPFILE="/tmp/conversion_generated.$(date +%s).go"
|
||||
|
||||
echo "Generating for ${version}"
|
||||
echo "Generating for ${group_version}"
|
||||
|
||||
sed 's/YEAR/2015/' hack/boilerplate/boilerplate.go.txt > "$TMPFILE"
|
||||
cat >> "$TMPFILE" <<EOF
|
||||
sed 's/YEAR/2015/' hack/boilerplate/boilerplate.go.txt > "$TMPFILE"
|
||||
cat >> "$TMPFILE" <<EOF
|
||||
// DO NOT EDIT. THIS FILE IS AUTO-GENERATED BY \$KUBEROOT/hack/update-generated-conversions.sh
|
||||
|
||||
EOF
|
||||
|
||||
"${genconversion}" -v "${version}" -f - >> "$TMPFILE"
|
||||
"${genconversion}" -v "${group_version}" -f - >> "$TMPFILE"
|
||||
|
||||
mv "$TMPFILE" "pkg/${version}/conversion_generated.go"
|
||||
mv "$TMPFILE" "pkg/$(kube::util::group-version-to-pkg-path "${group_version}")/conversion_generated.go"
|
||||
}
|
||||
|
||||
DEFAULT_VERSIONS="api/v1 expapi/v1"
|
||||
VERSIONS=${VERSIONS:-$DEFAULT_VERSIONS}
|
||||
# TODO(lavalamp): get this list by listing the pkg/apis/ directory?
|
||||
DEFAULT_GROUP_VERSIONS="api/v1 experimental/v1"
|
||||
VERSIONS=${VERSIONS:-$DEFAULT_GROUP_VERSIONS}
|
||||
for ver in $VERSIONS; do
|
||||
# Ensure that the version being processed is registered by setting
|
||||
# KUBE_API_VERSIONS.
|
||||
KUBE_API_VERSIONS="${ver##*/}" generate_version "${ver}"
|
||||
# Ensure that the version being processed is registered by setting
|
||||
# KUBE_API_VERSIONS.
|
||||
KUBE_API_VERSIONS="${ver##*/}" generate_version "${ver}"
|
||||
done
|
||||
|
@@ -25,42 +25,35 @@ kube::golang::setup_env
|
||||
|
||||
gendeepcopy=$(kube::util::find-binary "gendeepcopy")
|
||||
|
||||
function result_file_name() {
|
||||
local version=$1
|
||||
echo "pkg/${version}/deep_copy_generated.go"
|
||||
}
|
||||
|
||||
function generate_version() {
|
||||
local version=$1
|
||||
local TMPFILE="/tmp/deep_copy_generated.$(date +%s).go"
|
||||
local group_version=$1
|
||||
local TMPFILE="/tmp/deep_copy_generated.$(date +%s).go"
|
||||
|
||||
echo "Generating for ${version}"
|
||||
echo "Generating for ${group_version}"
|
||||
|
||||
sed 's/YEAR/2015/' hack/boilerplate/boilerplate.go.txt > $TMPFILE
|
||||
cat >> $TMPFILE <<EOF
|
||||
sed 's/YEAR/2015/' hack/boilerplate/boilerplate.go.txt > $TMPFILE
|
||||
cat >> $TMPFILE <<EOF
|
||||
// DO NOT EDIT. THIS FILE IS AUTO-GENERATED BY \$KUBEROOT/hack/update-generated-deep-copies.sh.
|
||||
|
||||
EOF
|
||||
|
||||
"${gendeepcopy}" -v "${version}" -f - -o "${version}=" >> "$TMPFILE"
|
||||
"${gendeepcopy}" -v "${group_version}" -f - -o "${group_version}=" >> "$TMPFILE"
|
||||
|
||||
mv "$TMPFILE" `result_file_name ${version}`
|
||||
local dest="pkg/$(kube::util::group-version-to-pkg-path "${group_version}")/deep_copy_generated.go"
|
||||
rm -f "${dest}"
|
||||
mv "${TMPFILE}" "${dest}"
|
||||
}
|
||||
|
||||
function generate_deep_copies() {
|
||||
local versions="$@"
|
||||
# To avoid compile errors, remove the currently existing files.
|
||||
for ver in ${versions}; do
|
||||
rm -f `result_file_name ${ver}`
|
||||
done
|
||||
for ver in ${versions}; do
|
||||
# Ensure that the version being processed is registered by setting
|
||||
# KUBE_API_VERSIONS.
|
||||
apiVersions="${ver##*/}"
|
||||
KUBE_API_VERSIONS="${apiVersions}" generate_version "${ver}"
|
||||
done
|
||||
local group_versions="$@"
|
||||
for ver in ${group_versions}; do
|
||||
# Ensure that the version being processed is registered by setting
|
||||
# KUBE_API_VERSIONS.
|
||||
apiVersions="${ver##*/}"
|
||||
KUBE_API_VERSIONS="${apiVersions}" generate_version "${ver}"
|
||||
done
|
||||
}
|
||||
|
||||
DEFAULT_VERSIONS="api/ api/v1 expapi/ expapi/v1"
|
||||
DEFAULT_VERSIONS="api/ api/v1 experimental/ experimental/v1"
|
||||
VERSIONS=${VERSIONS:-$DEFAULT_VERSIONS}
|
||||
generate_deep_copies "$VERSIONS"
|
||||
|
@@ -40,7 +40,7 @@ find_files() {
|
||||
\) -prune \
|
||||
\) \
|
||||
\( -wholename '*pkg/api/v*/types.go' \
|
||||
-o -wholename '*pkg/expapi/v*/types.go' \
|
||||
-o -wholename '*pkg/apis/*/v*/types.go' \
|
||||
\)
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ for file in $versioned_api_files; do
|
||||
fi
|
||||
done
|
||||
|
||||
internal_types_files="${KUBE_ROOT}/pkg/api/types.go ${KUBE_ROOT}/pkg/expapi/types.go"
|
||||
internal_types_files="${KUBE_ROOT}/pkg/api/types.go ${KUBE_ROOT}/pkg/apis/experimental/types.go"
|
||||
for internal_types_file in $internal_types_files; do
|
||||
if grep json: "${internal_types_file}" | grep -v // | grep description: ; then
|
||||
echo "Internal API types should not contain descriptions"
|
||||
|
@@ -23,7 +23,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
|
||||
kube::golang::setup_env
|
||||
|
||||
APIROOTS=${APIROOTS:-pkg/api pkg/expapi}
|
||||
APIROOTS=${APIROOTS:-pkg/api pkg/apis/experimental}
|
||||
_tmp="${KUBE_ROOT}/_tmp"
|
||||
|
||||
cleanup() {
|
||||
|
@@ -25,7 +25,7 @@ kube::golang::setup_env
|
||||
|
||||
gendeepcopy=$(kube::util::find-binary "gendeepcopy")
|
||||
|
||||
APIROOTS=${APIROOTS:-pkg/api pkg/expapi}
|
||||
APIROOTS=${APIROOTS:-pkg/api pkg/apis/experimental}
|
||||
_tmp="${KUBE_ROOT}/_tmp"
|
||||
|
||||
cleanup() {
|
||||
|
@@ -220,4 +220,35 @@ kube::util::analytics-link() {
|
||||
echo "[]()"
|
||||
}
|
||||
|
||||
# Takes a group/version and returns the path to its location on disk, sans
|
||||
# "pkg". E.g.:
|
||||
# * default behavior: experimental/v1 -> apis/experimental/v1
|
||||
# * legacy behavior: api/v1 -> api/v1
|
||||
# * Special handling for only a group: experimental -> apis/experimental
|
||||
# * Special handling for only "api" group: api -> api
|
||||
# * Very special handling for "v1": v1 -> api/v1
|
||||
kube::util::group-version-to-pkg-path() {
|
||||
local group_version="$1"
|
||||
# Special cases first.
|
||||
# TODO(lavalamp): Simplify this by moving pkg/api/v1 and splitting pkg/api,
|
||||
# moving the results to pkg/apis/api.
|
||||
case "${group_version}" in
|
||||
v1)
|
||||
echo "api/v1"
|
||||
;;
|
||||
api)
|
||||
echo "api/v1"
|
||||
;;
|
||||
api/*)
|
||||
echo "${group_version}"
|
||||
;;
|
||||
api/*)
|
||||
echo "${group_version}"
|
||||
;;
|
||||
*)
|
||||
echo "apis/${group_version}"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# ex: ts=2 sw=2 et filetype=sh
|
||||
|
@@ -24,14 +24,14 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
kube::golang::setup_env
|
||||
|
||||
function generate_version() {
|
||||
local groupVersion=$1
|
||||
local TMPFILE="/tmp/types_swagger_doc_generated.$(date +%s).go"
|
||||
local group_version=$1
|
||||
local TMPFILE="/tmp/types_swagger_doc_generated.$(date +%s).go"
|
||||
|
||||
echo "Generating swagger type docs for ${groupVersion}"
|
||||
echo "Generating swagger type docs for ${group_version}"
|
||||
|
||||
sed 's/YEAR/2015/' hack/boilerplate/boilerplate.go.txt > $TMPFILE
|
||||
echo "package ${groupVersion##*/}" >> $TMPFILE
|
||||
cat >> $TMPFILE <<EOF
|
||||
sed 's/YEAR/2015/' hack/boilerplate/boilerplate.go.txt > $TMPFILE
|
||||
echo "package ${group_version##*/}" >> $TMPFILE
|
||||
cat >> $TMPFILE <<EOF
|
||||
|
||||
// This file contains a collection of methods that can be used from go-resful to
|
||||
// generate Swagger API documentation for its models. Please read this PR for more
|
||||
@@ -46,21 +46,23 @@ function generate_version() {
|
||||
// AUTO-GENERATED FUNCTIONS START HERE
|
||||
EOF
|
||||
|
||||
GOPATH=$(godep path):$GOPATH go run cmd/genswaggertypedocs/swagger_type_docs.go -s "pkg/${groupVersion}/types.go" -f - >> $TMPFILE
|
||||
GOPATH=$(godep path):$GOPATH go run cmd/genswaggertypedocs/swagger_type_docs.go -s \
|
||||
"pkg/$(kube::util::group-version-to-pkg-path "${group_version}")/types.go" -f - \
|
||||
>> $TMPFILE
|
||||
|
||||
echo "// AUTO-GENERATED FUNCTIONS END HERE" >> $TMPFILE
|
||||
echo "// AUTO-GENERATED FUNCTIONS END HERE" >> $TMPFILE
|
||||
|
||||
gofmt -w -s $TMPFILE
|
||||
mv $TMPFILE "pkg/${groupVersion}/types_swagger_doc_generated.go"
|
||||
gofmt -w -s $TMPFILE
|
||||
mv $TMPFILE "pkg/$(kube::util::group-version-to-pkg-path "${group_version}")/types_swagger_doc_generated.go"
|
||||
}
|
||||
|
||||
GROUP_VERSIONS="api/v1 expapi/v1"
|
||||
GROUP_VERSIONS="api/v1 experimental/v1"
|
||||
# To avoid compile errors, remove the currently existing files.
|
||||
for groupVersion in $GROUP_VERSIONS; do
|
||||
rm -f "pkg/${groupVersion}/types_swagger_doc_generated.go"
|
||||
for group_version in $GROUP_VERSIONS; do
|
||||
rm -f "pkg/$(kube::util::group-version-to-pkg-path "${group_version}")/types_swagger_doc_generated.go"
|
||||
done
|
||||
for groupVersion in $GROUP_VERSIONS; do
|
||||
generate_version "${groupVersion}"
|
||||
for group_version in $GROUP_VERSIONS; do
|
||||
generate_version "${group_version}"
|
||||
done
|
||||
|
||||
"${KUBE_ROOT}/hack/update-swagger-spec.sh"
|
||||
|
48
hack/update-gofmt.sh
Executable file
48
hack/update-gofmt.sh
Executable file
@@ -0,0 +1,48 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2014 The Kubernetes Authors All rights reserved.
|
||||
#
|
||||
# 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.
|
||||
|
||||
# GoFmt apparently is changing @ head...
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
||||
|
||||
GO_VERSION=($(go version))
|
||||
|
||||
if [[ -z $(echo "${GO_VERSION[2]}" | grep -E 'go1.2|go1.3|go1.4|go1.5') ]]; then
|
||||
echo "Unknown go version '${GO_VERSION}', skipping gofmt."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
cd "${KUBE_ROOT}"
|
||||
|
||||
find_files() {
|
||||
find . -not \( \
|
||||
\( \
|
||||
-wholename './output' \
|
||||
-o -wholename './_output' \
|
||||
-o -wholename './release' \
|
||||
-o -wholename './target' \
|
||||
-o -wholename '*/third_party/*' \
|
||||
-o -wholename '*/Godeps/*' \
|
||||
\) -prune \
|
||||
\) -name '*.go'
|
||||
}
|
||||
|
||||
GOFMT="gofmt -s -w"
|
||||
find_files | xargs $GOFMT
|
@@ -33,8 +33,8 @@ import (
|
||||
"k8s.io/kubernetes/pkg/util"
|
||||
"k8s.io/kubernetes/pkg/util/sets"
|
||||
|
||||
_ "k8s.io/kubernetes/pkg/expapi"
|
||||
_ "k8s.io/kubernetes/pkg/expapi/v1"
|
||||
_ "k8s.io/kubernetes/pkg/apis/experimental"
|
||||
_ "k8s.io/kubernetes/pkg/apis/experimental/v1"
|
||||
|
||||
flag "github.com/spf13/pflag"
|
||||
)
|
||||
|
@@ -25,7 +25,7 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api/latest"
|
||||
"k8s.io/kubernetes/pkg/api/meta"
|
||||
apiutil "k8s.io/kubernetes/pkg/api/util"
|
||||
explatest "k8s.io/kubernetes/pkg/expapi/latest"
|
||||
explatest "k8s.io/kubernetes/pkg/apis/experimental/latest"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
)
|
||||
|
||||
|
@@ -27,7 +27,7 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/registered"
|
||||
"k8s.io/kubernetes/pkg/api/resource"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
@@ -121,15 +121,15 @@ func FuzzerFor(t *testing.T, version string, src rand.Source) *fuzz.Fuzzer {
|
||||
c.FuzzNoCustom(j) // fuzz self without calling this function again
|
||||
//j.TemplateRef = nil // this is required for round trip
|
||||
},
|
||||
func(j *expapi.DeploymentStrategy, c fuzz.Continue) {
|
||||
func(j *experimental.DeploymentStrategy, c fuzz.Continue) {
|
||||
c.FuzzNoCustom(j) // fuzz self without calling this function again
|
||||
// Ensure that strategyType is one of valid values.
|
||||
strategyTypes := []expapi.DeploymentType{expapi.DeploymentRecreate, expapi.DeploymentRollingUpdate}
|
||||
strategyTypes := []experimental.DeploymentType{experimental.DeploymentRecreate, experimental.DeploymentRollingUpdate}
|
||||
j.Type = strategyTypes[c.Rand.Intn(len(strategyTypes))]
|
||||
if j.Type != expapi.DeploymentRollingUpdate {
|
||||
if j.Type != experimental.DeploymentRollingUpdate {
|
||||
j.RollingUpdate = nil
|
||||
} else {
|
||||
rollingUpdate := expapi.RollingUpdateDeployment{}
|
||||
rollingUpdate := experimental.RollingUpdateDeployment{}
|
||||
if c.RandBool() {
|
||||
rollingUpdate.MaxUnavailable = util.NewIntOrStringFromInt(int(c.RandUint64()))
|
||||
rollingUpdate.MaxSurge = util.NewIntOrStringFromInt(int(c.RandUint64()))
|
||||
@@ -351,7 +351,7 @@ func FuzzerFor(t *testing.T, version string, src rand.Source) *fuzz.Fuzzer {
|
||||
c.FuzzNoCustom(n)
|
||||
n.Spec.ExternalID = "external"
|
||||
},
|
||||
func(s *expapi.APIVersion, c fuzz.Continue) {
|
||||
func(s *experimental.APIVersion, c fuzz.Continue) {
|
||||
// We can't use c.RandString() here because it may generate empty
|
||||
// string, which will cause tests failure.
|
||||
s.APIGroup = "something"
|
||||
|
@@ -16,7 +16,7 @@ limitations under the License.
|
||||
|
||||
// DO NOT EDIT. THIS FILE IS AUTO-GENERATED BY $KUBEROOT/hack/update-generated-deep-copies.sh.
|
||||
|
||||
package expapi
|
||||
package experimental
|
||||
|
||||
import (
|
||||
time "time"
|
||||
@@ -757,29 +757,29 @@ func deepCopy_resource_Quantity(in resource.Quantity, out *resource.Quantity, c
|
||||
return nil
|
||||
}
|
||||
|
||||
func deepCopy_expapi_APIVersion(in APIVersion, out *APIVersion, c *conversion.Cloner) error {
|
||||
func deepCopy_experimental_APIVersion(in APIVersion, out *APIVersion, c *conversion.Cloner) error {
|
||||
out.Name = in.Name
|
||||
out.APIGroup = in.APIGroup
|
||||
return nil
|
||||
}
|
||||
|
||||
func deepCopy_expapi_DaemonSet(in DaemonSet, out *DaemonSet, c *conversion.Cloner) error {
|
||||
func deepCopy_experimental_DaemonSet(in DaemonSet, out *DaemonSet, c *conversion.Cloner) error {
|
||||
if err := deepCopy_api_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := deepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := deepCopy_expapi_DaemonSetSpec(in.Spec, &out.Spec, c); err != nil {
|
||||
if err := deepCopy_experimental_DaemonSetSpec(in.Spec, &out.Spec, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := deepCopy_expapi_DaemonSetStatus(in.Status, &out.Status, c); err != nil {
|
||||
if err := deepCopy_experimental_DaemonSetStatus(in.Status, &out.Status, c); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func deepCopy_expapi_DaemonSetList(in DaemonSetList, out *DaemonSetList, c *conversion.Cloner) error {
|
||||
func deepCopy_experimental_DaemonSetList(in DaemonSetList, out *DaemonSetList, c *conversion.Cloner) error {
|
||||
if err := deepCopy_api_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -789,7 +789,7 @@ func deepCopy_expapi_DaemonSetList(in DaemonSetList, out *DaemonSetList, c *conv
|
||||
if in.Items != nil {
|
||||
out.Items = make([]DaemonSet, len(in.Items))
|
||||
for i := range in.Items {
|
||||
if err := deepCopy_expapi_DaemonSet(in.Items[i], &out.Items[i], c); err != nil {
|
||||
if err := deepCopy_experimental_DaemonSet(in.Items[i], &out.Items[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -799,7 +799,7 @@ func deepCopy_expapi_DaemonSetList(in DaemonSetList, out *DaemonSetList, c *conv
|
||||
return nil
|
||||
}
|
||||
|
||||
func deepCopy_expapi_DaemonSetSpec(in DaemonSetSpec, out *DaemonSetSpec, c *conversion.Cloner) error {
|
||||
func deepCopy_experimental_DaemonSetSpec(in DaemonSetSpec, out *DaemonSetSpec, c *conversion.Cloner) error {
|
||||
if in.Selector != nil {
|
||||
out.Selector = make(map[string]string)
|
||||
for key, val := range in.Selector {
|
||||
@@ -819,30 +819,30 @@ func deepCopy_expapi_DaemonSetSpec(in DaemonSetSpec, out *DaemonSetSpec, c *conv
|
||||
return nil
|
||||
}
|
||||
|
||||
func deepCopy_expapi_DaemonSetStatus(in DaemonSetStatus, out *DaemonSetStatus, c *conversion.Cloner) error {
|
||||
func deepCopy_experimental_DaemonSetStatus(in DaemonSetStatus, out *DaemonSetStatus, c *conversion.Cloner) error {
|
||||
out.CurrentNumberScheduled = in.CurrentNumberScheduled
|
||||
out.NumberMisscheduled = in.NumberMisscheduled
|
||||
out.DesiredNumberScheduled = in.DesiredNumberScheduled
|
||||
return nil
|
||||
}
|
||||
|
||||
func deepCopy_expapi_Deployment(in Deployment, out *Deployment, c *conversion.Cloner) error {
|
||||
func deepCopy_experimental_Deployment(in Deployment, out *Deployment, c *conversion.Cloner) error {
|
||||
if err := deepCopy_api_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := deepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := deepCopy_expapi_DeploymentSpec(in.Spec, &out.Spec, c); err != nil {
|
||||
if err := deepCopy_experimental_DeploymentSpec(in.Spec, &out.Spec, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := deepCopy_expapi_DeploymentStatus(in.Status, &out.Status, c); err != nil {
|
||||
if err := deepCopy_experimental_DeploymentStatus(in.Status, &out.Status, c); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func deepCopy_expapi_DeploymentList(in DeploymentList, out *DeploymentList, c *conversion.Cloner) error {
|
||||
func deepCopy_experimental_DeploymentList(in DeploymentList, out *DeploymentList, c *conversion.Cloner) error {
|
||||
if err := deepCopy_api_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -852,7 +852,7 @@ func deepCopy_expapi_DeploymentList(in DeploymentList, out *DeploymentList, c *c
|
||||
if in.Items != nil {
|
||||
out.Items = make([]Deployment, len(in.Items))
|
||||
for i := range in.Items {
|
||||
if err := deepCopy_expapi_Deployment(in.Items[i], &out.Items[i], c); err != nil {
|
||||
if err := deepCopy_experimental_Deployment(in.Items[i], &out.Items[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -862,7 +862,7 @@ func deepCopy_expapi_DeploymentList(in DeploymentList, out *DeploymentList, c *c
|
||||
return nil
|
||||
}
|
||||
|
||||
func deepCopy_expapi_DeploymentSpec(in DeploymentSpec, out *DeploymentSpec, c *conversion.Cloner) error {
|
||||
func deepCopy_experimental_DeploymentSpec(in DeploymentSpec, out *DeploymentSpec, c *conversion.Cloner) error {
|
||||
out.Replicas = in.Replicas
|
||||
if in.Selector != nil {
|
||||
out.Selector = make(map[string]string)
|
||||
@@ -880,24 +880,24 @@ func deepCopy_expapi_DeploymentSpec(in DeploymentSpec, out *DeploymentSpec, c *c
|
||||
} else {
|
||||
out.Template = nil
|
||||
}
|
||||
if err := deepCopy_expapi_DeploymentStrategy(in.Strategy, &out.Strategy, c); err != nil {
|
||||
if err := deepCopy_experimental_DeploymentStrategy(in.Strategy, &out.Strategy, c); err != nil {
|
||||
return err
|
||||
}
|
||||
out.UniqueLabelKey = in.UniqueLabelKey
|
||||
return nil
|
||||
}
|
||||
|
||||
func deepCopy_expapi_DeploymentStatus(in DeploymentStatus, out *DeploymentStatus, c *conversion.Cloner) error {
|
||||
func deepCopy_experimental_DeploymentStatus(in DeploymentStatus, out *DeploymentStatus, c *conversion.Cloner) error {
|
||||
out.Replicas = in.Replicas
|
||||
out.UpdatedReplicas = in.UpdatedReplicas
|
||||
return nil
|
||||
}
|
||||
|
||||
func deepCopy_expapi_DeploymentStrategy(in DeploymentStrategy, out *DeploymentStrategy, c *conversion.Cloner) error {
|
||||
func deepCopy_experimental_DeploymentStrategy(in DeploymentStrategy, out *DeploymentStrategy, c *conversion.Cloner) error {
|
||||
out.Type = in.Type
|
||||
if in.RollingUpdate != nil {
|
||||
out.RollingUpdate = new(RollingUpdateDeployment)
|
||||
if err := deepCopy_expapi_RollingUpdateDeployment(*in.RollingUpdate, out.RollingUpdate, c); err != nil {
|
||||
if err := deepCopy_experimental_RollingUpdateDeployment(*in.RollingUpdate, out.RollingUpdate, c); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
@@ -906,19 +906,19 @@ func deepCopy_expapi_DeploymentStrategy(in DeploymentStrategy, out *DeploymentSt
|
||||
return nil
|
||||
}
|
||||
|
||||
func deepCopy_expapi_HorizontalPodAutoscaler(in HorizontalPodAutoscaler, out *HorizontalPodAutoscaler, c *conversion.Cloner) error {
|
||||
func deepCopy_experimental_HorizontalPodAutoscaler(in HorizontalPodAutoscaler, out *HorizontalPodAutoscaler, c *conversion.Cloner) error {
|
||||
if err := deepCopy_api_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := deepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := deepCopy_expapi_HorizontalPodAutoscalerSpec(in.Spec, &out.Spec, c); err != nil {
|
||||
if err := deepCopy_experimental_HorizontalPodAutoscalerSpec(in.Spec, &out.Spec, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if in.Status != nil {
|
||||
out.Status = new(HorizontalPodAutoscalerStatus)
|
||||
if err := deepCopy_expapi_HorizontalPodAutoscalerStatus(*in.Status, out.Status, c); err != nil {
|
||||
if err := deepCopy_experimental_HorizontalPodAutoscalerStatus(*in.Status, out.Status, c); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
@@ -927,7 +927,7 @@ func deepCopy_expapi_HorizontalPodAutoscaler(in HorizontalPodAutoscaler, out *Ho
|
||||
return nil
|
||||
}
|
||||
|
||||
func deepCopy_expapi_HorizontalPodAutoscalerList(in HorizontalPodAutoscalerList, out *HorizontalPodAutoscalerList, c *conversion.Cloner) error {
|
||||
func deepCopy_experimental_HorizontalPodAutoscalerList(in HorizontalPodAutoscalerList, out *HorizontalPodAutoscalerList, c *conversion.Cloner) error {
|
||||
if err := deepCopy_api_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -937,7 +937,7 @@ func deepCopy_expapi_HorizontalPodAutoscalerList(in HorizontalPodAutoscalerList,
|
||||
if in.Items != nil {
|
||||
out.Items = make([]HorizontalPodAutoscaler, len(in.Items))
|
||||
for i := range in.Items {
|
||||
if err := deepCopy_expapi_HorizontalPodAutoscaler(in.Items[i], &out.Items[i], c); err != nil {
|
||||
if err := deepCopy_experimental_HorizontalPodAutoscaler(in.Items[i], &out.Items[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -947,10 +947,10 @@ func deepCopy_expapi_HorizontalPodAutoscalerList(in HorizontalPodAutoscalerList,
|
||||
return nil
|
||||
}
|
||||
|
||||
func deepCopy_expapi_HorizontalPodAutoscalerSpec(in HorizontalPodAutoscalerSpec, out *HorizontalPodAutoscalerSpec, c *conversion.Cloner) error {
|
||||
func deepCopy_experimental_HorizontalPodAutoscalerSpec(in HorizontalPodAutoscalerSpec, out *HorizontalPodAutoscalerSpec, c *conversion.Cloner) error {
|
||||
if in.ScaleRef != nil {
|
||||
out.ScaleRef = new(SubresourceReference)
|
||||
if err := deepCopy_expapi_SubresourceReference(*in.ScaleRef, out.ScaleRef, c); err != nil {
|
||||
if err := deepCopy_experimental_SubresourceReference(*in.ScaleRef, out.ScaleRef, c); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
@@ -958,18 +958,18 @@ func deepCopy_expapi_HorizontalPodAutoscalerSpec(in HorizontalPodAutoscalerSpec,
|
||||
}
|
||||
out.MinCount = in.MinCount
|
||||
out.MaxCount = in.MaxCount
|
||||
if err := deepCopy_expapi_ResourceConsumption(in.Target, &out.Target, c); err != nil {
|
||||
if err := deepCopy_experimental_ResourceConsumption(in.Target, &out.Target, c); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func deepCopy_expapi_HorizontalPodAutoscalerStatus(in HorizontalPodAutoscalerStatus, out *HorizontalPodAutoscalerStatus, c *conversion.Cloner) error {
|
||||
func deepCopy_experimental_HorizontalPodAutoscalerStatus(in HorizontalPodAutoscalerStatus, out *HorizontalPodAutoscalerStatus, c *conversion.Cloner) error {
|
||||
out.CurrentReplicas = in.CurrentReplicas
|
||||
out.DesiredReplicas = in.DesiredReplicas
|
||||
if in.CurrentConsumption != nil {
|
||||
out.CurrentConsumption = new(ResourceConsumption)
|
||||
if err := deepCopy_expapi_ResourceConsumption(*in.CurrentConsumption, out.CurrentConsumption, c); err != nil {
|
||||
if err := deepCopy_experimental_ResourceConsumption(*in.CurrentConsumption, out.CurrentConsumption, c); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
@@ -986,23 +986,23 @@ func deepCopy_expapi_HorizontalPodAutoscalerStatus(in HorizontalPodAutoscalerSta
|
||||
return nil
|
||||
}
|
||||
|
||||
func deepCopy_expapi_Job(in Job, out *Job, c *conversion.Cloner) error {
|
||||
func deepCopy_experimental_Job(in Job, out *Job, c *conversion.Cloner) error {
|
||||
if err := deepCopy_api_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := deepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := deepCopy_expapi_JobSpec(in.Spec, &out.Spec, c); err != nil {
|
||||
if err := deepCopy_experimental_JobSpec(in.Spec, &out.Spec, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := deepCopy_expapi_JobStatus(in.Status, &out.Status, c); err != nil {
|
||||
if err := deepCopy_experimental_JobStatus(in.Status, &out.Status, c); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func deepCopy_expapi_JobCondition(in JobCondition, out *JobCondition, c *conversion.Cloner) error {
|
||||
func deepCopy_experimental_JobCondition(in JobCondition, out *JobCondition, c *conversion.Cloner) error {
|
||||
out.Type = in.Type
|
||||
out.Status = in.Status
|
||||
if err := deepCopy_util_Time(in.LastProbeTime, &out.LastProbeTime, c); err != nil {
|
||||
@@ -1016,7 +1016,7 @@ func deepCopy_expapi_JobCondition(in JobCondition, out *JobCondition, c *convers
|
||||
return nil
|
||||
}
|
||||
|
||||
func deepCopy_expapi_JobList(in JobList, out *JobList, c *conversion.Cloner) error {
|
||||
func deepCopy_experimental_JobList(in JobList, out *JobList, c *conversion.Cloner) error {
|
||||
if err := deepCopy_api_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -1026,7 +1026,7 @@ func deepCopy_expapi_JobList(in JobList, out *JobList, c *conversion.Cloner) err
|
||||
if in.Items != nil {
|
||||
out.Items = make([]Job, len(in.Items))
|
||||
for i := range in.Items {
|
||||
if err := deepCopy_expapi_Job(in.Items[i], &out.Items[i], c); err != nil {
|
||||
if err := deepCopy_experimental_Job(in.Items[i], &out.Items[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -1036,7 +1036,7 @@ func deepCopy_expapi_JobList(in JobList, out *JobList, c *conversion.Cloner) err
|
||||
return nil
|
||||
}
|
||||
|
||||
func deepCopy_expapi_JobSpec(in JobSpec, out *JobSpec, c *conversion.Cloner) error {
|
||||
func deepCopy_experimental_JobSpec(in JobSpec, out *JobSpec, c *conversion.Cloner) error {
|
||||
if in.Parallelism != nil {
|
||||
out.Parallelism = new(int)
|
||||
*out.Parallelism = *in.Parallelism
|
||||
@@ -1068,11 +1068,11 @@ func deepCopy_expapi_JobSpec(in JobSpec, out *JobSpec, c *conversion.Cloner) err
|
||||
return nil
|
||||
}
|
||||
|
||||
func deepCopy_expapi_JobStatus(in JobStatus, out *JobStatus, c *conversion.Cloner) error {
|
||||
func deepCopy_experimental_JobStatus(in JobStatus, out *JobStatus, c *conversion.Cloner) error {
|
||||
if in.Conditions != nil {
|
||||
out.Conditions = make([]JobCondition, len(in.Conditions))
|
||||
for i := range in.Conditions {
|
||||
if err := deepCopy_expapi_JobCondition(in.Conditions[i], &out.Conditions[i], c); err != nil {
|
||||
if err := deepCopy_experimental_JobCondition(in.Conditions[i], &out.Conditions[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -1101,14 +1101,14 @@ func deepCopy_expapi_JobStatus(in JobStatus, out *JobStatus, c *conversion.Clone
|
||||
return nil
|
||||
}
|
||||
|
||||
func deepCopy_expapi_ReplicationControllerDummy(in ReplicationControllerDummy, out *ReplicationControllerDummy, c *conversion.Cloner) error {
|
||||
func deepCopy_experimental_ReplicationControllerDummy(in ReplicationControllerDummy, out *ReplicationControllerDummy, c *conversion.Cloner) error {
|
||||
if err := deepCopy_api_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func deepCopy_expapi_ResourceConsumption(in ResourceConsumption, out *ResourceConsumption, c *conversion.Cloner) error {
|
||||
func deepCopy_experimental_ResourceConsumption(in ResourceConsumption, out *ResourceConsumption, c *conversion.Cloner) error {
|
||||
out.Resource = in.Resource
|
||||
if err := deepCopy_resource_Quantity(in.Quantity, &out.Quantity, c); err != nil {
|
||||
return err
|
||||
@@ -1116,7 +1116,7 @@ func deepCopy_expapi_ResourceConsumption(in ResourceConsumption, out *ResourceCo
|
||||
return nil
|
||||
}
|
||||
|
||||
func deepCopy_expapi_RollingUpdateDeployment(in RollingUpdateDeployment, out *RollingUpdateDeployment, c *conversion.Cloner) error {
|
||||
func deepCopy_experimental_RollingUpdateDeployment(in RollingUpdateDeployment, out *RollingUpdateDeployment, c *conversion.Cloner) error {
|
||||
if err := deepCopy_util_IntOrString(in.MaxUnavailable, &out.MaxUnavailable, c); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -1127,28 +1127,28 @@ func deepCopy_expapi_RollingUpdateDeployment(in RollingUpdateDeployment, out *Ro
|
||||
return nil
|
||||
}
|
||||
|
||||
func deepCopy_expapi_Scale(in Scale, out *Scale, c *conversion.Cloner) error {
|
||||
func deepCopy_experimental_Scale(in Scale, out *Scale, c *conversion.Cloner) error {
|
||||
if err := deepCopy_api_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := deepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := deepCopy_expapi_ScaleSpec(in.Spec, &out.Spec, c); err != nil {
|
||||
if err := deepCopy_experimental_ScaleSpec(in.Spec, &out.Spec, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := deepCopy_expapi_ScaleStatus(in.Status, &out.Status, c); err != nil {
|
||||
if err := deepCopy_experimental_ScaleStatus(in.Status, &out.Status, c); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func deepCopy_expapi_ScaleSpec(in ScaleSpec, out *ScaleSpec, c *conversion.Cloner) error {
|
||||
func deepCopy_experimental_ScaleSpec(in ScaleSpec, out *ScaleSpec, c *conversion.Cloner) error {
|
||||
out.Replicas = in.Replicas
|
||||
return nil
|
||||
}
|
||||
|
||||
func deepCopy_expapi_ScaleStatus(in ScaleStatus, out *ScaleStatus, c *conversion.Cloner) error {
|
||||
func deepCopy_experimental_ScaleStatus(in ScaleStatus, out *ScaleStatus, c *conversion.Cloner) error {
|
||||
out.Replicas = in.Replicas
|
||||
if in.Selector != nil {
|
||||
out.Selector = make(map[string]string)
|
||||
@@ -1161,7 +1161,7 @@ func deepCopy_expapi_ScaleStatus(in ScaleStatus, out *ScaleStatus, c *conversion
|
||||
return nil
|
||||
}
|
||||
|
||||
func deepCopy_expapi_SubresourceReference(in SubresourceReference, out *SubresourceReference, c *conversion.Cloner) error {
|
||||
func deepCopy_experimental_SubresourceReference(in SubresourceReference, out *SubresourceReference, c *conversion.Cloner) error {
|
||||
out.Kind = in.Kind
|
||||
out.Namespace = in.Namespace
|
||||
out.Name = in.Name
|
||||
@@ -1170,7 +1170,7 @@ func deepCopy_expapi_SubresourceReference(in SubresourceReference, out *Subresou
|
||||
return nil
|
||||
}
|
||||
|
||||
func deepCopy_expapi_ThirdPartyResource(in ThirdPartyResource, out *ThirdPartyResource, c *conversion.Cloner) error {
|
||||
func deepCopy_experimental_ThirdPartyResource(in ThirdPartyResource, out *ThirdPartyResource, c *conversion.Cloner) error {
|
||||
if err := deepCopy_api_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -1181,7 +1181,7 @@ func deepCopy_expapi_ThirdPartyResource(in ThirdPartyResource, out *ThirdPartyRe
|
||||
if in.Versions != nil {
|
||||
out.Versions = make([]APIVersion, len(in.Versions))
|
||||
for i := range in.Versions {
|
||||
if err := deepCopy_expapi_APIVersion(in.Versions[i], &out.Versions[i], c); err != nil {
|
||||
if err := deepCopy_experimental_APIVersion(in.Versions[i], &out.Versions[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -1191,7 +1191,7 @@ func deepCopy_expapi_ThirdPartyResource(in ThirdPartyResource, out *ThirdPartyRe
|
||||
return nil
|
||||
}
|
||||
|
||||
func deepCopy_expapi_ThirdPartyResourceData(in ThirdPartyResourceData, out *ThirdPartyResourceData, c *conversion.Cloner) error {
|
||||
func deepCopy_experimental_ThirdPartyResourceData(in ThirdPartyResourceData, out *ThirdPartyResourceData, c *conversion.Cloner) error {
|
||||
if err := deepCopy_api_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -1209,7 +1209,7 @@ func deepCopy_expapi_ThirdPartyResourceData(in ThirdPartyResourceData, out *Thir
|
||||
return nil
|
||||
}
|
||||
|
||||
func deepCopy_expapi_ThirdPartyResourceDataList(in ThirdPartyResourceDataList, out *ThirdPartyResourceDataList, c *conversion.Cloner) error {
|
||||
func deepCopy_experimental_ThirdPartyResourceDataList(in ThirdPartyResourceDataList, out *ThirdPartyResourceDataList, c *conversion.Cloner) error {
|
||||
if err := deepCopy_api_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -1219,7 +1219,7 @@ func deepCopy_expapi_ThirdPartyResourceDataList(in ThirdPartyResourceDataList, o
|
||||
if in.Items != nil {
|
||||
out.Items = make([]ThirdPartyResourceData, len(in.Items))
|
||||
for i := range in.Items {
|
||||
if err := deepCopy_expapi_ThirdPartyResourceData(in.Items[i], &out.Items[i], c); err != nil {
|
||||
if err := deepCopy_experimental_ThirdPartyResourceData(in.Items[i], &out.Items[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -1229,7 +1229,7 @@ func deepCopy_expapi_ThirdPartyResourceDataList(in ThirdPartyResourceDataList, o
|
||||
return nil
|
||||
}
|
||||
|
||||
func deepCopy_expapi_ThirdPartyResourceList(in ThirdPartyResourceList, out *ThirdPartyResourceList, c *conversion.Cloner) error {
|
||||
func deepCopy_experimental_ThirdPartyResourceList(in ThirdPartyResourceList, out *ThirdPartyResourceList, c *conversion.Cloner) error {
|
||||
if err := deepCopy_api_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -1239,7 +1239,7 @@ func deepCopy_expapi_ThirdPartyResourceList(in ThirdPartyResourceList, out *Thir
|
||||
if in.Items != nil {
|
||||
out.Items = make([]ThirdPartyResource, len(in.Items))
|
||||
for i := range in.Items {
|
||||
if err := deepCopy_expapi_ThirdPartyResource(in.Items[i], &out.Items[i], c); err != nil {
|
||||
if err := deepCopy_experimental_ThirdPartyResource(in.Items[i], &out.Items[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -1307,36 +1307,36 @@ func init() {
|
||||
deepCopy_api_VolumeMount,
|
||||
deepCopy_api_VolumeSource,
|
||||
deepCopy_resource_Quantity,
|
||||
deepCopy_expapi_APIVersion,
|
||||
deepCopy_expapi_DaemonSet,
|
||||
deepCopy_expapi_DaemonSetList,
|
||||
deepCopy_expapi_DaemonSetSpec,
|
||||
deepCopy_expapi_DaemonSetStatus,
|
||||
deepCopy_expapi_Deployment,
|
||||
deepCopy_expapi_DeploymentList,
|
||||
deepCopy_expapi_DeploymentSpec,
|
||||
deepCopy_expapi_DeploymentStatus,
|
||||
deepCopy_expapi_DeploymentStrategy,
|
||||
deepCopy_expapi_HorizontalPodAutoscaler,
|
||||
deepCopy_expapi_HorizontalPodAutoscalerList,
|
||||
deepCopy_expapi_HorizontalPodAutoscalerSpec,
|
||||
deepCopy_expapi_HorizontalPodAutoscalerStatus,
|
||||
deepCopy_expapi_Job,
|
||||
deepCopy_expapi_JobCondition,
|
||||
deepCopy_expapi_JobList,
|
||||
deepCopy_expapi_JobSpec,
|
||||
deepCopy_expapi_JobStatus,
|
||||
deepCopy_expapi_ReplicationControllerDummy,
|
||||
deepCopy_expapi_ResourceConsumption,
|
||||
deepCopy_expapi_RollingUpdateDeployment,
|
||||
deepCopy_expapi_Scale,
|
||||
deepCopy_expapi_ScaleSpec,
|
||||
deepCopy_expapi_ScaleStatus,
|
||||
deepCopy_expapi_SubresourceReference,
|
||||
deepCopy_expapi_ThirdPartyResource,
|
||||
deepCopy_expapi_ThirdPartyResourceData,
|
||||
deepCopy_expapi_ThirdPartyResourceDataList,
|
||||
deepCopy_expapi_ThirdPartyResourceList,
|
||||
deepCopy_experimental_APIVersion,
|
||||
deepCopy_experimental_DaemonSet,
|
||||
deepCopy_experimental_DaemonSetList,
|
||||
deepCopy_experimental_DaemonSetSpec,
|
||||
deepCopy_experimental_DaemonSetStatus,
|
||||
deepCopy_experimental_Deployment,
|
||||
deepCopy_experimental_DeploymentList,
|
||||
deepCopy_experimental_DeploymentSpec,
|
||||
deepCopy_experimental_DeploymentStatus,
|
||||
deepCopy_experimental_DeploymentStrategy,
|
||||
deepCopy_experimental_HorizontalPodAutoscaler,
|
||||
deepCopy_experimental_HorizontalPodAutoscalerList,
|
||||
deepCopy_experimental_HorizontalPodAutoscalerSpec,
|
||||
deepCopy_experimental_HorizontalPodAutoscalerStatus,
|
||||
deepCopy_experimental_Job,
|
||||
deepCopy_experimental_JobCondition,
|
||||
deepCopy_experimental_JobList,
|
||||
deepCopy_experimental_JobSpec,
|
||||
deepCopy_experimental_JobStatus,
|
||||
deepCopy_experimental_ReplicationControllerDummy,
|
||||
deepCopy_experimental_ResourceConsumption,
|
||||
deepCopy_experimental_RollingUpdateDeployment,
|
||||
deepCopy_experimental_Scale,
|
||||
deepCopy_experimental_ScaleSpec,
|
||||
deepCopy_experimental_ScaleStatus,
|
||||
deepCopy_experimental_SubresourceReference,
|
||||
deepCopy_experimental_ThirdPartyResource,
|
||||
deepCopy_experimental_ThirdPartyResourceData,
|
||||
deepCopy_experimental_ThirdPartyResourceDataList,
|
||||
deepCopy_experimental_ThirdPartyResourceList,
|
||||
deepCopy_util_IntOrString,
|
||||
deepCopy_util_Time,
|
||||
)
|
@@ -23,8 +23,8 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/meta"
|
||||
"k8s.io/kubernetes/pkg/api/registered"
|
||||
_ "k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/expapi/v1"
|
||||
_ "k8s.io/kubernetes/pkg/apis/experimental"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental/v1"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/util/sets"
|
||||
)
|
||||
@@ -39,7 +39,7 @@ var (
|
||||
RESTMapper meta.RESTMapper
|
||||
)
|
||||
|
||||
const importPrefix = "k8s.io/kubernetes/pkg/expapi"
|
||||
const importPrefix = "k8s.io/kubernetes/pkg/apis/experimental"
|
||||
|
||||
func init() {
|
||||
Version = registered.RegisteredVersions[0]
|
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package expapi
|
||||
package experimental
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
@@ -19,7 +19,7 @@ package testapi
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"k8s.io/kubernetes/pkg/expapi/latest"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental/latest"
|
||||
)
|
||||
|
||||
// Returns the appropriate path for the given prefix (watch, proxy, redirect, etc), resource, namespace and name.
|
@@ -15,7 +15,7 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
This file (together with pkg/expapi/v1/types.go) contain the experimental
|
||||
This file (together with pkg/apis/experimental/v1/types.go) contain the experimental
|
||||
types in kubernetes. These API objects are experimental, meaning that the
|
||||
APIs may be broken at any time by the kubernetes team.
|
||||
|
||||
@@ -26,7 +26,7 @@ beyond registration differences. In other words, experimental API group
|
||||
support is experimental.
|
||||
*/
|
||||
|
||||
package expapi
|
||||
package experimental
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
@@ -21,8 +21,8 @@ import (
|
||||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
v1 "k8s.io/kubernetes/pkg/api/v1"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
"k8s.io/kubernetes/pkg/conversion"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/util"
|
||||
)
|
||||
|
||||
@@ -31,12 +31,12 @@ func addConversionFuncs() {
|
||||
err := api.Scheme.AddConversionFuncs(
|
||||
convert_api_PodSpec_To_v1_PodSpec,
|
||||
convert_v1_PodSpec_To_api_PodSpec,
|
||||
convert_expapi_DeploymentSpec_To_v1_DeploymentSpec,
|
||||
convert_v1_DeploymentSpec_To_expapi_DeploymentSpec,
|
||||
convert_expapi_DeploymentStrategy_To_v1_DeploymentStrategy,
|
||||
convert_v1_DeploymentStrategy_To_expapi_DeploymentStrategy,
|
||||
convert_expapi_RollingUpdateDeployment_To_v1_RollingUpdateDeployment,
|
||||
convert_v1_RollingUpdateDeployment_To_expapi_RollingUpdateDeployment,
|
||||
convert_experimental_DeploymentSpec_To_v1_DeploymentSpec,
|
||||
convert_v1_DeploymentSpec_To_experimental_DeploymentSpec,
|
||||
convert_experimental_DeploymentStrategy_To_v1_DeploymentStrategy,
|
||||
convert_v1_DeploymentStrategy_To_experimental_DeploymentStrategy,
|
||||
convert_experimental_RollingUpdateDeployment_To_v1_RollingUpdateDeployment,
|
||||
convert_v1_RollingUpdateDeployment_To_experimental_RollingUpdateDeployment,
|
||||
)
|
||||
if err != nil {
|
||||
// If one of the conversion functions is malformed, detect it immediately.
|
||||
@@ -178,9 +178,9 @@ func convert_v1_PodSpec_To_api_PodSpec(in *v1.PodSpec, out *api.PodSpec, s conve
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_expapi_DeploymentSpec_To_v1_DeploymentSpec(in *expapi.DeploymentSpec, out *DeploymentSpec, s conversion.Scope) error {
|
||||
func convert_experimental_DeploymentSpec_To_v1_DeploymentSpec(in *experimental.DeploymentSpec, out *DeploymentSpec, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*expapi.DeploymentSpec))(in)
|
||||
defaulting.(func(*experimental.DeploymentSpec))(in)
|
||||
}
|
||||
out.Replicas = new(int)
|
||||
*out.Replicas = in.Replicas
|
||||
@@ -200,7 +200,7 @@ func convert_expapi_DeploymentSpec_To_v1_DeploymentSpec(in *expapi.DeploymentSpe
|
||||
} else {
|
||||
out.Template = nil
|
||||
}
|
||||
if err := convert_expapi_DeploymentStrategy_To_v1_DeploymentStrategy(&in.Strategy, &out.Strategy, s); err != nil {
|
||||
if err := convert_experimental_DeploymentStrategy_To_v1_DeploymentStrategy(&in.Strategy, &out.Strategy, s); err != nil {
|
||||
return err
|
||||
}
|
||||
out.UniqueLabelKey = new(string)
|
||||
@@ -208,7 +208,7 @@ func convert_expapi_DeploymentSpec_To_v1_DeploymentSpec(in *expapi.DeploymentSpe
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_v1_DeploymentSpec_To_expapi_DeploymentSpec(in *DeploymentSpec, out *expapi.DeploymentSpec, s conversion.Scope) error {
|
||||
func convert_v1_DeploymentSpec_To_experimental_DeploymentSpec(in *DeploymentSpec, out *experimental.DeploymentSpec, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*DeploymentSpec))(in)
|
||||
}
|
||||
@@ -231,7 +231,7 @@ func convert_v1_DeploymentSpec_To_expapi_DeploymentSpec(in *DeploymentSpec, out
|
||||
} else {
|
||||
out.Template = nil
|
||||
}
|
||||
if err := convert_v1_DeploymentStrategy_To_expapi_DeploymentStrategy(&in.Strategy, &out.Strategy, s); err != nil {
|
||||
if err := convert_v1_DeploymentStrategy_To_experimental_DeploymentStrategy(&in.Strategy, &out.Strategy, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if in.UniqueLabelKey != nil {
|
||||
@@ -240,14 +240,14 @@ func convert_v1_DeploymentSpec_To_expapi_DeploymentSpec(in *DeploymentSpec, out
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_expapi_DeploymentStrategy_To_v1_DeploymentStrategy(in *expapi.DeploymentStrategy, out *DeploymentStrategy, s conversion.Scope) error {
|
||||
func convert_experimental_DeploymentStrategy_To_v1_DeploymentStrategy(in *experimental.DeploymentStrategy, out *DeploymentStrategy, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*expapi.DeploymentStrategy))(in)
|
||||
defaulting.(func(*experimental.DeploymentStrategy))(in)
|
||||
}
|
||||
out.Type = DeploymentType(in.Type)
|
||||
if in.RollingUpdate != nil {
|
||||
out.RollingUpdate = new(RollingUpdateDeployment)
|
||||
if err := convert_expapi_RollingUpdateDeployment_To_v1_RollingUpdateDeployment(in.RollingUpdate, out.RollingUpdate, s); err != nil {
|
||||
if err := convert_experimental_RollingUpdateDeployment_To_v1_RollingUpdateDeployment(in.RollingUpdate, out.RollingUpdate, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
@@ -256,14 +256,14 @@ func convert_expapi_DeploymentStrategy_To_v1_DeploymentStrategy(in *expapi.Deplo
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_v1_DeploymentStrategy_To_expapi_DeploymentStrategy(in *DeploymentStrategy, out *expapi.DeploymentStrategy, s conversion.Scope) error {
|
||||
func convert_v1_DeploymentStrategy_To_experimental_DeploymentStrategy(in *DeploymentStrategy, out *experimental.DeploymentStrategy, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*DeploymentStrategy))(in)
|
||||
}
|
||||
out.Type = expapi.DeploymentType(in.Type)
|
||||
out.Type = experimental.DeploymentType(in.Type)
|
||||
if in.RollingUpdate != nil {
|
||||
out.RollingUpdate = new(expapi.RollingUpdateDeployment)
|
||||
if err := convert_v1_RollingUpdateDeployment_To_expapi_RollingUpdateDeployment(in.RollingUpdate, out.RollingUpdate, s); err != nil {
|
||||
out.RollingUpdate = new(experimental.RollingUpdateDeployment)
|
||||
if err := convert_v1_RollingUpdateDeployment_To_experimental_RollingUpdateDeployment(in.RollingUpdate, out.RollingUpdate, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
@@ -272,9 +272,9 @@ func convert_v1_DeploymentStrategy_To_expapi_DeploymentStrategy(in *DeploymentSt
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_expapi_RollingUpdateDeployment_To_v1_RollingUpdateDeployment(in *expapi.RollingUpdateDeployment, out *RollingUpdateDeployment, s conversion.Scope) error {
|
||||
func convert_experimental_RollingUpdateDeployment_To_v1_RollingUpdateDeployment(in *experimental.RollingUpdateDeployment, out *RollingUpdateDeployment, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*expapi.RollingUpdateDeployment))(in)
|
||||
defaulting.(func(*experimental.RollingUpdateDeployment))(in)
|
||||
}
|
||||
if out.MaxUnavailable == nil {
|
||||
out.MaxUnavailable = &util.IntOrString{}
|
||||
@@ -292,7 +292,7 @@ func convert_expapi_RollingUpdateDeployment_To_v1_RollingUpdateDeployment(in *ex
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_v1_RollingUpdateDeployment_To_expapi_RollingUpdateDeployment(in *RollingUpdateDeployment, out *expapi.RollingUpdateDeployment, s conversion.Scope) error {
|
||||
func convert_v1_RollingUpdateDeployment_To_experimental_RollingUpdateDeployment(in *RollingUpdateDeployment, out *experimental.RollingUpdateDeployment, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*RollingUpdateDeployment))(in)
|
||||
}
|
@@ -24,8 +24,8 @@ import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
resource "k8s.io/kubernetes/pkg/api/resource"
|
||||
v1 "k8s.io/kubernetes/pkg/api/v1"
|
||||
experimental "k8s.io/kubernetes/pkg/apis/experimental"
|
||||
conversion "k8s.io/kubernetes/pkg/conversion"
|
||||
expapi "k8s.io/kubernetes/pkg/expapi"
|
||||
)
|
||||
|
||||
func convert_api_AWSElasticBlockStoreVolumeSource_To_v1_AWSElasticBlockStoreVolumeSource(in *api.AWSElasticBlockStoreVolumeSource, out *v1.AWSElasticBlockStoreVolumeSource, s conversion.Scope) error {
|
||||
@@ -1562,18 +1562,18 @@ func convert_v1_VolumeSource_To_api_VolumeSource(in *v1.VolumeSource, out *api.V
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_expapi_APIVersion_To_v1_APIVersion(in *expapi.APIVersion, out *APIVersion, s conversion.Scope) error {
|
||||
func convert_experimental_APIVersion_To_v1_APIVersion(in *experimental.APIVersion, out *APIVersion, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*expapi.APIVersion))(in)
|
||||
defaulting.(func(*experimental.APIVersion))(in)
|
||||
}
|
||||
out.Name = in.Name
|
||||
out.APIGroup = in.APIGroup
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_expapi_DaemonSet_To_v1_DaemonSet(in *expapi.DaemonSet, out *DaemonSet, s conversion.Scope) error {
|
||||
func convert_experimental_DaemonSet_To_v1_DaemonSet(in *experimental.DaemonSet, out *DaemonSet, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*expapi.DaemonSet))(in)
|
||||
defaulting.(func(*experimental.DaemonSet))(in)
|
||||
}
|
||||
if err := convert_api_TypeMeta_To_v1_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
@@ -1581,18 +1581,18 @@ func convert_expapi_DaemonSet_To_v1_DaemonSet(in *expapi.DaemonSet, out *DaemonS
|
||||
if err := convert_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := convert_expapi_DaemonSetSpec_To_v1_DaemonSetSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
if err := convert_experimental_DaemonSetSpec_To_v1_DaemonSetSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := convert_expapi_DaemonSetStatus_To_v1_DaemonSetStatus(&in.Status, &out.Status, s); err != nil {
|
||||
if err := convert_experimental_DaemonSetStatus_To_v1_DaemonSetStatus(&in.Status, &out.Status, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_expapi_DaemonSetList_To_v1_DaemonSetList(in *expapi.DaemonSetList, out *DaemonSetList, s conversion.Scope) error {
|
||||
func convert_experimental_DaemonSetList_To_v1_DaemonSetList(in *experimental.DaemonSetList, out *DaemonSetList, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*expapi.DaemonSetList))(in)
|
||||
defaulting.(func(*experimental.DaemonSetList))(in)
|
||||
}
|
||||
if err := convert_api_TypeMeta_To_v1_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
@@ -1603,7 +1603,7 @@ func convert_expapi_DaemonSetList_To_v1_DaemonSetList(in *expapi.DaemonSetList,
|
||||
if in.Items != nil {
|
||||
out.Items = make([]DaemonSet, len(in.Items))
|
||||
for i := range in.Items {
|
||||
if err := convert_expapi_DaemonSet_To_v1_DaemonSet(&in.Items[i], &out.Items[i], s); err != nil {
|
||||
if err := convert_experimental_DaemonSet_To_v1_DaemonSet(&in.Items[i], &out.Items[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -1613,9 +1613,9 @@ func convert_expapi_DaemonSetList_To_v1_DaemonSetList(in *expapi.DaemonSetList,
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_expapi_DaemonSetSpec_To_v1_DaemonSetSpec(in *expapi.DaemonSetSpec, out *DaemonSetSpec, s conversion.Scope) error {
|
||||
func convert_experimental_DaemonSetSpec_To_v1_DaemonSetSpec(in *experimental.DaemonSetSpec, out *DaemonSetSpec, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*expapi.DaemonSetSpec))(in)
|
||||
defaulting.(func(*experimental.DaemonSetSpec))(in)
|
||||
}
|
||||
if in.Selector != nil {
|
||||
out.Selector = make(map[string]string)
|
||||
@@ -1636,9 +1636,9 @@ func convert_expapi_DaemonSetSpec_To_v1_DaemonSetSpec(in *expapi.DaemonSetSpec,
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_expapi_DaemonSetStatus_To_v1_DaemonSetStatus(in *expapi.DaemonSetStatus, out *DaemonSetStatus, s conversion.Scope) error {
|
||||
func convert_experimental_DaemonSetStatus_To_v1_DaemonSetStatus(in *experimental.DaemonSetStatus, out *DaemonSetStatus, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*expapi.DaemonSetStatus))(in)
|
||||
defaulting.(func(*experimental.DaemonSetStatus))(in)
|
||||
}
|
||||
out.CurrentNumberScheduled = in.CurrentNumberScheduled
|
||||
out.NumberMisscheduled = in.NumberMisscheduled
|
||||
@@ -1646,9 +1646,9 @@ func convert_expapi_DaemonSetStatus_To_v1_DaemonSetStatus(in *expapi.DaemonSetSt
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_expapi_Deployment_To_v1_Deployment(in *expapi.Deployment, out *Deployment, s conversion.Scope) error {
|
||||
func convert_experimental_Deployment_To_v1_Deployment(in *experimental.Deployment, out *Deployment, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*expapi.Deployment))(in)
|
||||
defaulting.(func(*experimental.Deployment))(in)
|
||||
}
|
||||
if err := convert_api_TypeMeta_To_v1_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
@@ -1656,18 +1656,18 @@ func convert_expapi_Deployment_To_v1_Deployment(in *expapi.Deployment, out *Depl
|
||||
if err := convert_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := convert_expapi_DeploymentSpec_To_v1_DeploymentSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
if err := convert_experimental_DeploymentSpec_To_v1_DeploymentSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := convert_expapi_DeploymentStatus_To_v1_DeploymentStatus(&in.Status, &out.Status, s); err != nil {
|
||||
if err := convert_experimental_DeploymentStatus_To_v1_DeploymentStatus(&in.Status, &out.Status, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_expapi_DeploymentList_To_v1_DeploymentList(in *expapi.DeploymentList, out *DeploymentList, s conversion.Scope) error {
|
||||
func convert_experimental_DeploymentList_To_v1_DeploymentList(in *experimental.DeploymentList, out *DeploymentList, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*expapi.DeploymentList))(in)
|
||||
defaulting.(func(*experimental.DeploymentList))(in)
|
||||
}
|
||||
if err := convert_api_TypeMeta_To_v1_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
@@ -1678,7 +1678,7 @@ func convert_expapi_DeploymentList_To_v1_DeploymentList(in *expapi.DeploymentLis
|
||||
if in.Items != nil {
|
||||
out.Items = make([]Deployment, len(in.Items))
|
||||
for i := range in.Items {
|
||||
if err := convert_expapi_Deployment_To_v1_Deployment(&in.Items[i], &out.Items[i], s); err != nil {
|
||||
if err := convert_experimental_Deployment_To_v1_Deployment(&in.Items[i], &out.Items[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -1688,18 +1688,18 @@ func convert_expapi_DeploymentList_To_v1_DeploymentList(in *expapi.DeploymentLis
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_expapi_DeploymentStatus_To_v1_DeploymentStatus(in *expapi.DeploymentStatus, out *DeploymentStatus, s conversion.Scope) error {
|
||||
func convert_experimental_DeploymentStatus_To_v1_DeploymentStatus(in *experimental.DeploymentStatus, out *DeploymentStatus, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*expapi.DeploymentStatus))(in)
|
||||
defaulting.(func(*experimental.DeploymentStatus))(in)
|
||||
}
|
||||
out.Replicas = in.Replicas
|
||||
out.UpdatedReplicas = in.UpdatedReplicas
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_expapi_HorizontalPodAutoscaler_To_v1_HorizontalPodAutoscaler(in *expapi.HorizontalPodAutoscaler, out *HorizontalPodAutoscaler, s conversion.Scope) error {
|
||||
func convert_experimental_HorizontalPodAutoscaler_To_v1_HorizontalPodAutoscaler(in *experimental.HorizontalPodAutoscaler, out *HorizontalPodAutoscaler, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*expapi.HorizontalPodAutoscaler))(in)
|
||||
defaulting.(func(*experimental.HorizontalPodAutoscaler))(in)
|
||||
}
|
||||
if err := convert_api_TypeMeta_To_v1_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
@@ -1707,12 +1707,12 @@ func convert_expapi_HorizontalPodAutoscaler_To_v1_HorizontalPodAutoscaler(in *ex
|
||||
if err := convert_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := convert_expapi_HorizontalPodAutoscalerSpec_To_v1_HorizontalPodAutoscalerSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
if err := convert_experimental_HorizontalPodAutoscalerSpec_To_v1_HorizontalPodAutoscalerSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if in.Status != nil {
|
||||
out.Status = new(HorizontalPodAutoscalerStatus)
|
||||
if err := convert_expapi_HorizontalPodAutoscalerStatus_To_v1_HorizontalPodAutoscalerStatus(in.Status, out.Status, s); err != nil {
|
||||
if err := convert_experimental_HorizontalPodAutoscalerStatus_To_v1_HorizontalPodAutoscalerStatus(in.Status, out.Status, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
@@ -1721,9 +1721,9 @@ func convert_expapi_HorizontalPodAutoscaler_To_v1_HorizontalPodAutoscaler(in *ex
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_expapi_HorizontalPodAutoscalerList_To_v1_HorizontalPodAutoscalerList(in *expapi.HorizontalPodAutoscalerList, out *HorizontalPodAutoscalerList, s conversion.Scope) error {
|
||||
func convert_experimental_HorizontalPodAutoscalerList_To_v1_HorizontalPodAutoscalerList(in *experimental.HorizontalPodAutoscalerList, out *HorizontalPodAutoscalerList, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*expapi.HorizontalPodAutoscalerList))(in)
|
||||
defaulting.(func(*experimental.HorizontalPodAutoscalerList))(in)
|
||||
}
|
||||
if err := convert_api_TypeMeta_To_v1_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
@@ -1734,7 +1734,7 @@ func convert_expapi_HorizontalPodAutoscalerList_To_v1_HorizontalPodAutoscalerLis
|
||||
if in.Items != nil {
|
||||
out.Items = make([]HorizontalPodAutoscaler, len(in.Items))
|
||||
for i := range in.Items {
|
||||
if err := convert_expapi_HorizontalPodAutoscaler_To_v1_HorizontalPodAutoscaler(&in.Items[i], &out.Items[i], s); err != nil {
|
||||
if err := convert_experimental_HorizontalPodAutoscaler_To_v1_HorizontalPodAutoscaler(&in.Items[i], &out.Items[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -1744,13 +1744,13 @@ func convert_expapi_HorizontalPodAutoscalerList_To_v1_HorizontalPodAutoscalerLis
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_expapi_HorizontalPodAutoscalerSpec_To_v1_HorizontalPodAutoscalerSpec(in *expapi.HorizontalPodAutoscalerSpec, out *HorizontalPodAutoscalerSpec, s conversion.Scope) error {
|
||||
func convert_experimental_HorizontalPodAutoscalerSpec_To_v1_HorizontalPodAutoscalerSpec(in *experimental.HorizontalPodAutoscalerSpec, out *HorizontalPodAutoscalerSpec, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*expapi.HorizontalPodAutoscalerSpec))(in)
|
||||
defaulting.(func(*experimental.HorizontalPodAutoscalerSpec))(in)
|
||||
}
|
||||
if in.ScaleRef != nil {
|
||||
out.ScaleRef = new(SubresourceReference)
|
||||
if err := convert_expapi_SubresourceReference_To_v1_SubresourceReference(in.ScaleRef, out.ScaleRef, s); err != nil {
|
||||
if err := convert_experimental_SubresourceReference_To_v1_SubresourceReference(in.ScaleRef, out.ScaleRef, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
@@ -1758,21 +1758,21 @@ func convert_expapi_HorizontalPodAutoscalerSpec_To_v1_HorizontalPodAutoscalerSpe
|
||||
}
|
||||
out.MinCount = in.MinCount
|
||||
out.MaxCount = in.MaxCount
|
||||
if err := convert_expapi_ResourceConsumption_To_v1_ResourceConsumption(&in.Target, &out.Target, s); err != nil {
|
||||
if err := convert_experimental_ResourceConsumption_To_v1_ResourceConsumption(&in.Target, &out.Target, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_expapi_HorizontalPodAutoscalerStatus_To_v1_HorizontalPodAutoscalerStatus(in *expapi.HorizontalPodAutoscalerStatus, out *HorizontalPodAutoscalerStatus, s conversion.Scope) error {
|
||||
func convert_experimental_HorizontalPodAutoscalerStatus_To_v1_HorizontalPodAutoscalerStatus(in *experimental.HorizontalPodAutoscalerStatus, out *HorizontalPodAutoscalerStatus, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*expapi.HorizontalPodAutoscalerStatus))(in)
|
||||
defaulting.(func(*experimental.HorizontalPodAutoscalerStatus))(in)
|
||||
}
|
||||
out.CurrentReplicas = in.CurrentReplicas
|
||||
out.DesiredReplicas = in.DesiredReplicas
|
||||
if in.CurrentConsumption != nil {
|
||||
out.CurrentConsumption = new(ResourceConsumption)
|
||||
if err := convert_expapi_ResourceConsumption_To_v1_ResourceConsumption(in.CurrentConsumption, out.CurrentConsumption, s); err != nil {
|
||||
if err := convert_experimental_ResourceConsumption_To_v1_ResourceConsumption(in.CurrentConsumption, out.CurrentConsumption, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
@@ -1788,9 +1788,9 @@ func convert_expapi_HorizontalPodAutoscalerStatus_To_v1_HorizontalPodAutoscalerS
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_expapi_Job_To_v1_Job(in *expapi.Job, out *Job, s conversion.Scope) error {
|
||||
func convert_experimental_Job_To_v1_Job(in *experimental.Job, out *Job, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*expapi.Job))(in)
|
||||
defaulting.(func(*experimental.Job))(in)
|
||||
}
|
||||
if err := convert_api_TypeMeta_To_v1_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
@@ -1798,18 +1798,18 @@ func convert_expapi_Job_To_v1_Job(in *expapi.Job, out *Job, s conversion.Scope)
|
||||
if err := convert_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := convert_expapi_JobSpec_To_v1_JobSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
if err := convert_experimental_JobSpec_To_v1_JobSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := convert_expapi_JobStatus_To_v1_JobStatus(&in.Status, &out.Status, s); err != nil {
|
||||
if err := convert_experimental_JobStatus_To_v1_JobStatus(&in.Status, &out.Status, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_expapi_JobCondition_To_v1_JobCondition(in *expapi.JobCondition, out *JobCondition, s conversion.Scope) error {
|
||||
func convert_experimental_JobCondition_To_v1_JobCondition(in *experimental.JobCondition, out *JobCondition, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*expapi.JobCondition))(in)
|
||||
defaulting.(func(*experimental.JobCondition))(in)
|
||||
}
|
||||
out.Type = JobConditionType(in.Type)
|
||||
out.Status = v1.ConditionStatus(in.Status)
|
||||
@@ -1824,9 +1824,9 @@ func convert_expapi_JobCondition_To_v1_JobCondition(in *expapi.JobCondition, out
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_expapi_JobList_To_v1_JobList(in *expapi.JobList, out *JobList, s conversion.Scope) error {
|
||||
func convert_experimental_JobList_To_v1_JobList(in *experimental.JobList, out *JobList, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*expapi.JobList))(in)
|
||||
defaulting.(func(*experimental.JobList))(in)
|
||||
}
|
||||
if err := convert_api_TypeMeta_To_v1_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
@@ -1837,7 +1837,7 @@ func convert_expapi_JobList_To_v1_JobList(in *expapi.JobList, out *JobList, s co
|
||||
if in.Items != nil {
|
||||
out.Items = make([]Job, len(in.Items))
|
||||
for i := range in.Items {
|
||||
if err := convert_expapi_Job_To_v1_Job(&in.Items[i], &out.Items[i], s); err != nil {
|
||||
if err := convert_experimental_Job_To_v1_Job(&in.Items[i], &out.Items[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -1847,9 +1847,9 @@ func convert_expapi_JobList_To_v1_JobList(in *expapi.JobList, out *JobList, s co
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_expapi_JobSpec_To_v1_JobSpec(in *expapi.JobSpec, out *JobSpec, s conversion.Scope) error {
|
||||
func convert_experimental_JobSpec_To_v1_JobSpec(in *experimental.JobSpec, out *JobSpec, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*expapi.JobSpec))(in)
|
||||
defaulting.(func(*experimental.JobSpec))(in)
|
||||
}
|
||||
if in.Parallelism != nil {
|
||||
out.Parallelism = new(int)
|
||||
@@ -1882,14 +1882,14 @@ func convert_expapi_JobSpec_To_v1_JobSpec(in *expapi.JobSpec, out *JobSpec, s co
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_expapi_JobStatus_To_v1_JobStatus(in *expapi.JobStatus, out *JobStatus, s conversion.Scope) error {
|
||||
func convert_experimental_JobStatus_To_v1_JobStatus(in *experimental.JobStatus, out *JobStatus, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*expapi.JobStatus))(in)
|
||||
defaulting.(func(*experimental.JobStatus))(in)
|
||||
}
|
||||
if in.Conditions != nil {
|
||||
out.Conditions = make([]JobCondition, len(in.Conditions))
|
||||
for i := range in.Conditions {
|
||||
if err := convert_expapi_JobCondition_To_v1_JobCondition(&in.Conditions[i], &out.Conditions[i], s); err != nil {
|
||||
if err := convert_experimental_JobCondition_To_v1_JobCondition(&in.Conditions[i], &out.Conditions[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -1916,9 +1916,9 @@ func convert_expapi_JobStatus_To_v1_JobStatus(in *expapi.JobStatus, out *JobStat
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_expapi_ReplicationControllerDummy_To_v1_ReplicationControllerDummy(in *expapi.ReplicationControllerDummy, out *ReplicationControllerDummy, s conversion.Scope) error {
|
||||
func convert_experimental_ReplicationControllerDummy_To_v1_ReplicationControllerDummy(in *experimental.ReplicationControllerDummy, out *ReplicationControllerDummy, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*expapi.ReplicationControllerDummy))(in)
|
||||
defaulting.(func(*experimental.ReplicationControllerDummy))(in)
|
||||
}
|
||||
if err := convert_api_TypeMeta_To_v1_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
@@ -1926,9 +1926,9 @@ func convert_expapi_ReplicationControllerDummy_To_v1_ReplicationControllerDummy(
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_expapi_ResourceConsumption_To_v1_ResourceConsumption(in *expapi.ResourceConsumption, out *ResourceConsumption, s conversion.Scope) error {
|
||||
func convert_experimental_ResourceConsumption_To_v1_ResourceConsumption(in *experimental.ResourceConsumption, out *ResourceConsumption, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*expapi.ResourceConsumption))(in)
|
||||
defaulting.(func(*experimental.ResourceConsumption))(in)
|
||||
}
|
||||
out.Resource = v1.ResourceName(in.Resource)
|
||||
if err := s.Convert(&in.Quantity, &out.Quantity, 0); err != nil {
|
||||
@@ -1937,9 +1937,9 @@ func convert_expapi_ResourceConsumption_To_v1_ResourceConsumption(in *expapi.Res
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_expapi_Scale_To_v1_Scale(in *expapi.Scale, out *Scale, s conversion.Scope) error {
|
||||
func convert_experimental_Scale_To_v1_Scale(in *experimental.Scale, out *Scale, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*expapi.Scale))(in)
|
||||
defaulting.(func(*experimental.Scale))(in)
|
||||
}
|
||||
if err := convert_api_TypeMeta_To_v1_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
@@ -1947,26 +1947,26 @@ func convert_expapi_Scale_To_v1_Scale(in *expapi.Scale, out *Scale, s conversion
|
||||
if err := convert_api_ObjectMeta_To_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := convert_expapi_ScaleSpec_To_v1_ScaleSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
if err := convert_experimental_ScaleSpec_To_v1_ScaleSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := convert_expapi_ScaleStatus_To_v1_ScaleStatus(&in.Status, &out.Status, s); err != nil {
|
||||
if err := convert_experimental_ScaleStatus_To_v1_ScaleStatus(&in.Status, &out.Status, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_expapi_ScaleSpec_To_v1_ScaleSpec(in *expapi.ScaleSpec, out *ScaleSpec, s conversion.Scope) error {
|
||||
func convert_experimental_ScaleSpec_To_v1_ScaleSpec(in *experimental.ScaleSpec, out *ScaleSpec, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*expapi.ScaleSpec))(in)
|
||||
defaulting.(func(*experimental.ScaleSpec))(in)
|
||||
}
|
||||
out.Replicas = in.Replicas
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_expapi_ScaleStatus_To_v1_ScaleStatus(in *expapi.ScaleStatus, out *ScaleStatus, s conversion.Scope) error {
|
||||
func convert_experimental_ScaleStatus_To_v1_ScaleStatus(in *experimental.ScaleStatus, out *ScaleStatus, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*expapi.ScaleStatus))(in)
|
||||
defaulting.(func(*experimental.ScaleStatus))(in)
|
||||
}
|
||||
out.Replicas = in.Replicas
|
||||
if in.Selector != nil {
|
||||
@@ -1980,9 +1980,9 @@ func convert_expapi_ScaleStatus_To_v1_ScaleStatus(in *expapi.ScaleStatus, out *S
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_expapi_SubresourceReference_To_v1_SubresourceReference(in *expapi.SubresourceReference, out *SubresourceReference, s conversion.Scope) error {
|
||||
func convert_experimental_SubresourceReference_To_v1_SubresourceReference(in *experimental.SubresourceReference, out *SubresourceReference, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*expapi.SubresourceReference))(in)
|
||||
defaulting.(func(*experimental.SubresourceReference))(in)
|
||||
}
|
||||
out.Kind = in.Kind
|
||||
out.Namespace = in.Namespace
|
||||
@@ -1992,9 +1992,9 @@ func convert_expapi_SubresourceReference_To_v1_SubresourceReference(in *expapi.S
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_expapi_ThirdPartyResource_To_v1_ThirdPartyResource(in *expapi.ThirdPartyResource, out *ThirdPartyResource, s conversion.Scope) error {
|
||||
func convert_experimental_ThirdPartyResource_To_v1_ThirdPartyResource(in *experimental.ThirdPartyResource, out *ThirdPartyResource, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*expapi.ThirdPartyResource))(in)
|
||||
defaulting.(func(*experimental.ThirdPartyResource))(in)
|
||||
}
|
||||
if err := convert_api_TypeMeta_To_v1_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
@@ -2006,7 +2006,7 @@ func convert_expapi_ThirdPartyResource_To_v1_ThirdPartyResource(in *expapi.Third
|
||||
if in.Versions != nil {
|
||||
out.Versions = make([]APIVersion, len(in.Versions))
|
||||
for i := range in.Versions {
|
||||
if err := convert_expapi_APIVersion_To_v1_APIVersion(&in.Versions[i], &out.Versions[i], s); err != nil {
|
||||
if err := convert_experimental_APIVersion_To_v1_APIVersion(&in.Versions[i], &out.Versions[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -2016,9 +2016,9 @@ func convert_expapi_ThirdPartyResource_To_v1_ThirdPartyResource(in *expapi.Third
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_expapi_ThirdPartyResourceData_To_v1_ThirdPartyResourceData(in *expapi.ThirdPartyResourceData, out *ThirdPartyResourceData, s conversion.Scope) error {
|
||||
func convert_experimental_ThirdPartyResourceData_To_v1_ThirdPartyResourceData(in *experimental.ThirdPartyResourceData, out *ThirdPartyResourceData, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*expapi.ThirdPartyResourceData))(in)
|
||||
defaulting.(func(*experimental.ThirdPartyResourceData))(in)
|
||||
}
|
||||
if err := convert_api_TypeMeta_To_v1_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
@@ -2032,9 +2032,9 @@ func convert_expapi_ThirdPartyResourceData_To_v1_ThirdPartyResourceData(in *expa
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_expapi_ThirdPartyResourceDataList_To_v1_ThirdPartyResourceDataList(in *expapi.ThirdPartyResourceDataList, out *ThirdPartyResourceDataList, s conversion.Scope) error {
|
||||
func convert_experimental_ThirdPartyResourceDataList_To_v1_ThirdPartyResourceDataList(in *experimental.ThirdPartyResourceDataList, out *ThirdPartyResourceDataList, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*expapi.ThirdPartyResourceDataList))(in)
|
||||
defaulting.(func(*experimental.ThirdPartyResourceDataList))(in)
|
||||
}
|
||||
if err := convert_api_TypeMeta_To_v1_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
@@ -2045,7 +2045,7 @@ func convert_expapi_ThirdPartyResourceDataList_To_v1_ThirdPartyResourceDataList(
|
||||
if in.Items != nil {
|
||||
out.Items = make([]ThirdPartyResourceData, len(in.Items))
|
||||
for i := range in.Items {
|
||||
if err := convert_expapi_ThirdPartyResourceData_To_v1_ThirdPartyResourceData(&in.Items[i], &out.Items[i], s); err != nil {
|
||||
if err := convert_experimental_ThirdPartyResourceData_To_v1_ThirdPartyResourceData(&in.Items[i], &out.Items[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -2055,9 +2055,9 @@ func convert_expapi_ThirdPartyResourceDataList_To_v1_ThirdPartyResourceDataList(
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_expapi_ThirdPartyResourceList_To_v1_ThirdPartyResourceList(in *expapi.ThirdPartyResourceList, out *ThirdPartyResourceList, s conversion.Scope) error {
|
||||
func convert_experimental_ThirdPartyResourceList_To_v1_ThirdPartyResourceList(in *experimental.ThirdPartyResourceList, out *ThirdPartyResourceList, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*expapi.ThirdPartyResourceList))(in)
|
||||
defaulting.(func(*experimental.ThirdPartyResourceList))(in)
|
||||
}
|
||||
if err := convert_api_TypeMeta_To_v1_TypeMeta(&in.TypeMeta, &out.TypeMeta, s); err != nil {
|
||||
return err
|
||||
@@ -2068,7 +2068,7 @@ func convert_expapi_ThirdPartyResourceList_To_v1_ThirdPartyResourceList(in *expa
|
||||
if in.Items != nil {
|
||||
out.Items = make([]ThirdPartyResource, len(in.Items))
|
||||
for i := range in.Items {
|
||||
if err := convert_expapi_ThirdPartyResource_To_v1_ThirdPartyResource(&in.Items[i], &out.Items[i], s); err != nil {
|
||||
if err := convert_experimental_ThirdPartyResource_To_v1_ThirdPartyResource(&in.Items[i], &out.Items[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -2078,7 +2078,7 @@ func convert_expapi_ThirdPartyResourceList_To_v1_ThirdPartyResourceList(in *expa
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_v1_APIVersion_To_expapi_APIVersion(in *APIVersion, out *expapi.APIVersion, s conversion.Scope) error {
|
||||
func convert_v1_APIVersion_To_experimental_APIVersion(in *APIVersion, out *experimental.APIVersion, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*APIVersion))(in)
|
||||
}
|
||||
@@ -2087,7 +2087,7 @@ func convert_v1_APIVersion_To_expapi_APIVersion(in *APIVersion, out *expapi.APIV
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_v1_DaemonSet_To_expapi_DaemonSet(in *DaemonSet, out *expapi.DaemonSet, s conversion.Scope) error {
|
||||
func convert_v1_DaemonSet_To_experimental_DaemonSet(in *DaemonSet, out *experimental.DaemonSet, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*DaemonSet))(in)
|
||||
}
|
||||
@@ -2097,16 +2097,16 @@ func convert_v1_DaemonSet_To_expapi_DaemonSet(in *DaemonSet, out *expapi.DaemonS
|
||||
if err := convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := convert_v1_DaemonSetSpec_To_expapi_DaemonSetSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
if err := convert_v1_DaemonSetSpec_To_experimental_DaemonSetSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := convert_v1_DaemonSetStatus_To_expapi_DaemonSetStatus(&in.Status, &out.Status, s); err != nil {
|
||||
if err := convert_v1_DaemonSetStatus_To_experimental_DaemonSetStatus(&in.Status, &out.Status, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_v1_DaemonSetList_To_expapi_DaemonSetList(in *DaemonSetList, out *expapi.DaemonSetList, s conversion.Scope) error {
|
||||
func convert_v1_DaemonSetList_To_experimental_DaemonSetList(in *DaemonSetList, out *experimental.DaemonSetList, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*DaemonSetList))(in)
|
||||
}
|
||||
@@ -2117,9 +2117,9 @@ func convert_v1_DaemonSetList_To_expapi_DaemonSetList(in *DaemonSetList, out *ex
|
||||
return err
|
||||
}
|
||||
if in.Items != nil {
|
||||
out.Items = make([]expapi.DaemonSet, len(in.Items))
|
||||
out.Items = make([]experimental.DaemonSet, len(in.Items))
|
||||
for i := range in.Items {
|
||||
if err := convert_v1_DaemonSet_To_expapi_DaemonSet(&in.Items[i], &out.Items[i], s); err != nil {
|
||||
if err := convert_v1_DaemonSet_To_experimental_DaemonSet(&in.Items[i], &out.Items[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -2129,7 +2129,7 @@ func convert_v1_DaemonSetList_To_expapi_DaemonSetList(in *DaemonSetList, out *ex
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_v1_DaemonSetSpec_To_expapi_DaemonSetSpec(in *DaemonSetSpec, out *expapi.DaemonSetSpec, s conversion.Scope) error {
|
||||
func convert_v1_DaemonSetSpec_To_experimental_DaemonSetSpec(in *DaemonSetSpec, out *experimental.DaemonSetSpec, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*DaemonSetSpec))(in)
|
||||
}
|
||||
@@ -2152,7 +2152,7 @@ func convert_v1_DaemonSetSpec_To_expapi_DaemonSetSpec(in *DaemonSetSpec, out *ex
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_v1_DaemonSetStatus_To_expapi_DaemonSetStatus(in *DaemonSetStatus, out *expapi.DaemonSetStatus, s conversion.Scope) error {
|
||||
func convert_v1_DaemonSetStatus_To_experimental_DaemonSetStatus(in *DaemonSetStatus, out *experimental.DaemonSetStatus, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*DaemonSetStatus))(in)
|
||||
}
|
||||
@@ -2162,7 +2162,7 @@ func convert_v1_DaemonSetStatus_To_expapi_DaemonSetStatus(in *DaemonSetStatus, o
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_v1_Deployment_To_expapi_Deployment(in *Deployment, out *expapi.Deployment, s conversion.Scope) error {
|
||||
func convert_v1_Deployment_To_experimental_Deployment(in *Deployment, out *experimental.Deployment, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*Deployment))(in)
|
||||
}
|
||||
@@ -2172,16 +2172,16 @@ func convert_v1_Deployment_To_expapi_Deployment(in *Deployment, out *expapi.Depl
|
||||
if err := convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := convert_v1_DeploymentSpec_To_expapi_DeploymentSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
if err := convert_v1_DeploymentSpec_To_experimental_DeploymentSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := convert_v1_DeploymentStatus_To_expapi_DeploymentStatus(&in.Status, &out.Status, s); err != nil {
|
||||
if err := convert_v1_DeploymentStatus_To_experimental_DeploymentStatus(&in.Status, &out.Status, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_v1_DeploymentList_To_expapi_DeploymentList(in *DeploymentList, out *expapi.DeploymentList, s conversion.Scope) error {
|
||||
func convert_v1_DeploymentList_To_experimental_DeploymentList(in *DeploymentList, out *experimental.DeploymentList, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*DeploymentList))(in)
|
||||
}
|
||||
@@ -2192,9 +2192,9 @@ func convert_v1_DeploymentList_To_expapi_DeploymentList(in *DeploymentList, out
|
||||
return err
|
||||
}
|
||||
if in.Items != nil {
|
||||
out.Items = make([]expapi.Deployment, len(in.Items))
|
||||
out.Items = make([]experimental.Deployment, len(in.Items))
|
||||
for i := range in.Items {
|
||||
if err := convert_v1_Deployment_To_expapi_Deployment(&in.Items[i], &out.Items[i], s); err != nil {
|
||||
if err := convert_v1_Deployment_To_experimental_Deployment(&in.Items[i], &out.Items[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -2204,7 +2204,7 @@ func convert_v1_DeploymentList_To_expapi_DeploymentList(in *DeploymentList, out
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_v1_DeploymentStatus_To_expapi_DeploymentStatus(in *DeploymentStatus, out *expapi.DeploymentStatus, s conversion.Scope) error {
|
||||
func convert_v1_DeploymentStatus_To_experimental_DeploymentStatus(in *DeploymentStatus, out *experimental.DeploymentStatus, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*DeploymentStatus))(in)
|
||||
}
|
||||
@@ -2213,7 +2213,7 @@ func convert_v1_DeploymentStatus_To_expapi_DeploymentStatus(in *DeploymentStatus
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_v1_HorizontalPodAutoscaler_To_expapi_HorizontalPodAutoscaler(in *HorizontalPodAutoscaler, out *expapi.HorizontalPodAutoscaler, s conversion.Scope) error {
|
||||
func convert_v1_HorizontalPodAutoscaler_To_experimental_HorizontalPodAutoscaler(in *HorizontalPodAutoscaler, out *experimental.HorizontalPodAutoscaler, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*HorizontalPodAutoscaler))(in)
|
||||
}
|
||||
@@ -2223,12 +2223,12 @@ func convert_v1_HorizontalPodAutoscaler_To_expapi_HorizontalPodAutoscaler(in *Ho
|
||||
if err := convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := convert_v1_HorizontalPodAutoscalerSpec_To_expapi_HorizontalPodAutoscalerSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
if err := convert_v1_HorizontalPodAutoscalerSpec_To_experimental_HorizontalPodAutoscalerSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if in.Status != nil {
|
||||
out.Status = new(expapi.HorizontalPodAutoscalerStatus)
|
||||
if err := convert_v1_HorizontalPodAutoscalerStatus_To_expapi_HorizontalPodAutoscalerStatus(in.Status, out.Status, s); err != nil {
|
||||
out.Status = new(experimental.HorizontalPodAutoscalerStatus)
|
||||
if err := convert_v1_HorizontalPodAutoscalerStatus_To_experimental_HorizontalPodAutoscalerStatus(in.Status, out.Status, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
@@ -2237,7 +2237,7 @@ func convert_v1_HorizontalPodAutoscaler_To_expapi_HorizontalPodAutoscaler(in *Ho
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_v1_HorizontalPodAutoscalerList_To_expapi_HorizontalPodAutoscalerList(in *HorizontalPodAutoscalerList, out *expapi.HorizontalPodAutoscalerList, s conversion.Scope) error {
|
||||
func convert_v1_HorizontalPodAutoscalerList_To_experimental_HorizontalPodAutoscalerList(in *HorizontalPodAutoscalerList, out *experimental.HorizontalPodAutoscalerList, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*HorizontalPodAutoscalerList))(in)
|
||||
}
|
||||
@@ -2248,9 +2248,9 @@ func convert_v1_HorizontalPodAutoscalerList_To_expapi_HorizontalPodAutoscalerLis
|
||||
return err
|
||||
}
|
||||
if in.Items != nil {
|
||||
out.Items = make([]expapi.HorizontalPodAutoscaler, len(in.Items))
|
||||
out.Items = make([]experimental.HorizontalPodAutoscaler, len(in.Items))
|
||||
for i := range in.Items {
|
||||
if err := convert_v1_HorizontalPodAutoscaler_To_expapi_HorizontalPodAutoscaler(&in.Items[i], &out.Items[i], s); err != nil {
|
||||
if err := convert_v1_HorizontalPodAutoscaler_To_experimental_HorizontalPodAutoscaler(&in.Items[i], &out.Items[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -2260,13 +2260,13 @@ func convert_v1_HorizontalPodAutoscalerList_To_expapi_HorizontalPodAutoscalerLis
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_v1_HorizontalPodAutoscalerSpec_To_expapi_HorizontalPodAutoscalerSpec(in *HorizontalPodAutoscalerSpec, out *expapi.HorizontalPodAutoscalerSpec, s conversion.Scope) error {
|
||||
func convert_v1_HorizontalPodAutoscalerSpec_To_experimental_HorizontalPodAutoscalerSpec(in *HorizontalPodAutoscalerSpec, out *experimental.HorizontalPodAutoscalerSpec, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*HorizontalPodAutoscalerSpec))(in)
|
||||
}
|
||||
if in.ScaleRef != nil {
|
||||
out.ScaleRef = new(expapi.SubresourceReference)
|
||||
if err := convert_v1_SubresourceReference_To_expapi_SubresourceReference(in.ScaleRef, out.ScaleRef, s); err != nil {
|
||||
out.ScaleRef = new(experimental.SubresourceReference)
|
||||
if err := convert_v1_SubresourceReference_To_experimental_SubresourceReference(in.ScaleRef, out.ScaleRef, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
@@ -2274,21 +2274,21 @@ func convert_v1_HorizontalPodAutoscalerSpec_To_expapi_HorizontalPodAutoscalerSpe
|
||||
}
|
||||
out.MinCount = in.MinCount
|
||||
out.MaxCount = in.MaxCount
|
||||
if err := convert_v1_ResourceConsumption_To_expapi_ResourceConsumption(&in.Target, &out.Target, s); err != nil {
|
||||
if err := convert_v1_ResourceConsumption_To_experimental_ResourceConsumption(&in.Target, &out.Target, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_v1_HorizontalPodAutoscalerStatus_To_expapi_HorizontalPodAutoscalerStatus(in *HorizontalPodAutoscalerStatus, out *expapi.HorizontalPodAutoscalerStatus, s conversion.Scope) error {
|
||||
func convert_v1_HorizontalPodAutoscalerStatus_To_experimental_HorizontalPodAutoscalerStatus(in *HorizontalPodAutoscalerStatus, out *experimental.HorizontalPodAutoscalerStatus, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*HorizontalPodAutoscalerStatus))(in)
|
||||
}
|
||||
out.CurrentReplicas = in.CurrentReplicas
|
||||
out.DesiredReplicas = in.DesiredReplicas
|
||||
if in.CurrentConsumption != nil {
|
||||
out.CurrentConsumption = new(expapi.ResourceConsumption)
|
||||
if err := convert_v1_ResourceConsumption_To_expapi_ResourceConsumption(in.CurrentConsumption, out.CurrentConsumption, s); err != nil {
|
||||
out.CurrentConsumption = new(experimental.ResourceConsumption)
|
||||
if err := convert_v1_ResourceConsumption_To_experimental_ResourceConsumption(in.CurrentConsumption, out.CurrentConsumption, s); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
@@ -2304,7 +2304,7 @@ func convert_v1_HorizontalPodAutoscalerStatus_To_expapi_HorizontalPodAutoscalerS
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_v1_Job_To_expapi_Job(in *Job, out *expapi.Job, s conversion.Scope) error {
|
||||
func convert_v1_Job_To_experimental_Job(in *Job, out *experimental.Job, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*Job))(in)
|
||||
}
|
||||
@@ -2314,20 +2314,20 @@ func convert_v1_Job_To_expapi_Job(in *Job, out *expapi.Job, s conversion.Scope)
|
||||
if err := convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := convert_v1_JobSpec_To_expapi_JobSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
if err := convert_v1_JobSpec_To_experimental_JobSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := convert_v1_JobStatus_To_expapi_JobStatus(&in.Status, &out.Status, s); err != nil {
|
||||
if err := convert_v1_JobStatus_To_experimental_JobStatus(&in.Status, &out.Status, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_v1_JobCondition_To_expapi_JobCondition(in *JobCondition, out *expapi.JobCondition, s conversion.Scope) error {
|
||||
func convert_v1_JobCondition_To_experimental_JobCondition(in *JobCondition, out *experimental.JobCondition, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*JobCondition))(in)
|
||||
}
|
||||
out.Type = expapi.JobConditionType(in.Type)
|
||||
out.Type = experimental.JobConditionType(in.Type)
|
||||
out.Status = api.ConditionStatus(in.Status)
|
||||
if err := s.Convert(&in.LastProbeTime, &out.LastProbeTime, 0); err != nil {
|
||||
return err
|
||||
@@ -2340,7 +2340,7 @@ func convert_v1_JobCondition_To_expapi_JobCondition(in *JobCondition, out *expap
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_v1_JobList_To_expapi_JobList(in *JobList, out *expapi.JobList, s conversion.Scope) error {
|
||||
func convert_v1_JobList_To_experimental_JobList(in *JobList, out *experimental.JobList, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*JobList))(in)
|
||||
}
|
||||
@@ -2351,9 +2351,9 @@ func convert_v1_JobList_To_expapi_JobList(in *JobList, out *expapi.JobList, s co
|
||||
return err
|
||||
}
|
||||
if in.Items != nil {
|
||||
out.Items = make([]expapi.Job, len(in.Items))
|
||||
out.Items = make([]experimental.Job, len(in.Items))
|
||||
for i := range in.Items {
|
||||
if err := convert_v1_Job_To_expapi_Job(&in.Items[i], &out.Items[i], s); err != nil {
|
||||
if err := convert_v1_Job_To_experimental_Job(&in.Items[i], &out.Items[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -2363,7 +2363,7 @@ func convert_v1_JobList_To_expapi_JobList(in *JobList, out *expapi.JobList, s co
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_v1_JobSpec_To_expapi_JobSpec(in *JobSpec, out *expapi.JobSpec, s conversion.Scope) error {
|
||||
func convert_v1_JobSpec_To_experimental_JobSpec(in *JobSpec, out *experimental.JobSpec, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*JobSpec))(in)
|
||||
}
|
||||
@@ -2398,14 +2398,14 @@ func convert_v1_JobSpec_To_expapi_JobSpec(in *JobSpec, out *expapi.JobSpec, s co
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_v1_JobStatus_To_expapi_JobStatus(in *JobStatus, out *expapi.JobStatus, s conversion.Scope) error {
|
||||
func convert_v1_JobStatus_To_experimental_JobStatus(in *JobStatus, out *experimental.JobStatus, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*JobStatus))(in)
|
||||
}
|
||||
if in.Conditions != nil {
|
||||
out.Conditions = make([]expapi.JobCondition, len(in.Conditions))
|
||||
out.Conditions = make([]experimental.JobCondition, len(in.Conditions))
|
||||
for i := range in.Conditions {
|
||||
if err := convert_v1_JobCondition_To_expapi_JobCondition(&in.Conditions[i], &out.Conditions[i], s); err != nil {
|
||||
if err := convert_v1_JobCondition_To_experimental_JobCondition(&in.Conditions[i], &out.Conditions[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -2432,7 +2432,7 @@ func convert_v1_JobStatus_To_expapi_JobStatus(in *JobStatus, out *expapi.JobStat
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_v1_ReplicationControllerDummy_To_expapi_ReplicationControllerDummy(in *ReplicationControllerDummy, out *expapi.ReplicationControllerDummy, s conversion.Scope) error {
|
||||
func convert_v1_ReplicationControllerDummy_To_experimental_ReplicationControllerDummy(in *ReplicationControllerDummy, out *experimental.ReplicationControllerDummy, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*ReplicationControllerDummy))(in)
|
||||
}
|
||||
@@ -2442,7 +2442,7 @@ func convert_v1_ReplicationControllerDummy_To_expapi_ReplicationControllerDummy(
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_v1_ResourceConsumption_To_expapi_ResourceConsumption(in *ResourceConsumption, out *expapi.ResourceConsumption, s conversion.Scope) error {
|
||||
func convert_v1_ResourceConsumption_To_experimental_ResourceConsumption(in *ResourceConsumption, out *experimental.ResourceConsumption, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*ResourceConsumption))(in)
|
||||
}
|
||||
@@ -2453,7 +2453,7 @@ func convert_v1_ResourceConsumption_To_expapi_ResourceConsumption(in *ResourceCo
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_v1_Scale_To_expapi_Scale(in *Scale, out *expapi.Scale, s conversion.Scope) error {
|
||||
func convert_v1_Scale_To_experimental_Scale(in *Scale, out *experimental.Scale, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*Scale))(in)
|
||||
}
|
||||
@@ -2463,16 +2463,16 @@ func convert_v1_Scale_To_expapi_Scale(in *Scale, out *expapi.Scale, s conversion
|
||||
if err := convert_v1_ObjectMeta_To_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := convert_v1_ScaleSpec_To_expapi_ScaleSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
if err := convert_v1_ScaleSpec_To_experimental_ScaleSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := convert_v1_ScaleStatus_To_expapi_ScaleStatus(&in.Status, &out.Status, s); err != nil {
|
||||
if err := convert_v1_ScaleStatus_To_experimental_ScaleStatus(&in.Status, &out.Status, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_v1_ScaleSpec_To_expapi_ScaleSpec(in *ScaleSpec, out *expapi.ScaleSpec, s conversion.Scope) error {
|
||||
func convert_v1_ScaleSpec_To_experimental_ScaleSpec(in *ScaleSpec, out *experimental.ScaleSpec, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*ScaleSpec))(in)
|
||||
}
|
||||
@@ -2480,7 +2480,7 @@ func convert_v1_ScaleSpec_To_expapi_ScaleSpec(in *ScaleSpec, out *expapi.ScaleSp
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_v1_ScaleStatus_To_expapi_ScaleStatus(in *ScaleStatus, out *expapi.ScaleStatus, s conversion.Scope) error {
|
||||
func convert_v1_ScaleStatus_To_experimental_ScaleStatus(in *ScaleStatus, out *experimental.ScaleStatus, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*ScaleStatus))(in)
|
||||
}
|
||||
@@ -2496,7 +2496,7 @@ func convert_v1_ScaleStatus_To_expapi_ScaleStatus(in *ScaleStatus, out *expapi.S
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_v1_SubresourceReference_To_expapi_SubresourceReference(in *SubresourceReference, out *expapi.SubresourceReference, s conversion.Scope) error {
|
||||
func convert_v1_SubresourceReference_To_experimental_SubresourceReference(in *SubresourceReference, out *experimental.SubresourceReference, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*SubresourceReference))(in)
|
||||
}
|
||||
@@ -2508,7 +2508,7 @@ func convert_v1_SubresourceReference_To_expapi_SubresourceReference(in *Subresou
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_v1_ThirdPartyResource_To_expapi_ThirdPartyResource(in *ThirdPartyResource, out *expapi.ThirdPartyResource, s conversion.Scope) error {
|
||||
func convert_v1_ThirdPartyResource_To_experimental_ThirdPartyResource(in *ThirdPartyResource, out *experimental.ThirdPartyResource, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*ThirdPartyResource))(in)
|
||||
}
|
||||
@@ -2520,9 +2520,9 @@ func convert_v1_ThirdPartyResource_To_expapi_ThirdPartyResource(in *ThirdPartyRe
|
||||
}
|
||||
out.Description = in.Description
|
||||
if in.Versions != nil {
|
||||
out.Versions = make([]expapi.APIVersion, len(in.Versions))
|
||||
out.Versions = make([]experimental.APIVersion, len(in.Versions))
|
||||
for i := range in.Versions {
|
||||
if err := convert_v1_APIVersion_To_expapi_APIVersion(&in.Versions[i], &out.Versions[i], s); err != nil {
|
||||
if err := convert_v1_APIVersion_To_experimental_APIVersion(&in.Versions[i], &out.Versions[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -2532,7 +2532,7 @@ func convert_v1_ThirdPartyResource_To_expapi_ThirdPartyResource(in *ThirdPartyRe
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_v1_ThirdPartyResourceData_To_expapi_ThirdPartyResourceData(in *ThirdPartyResourceData, out *expapi.ThirdPartyResourceData, s conversion.Scope) error {
|
||||
func convert_v1_ThirdPartyResourceData_To_experimental_ThirdPartyResourceData(in *ThirdPartyResourceData, out *experimental.ThirdPartyResourceData, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*ThirdPartyResourceData))(in)
|
||||
}
|
||||
@@ -2548,7 +2548,7 @@ func convert_v1_ThirdPartyResourceData_To_expapi_ThirdPartyResourceData(in *Thir
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_v1_ThirdPartyResourceDataList_To_expapi_ThirdPartyResourceDataList(in *ThirdPartyResourceDataList, out *expapi.ThirdPartyResourceDataList, s conversion.Scope) error {
|
||||
func convert_v1_ThirdPartyResourceDataList_To_experimental_ThirdPartyResourceDataList(in *ThirdPartyResourceDataList, out *experimental.ThirdPartyResourceDataList, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*ThirdPartyResourceDataList))(in)
|
||||
}
|
||||
@@ -2559,9 +2559,9 @@ func convert_v1_ThirdPartyResourceDataList_To_expapi_ThirdPartyResourceDataList(
|
||||
return err
|
||||
}
|
||||
if in.Items != nil {
|
||||
out.Items = make([]expapi.ThirdPartyResourceData, len(in.Items))
|
||||
out.Items = make([]experimental.ThirdPartyResourceData, len(in.Items))
|
||||
for i := range in.Items {
|
||||
if err := convert_v1_ThirdPartyResourceData_To_expapi_ThirdPartyResourceData(&in.Items[i], &out.Items[i], s); err != nil {
|
||||
if err := convert_v1_ThirdPartyResourceData_To_experimental_ThirdPartyResourceData(&in.Items[i], &out.Items[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -2571,7 +2571,7 @@ func convert_v1_ThirdPartyResourceDataList_To_expapi_ThirdPartyResourceDataList(
|
||||
return nil
|
||||
}
|
||||
|
||||
func convert_v1_ThirdPartyResourceList_To_expapi_ThirdPartyResourceList(in *ThirdPartyResourceList, out *expapi.ThirdPartyResourceList, s conversion.Scope) error {
|
||||
func convert_v1_ThirdPartyResourceList_To_experimental_ThirdPartyResourceList(in *ThirdPartyResourceList, out *experimental.ThirdPartyResourceList, s conversion.Scope) error {
|
||||
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
|
||||
defaulting.(func(*ThirdPartyResourceList))(in)
|
||||
}
|
||||
@@ -2582,9 +2582,9 @@ func convert_v1_ThirdPartyResourceList_To_expapi_ThirdPartyResourceList(in *Thir
|
||||
return err
|
||||
}
|
||||
if in.Items != nil {
|
||||
out.Items = make([]expapi.ThirdPartyResource, len(in.Items))
|
||||
out.Items = make([]experimental.ThirdPartyResource, len(in.Items))
|
||||
for i := range in.Items {
|
||||
if err := convert_v1_ThirdPartyResource_To_expapi_ThirdPartyResource(&in.Items[i], &out.Items[i], s); err != nil {
|
||||
if err := convert_v1_ThirdPartyResource_To_experimental_ThirdPartyResource(&in.Items[i], &out.Items[i], s); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -2634,47 +2634,47 @@ func init() {
|
||||
convert_api_VolumeMount_To_v1_VolumeMount,
|
||||
convert_api_VolumeSource_To_v1_VolumeSource,
|
||||
convert_api_Volume_To_v1_Volume,
|
||||
convert_expapi_APIVersion_To_v1_APIVersion,
|
||||
convert_expapi_DaemonSetList_To_v1_DaemonSetList,
|
||||
convert_expapi_DaemonSetSpec_To_v1_DaemonSetSpec,
|
||||
convert_expapi_DaemonSetStatus_To_v1_DaemonSetStatus,
|
||||
convert_expapi_DaemonSet_To_v1_DaemonSet,
|
||||
convert_expapi_DeploymentList_To_v1_DeploymentList,
|
||||
convert_expapi_DeploymentStatus_To_v1_DeploymentStatus,
|
||||
convert_expapi_Deployment_To_v1_Deployment,
|
||||
convert_expapi_HorizontalPodAutoscalerList_To_v1_HorizontalPodAutoscalerList,
|
||||
convert_expapi_HorizontalPodAutoscalerSpec_To_v1_HorizontalPodAutoscalerSpec,
|
||||
convert_expapi_HorizontalPodAutoscalerStatus_To_v1_HorizontalPodAutoscalerStatus,
|
||||
convert_expapi_HorizontalPodAutoscaler_To_v1_HorizontalPodAutoscaler,
|
||||
convert_expapi_JobCondition_To_v1_JobCondition,
|
||||
convert_expapi_JobList_To_v1_JobList,
|
||||
convert_expapi_JobSpec_To_v1_JobSpec,
|
||||
convert_expapi_JobStatus_To_v1_JobStatus,
|
||||
convert_expapi_Job_To_v1_Job,
|
||||
convert_expapi_ReplicationControllerDummy_To_v1_ReplicationControllerDummy,
|
||||
convert_expapi_ResourceConsumption_To_v1_ResourceConsumption,
|
||||
convert_expapi_ScaleSpec_To_v1_ScaleSpec,
|
||||
convert_expapi_ScaleStatus_To_v1_ScaleStatus,
|
||||
convert_expapi_Scale_To_v1_Scale,
|
||||
convert_expapi_SubresourceReference_To_v1_SubresourceReference,
|
||||
convert_expapi_ThirdPartyResourceDataList_To_v1_ThirdPartyResourceDataList,
|
||||
convert_expapi_ThirdPartyResourceData_To_v1_ThirdPartyResourceData,
|
||||
convert_expapi_ThirdPartyResourceList_To_v1_ThirdPartyResourceList,
|
||||
convert_expapi_ThirdPartyResource_To_v1_ThirdPartyResource,
|
||||
convert_v1_APIVersion_To_expapi_APIVersion,
|
||||
convert_experimental_APIVersion_To_v1_APIVersion,
|
||||
convert_experimental_DaemonSetList_To_v1_DaemonSetList,
|
||||
convert_experimental_DaemonSetSpec_To_v1_DaemonSetSpec,
|
||||
convert_experimental_DaemonSetStatus_To_v1_DaemonSetStatus,
|
||||
convert_experimental_DaemonSet_To_v1_DaemonSet,
|
||||
convert_experimental_DeploymentList_To_v1_DeploymentList,
|
||||
convert_experimental_DeploymentStatus_To_v1_DeploymentStatus,
|
||||
convert_experimental_Deployment_To_v1_Deployment,
|
||||
convert_experimental_HorizontalPodAutoscalerList_To_v1_HorizontalPodAutoscalerList,
|
||||
convert_experimental_HorizontalPodAutoscalerSpec_To_v1_HorizontalPodAutoscalerSpec,
|
||||
convert_experimental_HorizontalPodAutoscalerStatus_To_v1_HorizontalPodAutoscalerStatus,
|
||||
convert_experimental_HorizontalPodAutoscaler_To_v1_HorizontalPodAutoscaler,
|
||||
convert_experimental_JobCondition_To_v1_JobCondition,
|
||||
convert_experimental_JobList_To_v1_JobList,
|
||||
convert_experimental_JobSpec_To_v1_JobSpec,
|
||||
convert_experimental_JobStatus_To_v1_JobStatus,
|
||||
convert_experimental_Job_To_v1_Job,
|
||||
convert_experimental_ReplicationControllerDummy_To_v1_ReplicationControllerDummy,
|
||||
convert_experimental_ResourceConsumption_To_v1_ResourceConsumption,
|
||||
convert_experimental_ScaleSpec_To_v1_ScaleSpec,
|
||||
convert_experimental_ScaleStatus_To_v1_ScaleStatus,
|
||||
convert_experimental_Scale_To_v1_Scale,
|
||||
convert_experimental_SubresourceReference_To_v1_SubresourceReference,
|
||||
convert_experimental_ThirdPartyResourceDataList_To_v1_ThirdPartyResourceDataList,
|
||||
convert_experimental_ThirdPartyResourceData_To_v1_ThirdPartyResourceData,
|
||||
convert_experimental_ThirdPartyResourceList_To_v1_ThirdPartyResourceList,
|
||||
convert_experimental_ThirdPartyResource_To_v1_ThirdPartyResource,
|
||||
convert_v1_APIVersion_To_experimental_APIVersion,
|
||||
convert_v1_AWSElasticBlockStoreVolumeSource_To_api_AWSElasticBlockStoreVolumeSource,
|
||||
convert_v1_Capabilities_To_api_Capabilities,
|
||||
convert_v1_CephFSVolumeSource_To_api_CephFSVolumeSource,
|
||||
convert_v1_CinderVolumeSource_To_api_CinderVolumeSource,
|
||||
convert_v1_ContainerPort_To_api_ContainerPort,
|
||||
convert_v1_Container_To_api_Container,
|
||||
convert_v1_DaemonSetList_To_expapi_DaemonSetList,
|
||||
convert_v1_DaemonSetSpec_To_expapi_DaemonSetSpec,
|
||||
convert_v1_DaemonSetStatus_To_expapi_DaemonSetStatus,
|
||||
convert_v1_DaemonSet_To_expapi_DaemonSet,
|
||||
convert_v1_DeploymentList_To_expapi_DeploymentList,
|
||||
convert_v1_DeploymentStatus_To_expapi_DeploymentStatus,
|
||||
convert_v1_Deployment_To_expapi_Deployment,
|
||||
convert_v1_DaemonSetList_To_experimental_DaemonSetList,
|
||||
convert_v1_DaemonSetSpec_To_experimental_DaemonSetSpec,
|
||||
convert_v1_DaemonSetStatus_To_experimental_DaemonSetStatus,
|
||||
convert_v1_DaemonSet_To_experimental_DaemonSet,
|
||||
convert_v1_DeploymentList_To_experimental_DeploymentList,
|
||||
convert_v1_DeploymentStatus_To_experimental_DeploymentStatus,
|
||||
convert_v1_Deployment_To_experimental_Deployment,
|
||||
convert_v1_DownwardAPIVolumeFile_To_api_DownwardAPIVolumeFile,
|
||||
convert_v1_DownwardAPIVolumeSource_To_api_DownwardAPIVolumeSource,
|
||||
convert_v1_EmptyDirVolumeSource_To_api_EmptyDirVolumeSource,
|
||||
@@ -2686,17 +2686,17 @@ func init() {
|
||||
convert_v1_GlusterfsVolumeSource_To_api_GlusterfsVolumeSource,
|
||||
convert_v1_HTTPGetAction_To_api_HTTPGetAction,
|
||||
convert_v1_Handler_To_api_Handler,
|
||||
convert_v1_HorizontalPodAutoscalerList_To_expapi_HorizontalPodAutoscalerList,
|
||||
convert_v1_HorizontalPodAutoscalerSpec_To_expapi_HorizontalPodAutoscalerSpec,
|
||||
convert_v1_HorizontalPodAutoscalerStatus_To_expapi_HorizontalPodAutoscalerStatus,
|
||||
convert_v1_HorizontalPodAutoscaler_To_expapi_HorizontalPodAutoscaler,
|
||||
convert_v1_HorizontalPodAutoscalerList_To_experimental_HorizontalPodAutoscalerList,
|
||||
convert_v1_HorizontalPodAutoscalerSpec_To_experimental_HorizontalPodAutoscalerSpec,
|
||||
convert_v1_HorizontalPodAutoscalerStatus_To_experimental_HorizontalPodAutoscalerStatus,
|
||||
convert_v1_HorizontalPodAutoscaler_To_experimental_HorizontalPodAutoscaler,
|
||||
convert_v1_HostPathVolumeSource_To_api_HostPathVolumeSource,
|
||||
convert_v1_ISCSIVolumeSource_To_api_ISCSIVolumeSource,
|
||||
convert_v1_JobCondition_To_expapi_JobCondition,
|
||||
convert_v1_JobList_To_expapi_JobList,
|
||||
convert_v1_JobSpec_To_expapi_JobSpec,
|
||||
convert_v1_JobStatus_To_expapi_JobStatus,
|
||||
convert_v1_Job_To_expapi_Job,
|
||||
convert_v1_JobCondition_To_experimental_JobCondition,
|
||||
convert_v1_JobList_To_experimental_JobList,
|
||||
convert_v1_JobSpec_To_experimental_JobSpec,
|
||||
convert_v1_JobStatus_To_experimental_JobStatus,
|
||||
convert_v1_Job_To_experimental_Job,
|
||||
convert_v1_Lifecycle_To_api_Lifecycle,
|
||||
convert_v1_ListMeta_To_api_ListMeta,
|
||||
convert_v1_LocalObjectReference_To_api_LocalObjectReference,
|
||||
@@ -2707,21 +2707,21 @@ func init() {
|
||||
convert_v1_PodTemplateSpec_To_api_PodTemplateSpec,
|
||||
convert_v1_Probe_To_api_Probe,
|
||||
convert_v1_RBDVolumeSource_To_api_RBDVolumeSource,
|
||||
convert_v1_ReplicationControllerDummy_To_expapi_ReplicationControllerDummy,
|
||||
convert_v1_ResourceConsumption_To_expapi_ResourceConsumption,
|
||||
convert_v1_ReplicationControllerDummy_To_experimental_ReplicationControllerDummy,
|
||||
convert_v1_ResourceConsumption_To_experimental_ResourceConsumption,
|
||||
convert_v1_ResourceRequirements_To_api_ResourceRequirements,
|
||||
convert_v1_SELinuxOptions_To_api_SELinuxOptions,
|
||||
convert_v1_ScaleSpec_To_expapi_ScaleSpec,
|
||||
convert_v1_ScaleStatus_To_expapi_ScaleStatus,
|
||||
convert_v1_Scale_To_expapi_Scale,
|
||||
convert_v1_ScaleSpec_To_experimental_ScaleSpec,
|
||||
convert_v1_ScaleStatus_To_experimental_ScaleStatus,
|
||||
convert_v1_Scale_To_experimental_Scale,
|
||||
convert_v1_SecretVolumeSource_To_api_SecretVolumeSource,
|
||||
convert_v1_SecurityContext_To_api_SecurityContext,
|
||||
convert_v1_SubresourceReference_To_expapi_SubresourceReference,
|
||||
convert_v1_SubresourceReference_To_experimental_SubresourceReference,
|
||||
convert_v1_TCPSocketAction_To_api_TCPSocketAction,
|
||||
convert_v1_ThirdPartyResourceDataList_To_expapi_ThirdPartyResourceDataList,
|
||||
convert_v1_ThirdPartyResourceData_To_expapi_ThirdPartyResourceData,
|
||||
convert_v1_ThirdPartyResourceList_To_expapi_ThirdPartyResourceList,
|
||||
convert_v1_ThirdPartyResource_To_expapi_ThirdPartyResource,
|
||||
convert_v1_ThirdPartyResourceDataList_To_experimental_ThirdPartyResourceDataList,
|
||||
convert_v1_ThirdPartyResourceData_To_experimental_ThirdPartyResourceData,
|
||||
convert_v1_ThirdPartyResourceList_To_experimental_ThirdPartyResourceList,
|
||||
convert_v1_ThirdPartyResource_To_experimental_ThirdPartyResource,
|
||||
convert_v1_TypeMeta_To_api_TypeMeta,
|
||||
convert_v1_VolumeMount_To_api_VolumeMount,
|
||||
convert_v1_VolumeSource_To_api_VolumeSource,
|
@@ -178,6 +178,67 @@ func (HorizontalPodAutoscalerStatus) SwaggerDoc() map[string]string {
|
||||
return map_HorizontalPodAutoscalerStatus
|
||||
}
|
||||
|
||||
var map_Job = map[string]string{
|
||||
"": "Job represents the configuration of a single job.",
|
||||
"metadata": "Standard object's metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata",
|
||||
"spec": "Spec is a structure defining the expected behavior of a job. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status",
|
||||
"status": "Status is a structure describing current status of a job. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status",
|
||||
}
|
||||
|
||||
func (Job) SwaggerDoc() map[string]string {
|
||||
return map_Job
|
||||
}
|
||||
|
||||
var map_JobCondition = map[string]string{
|
||||
"": "JobCondition describes current state of a job.",
|
||||
"type": "Type of job condition, currently only Complete.",
|
||||
"status": "Status of the condition, one of True, False, Unknown.",
|
||||
"lastProbeTime": "Last time the condition was checked.",
|
||||
"lastTransitionTime": "Last time the condition transit from one status to another.",
|
||||
"reason": "(brief) reason for the condition's last transition.",
|
||||
"message": "Human readable message indicating details about last transition.",
|
||||
}
|
||||
|
||||
func (JobCondition) SwaggerDoc() map[string]string {
|
||||
return map_JobCondition
|
||||
}
|
||||
|
||||
var map_JobList = map[string]string{
|
||||
"": "JobList is a collection of jobs.",
|
||||
"metadata": "Standard list metadata More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata",
|
||||
"items": "Items is the list of Job.",
|
||||
}
|
||||
|
||||
func (JobList) SwaggerDoc() map[string]string {
|
||||
return map_JobList
|
||||
}
|
||||
|
||||
var map_JobSpec = map[string]string{
|
||||
"": "JobSpec describes how the job execution will look like.",
|
||||
"parallelism": "Parallelism specifies the maximum desired number of pods the job should run at any given time. The actual number of pods running in steady state will be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism), i.e. when the work left to do is less than max parallelism.",
|
||||
"completions": "Completions specifies the desired number of successfully finished pods the job should be run with. Defaults to 1.",
|
||||
"selector": "Selector is a label query over pods that should match the pod count.",
|
||||
"template": "Template is the object that describes the pod that will be created when executing a job.",
|
||||
}
|
||||
|
||||
func (JobSpec) SwaggerDoc() map[string]string {
|
||||
return map_JobSpec
|
||||
}
|
||||
|
||||
var map_JobStatus = map[string]string{
|
||||
"": "JobStatus represents the current state of a Job.",
|
||||
"conditions": "Conditions represent the latest available observations of an object's current state.",
|
||||
"startTime": "StartTime represents time when the job was acknowledged by the Job Manager. It is not guaranteed to be set in happens-before order across separate operations. It is represented in RFC3339 form and is in UTC.",
|
||||
"completionTime": "CompletionTime represents time when the job was completed. It is not guaranteed to be set in happens-before order across separate operations. It is represented in RFC3339 form and is in UTC.",
|
||||
"active": "Active is the number of actively running pods.",
|
||||
"successful": "Successful is the number of pods which reached Phase Succeeded.",
|
||||
"unsuccessful": "Unsuccessful is the number of pods failures, this applies only to jobs created with RestartPolicyNever, otherwise this value will always be 0.",
|
||||
}
|
||||
|
||||
func (JobStatus) SwaggerDoc() map[string]string {
|
||||
return map_JobStatus
|
||||
}
|
||||
|
||||
var map_ReplicationControllerDummy = map[string]string{
|
||||
"": "Dummy definition",
|
||||
}
|
@@ -21,7 +21,7 @@ import (
|
||||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
apivalidation "k8s.io/kubernetes/pkg/api/validation"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/util"
|
||||
errs "k8s.io/kubernetes/pkg/util/fielderrors"
|
||||
@@ -37,7 +37,7 @@ func ValidateHorizontalPodAutoscalerName(name string, prefix bool) (bool, string
|
||||
return apivalidation.ValidateReplicationControllerName(name, prefix)
|
||||
}
|
||||
|
||||
func validateHorizontalPodAutoscalerSpec(autoscaler expapi.HorizontalPodAutoscalerSpec) errs.ValidationErrorList {
|
||||
func validateHorizontalPodAutoscalerSpec(autoscaler experimental.HorizontalPodAutoscalerSpec) errs.ValidationErrorList {
|
||||
allErrs := errs.ValidationErrorList{}
|
||||
if autoscaler.MinCount < 0 {
|
||||
allErrs = append(allErrs, errs.NewFieldInvalid("minCount", autoscaler.MinCount, `must be non-negative`))
|
||||
@@ -59,25 +59,25 @@ func validateHorizontalPodAutoscalerSpec(autoscaler expapi.HorizontalPodAutoscal
|
||||
return allErrs
|
||||
}
|
||||
|
||||
func ValidateHorizontalPodAutoscaler(autoscaler *expapi.HorizontalPodAutoscaler) errs.ValidationErrorList {
|
||||
func ValidateHorizontalPodAutoscaler(autoscaler *experimental.HorizontalPodAutoscaler) errs.ValidationErrorList {
|
||||
allErrs := errs.ValidationErrorList{}
|
||||
allErrs = append(allErrs, apivalidation.ValidateObjectMeta(&autoscaler.ObjectMeta, true, ValidateHorizontalPodAutoscalerName).Prefix("metadata")...)
|
||||
allErrs = append(allErrs, validateHorizontalPodAutoscalerSpec(autoscaler.Spec)...)
|
||||
return allErrs
|
||||
}
|
||||
|
||||
func ValidateHorizontalPodAutoscalerUpdate(newAutoscler, oldAutoscaler *expapi.HorizontalPodAutoscaler) errs.ValidationErrorList {
|
||||
func ValidateHorizontalPodAutoscalerUpdate(newAutoscler, oldAutoscaler *experimental.HorizontalPodAutoscaler) errs.ValidationErrorList {
|
||||
allErrs := errs.ValidationErrorList{}
|
||||
allErrs = append(allErrs, apivalidation.ValidateObjectMetaUpdate(&newAutoscler.ObjectMeta, &oldAutoscaler.ObjectMeta).Prefix("metadata")...)
|
||||
allErrs = append(allErrs, validateHorizontalPodAutoscalerSpec(newAutoscler.Spec)...)
|
||||
return allErrs
|
||||
}
|
||||
|
||||
func ValidateThirdPartyResourceUpdate(old, update *expapi.ThirdPartyResource) errs.ValidationErrorList {
|
||||
func ValidateThirdPartyResourceUpdate(old, update *experimental.ThirdPartyResource) errs.ValidationErrorList {
|
||||
return ValidateThirdPartyResource(update)
|
||||
}
|
||||
|
||||
func ValidateThirdPartyResource(obj *expapi.ThirdPartyResource) errs.ValidationErrorList {
|
||||
func ValidateThirdPartyResource(obj *experimental.ThirdPartyResource) errs.ValidationErrorList {
|
||||
allErrs := errs.ValidationErrorList{}
|
||||
if len(obj.Name) == 0 {
|
||||
allErrs = append(allErrs, errs.NewFieldInvalid("name", obj.Name, "name must be non-empty"))
|
||||
@@ -97,7 +97,7 @@ func ValidateThirdPartyResource(obj *expapi.ThirdPartyResource) errs.ValidationE
|
||||
}
|
||||
|
||||
// ValidateDaemonSet tests if required fields in the DaemonSet are set.
|
||||
func ValidateDaemonSet(controller *expapi.DaemonSet) errs.ValidationErrorList {
|
||||
func ValidateDaemonSet(controller *experimental.DaemonSet) errs.ValidationErrorList {
|
||||
allErrs := errs.ValidationErrorList{}
|
||||
allErrs = append(allErrs, apivalidation.ValidateObjectMeta(&controller.ObjectMeta, true, apivalidation.ValidateReplicationControllerName).Prefix("metadata")...)
|
||||
allErrs = append(allErrs, ValidateDaemonSetSpec(&controller.Spec).Prefix("spec")...)
|
||||
@@ -105,7 +105,7 @@ func ValidateDaemonSet(controller *expapi.DaemonSet) errs.ValidationErrorList {
|
||||
}
|
||||
|
||||
// ValidateDaemonSetUpdate tests if required fields in the DaemonSet are set.
|
||||
func ValidateDaemonSetUpdate(oldController, controller *expapi.DaemonSet) errs.ValidationErrorList {
|
||||
func ValidateDaemonSetUpdate(oldController, controller *experimental.DaemonSet) errs.ValidationErrorList {
|
||||
allErrs := errs.ValidationErrorList{}
|
||||
allErrs = append(allErrs, apivalidation.ValidateObjectMetaUpdate(&controller.ObjectMeta, &oldController.ObjectMeta).Prefix("metadata")...)
|
||||
allErrs = append(allErrs, ValidateDaemonSetSpec(&controller.Spec).Prefix("spec")...)
|
||||
@@ -129,7 +129,7 @@ func ValidateDaemonSetTemplateUpdate(oldPodTemplate, podTemplate *api.PodTemplat
|
||||
}
|
||||
|
||||
// ValidateDaemonSetSpec tests if required fields in the DaemonSetSpec are set.
|
||||
func ValidateDaemonSetSpec(spec *expapi.DaemonSetSpec) errs.ValidationErrorList {
|
||||
func ValidateDaemonSetSpec(spec *experimental.DaemonSetSpec) errs.ValidationErrorList {
|
||||
allErrs := errs.ValidationErrorList{}
|
||||
|
||||
selector := labels.Set(spec.Selector).AsSelector()
|
||||
@@ -206,7 +206,7 @@ func IsNotMoreThan100Percent(intOrStringValue util.IntOrString, fieldName string
|
||||
return allErrs
|
||||
}
|
||||
|
||||
func ValidateRollingUpdateDeployment(rollingUpdate *expapi.RollingUpdateDeployment, fieldName string) errs.ValidationErrorList {
|
||||
func ValidateRollingUpdateDeployment(rollingUpdate *experimental.RollingUpdateDeployment, fieldName string) errs.ValidationErrorList {
|
||||
allErrs := errs.ValidationErrorList{}
|
||||
allErrs = append(allErrs, ValidatePositiveIntOrPercent(rollingUpdate.MaxUnavailable, fieldName+"maxUnavailable")...)
|
||||
allErrs = append(allErrs, ValidatePositiveIntOrPercent(rollingUpdate.MaxSurge, fieldName+".maxSurge")...)
|
||||
@@ -220,22 +220,22 @@ func ValidateRollingUpdateDeployment(rollingUpdate *expapi.RollingUpdateDeployme
|
||||
return allErrs
|
||||
}
|
||||
|
||||
func ValidateDeploymentStrategy(strategy *expapi.DeploymentStrategy, fieldName string) errs.ValidationErrorList {
|
||||
func ValidateDeploymentStrategy(strategy *experimental.DeploymentStrategy, fieldName string) errs.ValidationErrorList {
|
||||
allErrs := errs.ValidationErrorList{}
|
||||
if strategy.RollingUpdate == nil {
|
||||
return allErrs
|
||||
}
|
||||
switch strategy.Type {
|
||||
case expapi.DeploymentRecreate:
|
||||
allErrs = append(allErrs, errs.NewFieldForbidden("rollingUpdate", "rollingUpdate should be nil when strategy type is "+expapi.DeploymentRecreate))
|
||||
case expapi.DeploymentRollingUpdate:
|
||||
case experimental.DeploymentRecreate:
|
||||
allErrs = append(allErrs, errs.NewFieldForbidden("rollingUpdate", "rollingUpdate should be nil when strategy type is "+experimental.DeploymentRecreate))
|
||||
case experimental.DeploymentRollingUpdate:
|
||||
allErrs = append(allErrs, ValidateRollingUpdateDeployment(strategy.RollingUpdate, "rollingUpdate")...)
|
||||
}
|
||||
return allErrs
|
||||
}
|
||||
|
||||
// Validates given deployment spec.
|
||||
func ValidateDeploymentSpec(spec *expapi.DeploymentSpec) errs.ValidationErrorList {
|
||||
func ValidateDeploymentSpec(spec *experimental.DeploymentSpec) errs.ValidationErrorList {
|
||||
allErrs := errs.ValidationErrorList{}
|
||||
allErrs = append(allErrs, apivalidation.ValidateNonEmptySelector(spec.Selector, "selector")...)
|
||||
allErrs = append(allErrs, apivalidation.ValidatePositiveField(int64(spec.Replicas), "replicas")...)
|
||||
@@ -245,25 +245,25 @@ func ValidateDeploymentSpec(spec *expapi.DeploymentSpec) errs.ValidationErrorLis
|
||||
return allErrs
|
||||
}
|
||||
|
||||
func ValidateDeploymentUpdate(old, update *expapi.Deployment) errs.ValidationErrorList {
|
||||
func ValidateDeploymentUpdate(old, update *experimental.Deployment) errs.ValidationErrorList {
|
||||
allErrs := errs.ValidationErrorList{}
|
||||
allErrs = append(allErrs, apivalidation.ValidateObjectMetaUpdate(&update.ObjectMeta, &old.ObjectMeta).Prefix("metadata")...)
|
||||
allErrs = append(allErrs, ValidateDeploymentSpec(&update.Spec).Prefix("spec")...)
|
||||
return allErrs
|
||||
}
|
||||
|
||||
func ValidateDeployment(obj *expapi.Deployment) errs.ValidationErrorList {
|
||||
func ValidateDeployment(obj *experimental.Deployment) errs.ValidationErrorList {
|
||||
allErrs := errs.ValidationErrorList{}
|
||||
allErrs = append(allErrs, apivalidation.ValidateObjectMeta(&obj.ObjectMeta, true, ValidateDeploymentName).Prefix("metadata")...)
|
||||
allErrs = append(allErrs, ValidateDeploymentSpec(&obj.Spec).Prefix("spec")...)
|
||||
return allErrs
|
||||
}
|
||||
|
||||
func ValidateThirdPartyResourceDataUpdate(old, update *expapi.ThirdPartyResourceData) errs.ValidationErrorList {
|
||||
func ValidateThirdPartyResourceDataUpdate(old, update *experimental.ThirdPartyResourceData) errs.ValidationErrorList {
|
||||
return ValidateThirdPartyResourceData(update)
|
||||
}
|
||||
|
||||
func ValidateThirdPartyResourceData(obj *expapi.ThirdPartyResourceData) errs.ValidationErrorList {
|
||||
func ValidateThirdPartyResourceData(obj *experimental.ThirdPartyResourceData) errs.ValidationErrorList {
|
||||
allErrs := errs.ValidationErrorList{}
|
||||
if len(obj.Name) == 0 {
|
||||
allErrs = append(allErrs, errs.NewFieldInvalid("name", obj.Name, "name must be non-empty"))
|
||||
@@ -271,7 +271,7 @@ func ValidateThirdPartyResourceData(obj *expapi.ThirdPartyResourceData) errs.Val
|
||||
return allErrs
|
||||
}
|
||||
|
||||
func ValidateJob(job *expapi.Job) errs.ValidationErrorList {
|
||||
func ValidateJob(job *experimental.Job) errs.ValidationErrorList {
|
||||
allErrs := errs.ValidationErrorList{}
|
||||
// Jobs and rcs have the same name validation
|
||||
allErrs = append(allErrs, apivalidation.ValidateObjectMeta(&job.ObjectMeta, true, apivalidation.ValidateReplicationControllerName).Prefix("metadata")...)
|
||||
@@ -279,7 +279,7 @@ func ValidateJob(job *expapi.Job) errs.ValidationErrorList {
|
||||
return allErrs
|
||||
}
|
||||
|
||||
func ValidateJobSpec(spec *expapi.JobSpec) errs.ValidationErrorList {
|
||||
func ValidateJobSpec(spec *experimental.JobSpec) errs.ValidationErrorList {
|
||||
allErrs := errs.ValidationErrorList{}
|
||||
|
||||
if spec.Parallelism != nil && *spec.Parallelism < 0 {
|
||||
@@ -311,7 +311,7 @@ func ValidateJobSpec(spec *expapi.JobSpec) errs.ValidationErrorList {
|
||||
return allErrs
|
||||
}
|
||||
|
||||
func ValidateJobUpdate(oldJob, job *expapi.Job) errs.ValidationErrorList {
|
||||
func ValidateJobUpdate(oldJob, job *experimental.Job) errs.ValidationErrorList {
|
||||
allErrs := errs.ValidationErrorList{}
|
||||
allErrs = append(allErrs, apivalidation.ValidateObjectMetaUpdate(&oldJob.ObjectMeta, &job.ObjectMeta).Prefix("metadata")...)
|
||||
allErrs = append(allErrs, ValidateJobSpec(&job.Spec).Prefix("spec")...)
|
@@ -22,25 +22,25 @@ import (
|
||||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/resource"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
"k8s.io/kubernetes/pkg/util"
|
||||
errors "k8s.io/kubernetes/pkg/util/fielderrors"
|
||||
)
|
||||
|
||||
func TestValidateHorizontalPodAutoscaler(t *testing.T) {
|
||||
successCases := []expapi.HorizontalPodAutoscaler{
|
||||
successCases := []experimental.HorizontalPodAutoscaler{
|
||||
{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "myautoscaler",
|
||||
Namespace: api.NamespaceDefault,
|
||||
},
|
||||
Spec: expapi.HorizontalPodAutoscalerSpec{
|
||||
ScaleRef: &expapi.SubresourceReference{
|
||||
Spec: experimental.HorizontalPodAutoscalerSpec{
|
||||
ScaleRef: &experimental.SubresourceReference{
|
||||
Subresource: "scale",
|
||||
},
|
||||
MinCount: 1,
|
||||
MaxCount: 5,
|
||||
Target: expapi.ResourceConsumption{Resource: api.ResourceCPU, Quantity: resource.MustParse("0.8")},
|
||||
Target: experimental.ResourceConsumption{Resource: api.ResourceCPU, Quantity: resource.MustParse("0.8")},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -50,19 +50,19 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
errorCases := map[string]expapi.HorizontalPodAutoscaler{
|
||||
errorCases := map[string]experimental.HorizontalPodAutoscaler{
|
||||
"must be non-negative": {
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "myautoscaler",
|
||||
Namespace: api.NamespaceDefault,
|
||||
},
|
||||
Spec: expapi.HorizontalPodAutoscalerSpec{
|
||||
ScaleRef: &expapi.SubresourceReference{
|
||||
Spec: experimental.HorizontalPodAutoscalerSpec{
|
||||
ScaleRef: &experimental.SubresourceReference{
|
||||
Subresource: "scale",
|
||||
},
|
||||
MinCount: -1,
|
||||
MaxCount: 5,
|
||||
Target: expapi.ResourceConsumption{Resource: api.ResourceCPU, Quantity: resource.MustParse("0.8")},
|
||||
Target: experimental.ResourceConsumption{Resource: api.ResourceCPU, Quantity: resource.MustParse("0.8")},
|
||||
},
|
||||
},
|
||||
"must be bigger or equal to minCount": {
|
||||
@@ -70,13 +70,13 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
|
||||
Name: "myautoscaler",
|
||||
Namespace: api.NamespaceDefault,
|
||||
},
|
||||
Spec: expapi.HorizontalPodAutoscalerSpec{
|
||||
ScaleRef: &expapi.SubresourceReference{
|
||||
Spec: experimental.HorizontalPodAutoscalerSpec{
|
||||
ScaleRef: &experimental.SubresourceReference{
|
||||
Subresource: "scale",
|
||||
},
|
||||
MinCount: 7,
|
||||
MaxCount: 5,
|
||||
Target: expapi.ResourceConsumption{Resource: api.ResourceCPU, Quantity: resource.MustParse("0.8")},
|
||||
Target: experimental.ResourceConsumption{Resource: api.ResourceCPU, Quantity: resource.MustParse("0.8")},
|
||||
},
|
||||
},
|
||||
"invalid value": {
|
||||
@@ -84,13 +84,13 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
|
||||
Name: "myautoscaler",
|
||||
Namespace: api.NamespaceDefault,
|
||||
},
|
||||
Spec: expapi.HorizontalPodAutoscalerSpec{
|
||||
ScaleRef: &expapi.SubresourceReference{
|
||||
Spec: experimental.HorizontalPodAutoscalerSpec{
|
||||
ScaleRef: &experimental.SubresourceReference{
|
||||
Subresource: "scale",
|
||||
},
|
||||
MinCount: 1,
|
||||
MaxCount: 5,
|
||||
Target: expapi.ResourceConsumption{Resource: api.ResourceCPU, Quantity: resource.MustParse("-0.8")},
|
||||
Target: experimental.ResourceConsumption{Resource: api.ResourceCPU, Quantity: resource.MustParse("-0.8")},
|
||||
},
|
||||
},
|
||||
"resource not supported": {
|
||||
@@ -98,13 +98,13 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
|
||||
Name: "myautoscaler",
|
||||
Namespace: api.NamespaceDefault,
|
||||
},
|
||||
Spec: expapi.HorizontalPodAutoscalerSpec{
|
||||
ScaleRef: &expapi.SubresourceReference{
|
||||
Spec: experimental.HorizontalPodAutoscalerSpec{
|
||||
ScaleRef: &experimental.SubresourceReference{
|
||||
Subresource: "scale",
|
||||
},
|
||||
MinCount: 1,
|
||||
MaxCount: 5,
|
||||
Target: expapi.ResourceConsumption{Resource: api.ResourceName("NotSupportedResource"), Quantity: resource.MustParse("0.8")},
|
||||
Target: experimental.ResourceConsumption{Resource: api.ResourceName("NotSupportedResource"), Quantity: resource.MustParse("0.8")},
|
||||
},
|
||||
},
|
||||
"required value": {
|
||||
@@ -112,10 +112,10 @@ func TestValidateHorizontalPodAutoscaler(t *testing.T) {
|
||||
Name: "myautoscaler",
|
||||
Namespace: api.NamespaceDefault,
|
||||
},
|
||||
Spec: expapi.HorizontalPodAutoscalerSpec{
|
||||
Spec: experimental.HorizontalPodAutoscalerSpec{
|
||||
MinCount: 1,
|
||||
MaxCount: 5,
|
||||
Target: expapi.ResourceConsumption{Resource: api.ResourceCPU, Quantity: resource.MustParse("0.8")},
|
||||
Target: experimental.ResourceConsumption{Resource: api.ResourceCPU, Quantity: resource.MustParse("0.8")},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -212,53 +212,53 @@ func TestValidateDaemonSetUpdate(t *testing.T) {
|
||||
}
|
||||
|
||||
type dsUpdateTest struct {
|
||||
old expapi.DaemonSet
|
||||
update expapi.DaemonSet
|
||||
old experimental.DaemonSet
|
||||
update experimental.DaemonSet
|
||||
}
|
||||
successCases := []dsUpdateTest{
|
||||
{
|
||||
old: expapi.DaemonSet{
|
||||
old: experimental.DaemonSet{
|
||||
ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
|
||||
Spec: expapi.DaemonSetSpec{
|
||||
Spec: experimental.DaemonSetSpec{
|
||||
Selector: validSelector,
|
||||
Template: &validPodTemplateAbc.Template,
|
||||
},
|
||||
},
|
||||
update: expapi.DaemonSet{
|
||||
update: experimental.DaemonSet{
|
||||
ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
|
||||
Spec: expapi.DaemonSetSpec{
|
||||
Spec: experimental.DaemonSetSpec{
|
||||
Selector: validSelector,
|
||||
Template: &validPodTemplateAbc.Template,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
old: expapi.DaemonSet{
|
||||
old: experimental.DaemonSet{
|
||||
ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
|
||||
Spec: expapi.DaemonSetSpec{
|
||||
Spec: experimental.DaemonSetSpec{
|
||||
Selector: validSelector,
|
||||
Template: &validPodTemplateAbc.Template,
|
||||
},
|
||||
},
|
||||
update: expapi.DaemonSet{
|
||||
update: experimental.DaemonSet{
|
||||
ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
|
||||
Spec: expapi.DaemonSetSpec{
|
||||
Spec: experimental.DaemonSetSpec{
|
||||
Selector: validSelector2,
|
||||
Template: &validPodTemplateAbc2.Template,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
old: expapi.DaemonSet{
|
||||
old: experimental.DaemonSet{
|
||||
ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
|
||||
Spec: expapi.DaemonSetSpec{
|
||||
Spec: experimental.DaemonSetSpec{
|
||||
Selector: validSelector,
|
||||
Template: &validPodTemplateAbc.Template,
|
||||
},
|
||||
},
|
||||
update: expapi.DaemonSet{
|
||||
update: experimental.DaemonSet{
|
||||
ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
|
||||
Spec: expapi.DaemonSetSpec{
|
||||
Spec: experimental.DaemonSetSpec{
|
||||
Selector: validSelector,
|
||||
Template: &validPodTemplateNodeSelector.Template,
|
||||
},
|
||||
@@ -274,80 +274,80 @@ func TestValidateDaemonSetUpdate(t *testing.T) {
|
||||
}
|
||||
errorCases := map[string]dsUpdateTest{
|
||||
"change daemon name": {
|
||||
old: expapi.DaemonSet{
|
||||
old: experimental.DaemonSet{
|
||||
ObjectMeta: api.ObjectMeta{Name: "", Namespace: api.NamespaceDefault},
|
||||
Spec: expapi.DaemonSetSpec{
|
||||
Spec: experimental.DaemonSetSpec{
|
||||
Selector: validSelector,
|
||||
Template: &validPodTemplateAbc.Template,
|
||||
},
|
||||
},
|
||||
update: expapi.DaemonSet{
|
||||
update: experimental.DaemonSet{
|
||||
ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
|
||||
Spec: expapi.DaemonSetSpec{
|
||||
Spec: experimental.DaemonSetSpec{
|
||||
Selector: validSelector,
|
||||
Template: &validPodTemplateAbc.Template,
|
||||
},
|
||||
},
|
||||
},
|
||||
"invalid selector": {
|
||||
old: expapi.DaemonSet{
|
||||
old: experimental.DaemonSet{
|
||||
ObjectMeta: api.ObjectMeta{Name: "", Namespace: api.NamespaceDefault},
|
||||
Spec: expapi.DaemonSetSpec{
|
||||
Spec: experimental.DaemonSetSpec{
|
||||
Selector: validSelector,
|
||||
Template: &validPodTemplateAbc.Template,
|
||||
},
|
||||
},
|
||||
update: expapi.DaemonSet{
|
||||
update: experimental.DaemonSet{
|
||||
ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
|
||||
Spec: expapi.DaemonSetSpec{
|
||||
Spec: experimental.DaemonSetSpec{
|
||||
Selector: invalidSelector,
|
||||
Template: &validPodTemplateAbc.Template,
|
||||
},
|
||||
},
|
||||
},
|
||||
"invalid pod": {
|
||||
old: expapi.DaemonSet{
|
||||
old: experimental.DaemonSet{
|
||||
ObjectMeta: api.ObjectMeta{Name: "", Namespace: api.NamespaceDefault},
|
||||
Spec: expapi.DaemonSetSpec{
|
||||
Spec: experimental.DaemonSetSpec{
|
||||
Selector: validSelector,
|
||||
Template: &validPodTemplateAbc.Template,
|
||||
},
|
||||
},
|
||||
update: expapi.DaemonSet{
|
||||
update: experimental.DaemonSet{
|
||||
ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
|
||||
Spec: expapi.DaemonSetSpec{
|
||||
Spec: experimental.DaemonSetSpec{
|
||||
Selector: validSelector,
|
||||
Template: &invalidPodTemplate.Template,
|
||||
},
|
||||
},
|
||||
},
|
||||
"change container image": {
|
||||
old: expapi.DaemonSet{
|
||||
old: experimental.DaemonSet{
|
||||
ObjectMeta: api.ObjectMeta{Name: "", Namespace: api.NamespaceDefault},
|
||||
Spec: expapi.DaemonSetSpec{
|
||||
Spec: experimental.DaemonSetSpec{
|
||||
Selector: validSelector,
|
||||
Template: &validPodTemplateAbc.Template,
|
||||
},
|
||||
},
|
||||
update: expapi.DaemonSet{
|
||||
update: experimental.DaemonSet{
|
||||
ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
|
||||
Spec: expapi.DaemonSetSpec{
|
||||
Spec: experimental.DaemonSetSpec{
|
||||
Selector: validSelector,
|
||||
Template: &validPodTemplateDef.Template,
|
||||
},
|
||||
},
|
||||
},
|
||||
"read-write volume": {
|
||||
old: expapi.DaemonSet{
|
||||
old: experimental.DaemonSet{
|
||||
ObjectMeta: api.ObjectMeta{Name: "", Namespace: api.NamespaceDefault},
|
||||
Spec: expapi.DaemonSetSpec{
|
||||
Spec: experimental.DaemonSetSpec{
|
||||
Selector: validSelector,
|
||||
Template: &validPodTemplateAbc.Template,
|
||||
},
|
||||
},
|
||||
update: expapi.DaemonSet{
|
||||
update: experimental.DaemonSet{
|
||||
ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
|
||||
Spec: expapi.DaemonSetSpec{
|
||||
Spec: experimental.DaemonSetSpec{
|
||||
Selector: validSelector,
|
||||
Template: &readWriteVolumePodTemplate.Template,
|
||||
},
|
||||
@@ -387,17 +387,17 @@ func TestValidateDaemonSet(t *testing.T) {
|
||||
},
|
||||
},
|
||||
}
|
||||
successCases := []expapi.DaemonSet{
|
||||
successCases := []experimental.DaemonSet{
|
||||
{
|
||||
ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
|
||||
Spec: expapi.DaemonSetSpec{
|
||||
Spec: experimental.DaemonSetSpec{
|
||||
Selector: validSelector,
|
||||
Template: &validPodTemplate.Template,
|
||||
},
|
||||
},
|
||||
{
|
||||
ObjectMeta: api.ObjectMeta{Name: "abc-123", Namespace: api.NamespaceDefault},
|
||||
Spec: expapi.DaemonSetSpec{
|
||||
Spec: experimental.DaemonSetSpec{
|
||||
Selector: validSelector,
|
||||
Template: &validPodTemplate.Template,
|
||||
},
|
||||
@@ -409,37 +409,37 @@ func TestValidateDaemonSet(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
errorCases := map[string]expapi.DaemonSet{
|
||||
errorCases := map[string]experimental.DaemonSet{
|
||||
"zero-length ID": {
|
||||
ObjectMeta: api.ObjectMeta{Name: "", Namespace: api.NamespaceDefault},
|
||||
Spec: expapi.DaemonSetSpec{
|
||||
Spec: experimental.DaemonSetSpec{
|
||||
Selector: validSelector,
|
||||
Template: &validPodTemplate.Template,
|
||||
},
|
||||
},
|
||||
"missing-namespace": {
|
||||
ObjectMeta: api.ObjectMeta{Name: "abc-123"},
|
||||
Spec: expapi.DaemonSetSpec{
|
||||
Spec: experimental.DaemonSetSpec{
|
||||
Selector: validSelector,
|
||||
Template: &validPodTemplate.Template,
|
||||
},
|
||||
},
|
||||
"empty selector": {
|
||||
ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
|
||||
Spec: expapi.DaemonSetSpec{
|
||||
Spec: experimental.DaemonSetSpec{
|
||||
Template: &validPodTemplate.Template,
|
||||
},
|
||||
},
|
||||
"selector_doesnt_match": {
|
||||
ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
|
||||
Spec: expapi.DaemonSetSpec{
|
||||
Spec: experimental.DaemonSetSpec{
|
||||
Selector: map[string]string{"foo": "bar"},
|
||||
Template: &validPodTemplate.Template,
|
||||
},
|
||||
},
|
||||
"invalid manifest": {
|
||||
ObjectMeta: api.ObjectMeta{Name: "abc", Namespace: api.NamespaceDefault},
|
||||
Spec: expapi.DaemonSetSpec{
|
||||
Spec: experimental.DaemonSetSpec{
|
||||
Selector: validSelector,
|
||||
},
|
||||
},
|
||||
@@ -451,7 +451,7 @@ func TestValidateDaemonSet(t *testing.T) {
|
||||
"NoUppercaseOrSpecialCharsLike=Equals": "bar",
|
||||
},
|
||||
},
|
||||
Spec: expapi.DaemonSetSpec{
|
||||
Spec: experimental.DaemonSetSpec{
|
||||
Selector: validSelector,
|
||||
Template: &validPodTemplate.Template,
|
||||
},
|
||||
@@ -464,7 +464,7 @@ func TestValidateDaemonSet(t *testing.T) {
|
||||
"NoUppercaseOrSpecialCharsLike=Equals": "bar",
|
||||
},
|
||||
},
|
||||
Spec: expapi.DaemonSetSpec{
|
||||
Spec: experimental.DaemonSetSpec{
|
||||
Template: &invalidPodTemplate.Template,
|
||||
},
|
||||
},
|
||||
@@ -476,7 +476,7 @@ func TestValidateDaemonSet(t *testing.T) {
|
||||
"NoUppercaseOrSpecialCharsLike=Equals": "bar",
|
||||
},
|
||||
},
|
||||
Spec: expapi.DaemonSetSpec{
|
||||
Spec: experimental.DaemonSetSpec{
|
||||
Selector: validSelector,
|
||||
Template: &validPodTemplate.Template,
|
||||
},
|
||||
@@ -486,7 +486,7 @@ func TestValidateDaemonSet(t *testing.T) {
|
||||
Name: "abc-123",
|
||||
Namespace: api.NamespaceDefault,
|
||||
},
|
||||
Spec: expapi.DaemonSetSpec{
|
||||
Spec: experimental.DaemonSetSpec{
|
||||
Selector: validSelector,
|
||||
Template: &api.PodTemplateSpec{
|
||||
Spec: api.PodSpec{
|
||||
@@ -505,7 +505,7 @@ func TestValidateDaemonSet(t *testing.T) {
|
||||
Name: "abc-123",
|
||||
Namespace: api.NamespaceDefault,
|
||||
},
|
||||
Spec: expapi.DaemonSetSpec{
|
||||
Spec: experimental.DaemonSetSpec{
|
||||
Selector: validSelector,
|
||||
Template: &api.PodTemplateSpec{
|
||||
Spec: api.PodSpec{
|
||||
@@ -542,13 +542,13 @@ func TestValidateDaemonSet(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func validDeployment() *expapi.Deployment {
|
||||
return &expapi.Deployment{
|
||||
func validDeployment() *experimental.Deployment {
|
||||
return &experimental.Deployment{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "abc",
|
||||
Namespace: api.NamespaceDefault,
|
||||
},
|
||||
Spec: expapi.DeploymentSpec{
|
||||
Spec: experimental.DeploymentSpec{
|
||||
Selector: map[string]string{
|
||||
"name": "abc",
|
||||
},
|
||||
@@ -578,7 +578,7 @@ func validDeployment() *expapi.Deployment {
|
||||
}
|
||||
|
||||
func TestValidateDeployment(t *testing.T) {
|
||||
successCases := []*expapi.Deployment{
|
||||
successCases := []*experimental.Deployment{
|
||||
validDeployment(),
|
||||
}
|
||||
for _, successCase := range successCases {
|
||||
@@ -587,8 +587,8 @@ func TestValidateDeployment(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
errorCases := map[string]*expapi.Deployment{}
|
||||
errorCases["metadata.name: required value"] = &expapi.Deployment{
|
||||
errorCases := map[string]*experimental.Deployment{}
|
||||
errorCases["metadata.name: required value"] = &experimental.Deployment{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Namespace: api.NamespaceDefault,
|
||||
},
|
||||
@@ -612,17 +612,17 @@ func TestValidateDeployment(t *testing.T) {
|
||||
|
||||
// rollingUpdate should be nil for recreate.
|
||||
invalidRecreateDeployment := validDeployment()
|
||||
invalidRecreateDeployment.Spec.Strategy = expapi.DeploymentStrategy{
|
||||
Type: expapi.DeploymentRecreate,
|
||||
RollingUpdate: &expapi.RollingUpdateDeployment{},
|
||||
invalidRecreateDeployment.Spec.Strategy = experimental.DeploymentStrategy{
|
||||
Type: experimental.DeploymentRecreate,
|
||||
RollingUpdate: &experimental.RollingUpdateDeployment{},
|
||||
}
|
||||
errorCases["rollingUpdate should be nil when strategy type is Recreate"] = invalidRecreateDeployment
|
||||
|
||||
// MaxSurge should be in the form of 20%.
|
||||
invalidMaxSurgeDeployment := validDeployment()
|
||||
invalidMaxSurgeDeployment.Spec.Strategy = expapi.DeploymentStrategy{
|
||||
Type: expapi.DeploymentRollingUpdate,
|
||||
RollingUpdate: &expapi.RollingUpdateDeployment{
|
||||
invalidMaxSurgeDeployment.Spec.Strategy = experimental.DeploymentStrategy{
|
||||
Type: experimental.DeploymentRollingUpdate,
|
||||
RollingUpdate: &experimental.RollingUpdateDeployment{
|
||||
MaxSurge: util.NewIntOrStringFromString("20Percent"),
|
||||
},
|
||||
}
|
||||
@@ -630,9 +630,9 @@ func TestValidateDeployment(t *testing.T) {
|
||||
|
||||
// MaxSurge and MaxUnavailable cannot both be zero.
|
||||
invalidRollingUpdateDeployment := validDeployment()
|
||||
invalidRollingUpdateDeployment.Spec.Strategy = expapi.DeploymentStrategy{
|
||||
Type: expapi.DeploymentRollingUpdate,
|
||||
RollingUpdate: &expapi.RollingUpdateDeployment{
|
||||
invalidRollingUpdateDeployment.Spec.Strategy = experimental.DeploymentStrategy{
|
||||
Type: experimental.DeploymentRollingUpdate,
|
||||
RollingUpdate: &experimental.RollingUpdateDeployment{
|
||||
MaxSurge: util.NewIntOrStringFromString("0%"),
|
||||
MaxUnavailable: util.NewIntOrStringFromInt(0),
|
||||
},
|
||||
@@ -641,9 +641,9 @@ func TestValidateDeployment(t *testing.T) {
|
||||
|
||||
// MaxUnavailable should not be more than 100%.
|
||||
invalidMaxUnavailableDeployment := validDeployment()
|
||||
invalidMaxUnavailableDeployment.Spec.Strategy = expapi.DeploymentStrategy{
|
||||
Type: expapi.DeploymentRollingUpdate,
|
||||
RollingUpdate: &expapi.RollingUpdateDeployment{
|
||||
invalidMaxUnavailableDeployment.Spec.Strategy = experimental.DeploymentStrategy{
|
||||
Type: experimental.DeploymentRollingUpdate,
|
||||
RollingUpdate: &experimental.RollingUpdateDeployment{
|
||||
MaxUnavailable: util.NewIntOrStringFromString("110%"),
|
||||
},
|
||||
}
|
||||
@@ -671,13 +671,13 @@ func TestValidateJob(t *testing.T) {
|
||||
Containers: []api.Container{{Name: "abc", Image: "image", ImagePullPolicy: "IfNotPresent"}},
|
||||
},
|
||||
}
|
||||
successCases := []expapi.Job{
|
||||
successCases := []experimental.Job{
|
||||
{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "myjob",
|
||||
Namespace: api.NamespaceDefault,
|
||||
},
|
||||
Spec: expapi.JobSpec{
|
||||
Spec: experimental.JobSpec{
|
||||
Selector: validSelector,
|
||||
Template: &validPodTemplateSpec,
|
||||
},
|
||||
@@ -689,13 +689,13 @@ func TestValidateJob(t *testing.T) {
|
||||
}
|
||||
}
|
||||
negative := -1
|
||||
errorCases := map[string]expapi.Job{
|
||||
errorCases := map[string]experimental.Job{
|
||||
"spec.parallelism:must be non-negative": {
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "myjob",
|
||||
Namespace: api.NamespaceDefault,
|
||||
},
|
||||
Spec: expapi.JobSpec{
|
||||
Spec: experimental.JobSpec{
|
||||
Parallelism: &negative,
|
||||
Selector: validSelector,
|
||||
Template: &validPodTemplateSpec,
|
||||
@@ -706,7 +706,7 @@ func TestValidateJob(t *testing.T) {
|
||||
Name: "myjob",
|
||||
Namespace: api.NamespaceDefault,
|
||||
},
|
||||
Spec: expapi.JobSpec{
|
||||
Spec: experimental.JobSpec{
|
||||
Completions: &negative,
|
||||
Selector: validSelector,
|
||||
Template: &validPodTemplateSpec,
|
||||
@@ -717,7 +717,7 @@ func TestValidateJob(t *testing.T) {
|
||||
Name: "myjob",
|
||||
Namespace: api.NamespaceDefault,
|
||||
},
|
||||
Spec: expapi.JobSpec{
|
||||
Spec: experimental.JobSpec{
|
||||
Selector: map[string]string{},
|
||||
Template: &validPodTemplateSpec,
|
||||
},
|
||||
@@ -727,7 +727,7 @@ func TestValidateJob(t *testing.T) {
|
||||
Name: "myjob",
|
||||
Namespace: api.NamespaceDefault,
|
||||
},
|
||||
Spec: expapi.JobSpec{
|
||||
Spec: experimental.JobSpec{
|
||||
Selector: validSelector,
|
||||
},
|
||||
},
|
||||
@@ -736,7 +736,7 @@ func TestValidateJob(t *testing.T) {
|
||||
Name: "myjob",
|
||||
Namespace: api.NamespaceDefault,
|
||||
},
|
||||
Spec: expapi.JobSpec{
|
||||
Spec: experimental.JobSpec{
|
||||
Selector: validSelector,
|
||||
Template: &api.PodTemplateSpec{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
@@ -755,7 +755,7 @@ func TestValidateJob(t *testing.T) {
|
||||
Name: "myjob",
|
||||
Namespace: api.NamespaceDefault,
|
||||
},
|
||||
Spec: expapi.JobSpec{
|
||||
Spec: experimental.JobSpec{
|
||||
Selector: validSelector,
|
||||
Template: &api.PodTemplateSpec{
|
||||
ObjectMeta: api.ObjectMeta{
|
14
pkg/client/cache/listers.go
vendored
14
pkg/client/cache/listers.go
vendored
@@ -21,7 +21,7 @@ import (
|
||||
|
||||
"github.com/golang/glog"
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
)
|
||||
|
||||
@@ -232,7 +232,7 @@ type StoreToDaemonSetLister struct {
|
||||
}
|
||||
|
||||
// Exists checks if the given daemon set exists in the store.
|
||||
func (s *StoreToDaemonSetLister) Exists(ds *expapi.DaemonSet) (bool, error) {
|
||||
func (s *StoreToDaemonSetLister) Exists(ds *experimental.DaemonSet) (bool, error) {
|
||||
_, exists, err := s.Store.Get(ds)
|
||||
if err != nil {
|
||||
return false, err
|
||||
@@ -242,17 +242,17 @@ func (s *StoreToDaemonSetLister) Exists(ds *expapi.DaemonSet) (bool, error) {
|
||||
|
||||
// List lists all daemon sets in the store.
|
||||
// TODO: converge on the interface in pkg/client
|
||||
func (s *StoreToDaemonSetLister) List() (dss []expapi.DaemonSet, err error) {
|
||||
func (s *StoreToDaemonSetLister) List() (dss []experimental.DaemonSet, err error) {
|
||||
for _, c := range s.Store.List() {
|
||||
dss = append(dss, *(c.(*expapi.DaemonSet)))
|
||||
dss = append(dss, *(c.(*experimental.DaemonSet)))
|
||||
}
|
||||
return dss, nil
|
||||
}
|
||||
|
||||
// GetPodDaemonSets returns a list of daemon sets managing a pod. Returns an error iff no matching daemon sets are found.
|
||||
func (s *StoreToDaemonSetLister) GetPodDaemonSets(pod *api.Pod) (daemonSets []expapi.DaemonSet, err error) {
|
||||
func (s *StoreToDaemonSetLister) GetPodDaemonSets(pod *api.Pod) (daemonSets []experimental.DaemonSet, err error) {
|
||||
var selector labels.Selector
|
||||
var daemonSet expapi.DaemonSet
|
||||
var daemonSet experimental.DaemonSet
|
||||
|
||||
if len(pod.Labels) == 0 {
|
||||
err = fmt.Errorf("No daemon sets found for pod %v because it has no labels", pod.Name)
|
||||
@@ -260,7 +260,7 @@ func (s *StoreToDaemonSetLister) GetPodDaemonSets(pod *api.Pod) (daemonSets []ex
|
||||
}
|
||||
|
||||
for _, m := range s.Store.List() {
|
||||
daemonSet = *m.(*expapi.DaemonSet)
|
||||
daemonSet = *m.(*experimental.DaemonSet)
|
||||
if daemonSet.Namespace != pod.Namespace {
|
||||
continue
|
||||
}
|
||||
|
32
pkg/client/cache/listers_test.go
vendored
32
pkg/client/cache/listers_test.go
vendored
@@ -20,7 +20,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/util/sets"
|
||||
)
|
||||
@@ -160,44 +160,44 @@ func TestStoreToDaemonSetLister(t *testing.T) {
|
||||
store := NewStore(MetaNamespaceKeyFunc)
|
||||
lister := StoreToDaemonSetLister{store}
|
||||
testCases := []struct {
|
||||
inDSs []*expapi.DaemonSet
|
||||
list func() ([]expapi.DaemonSet, error)
|
||||
inDSs []*experimental.DaemonSet
|
||||
list func() ([]experimental.DaemonSet, error)
|
||||
outDaemonSetNames sets.String
|
||||
expectErr bool
|
||||
}{
|
||||
// Basic listing
|
||||
{
|
||||
inDSs: []*expapi.DaemonSet{
|
||||
inDSs: []*experimental.DaemonSet{
|
||||
{ObjectMeta: api.ObjectMeta{Name: "basic"}},
|
||||
},
|
||||
list: func() ([]expapi.DaemonSet, error) {
|
||||
list: func() ([]experimental.DaemonSet, error) {
|
||||
return lister.List()
|
||||
},
|
||||
outDaemonSetNames: sets.NewString("basic"),
|
||||
},
|
||||
// Listing multiple daemon sets
|
||||
{
|
||||
inDSs: []*expapi.DaemonSet{
|
||||
inDSs: []*experimental.DaemonSet{
|
||||
{ObjectMeta: api.ObjectMeta{Name: "basic"}},
|
||||
{ObjectMeta: api.ObjectMeta{Name: "complex"}},
|
||||
{ObjectMeta: api.ObjectMeta{Name: "complex2"}},
|
||||
},
|
||||
list: func() ([]expapi.DaemonSet, error) {
|
||||
list: func() ([]experimental.DaemonSet, error) {
|
||||
return lister.List()
|
||||
},
|
||||
outDaemonSetNames: sets.NewString("basic", "complex", "complex2"),
|
||||
},
|
||||
// No pod labels
|
||||
{
|
||||
inDSs: []*expapi.DaemonSet{
|
||||
inDSs: []*experimental.DaemonSet{
|
||||
{
|
||||
ObjectMeta: api.ObjectMeta{Name: "basic", Namespace: "ns"},
|
||||
Spec: expapi.DaemonSetSpec{
|
||||
Spec: experimental.DaemonSetSpec{
|
||||
Selector: map[string]string{"foo": "baz"},
|
||||
},
|
||||
},
|
||||
},
|
||||
list: func() ([]expapi.DaemonSet, error) {
|
||||
list: func() ([]experimental.DaemonSet, error) {
|
||||
pod := &api.Pod{
|
||||
ObjectMeta: api.ObjectMeta{Name: "pod1", Namespace: "ns"},
|
||||
}
|
||||
@@ -208,12 +208,12 @@ func TestStoreToDaemonSetLister(t *testing.T) {
|
||||
},
|
||||
// No DS selectors
|
||||
{
|
||||
inDSs: []*expapi.DaemonSet{
|
||||
inDSs: []*experimental.DaemonSet{
|
||||
{
|
||||
ObjectMeta: api.ObjectMeta{Name: "basic", Namespace: "ns"},
|
||||
},
|
||||
},
|
||||
list: func() ([]expapi.DaemonSet, error) {
|
||||
list: func() ([]experimental.DaemonSet, error) {
|
||||
pod := &api.Pod{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "pod1",
|
||||
@@ -228,21 +228,21 @@ func TestStoreToDaemonSetLister(t *testing.T) {
|
||||
},
|
||||
// Matching labels to selectors and namespace
|
||||
{
|
||||
inDSs: []*expapi.DaemonSet{
|
||||
inDSs: []*experimental.DaemonSet{
|
||||
{
|
||||
ObjectMeta: api.ObjectMeta{Name: "foo"},
|
||||
Spec: expapi.DaemonSetSpec{
|
||||
Spec: experimental.DaemonSetSpec{
|
||||
Selector: map[string]string{"foo": "bar"},
|
||||
},
|
||||
},
|
||||
{
|
||||
ObjectMeta: api.ObjectMeta{Name: "bar", Namespace: "ns"},
|
||||
Spec: expapi.DaemonSetSpec{
|
||||
Spec: experimental.DaemonSetSpec{
|
||||
Selector: map[string]string{"foo": "bar"},
|
||||
},
|
||||
},
|
||||
},
|
||||
list: func() ([]expapi.DaemonSet, error) {
|
||||
list: func() ([]experimental.DaemonSet, error) {
|
||||
pod := &api.Pod{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "pod1",
|
||||
|
@@ -17,7 +17,7 @@ limitations under the License.
|
||||
package unversioned
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/watch"
|
||||
@@ -29,10 +29,10 @@ type DaemonSetsNamespacer interface {
|
||||
}
|
||||
|
||||
type DaemonSetInterface interface {
|
||||
List(selector labels.Selector) (*expapi.DaemonSetList, error)
|
||||
Get(name string) (*expapi.DaemonSet, error)
|
||||
Create(ctrl *expapi.DaemonSet) (*expapi.DaemonSet, error)
|
||||
Update(ctrl *expapi.DaemonSet) (*expapi.DaemonSet, error)
|
||||
List(selector labels.Selector) (*experimental.DaemonSetList, error)
|
||||
Get(name string) (*experimental.DaemonSet, error)
|
||||
Create(ctrl *experimental.DaemonSet) (*experimental.DaemonSet, error)
|
||||
Update(ctrl *experimental.DaemonSet) (*experimental.DaemonSet, error)
|
||||
Delete(name string) error
|
||||
Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)
|
||||
}
|
||||
@@ -50,29 +50,29 @@ func newDaemonSets(c *ExperimentalClient, namespace string) *daemonSets {
|
||||
// Ensure statically that daemonSets implements DaemonSetsInterface.
|
||||
var _ DaemonSetInterface = &daemonSets{}
|
||||
|
||||
func (c *daemonSets) List(selector labels.Selector) (result *expapi.DaemonSetList, err error) {
|
||||
result = &expapi.DaemonSetList{}
|
||||
func (c *daemonSets) List(selector labels.Selector) (result *experimental.DaemonSetList, err error) {
|
||||
result = &experimental.DaemonSetList{}
|
||||
err = c.r.Get().Namespace(c.ns).Resource("daemonsets").LabelsSelectorParam(selector).Do().Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Get returns information about a particular daemon set.
|
||||
func (c *daemonSets) Get(name string) (result *expapi.DaemonSet, err error) {
|
||||
result = &expapi.DaemonSet{}
|
||||
func (c *daemonSets) Get(name string) (result *experimental.DaemonSet, err error) {
|
||||
result = &experimental.DaemonSet{}
|
||||
err = c.r.Get().Namespace(c.ns).Resource("daemonsets").Name(name).Do().Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Create creates a new daemon set.
|
||||
func (c *daemonSets) Create(daemon *expapi.DaemonSet) (result *expapi.DaemonSet, err error) {
|
||||
result = &expapi.DaemonSet{}
|
||||
func (c *daemonSets) Create(daemon *experimental.DaemonSet) (result *experimental.DaemonSet, err error) {
|
||||
result = &experimental.DaemonSet{}
|
||||
err = c.r.Post().Namespace(c.ns).Resource("daemonsets").Body(daemon).Do().Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update updates an existing daemon set.
|
||||
func (c *daemonSets) Update(daemon *expapi.DaemonSet) (result *expapi.DaemonSet, err error) {
|
||||
result = &expapi.DaemonSet{}
|
||||
func (c *daemonSets) Update(daemon *experimental.DaemonSet) (result *experimental.DaemonSet, err error) {
|
||||
result = &experimental.DaemonSet{}
|
||||
err = c.r.Put().Namespace(c.ns).Resource("daemonsets").Name(daemon.Name).Body(daemon).Do().Into(result)
|
||||
return
|
||||
}
|
||||
|
@@ -21,7 +21,7 @@ import (
|
||||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/testapi"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
)
|
||||
|
||||
@@ -37,8 +37,8 @@ func TestListDaemonSets(t *testing.T) {
|
||||
Path: testapi.Experimental.ResourcePath(getDSResourceName(), ns, ""),
|
||||
},
|
||||
Response: Response{StatusCode: 200,
|
||||
Body: &expapi.DaemonSetList{
|
||||
Items: []expapi.DaemonSet{
|
||||
Body: &experimental.DaemonSetList{
|
||||
Items: []experimental.DaemonSet{
|
||||
{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "foo",
|
||||
@@ -47,7 +47,7 @@ func TestListDaemonSets(t *testing.T) {
|
||||
"name": "baz",
|
||||
},
|
||||
},
|
||||
Spec: expapi.DaemonSetSpec{
|
||||
Spec: experimental.DaemonSetSpec{
|
||||
Template: &api.PodTemplateSpec{},
|
||||
},
|
||||
},
|
||||
@@ -66,7 +66,7 @@ func TestGetDaemonSet(t *testing.T) {
|
||||
Request: testRequest{Method: "GET", Path: testapi.Experimental.ResourcePath(getDSResourceName(), ns, "foo"), Query: buildQueryValues(nil)},
|
||||
Response: Response{
|
||||
StatusCode: 200,
|
||||
Body: &expapi.DaemonSet{
|
||||
Body: &experimental.DaemonSet{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "foo",
|
||||
Labels: map[string]string{
|
||||
@@ -74,7 +74,7 @@ func TestGetDaemonSet(t *testing.T) {
|
||||
"name": "baz",
|
||||
},
|
||||
},
|
||||
Spec: expapi.DaemonSetSpec{
|
||||
Spec: experimental.DaemonSetSpec{
|
||||
Template: &api.PodTemplateSpec{},
|
||||
},
|
||||
},
|
||||
@@ -97,14 +97,14 @@ func TestGetDaemonSetWithNoName(t *testing.T) {
|
||||
|
||||
func TestUpdateDaemonSet(t *testing.T) {
|
||||
ns := api.NamespaceDefault
|
||||
requestDaemonSet := &expapi.DaemonSet{
|
||||
requestDaemonSet := &experimental.DaemonSet{
|
||||
ObjectMeta: api.ObjectMeta{Name: "foo", ResourceVersion: "1"},
|
||||
}
|
||||
c := &testClient{
|
||||
Request: testRequest{Method: "PUT", Path: testapi.Experimental.ResourcePath(getDSResourceName(), ns, "foo"), Query: buildQueryValues(nil)},
|
||||
Response: Response{
|
||||
StatusCode: 200,
|
||||
Body: &expapi.DaemonSet{
|
||||
Body: &experimental.DaemonSet{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "foo",
|
||||
Labels: map[string]string{
|
||||
@@ -112,7 +112,7 @@ func TestUpdateDaemonSet(t *testing.T) {
|
||||
"name": "baz",
|
||||
},
|
||||
},
|
||||
Spec: expapi.DaemonSetSpec{
|
||||
Spec: experimental.DaemonSetSpec{
|
||||
Template: &api.PodTemplateSpec{},
|
||||
},
|
||||
},
|
||||
@@ -134,14 +134,14 @@ func TestDeleteDaemon(t *testing.T) {
|
||||
|
||||
func TestCreateDaemonSet(t *testing.T) {
|
||||
ns := api.NamespaceDefault
|
||||
requestDaemonSet := &expapi.DaemonSet{
|
||||
requestDaemonSet := &experimental.DaemonSet{
|
||||
ObjectMeta: api.ObjectMeta{Name: "foo"},
|
||||
}
|
||||
c := &testClient{
|
||||
Request: testRequest{Method: "POST", Path: testapi.Experimental.ResourcePath(getDSResourceName(), ns, ""), Body: requestDaemonSet, Query: buildQueryValues(nil)},
|
||||
Response: Response{
|
||||
StatusCode: 200,
|
||||
Body: &expapi.DaemonSet{
|
||||
Body: &experimental.DaemonSet{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "foo",
|
||||
Labels: map[string]string{
|
||||
@@ -149,7 +149,7 @@ func TestCreateDaemonSet(t *testing.T) {
|
||||
"name": "baz",
|
||||
},
|
||||
},
|
||||
Spec: expapi.DaemonSetSpec{
|
||||
Spec: experimental.DaemonSetSpec{
|
||||
Template: &api.PodTemplateSpec{},
|
||||
},
|
||||
},
|
||||
|
@@ -18,7 +18,7 @@ package unversioned
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/watch"
|
||||
@@ -31,11 +31,11 @@ type DeploymentsNamespacer interface {
|
||||
|
||||
// DeploymentInterface has methods to work with Deployment resources.
|
||||
type DeploymentInterface interface {
|
||||
List(label labels.Selector, field fields.Selector) (*expapi.DeploymentList, error)
|
||||
Get(name string) (*expapi.Deployment, error)
|
||||
List(label labels.Selector, field fields.Selector) (*experimental.DeploymentList, error)
|
||||
Get(name string) (*experimental.Deployment, error)
|
||||
Delete(name string, options *api.DeleteOptions) error
|
||||
Create(Deployment *expapi.Deployment) (*expapi.Deployment, error)
|
||||
Update(Deployment *expapi.Deployment) (*expapi.Deployment, error)
|
||||
Create(Deployment *experimental.Deployment) (*experimental.Deployment, error)
|
||||
Update(Deployment *experimental.Deployment) (*experimental.Deployment, error)
|
||||
Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)
|
||||
}
|
||||
|
||||
@@ -54,15 +54,15 @@ func newDeployments(c *ExperimentalClient, namespace string) *deployments {
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Deployments that match those selectors.
|
||||
func (c *deployments) List(label labels.Selector, field fields.Selector) (result *expapi.DeploymentList, err error) {
|
||||
result = &expapi.DeploymentList{}
|
||||
func (c *deployments) List(label labels.Selector, field fields.Selector) (result *experimental.DeploymentList, err error) {
|
||||
result = &experimental.DeploymentList{}
|
||||
err = c.client.Get().Namespace(c.ns).Resource("deployments").LabelsSelectorParam(label).FieldsSelectorParam(field).Do().Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Get takes name of the deployment, and returns the corresponding deployment object, and an error if there is any.
|
||||
func (c *deployments) Get(name string) (result *expapi.Deployment, err error) {
|
||||
result = &expapi.Deployment{}
|
||||
func (c *deployments) Get(name string) (result *experimental.Deployment, err error) {
|
||||
result = &experimental.Deployment{}
|
||||
err = c.client.Get().Namespace(c.ns).Resource("deployments").Name(name).Do().Into(result)
|
||||
return
|
||||
}
|
||||
@@ -80,15 +80,15 @@ func (c *deployments) Delete(name string, options *api.DeleteOptions) error {
|
||||
}
|
||||
|
||||
// Create takes the representation of a deployment and creates it. Returns the server's representation of the deployment, and an error, if there is any.
|
||||
func (c *deployments) Create(deployment *expapi.Deployment) (result *expapi.Deployment, err error) {
|
||||
result = &expapi.Deployment{}
|
||||
func (c *deployments) Create(deployment *experimental.Deployment) (result *experimental.Deployment, err error) {
|
||||
result = &experimental.Deployment{}
|
||||
err = c.client.Post().Namespace(c.ns).Resource("deployments").Body(deployment).Do().Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a deployment and updates it. Returns the server's representation of the deployment, and an error, if there is any.
|
||||
func (c *deployments) Update(deployment *expapi.Deployment) (result *expapi.Deployment, err error) {
|
||||
result = &expapi.Deployment{}
|
||||
func (c *deployments) Update(deployment *experimental.Deployment) (result *experimental.Deployment, err error) {
|
||||
result = &experimental.Deployment{}
|
||||
err = c.client.Put().Namespace(c.ns).Resource("deployments").Name(deployment.Name).Body(deployment).Do().Into(result)
|
||||
return
|
||||
}
|
||||
|
@@ -22,7 +22,7 @@ import (
|
||||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/testapi"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
)
|
||||
@@ -33,7 +33,7 @@ func getDeploymentsResoureName() string {
|
||||
|
||||
func TestDeploymentCreate(t *testing.T) {
|
||||
ns := api.NamespaceDefault
|
||||
deployment := expapi.Deployment{
|
||||
deployment := experimental.Deployment{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "abc",
|
||||
Namespace: ns,
|
||||
@@ -58,7 +58,7 @@ func TestDeploymentCreate(t *testing.T) {
|
||||
|
||||
func TestDeploymentGet(t *testing.T) {
|
||||
ns := api.NamespaceDefault
|
||||
deployment := &expapi.Deployment{
|
||||
deployment := &experimental.Deployment{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "abc",
|
||||
Namespace: ns,
|
||||
@@ -80,8 +80,8 @@ func TestDeploymentGet(t *testing.T) {
|
||||
|
||||
func TestDeploymentList(t *testing.T) {
|
||||
ns := api.NamespaceDefault
|
||||
deploymentList := &expapi.DeploymentList{
|
||||
Items: []expapi.Deployment{
|
||||
deploymentList := &experimental.DeploymentList{
|
||||
Items: []experimental.Deployment{
|
||||
{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "foo",
|
||||
@@ -105,7 +105,7 @@ func TestDeploymentList(t *testing.T) {
|
||||
|
||||
func TestDeploymentUpdate(t *testing.T) {
|
||||
ns := api.NamespaceDefault
|
||||
deployment := &expapi.Deployment{
|
||||
deployment := &experimental.Deployment{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "abc",
|
||||
Namespace: ns,
|
||||
|
@@ -22,7 +22,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
explatest "k8s.io/kubernetes/pkg/expapi/latest"
|
||||
explatest "k8s.io/kubernetes/pkg/apis/experimental/latest"
|
||||
"k8s.io/kubernetes/pkg/version"
|
||||
)
|
||||
|
||||
|
@@ -18,7 +18,7 @@ package unversioned
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/watch"
|
||||
@@ -31,11 +31,11 @@ type HorizontalPodAutoscalersNamespacer interface {
|
||||
|
||||
// HorizontalPodAutoscalerInterface has methods to work with HorizontalPodAutoscaler resources.
|
||||
type HorizontalPodAutoscalerInterface interface {
|
||||
List(label labels.Selector, field fields.Selector) (*expapi.HorizontalPodAutoscalerList, error)
|
||||
Get(name string) (*expapi.HorizontalPodAutoscaler, error)
|
||||
List(label labels.Selector, field fields.Selector) (*experimental.HorizontalPodAutoscalerList, error)
|
||||
Get(name string) (*experimental.HorizontalPodAutoscaler, error)
|
||||
Delete(name string, options *api.DeleteOptions) error
|
||||
Create(horizontalPodAutoscaler *expapi.HorizontalPodAutoscaler) (*expapi.HorizontalPodAutoscaler, error)
|
||||
Update(horizontalPodAutoscaler *expapi.HorizontalPodAutoscaler) (*expapi.HorizontalPodAutoscaler, error)
|
||||
Create(horizontalPodAutoscaler *experimental.HorizontalPodAutoscaler) (*experimental.HorizontalPodAutoscaler, error)
|
||||
Update(horizontalPodAutoscaler *experimental.HorizontalPodAutoscaler) (*experimental.HorizontalPodAutoscaler, error)
|
||||
Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)
|
||||
}
|
||||
|
||||
@@ -54,15 +54,15 @@ func newHorizontalPodAutoscalers(c *ExperimentalClient, namespace string) *horiz
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of horizontalPodAutoscalers that match those selectors.
|
||||
func (c *horizontalPodAutoscalers) List(label labels.Selector, field fields.Selector) (result *expapi.HorizontalPodAutoscalerList, err error) {
|
||||
result = &expapi.HorizontalPodAutoscalerList{}
|
||||
func (c *horizontalPodAutoscalers) List(label labels.Selector, field fields.Selector) (result *experimental.HorizontalPodAutoscalerList, err error) {
|
||||
result = &experimental.HorizontalPodAutoscalerList{}
|
||||
err = c.client.Get().Namespace(c.ns).Resource("horizontalPodAutoscalers").LabelsSelectorParam(label).FieldsSelectorParam(field).Do().Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Get takes the name of the horizontalPodAutoscaler, and returns the corresponding HorizontalPodAutoscaler object, and an error if it occurs
|
||||
func (c *horizontalPodAutoscalers) Get(name string) (result *expapi.HorizontalPodAutoscaler, err error) {
|
||||
result = &expapi.HorizontalPodAutoscaler{}
|
||||
func (c *horizontalPodAutoscalers) Get(name string) (result *experimental.HorizontalPodAutoscaler, err error) {
|
||||
result = &experimental.HorizontalPodAutoscaler{}
|
||||
err = c.client.Get().Namespace(c.ns).Resource("horizontalPodAutoscalers").Name(name).Do().Into(result)
|
||||
return
|
||||
}
|
||||
@@ -81,15 +81,15 @@ func (c *horizontalPodAutoscalers) Delete(name string, options *api.DeleteOption
|
||||
}
|
||||
|
||||
// Create takes the representation of a horizontalPodAutoscaler and creates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if it occurs.
|
||||
func (c *horizontalPodAutoscalers) Create(horizontalPodAutoscaler *expapi.HorizontalPodAutoscaler) (result *expapi.HorizontalPodAutoscaler, err error) {
|
||||
result = &expapi.HorizontalPodAutoscaler{}
|
||||
func (c *horizontalPodAutoscalers) Create(horizontalPodAutoscaler *experimental.HorizontalPodAutoscaler) (result *experimental.HorizontalPodAutoscaler, err error) {
|
||||
result = &experimental.HorizontalPodAutoscaler{}
|
||||
err = c.client.Post().Namespace(c.ns).Resource("horizontalPodAutoscalers").Body(horizontalPodAutoscaler).Do().Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a horizontalPodAutoscaler and updates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if it occurs.
|
||||
func (c *horizontalPodAutoscalers) Update(horizontalPodAutoscaler *expapi.HorizontalPodAutoscaler) (result *expapi.HorizontalPodAutoscaler, err error) {
|
||||
result = &expapi.HorizontalPodAutoscaler{}
|
||||
func (c *horizontalPodAutoscalers) Update(horizontalPodAutoscaler *experimental.HorizontalPodAutoscaler) (result *experimental.HorizontalPodAutoscaler, err error) {
|
||||
result = &experimental.HorizontalPodAutoscaler{}
|
||||
err = c.client.Put().Namespace(c.ns).Resource("horizontalPodAutoscalers").Name(horizontalPodAutoscaler.Name).Body(horizontalPodAutoscaler).Do().Into(result)
|
||||
return
|
||||
}
|
||||
|
@@ -22,7 +22,7 @@ import (
|
||||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/testapi"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
)
|
||||
@@ -33,7 +33,7 @@ func getHorizontalPodAutoscalersResoureName() string {
|
||||
|
||||
func TestHorizontalPodAutoscalerCreate(t *testing.T) {
|
||||
ns := api.NamespaceDefault
|
||||
horizontalPodAutoscaler := expapi.HorizontalPodAutoscaler{
|
||||
horizontalPodAutoscaler := experimental.HorizontalPodAutoscaler{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "abc",
|
||||
Namespace: ns,
|
||||
@@ -58,7 +58,7 @@ func TestHorizontalPodAutoscalerCreate(t *testing.T) {
|
||||
|
||||
func TestHorizontalPodAutoscalerGet(t *testing.T) {
|
||||
ns := api.NamespaceDefault
|
||||
horizontalPodAutoscaler := &expapi.HorizontalPodAutoscaler{
|
||||
horizontalPodAutoscaler := &experimental.HorizontalPodAutoscaler{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "abc",
|
||||
Namespace: ns,
|
||||
@@ -80,8 +80,8 @@ func TestHorizontalPodAutoscalerGet(t *testing.T) {
|
||||
|
||||
func TestHorizontalPodAutoscalerList(t *testing.T) {
|
||||
ns := api.NamespaceDefault
|
||||
horizontalPodAutoscalerList := &expapi.HorizontalPodAutoscalerList{
|
||||
Items: []expapi.HorizontalPodAutoscaler{
|
||||
horizontalPodAutoscalerList := &experimental.HorizontalPodAutoscalerList{
|
||||
Items: []experimental.HorizontalPodAutoscaler{
|
||||
{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "foo",
|
||||
@@ -105,7 +105,7 @@ func TestHorizontalPodAutoscalerList(t *testing.T) {
|
||||
|
||||
func TestHorizontalPodAutoscalerUpdate(t *testing.T) {
|
||||
ns := api.NamespaceDefault
|
||||
horizontalPodAutoscaler := &expapi.HorizontalPodAutoscaler{
|
||||
horizontalPodAutoscaler := &experimental.HorizontalPodAutoscaler{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "abc",
|
||||
Namespace: ns,
|
||||
|
@@ -18,7 +18,7 @@ package unversioned
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/api/meta"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
)
|
||||
|
||||
type ScaleNamespacer interface {
|
||||
@@ -27,8 +27,8 @@ type ScaleNamespacer interface {
|
||||
|
||||
// ScaleInterface has methods to work with Scale (sub)resources.
|
||||
type ScaleInterface interface {
|
||||
Get(string, string) (*expapi.Scale, error)
|
||||
Update(string, *expapi.Scale) (*expapi.Scale, error)
|
||||
Get(string, string) (*experimental.Scale, error)
|
||||
Update(string, *experimental.Scale) (*experimental.Scale, error)
|
||||
}
|
||||
|
||||
// horizontalPodAutoscalers implements HorizontalPodAutoscalersNamespacer interface
|
||||
@@ -46,15 +46,15 @@ func newScales(c *ExperimentalClient, namespace string) *scales {
|
||||
}
|
||||
|
||||
// Get takes the reference to scale subresource and returns the subresource or error, if one occurs.
|
||||
func (c *scales) Get(kind string, name string) (result *expapi.Scale, err error) {
|
||||
result = &expapi.Scale{}
|
||||
func (c *scales) Get(kind string, name string) (result *experimental.Scale, err error) {
|
||||
result = &experimental.Scale{}
|
||||
resource, _ := meta.KindToResource(kind, false)
|
||||
err = c.client.Get().Namespace(c.ns).Resource(resource).Name(name).SubResource("scale").Do().Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
func (c *scales) Update(kind string, scale *expapi.Scale) (result *expapi.Scale, err error) {
|
||||
result = &expapi.Scale{}
|
||||
func (c *scales) Update(kind string, scale *experimental.Scale) (result *experimental.Scale, err error) {
|
||||
result = &experimental.Scale{}
|
||||
resource, _ := meta.KindToResource(kind, false)
|
||||
err = c.client.Put().
|
||||
Namespace(scale.Namespace).
|
||||
|
@@ -17,8 +17,8 @@ limitations under the License.
|
||||
package testclient
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
kClientLib "k8s.io/kubernetes/pkg/client/unversioned"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/watch"
|
||||
@@ -34,40 +34,40 @@ type FakeDaemonSets struct {
|
||||
// Ensure statically that FakeDaemonSets implements DaemonInterface.
|
||||
var _ kClientLib.DaemonSetInterface = &FakeDaemonSets{}
|
||||
|
||||
func (c *FakeDaemonSets) Get(name string) (*expapi.DaemonSet, error) {
|
||||
obj, err := c.Fake.Invokes(NewGetAction("daemonsets", c.Namespace, name), &expapi.DaemonSet{})
|
||||
func (c *FakeDaemonSets) Get(name string) (*experimental.DaemonSet, error) {
|
||||
obj, err := c.Fake.Invokes(NewGetAction("daemonsets", c.Namespace, name), &experimental.DaemonSet{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*expapi.DaemonSet), err
|
||||
return obj.(*experimental.DaemonSet), err
|
||||
}
|
||||
|
||||
func (c *FakeDaemonSets) List(label labels.Selector) (*expapi.DaemonSetList, error) {
|
||||
obj, err := c.Fake.Invokes(NewListAction("daemonsets", c.Namespace, label, nil), &expapi.DaemonSetList{})
|
||||
func (c *FakeDaemonSets) List(label labels.Selector) (*experimental.DaemonSetList, error) {
|
||||
obj, err := c.Fake.Invokes(NewListAction("daemonsets", c.Namespace, label, nil), &experimental.DaemonSetList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*expapi.DaemonSetList), err
|
||||
return obj.(*experimental.DaemonSetList), err
|
||||
}
|
||||
|
||||
func (c *FakeDaemonSets) Create(daemon *expapi.DaemonSet) (*expapi.DaemonSet, error) {
|
||||
obj, err := c.Fake.Invokes(NewCreateAction("daemonsets", c.Namespace, daemon), &expapi.DaemonSet{})
|
||||
func (c *FakeDaemonSets) Create(daemon *experimental.DaemonSet) (*experimental.DaemonSet, error) {
|
||||
obj, err := c.Fake.Invokes(NewCreateAction("daemonsets", c.Namespace, daemon), &experimental.DaemonSet{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*expapi.DaemonSet), err
|
||||
return obj.(*experimental.DaemonSet), err
|
||||
}
|
||||
|
||||
func (c *FakeDaemonSets) Update(daemon *expapi.DaemonSet) (*expapi.DaemonSet, error) {
|
||||
obj, err := c.Fake.Invokes(NewUpdateAction("daemonsets", c.Namespace, daemon), &expapi.DaemonSet{})
|
||||
func (c *FakeDaemonSets) Update(daemon *experimental.DaemonSet) (*experimental.DaemonSet, error) {
|
||||
obj, err := c.Fake.Invokes(NewUpdateAction("daemonsets", c.Namespace, daemon), &experimental.DaemonSet{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*expapi.DaemonSet), err
|
||||
return obj.(*experimental.DaemonSet), err
|
||||
}
|
||||
|
||||
func (c *FakeDaemonSets) Delete(name string) error {
|
||||
_, err := c.Fake.Invokes(NewDeleteAction("daemonsets", c.Namespace, name), &expapi.DaemonSet{})
|
||||
_, err := c.Fake.Invokes(NewDeleteAction("daemonsets", c.Namespace, name), &experimental.DaemonSet{})
|
||||
return err
|
||||
}
|
||||
|
||||
|
@@ -18,7 +18,7 @@ package testclient
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/watch"
|
||||
@@ -31,22 +31,22 @@ type FakeDeployments struct {
|
||||
Namespace string
|
||||
}
|
||||
|
||||
func (c *FakeDeployments) Get(name string) (*expapi.Deployment, error) {
|
||||
obj, err := c.Fake.Invokes(NewGetAction("deployments", c.Namespace, name), &expapi.Deployment{})
|
||||
func (c *FakeDeployments) Get(name string) (*experimental.Deployment, error) {
|
||||
obj, err := c.Fake.Invokes(NewGetAction("deployments", c.Namespace, name), &experimental.Deployment{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*expapi.Deployment), err
|
||||
return obj.(*experimental.Deployment), err
|
||||
}
|
||||
|
||||
func (c *FakeDeployments) List(label labels.Selector, field fields.Selector) (*expapi.DeploymentList, error) {
|
||||
obj, err := c.Fake.Invokes(NewListAction("deployments", c.Namespace, label, field), &expapi.DeploymentList{})
|
||||
func (c *FakeDeployments) List(label labels.Selector, field fields.Selector) (*experimental.DeploymentList, error) {
|
||||
obj, err := c.Fake.Invokes(NewListAction("deployments", c.Namespace, label, field), &experimental.DeploymentList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
list := &expapi.DeploymentList{}
|
||||
for _, deployment := range obj.(*expapi.DeploymentList).Items {
|
||||
list := &experimental.DeploymentList{}
|
||||
for _, deployment := range obj.(*experimental.DeploymentList).Items {
|
||||
if label.Matches(labels.Set(deployment.Labels)) {
|
||||
list.Items = append(list.Items, deployment)
|
||||
}
|
||||
@@ -54,26 +54,26 @@ func (c *FakeDeployments) List(label labels.Selector, field fields.Selector) (*e
|
||||
return list, err
|
||||
}
|
||||
|
||||
func (c *FakeDeployments) Create(deployment *expapi.Deployment) (*expapi.Deployment, error) {
|
||||
func (c *FakeDeployments) Create(deployment *experimental.Deployment) (*experimental.Deployment, error) {
|
||||
obj, err := c.Fake.Invokes(NewCreateAction("deployments", c.Namespace, deployment), deployment)
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*expapi.Deployment), err
|
||||
return obj.(*experimental.Deployment), err
|
||||
}
|
||||
|
||||
func (c *FakeDeployments) Update(deployment *expapi.Deployment) (*expapi.Deployment, error) {
|
||||
func (c *FakeDeployments) Update(deployment *experimental.Deployment) (*experimental.Deployment, error) {
|
||||
obj, err := c.Fake.Invokes(NewUpdateAction("deployments", c.Namespace, deployment), deployment)
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*expapi.Deployment), err
|
||||
return obj.(*experimental.Deployment), err
|
||||
}
|
||||
|
||||
func (c *FakeDeployments) Delete(name string, options *api.DeleteOptions) error {
|
||||
_, err := c.Fake.Invokes(NewDeleteAction("deployments", c.Namespace, name), &expapi.Deployment{})
|
||||
_, err := c.Fake.Invokes(NewDeleteAction("deployments", c.Namespace, name), &experimental.Deployment{})
|
||||
return err
|
||||
}
|
||||
|
||||
|
@@ -18,7 +18,7 @@ package testclient
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/watch"
|
||||
@@ -31,22 +31,22 @@ type FakeHorizontalPodAutoscalers struct {
|
||||
Namespace string
|
||||
}
|
||||
|
||||
func (c *FakeHorizontalPodAutoscalers) Get(name string) (*expapi.HorizontalPodAutoscaler, error) {
|
||||
obj, err := c.Fake.Invokes(NewGetAction("horizontalpodautoscalers", c.Namespace, name), &expapi.HorizontalPodAutoscaler{})
|
||||
func (c *FakeHorizontalPodAutoscalers) Get(name string) (*experimental.HorizontalPodAutoscaler, error) {
|
||||
obj, err := c.Fake.Invokes(NewGetAction("horizontalpodautoscalers", c.Namespace, name), &experimental.HorizontalPodAutoscaler{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*expapi.HorizontalPodAutoscaler), err
|
||||
return obj.(*experimental.HorizontalPodAutoscaler), err
|
||||
}
|
||||
|
||||
func (c *FakeHorizontalPodAutoscalers) List(label labels.Selector, field fields.Selector) (*expapi.HorizontalPodAutoscalerList, error) {
|
||||
obj, err := c.Fake.Invokes(NewListAction("horizontalpodautoscalers", c.Namespace, label, field), &expapi.HorizontalPodAutoscalerList{})
|
||||
func (c *FakeHorizontalPodAutoscalers) List(label labels.Selector, field fields.Selector) (*experimental.HorizontalPodAutoscalerList, error) {
|
||||
obj, err := c.Fake.Invokes(NewListAction("horizontalpodautoscalers", c.Namespace, label, field), &experimental.HorizontalPodAutoscalerList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
list := &expapi.HorizontalPodAutoscalerList{}
|
||||
for _, a := range obj.(*expapi.HorizontalPodAutoscalerList).Items {
|
||||
list := &experimental.HorizontalPodAutoscalerList{}
|
||||
for _, a := range obj.(*experimental.HorizontalPodAutoscalerList).Items {
|
||||
if label.Matches(labels.Set(a.Labels)) {
|
||||
list.Items = append(list.Items, a)
|
||||
}
|
||||
@@ -54,26 +54,26 @@ func (c *FakeHorizontalPodAutoscalers) List(label labels.Selector, field fields.
|
||||
return list, err
|
||||
}
|
||||
|
||||
func (c *FakeHorizontalPodAutoscalers) Create(a *expapi.HorizontalPodAutoscaler) (*expapi.HorizontalPodAutoscaler, error) {
|
||||
func (c *FakeHorizontalPodAutoscalers) Create(a *experimental.HorizontalPodAutoscaler) (*experimental.HorizontalPodAutoscaler, error) {
|
||||
obj, err := c.Fake.Invokes(NewCreateAction("horizontalpodautoscalers", c.Namespace, a), a)
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*expapi.HorizontalPodAutoscaler), err
|
||||
return obj.(*experimental.HorizontalPodAutoscaler), err
|
||||
}
|
||||
|
||||
func (c *FakeHorizontalPodAutoscalers) Update(a *expapi.HorizontalPodAutoscaler) (*expapi.HorizontalPodAutoscaler, error) {
|
||||
func (c *FakeHorizontalPodAutoscalers) Update(a *experimental.HorizontalPodAutoscaler) (*experimental.HorizontalPodAutoscaler, error) {
|
||||
obj, err := c.Fake.Invokes(NewUpdateAction("horizontalpodautoscalers", c.Namespace, a), a)
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*expapi.HorizontalPodAutoscaler), err
|
||||
return obj.(*experimental.HorizontalPodAutoscaler), err
|
||||
}
|
||||
|
||||
func (c *FakeHorizontalPodAutoscalers) Delete(name string, options *api.DeleteOptions) error {
|
||||
_, err := c.Fake.Invokes(NewDeleteAction("horizontalpodautoscalers", c.Namespace, name), &expapi.HorizontalPodAutoscaler{})
|
||||
_, err := c.Fake.Invokes(NewDeleteAction("horizontalpodautoscalers", c.Namespace, name), &experimental.HorizontalPodAutoscaler{})
|
||||
return err
|
||||
}
|
||||
|
||||
|
@@ -17,7 +17,7 @@ limitations under the License.
|
||||
package testclient
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
)
|
||||
|
||||
// FakeScales implements ScaleInterface. Meant to be embedded into a struct to get a default
|
||||
@@ -27,19 +27,19 @@ type FakeScales struct {
|
||||
Namespace string
|
||||
}
|
||||
|
||||
func (c *FakeScales) Get(kind string, name string) (result *expapi.Scale, err error) {
|
||||
func (c *FakeScales) Get(kind string, name string) (result *experimental.Scale, err error) {
|
||||
action := GetActionImpl{}
|
||||
action.Verb = "get"
|
||||
action.Namespace = c.Namespace
|
||||
action.Resource = kind
|
||||
action.Subresource = "scale"
|
||||
action.Name = name
|
||||
obj, err := c.Fake.Invokes(action, &expapi.Scale{})
|
||||
result = obj.(*expapi.Scale)
|
||||
obj, err := c.Fake.Invokes(action, &experimental.Scale{})
|
||||
result = obj.(*experimental.Scale)
|
||||
return
|
||||
}
|
||||
|
||||
func (c *FakeScales) Update(kind string, scale *expapi.Scale) (result *expapi.Scale, err error) {
|
||||
func (c *FakeScales) Update(kind string, scale *experimental.Scale) (result *experimental.Scale, err error) {
|
||||
action := UpdateActionImpl{}
|
||||
action.Verb = "update"
|
||||
action.Namespace = c.Namespace
|
||||
@@ -47,6 +47,6 @@ func (c *FakeScales) Update(kind string, scale *expapi.Scale) (result *expapi.Sc
|
||||
action.Subresource = "scale"
|
||||
action.Object = scale
|
||||
obj, err := c.Fake.Invokes(action, scale)
|
||||
result = obj.(*expapi.Scale)
|
||||
result = obj.(*experimental.Scale)
|
||||
return
|
||||
}
|
||||
|
@@ -23,9 +23,9 @@ import (
|
||||
|
||||
"github.com/golang/glog"
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
client "k8s.io/kubernetes/pkg/client/unversioned"
|
||||
"k8s.io/kubernetes/pkg/controller/podautoscaler/metrics"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/util"
|
||||
@@ -134,7 +134,7 @@ func (a *HorizontalController) reconcileAutoscalers() error {
|
||||
desiredReplicas = currentReplicas
|
||||
}
|
||||
|
||||
status := expapi.HorizontalPodAutoscalerStatus{
|
||||
status := experimental.HorizontalPodAutoscalerStatus{
|
||||
CurrentReplicas: currentReplicas,
|
||||
DesiredReplicas: desiredReplicas,
|
||||
CurrentConsumption: currentConsumption,
|
||||
|
@@ -26,9 +26,9 @@ import (
|
||||
_ "k8s.io/kubernetes/pkg/api/latest"
|
||||
"k8s.io/kubernetes/pkg/api/resource"
|
||||
"k8s.io/kubernetes/pkg/api/testapi"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
client "k8s.io/kubernetes/pkg/client/unversioned"
|
||||
"k8s.io/kubernetes/pkg/controller/podautoscaler/metrics"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/util"
|
||||
|
||||
@@ -57,14 +57,14 @@ type fakeMetricsClient struct {
|
||||
}
|
||||
|
||||
type fakeResourceConsumptionClient struct {
|
||||
metrics map[api.ResourceName]expapi.ResourceConsumption
|
||||
metrics map[api.ResourceName]experimental.ResourceConsumption
|
||||
}
|
||||
|
||||
func (f *fakeMetricsClient) ResourceConsumption(namespace string) metrics.ResourceConsumptionClient {
|
||||
return f.consumption
|
||||
}
|
||||
|
||||
func (f *fakeResourceConsumptionClient) Get(resource api.ResourceName, selector map[string]string) (*expapi.ResourceConsumption, error) {
|
||||
func (f *fakeResourceConsumptionClient) Get(resource api.ResourceName, selector map[string]string) (*experimental.ResourceConsumption, error) {
|
||||
consumption, found := f.metrics[resource]
|
||||
if !found {
|
||||
return nil, fmt.Errorf("resource not found: %v", resource)
|
||||
@@ -110,15 +110,15 @@ func makeTestServer(t *testing.T, responses map[string]*serverResponse) (*httpte
|
||||
|
||||
func TestSyncEndpointsItemsPreserveNoSelector(t *testing.T) {
|
||||
|
||||
hpaResponse := serverResponse{http.StatusOK, &expapi.HorizontalPodAutoscalerList{
|
||||
Items: []expapi.HorizontalPodAutoscaler{
|
||||
hpaResponse := serverResponse{http.StatusOK, &experimental.HorizontalPodAutoscalerList{
|
||||
Items: []experimental.HorizontalPodAutoscaler{
|
||||
{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: hpaName,
|
||||
Namespace: namespace,
|
||||
},
|
||||
Spec: expapi.HorizontalPodAutoscalerSpec{
|
||||
ScaleRef: &expapi.SubresourceReference{
|
||||
Spec: experimental.HorizontalPodAutoscalerSpec{
|
||||
ScaleRef: &experimental.SubresourceReference{
|
||||
Kind: "replicationController",
|
||||
Name: rcName,
|
||||
Namespace: namespace,
|
||||
@@ -126,36 +126,36 @@ func TestSyncEndpointsItemsPreserveNoSelector(t *testing.T) {
|
||||
},
|
||||
MinCount: 1,
|
||||
MaxCount: 5,
|
||||
Target: expapi.ResourceConsumption{Resource: api.ResourceCPU, Quantity: resource.MustParse("0.3")},
|
||||
Target: experimental.ResourceConsumption{Resource: api.ResourceCPU, Quantity: resource.MustParse("0.3")},
|
||||
},
|
||||
}}}}
|
||||
|
||||
scaleResponse := serverResponse{http.StatusOK, &expapi.Scale{
|
||||
scaleResponse := serverResponse{http.StatusOK, &experimental.Scale{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: rcName,
|
||||
Namespace: namespace,
|
||||
},
|
||||
Spec: expapi.ScaleSpec{
|
||||
Spec: experimental.ScaleSpec{
|
||||
Replicas: 1,
|
||||
},
|
||||
Status: expapi.ScaleStatus{
|
||||
Status: experimental.ScaleStatus{
|
||||
Replicas: 1,
|
||||
Selector: map[string]string{"name": podNameLabel},
|
||||
},
|
||||
}}
|
||||
|
||||
status := expapi.HorizontalPodAutoscalerStatus{
|
||||
status := experimental.HorizontalPodAutoscalerStatus{
|
||||
CurrentReplicas: 1,
|
||||
DesiredReplicas: 3,
|
||||
}
|
||||
updateHpaResponse := serverResponse{http.StatusOK, &expapi.HorizontalPodAutoscaler{
|
||||
updateHpaResponse := serverResponse{http.StatusOK, &experimental.HorizontalPodAutoscaler{
|
||||
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: hpaName,
|
||||
Namespace: namespace,
|
||||
},
|
||||
Spec: expapi.HorizontalPodAutoscalerSpec{
|
||||
ScaleRef: &expapi.SubresourceReference{
|
||||
Spec: experimental.HorizontalPodAutoscalerSpec{
|
||||
ScaleRef: &experimental.SubresourceReference{
|
||||
Kind: "replicationController",
|
||||
Name: rcName,
|
||||
Namespace: namespace,
|
||||
@@ -163,7 +163,7 @@ func TestSyncEndpointsItemsPreserveNoSelector(t *testing.T) {
|
||||
},
|
||||
MinCount: 1,
|
||||
MaxCount: 5,
|
||||
Target: expapi.ResourceConsumption{Resource: api.ResourceCPU, Quantity: resource.MustParse("0.3")},
|
||||
Target: experimental.ResourceConsumption{Resource: api.ResourceCPU, Quantity: resource.MustParse("0.3")},
|
||||
},
|
||||
Status: &status,
|
||||
}}
|
||||
@@ -177,7 +177,7 @@ func TestSyncEndpointsItemsPreserveNoSelector(t *testing.T) {
|
||||
|
||||
defer testServer.Close()
|
||||
kubeClient := client.NewOrDie(&client.Config{Host: testServer.URL, Version: testapi.Experimental.Version()})
|
||||
fakeRC := fakeResourceConsumptionClient{metrics: map[api.ResourceName]expapi.ResourceConsumption{
|
||||
fakeRC := fakeResourceConsumptionClient{metrics: map[api.ResourceName]experimental.ResourceConsumption{
|
||||
api.ResourceCPU: {Resource: api.ResourceCPU, Quantity: resource.MustParse("650m")},
|
||||
}}
|
||||
fake := fakeMetricsClient{consumption: &fakeRC}
|
||||
@@ -195,7 +195,7 @@ func TestSyncEndpointsItemsPreserveNoSelector(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal("Failed to decode: %v %v", err)
|
||||
}
|
||||
hpa, _ := obj.(*expapi.HorizontalPodAutoscaler)
|
||||
hpa, _ := obj.(*experimental.HorizontalPodAutoscaler)
|
||||
|
||||
assert.Equal(t, 3, hpa.Status.DesiredReplicas)
|
||||
assert.Equal(t, int64(650), hpa.Status.CurrentConsumption.Quantity.MilliValue())
|
||||
|
@@ -25,8 +25,8 @@ import (
|
||||
"github.com/golang/glog"
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/resource"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
client "k8s.io/kubernetes/pkg/client/unversioned"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
|
||||
@@ -47,12 +47,12 @@ type MetricsClient interface {
|
||||
|
||||
type ResourceConsumptionClient interface {
|
||||
// Gets average resource consumption for pods under the given selector.
|
||||
Get(resourceName api.ResourceName, selector map[string]string) (*expapi.ResourceConsumption, error)
|
||||
Get(resourceName api.ResourceName, selector map[string]string) (*experimental.ResourceConsumption, error)
|
||||
}
|
||||
|
||||
// Aggregates results into ResourceConsumption. Also returns number of
|
||||
// pods included in the aggregation.
|
||||
type metricAggregator func(heapster.MetricResultList) (expapi.ResourceConsumption, int)
|
||||
type metricAggregator func(heapster.MetricResultList) (experimental.ResourceConsumption, int)
|
||||
|
||||
type metricDefinition struct {
|
||||
name string
|
||||
@@ -76,23 +76,23 @@ func NewHeapsterMetricsClient(client client.Interface) *HeapsterMetricsClient {
|
||||
|
||||
var heapsterMetricDefinitions = map[api.ResourceName]metricDefinition{
|
||||
api.ResourceCPU: {"cpu-usage",
|
||||
func(metrics heapster.MetricResultList) (expapi.ResourceConsumption, int) {
|
||||
func(metrics heapster.MetricResultList) (experimental.ResourceConsumption, int) {
|
||||
sum, count := calculateSumFromLatestSample(metrics)
|
||||
value := "0"
|
||||
if count > 0 {
|
||||
// assumes that cpu usage is in millis
|
||||
value = fmt.Sprintf("%dm", sum/uint64(count))
|
||||
}
|
||||
return expapi.ResourceConsumption{Resource: api.ResourceCPU, Quantity: resource.MustParse(value)}, count
|
||||
return experimental.ResourceConsumption{Resource: api.ResourceCPU, Quantity: resource.MustParse(value)}, count
|
||||
}},
|
||||
api.ResourceMemory: {"memory-usage",
|
||||
func(metrics heapster.MetricResultList) (expapi.ResourceConsumption, int) {
|
||||
func(metrics heapster.MetricResultList) (experimental.ResourceConsumption, int) {
|
||||
sum, count := calculateSumFromLatestSample(metrics)
|
||||
value := int64(0)
|
||||
if count > 0 {
|
||||
value = int64(sum) / int64(count)
|
||||
}
|
||||
return expapi.ResourceConsumption{Resource: api.ResourceMemory, Quantity: *resource.NewQuantity(value, resource.DecimalSI)}, count
|
||||
return experimental.ResourceConsumption{Resource: api.ResourceMemory, Quantity: *resource.NewQuantity(value, resource.DecimalSI)}, count
|
||||
}},
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ func (h *HeapsterMetricsClient) ResourceConsumption(namespace string) ResourceCo
|
||||
}
|
||||
}
|
||||
|
||||
func (h *HeapsterResourceConsumptionClient) Get(resourceName api.ResourceName, selector map[string]string) (*expapi.ResourceConsumption, error) {
|
||||
func (h *HeapsterResourceConsumptionClient) Get(resourceName api.ResourceName, selector map[string]string) (*experimental.ResourceConsumption, error) {
|
||||
podList, err := h.client.Pods(h.namespace).
|
||||
List(labels.SelectorFromSet(labels.Set(selector)), fields.Everything())
|
||||
|
||||
@@ -118,7 +118,7 @@ func (h *HeapsterResourceConsumptionClient) Get(resourceName api.ResourceName, s
|
||||
return h.getForPods(resourceName, podNames)
|
||||
}
|
||||
|
||||
func (h *HeapsterResourceConsumptionClient) getForPods(resourceName api.ResourceName, podNames []string) (*expapi.ResourceConsumption, error) {
|
||||
func (h *HeapsterResourceConsumptionClient) getForPods(resourceName api.ResourceName, podNames []string) (*experimental.ResourceConsumption, error) {
|
||||
metricSpec, metricDefined := h.resourceDefinitions[resourceName]
|
||||
if !metricDefined {
|
||||
return nil, fmt.Errorf("heapster metric not defined for %v", resourceName)
|
||||
|
@@ -36,8 +36,8 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/meta"
|
||||
"k8s.io/kubernetes/pkg/api/v1"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
"k8s.io/kubernetes/pkg/conversion"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/util"
|
||||
@@ -1136,7 +1136,7 @@ func printComponentStatusList(list *api.ComponentStatusList, w io.Writer, withNa
|
||||
return nil
|
||||
}
|
||||
|
||||
func printThirdPartyResource(rsrc *expapi.ThirdPartyResource, w io.Writer, withNamespace bool, wide bool, showAll bool, columnLabels []string) error {
|
||||
func printThirdPartyResource(rsrc *experimental.ThirdPartyResource, w io.Writer, withNamespace bool, wide bool, showAll bool, columnLabels []string) error {
|
||||
versions := make([]string, len(rsrc.Versions))
|
||||
for ix := range rsrc.Versions {
|
||||
version := &rsrc.Versions[ix]
|
||||
@@ -1149,7 +1149,7 @@ func printThirdPartyResource(rsrc *expapi.ThirdPartyResource, w io.Writer, withN
|
||||
return nil
|
||||
}
|
||||
|
||||
func printThirdPartyResourceList(list *expapi.ThirdPartyResourceList, w io.Writer, withNamespace bool, wide bool, showAll bool, columnLabels []string) error {
|
||||
func printThirdPartyResourceList(list *experimental.ThirdPartyResourceList, w io.Writer, withNamespace bool, wide bool, showAll bool, columnLabels []string) error {
|
||||
for _, item := range list.Items {
|
||||
if err := printThirdPartyResource(&item, w, withNamespace, wide, showAll, columnLabels); err != nil {
|
||||
return err
|
||||
@@ -1159,7 +1159,7 @@ func printThirdPartyResourceList(list *expapi.ThirdPartyResourceList, w io.Write
|
||||
return nil
|
||||
}
|
||||
|
||||
func printDeployment(deployment *expapi.Deployment, w io.Writer, withNamespace bool, wide bool, showAll bool, columnLabels []string) error {
|
||||
func printDeployment(deployment *experimental.Deployment, w io.Writer, withNamespace bool, wide bool, showAll bool, columnLabels []string) error {
|
||||
if withNamespace {
|
||||
if _, err := fmt.Fprintf(w, "%s\t", deployment.Namespace); err != nil {
|
||||
return err
|
||||
@@ -1175,7 +1175,7 @@ func printDeployment(deployment *expapi.Deployment, w io.Writer, withNamespace b
|
||||
return err
|
||||
}
|
||||
|
||||
func printDeploymentList(list *expapi.DeploymentList, w io.Writer, withNamespace bool, wide bool, showAll bool, columnLabels []string) error {
|
||||
func printDeploymentList(list *experimental.DeploymentList, w io.Writer, withNamespace bool, wide bool, showAll bool, columnLabels []string) error {
|
||||
for _, item := range list.Items {
|
||||
if err := printDeployment(&item, w, withNamespace, wide, showAll, columnLabels); err != nil {
|
||||
return err
|
||||
@@ -1184,7 +1184,7 @@ func printDeploymentList(list *expapi.DeploymentList, w io.Writer, withNamespace
|
||||
return nil
|
||||
}
|
||||
|
||||
func printHorizontalPodAutoscaler(hpa *expapi.HorizontalPodAutoscaler, w io.Writer, withNamespace bool, wide bool, showAll bool, columnLabels []string) error {
|
||||
func printHorizontalPodAutoscaler(hpa *experimental.HorizontalPodAutoscaler, w io.Writer, withNamespace bool, wide bool, showAll bool, columnLabels []string) error {
|
||||
namespace := hpa.Namespace
|
||||
name := hpa.Name
|
||||
reference := fmt.Sprintf("%s/%s/%s/%s",
|
||||
@@ -1221,7 +1221,7 @@ func printHorizontalPodAutoscaler(hpa *expapi.HorizontalPodAutoscaler, w io.Writ
|
||||
return err
|
||||
}
|
||||
|
||||
func printHorizontalPodAutoscalerList(list *expapi.HorizontalPodAutoscalerList, w io.Writer, withNamespace bool, wide bool, showAll bool, columnLabels []string) error {
|
||||
func printHorizontalPodAutoscalerList(list *experimental.HorizontalPodAutoscalerList, w io.Writer, withNamespace bool, wide bool, showAll bool, columnLabels []string) error {
|
||||
for i := range list.Items {
|
||||
if err := printHorizontalPodAutoscaler(&list.Items[i], w, withNamespace, wide, showAll, columnLabels); err != nil {
|
||||
return err
|
||||
|
@@ -29,7 +29,7 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/testapi"
|
||||
"k8s.io/kubernetes/pkg/api/v1"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/util"
|
||||
"k8s.io/kubernetes/pkg/util/sets"
|
||||
@@ -1235,22 +1235,22 @@ func TestTranslateTimestamp(t *testing.T) {
|
||||
|
||||
func TestPrintDeployment(t *testing.T) {
|
||||
tests := []struct {
|
||||
deployment expapi.Deployment
|
||||
deployment experimental.Deployment
|
||||
expect string
|
||||
}{
|
||||
{
|
||||
expapi.Deployment{
|
||||
experimental.Deployment{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "test1",
|
||||
CreationTimestamp: util.Time{Time: time.Now().Add(1.9e9)},
|
||||
},
|
||||
Spec: expapi.DeploymentSpec{
|
||||
Spec: experimental.DeploymentSpec{
|
||||
Replicas: 5,
|
||||
Template: &api.PodTemplateSpec{
|
||||
Spec: api.PodSpec{Containers: make([]api.Container, 2)},
|
||||
},
|
||||
},
|
||||
Status: expapi.DeploymentStatus{
|
||||
Status: experimental.DeploymentStatus{
|
||||
Replicas: 10,
|
||||
UpdatedReplicas: 2,
|
||||
},
|
||||
|
@@ -37,13 +37,13 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api/meta"
|
||||
"k8s.io/kubernetes/pkg/api/rest"
|
||||
"k8s.io/kubernetes/pkg/api/v1"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
explatest "k8s.io/kubernetes/pkg/apis/experimental/latest"
|
||||
"k8s.io/kubernetes/pkg/apiserver"
|
||||
"k8s.io/kubernetes/pkg/auth/authenticator"
|
||||
"k8s.io/kubernetes/pkg/auth/authorizer"
|
||||
"k8s.io/kubernetes/pkg/auth/handlers"
|
||||
client "k8s.io/kubernetes/pkg/client/unversioned"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
explatest "k8s.io/kubernetes/pkg/expapi/latest"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/healthz"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
@@ -572,7 +572,7 @@ func (m *Master) init(c *Config) {
|
||||
apiserver.InstallServiceErrorHandler(m.handlerContainer, requestInfoResolver, apiVersions)
|
||||
|
||||
if m.exp {
|
||||
expVersion := m.expapi(c)
|
||||
expVersion := m.experimental(c)
|
||||
if err := expVersion.InstallREST(m.handlerContainer); err != nil {
|
||||
glog.Fatalf("Unable to setup experimental api: %v", err)
|
||||
}
|
||||
@@ -775,7 +775,7 @@ func (m *Master) api_v1() *apiserver.APIGroupVersion {
|
||||
return version
|
||||
}
|
||||
|
||||
func (m *Master) InstallThirdPartyAPI(rsrc *expapi.ThirdPartyResource) error {
|
||||
func (m *Master) InstallThirdPartyAPI(rsrc *experimental.ThirdPartyResource) error {
|
||||
kind, group, err := thirdpartyresourcedata.ExtractApiGroupAndKind(rsrc)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -821,8 +821,8 @@ func (m *Master) thirdpartyapi(group, kind, version string) *apiserver.APIGroupV
|
||||
}
|
||||
}
|
||||
|
||||
// expapi returns the resources and codec for the experimental api
|
||||
func (m *Master) expapi(c *Config) *apiserver.APIGroupVersion {
|
||||
// experimental returns the resources and codec for the experimental api
|
||||
func (m *Master) experimental(c *Config) *apiserver.APIGroupVersion {
|
||||
controllerStorage := expcontrolleretcd.NewStorage(c.ExpDatabaseStorage)
|
||||
autoscalerStorage := horizontalpodautoscaleretcd.NewREST(c.ExpDatabaseStorage)
|
||||
thirdPartyResourceStorage := thirdpartyresourceetcd.NewREST(c.ExpDatabaseStorage)
|
||||
|
@@ -37,10 +37,10 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api/latest"
|
||||
"k8s.io/kubernetes/pkg/api/meta"
|
||||
"k8s.io/kubernetes/pkg/api/v1"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
explatest "k8s.io/kubernetes/pkg/apis/experimental/latest"
|
||||
"k8s.io/kubernetes/pkg/apiserver"
|
||||
client "k8s.io/kubernetes/pkg/client/unversioned"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
explatest "k8s.io/kubernetes/pkg/expapi/latest"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/registry/endpoint"
|
||||
@@ -280,7 +280,7 @@ func TestDefaultAPIGroupVersion(t *testing.T) {
|
||||
func TestExpapi(t *testing.T) {
|
||||
master, config, assert := setUp(t)
|
||||
|
||||
expAPIGroup := master.expapi(&config)
|
||||
expAPIGroup := master.experimental(&config)
|
||||
assert.Equal(expAPIGroup.Root, master.expAPIPrefix)
|
||||
assert.Equal(expAPIGroup.Mapper, explatest.RESTMapper)
|
||||
assert.Equal(expAPIGroup.Codec, explatest.Codec)
|
||||
@@ -442,11 +442,11 @@ type FooList struct {
|
||||
func initThirdParty(t *testing.T, version string) (*tools.FakeEtcdClient, *httptest.Server, *assert.Assertions) {
|
||||
master, _, assert := setUp(t)
|
||||
|
||||
api := &expapi.ThirdPartyResource{
|
||||
api := &experimental.ThirdPartyResource{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "foo.company.com",
|
||||
},
|
||||
Versions: []expapi.APIVersion{
|
||||
Versions: []experimental.APIVersion{
|
||||
{
|
||||
APIGroup: "group",
|
||||
Name: version,
|
||||
@@ -502,7 +502,7 @@ func encodeToThirdParty(name string, obj interface{}) ([]byte, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
thirdPartyData := expapi.ThirdPartyResourceData{
|
||||
thirdPartyData := experimental.ThirdPartyResourceData{
|
||||
ObjectMeta: api.ObjectMeta{Name: name},
|
||||
Data: serial,
|
||||
}
|
||||
@@ -631,7 +631,7 @@ func testInstallThirdPartyAPIPostForVersion(t *testing.T, version string) {
|
||||
obj, err := explatest.Codec.Decode([]byte(etcdResp.Node.Value))
|
||||
assert.NoError(err)
|
||||
|
||||
thirdPartyObj, ok := obj.(*expapi.ThirdPartyResourceData)
|
||||
thirdPartyObj, ok := obj.(*experimental.ThirdPartyResourceData)
|
||||
if !assert.True(ok) {
|
||||
t.Errorf("unexpected object: %v", obj)
|
||||
}
|
||||
|
@@ -18,7 +18,7 @@ package etcd
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/registry/daemonset"
|
||||
@@ -39,10 +39,10 @@ var daemonPrefix = "/daemonsets"
|
||||
// NewREST returns a RESTStorage object that will work against DaemonSets.
|
||||
func NewREST(s storage.Interface) *REST {
|
||||
store := &etcdgeneric.Etcd{
|
||||
NewFunc: func() runtime.Object { return &expapi.DaemonSet{} },
|
||||
NewFunc: func() runtime.Object { return &experimental.DaemonSet{} },
|
||||
|
||||
// NewListFunc returns an object capable of storing results of an etcd list.
|
||||
NewListFunc: func() runtime.Object { return &expapi.DaemonSetList{} },
|
||||
NewListFunc: func() runtime.Object { return &experimental.DaemonSetList{} },
|
||||
// Produces a path that etcd understands, to the root of the resource
|
||||
// by combining the namespace in the context with the given prefix
|
||||
KeyRootFunc: func(ctx api.Context) string {
|
||||
@@ -55,7 +55,7 @@ func NewREST(s storage.Interface) *REST {
|
||||
},
|
||||
// Retrieve the name field of a daemon set
|
||||
ObjectNameFunc: func(obj runtime.Object) (string, error) {
|
||||
return obj.(*expapi.DaemonSet).Name, nil
|
||||
return obj.(*experimental.DaemonSet).Name, nil
|
||||
},
|
||||
// Used to match objects based on labels/fields for list and watch
|
||||
PredicateFunc: func(label labels.Selector, field fields.Selector) generic.Matcher {
|
||||
|
@@ -20,7 +20,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/registry/registrytest"
|
||||
@@ -33,13 +33,13 @@ func newStorage(t *testing.T) (*REST, *tools.FakeEtcdClient) {
|
||||
return NewREST(etcdStorage), fakeClient
|
||||
}
|
||||
|
||||
func newValidDaemonSet() *expapi.DaemonSet {
|
||||
return &expapi.DaemonSet{
|
||||
func newValidDaemonSet() *experimental.DaemonSet {
|
||||
return &experimental.DaemonSet{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "foo",
|
||||
Namespace: api.NamespaceDefault,
|
||||
},
|
||||
Spec: expapi.DaemonSetSpec{
|
||||
Spec: experimental.DaemonSetSpec{
|
||||
Selector: map[string]string{"a": "b"},
|
||||
Template: &api.PodTemplateSpec{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
@@ -72,8 +72,8 @@ func TestCreate(t *testing.T) {
|
||||
// valid
|
||||
ds,
|
||||
// invalid (invalid selector)
|
||||
&expapi.DaemonSet{
|
||||
Spec: expapi.DaemonSetSpec{
|
||||
&experimental.DaemonSet{
|
||||
Spec: experimental.DaemonSetSpec{
|
||||
Selector: map[string]string{},
|
||||
Template: validDaemonSet.Spec.Template,
|
||||
},
|
||||
@@ -89,28 +89,28 @@ func TestUpdate(t *testing.T) {
|
||||
newValidDaemonSet(),
|
||||
// updateFunc
|
||||
func(obj runtime.Object) runtime.Object {
|
||||
object := obj.(*expapi.DaemonSet)
|
||||
object := obj.(*experimental.DaemonSet)
|
||||
object.Spec.Template.Spec.NodeSelector = map[string]string{"c": "d"}
|
||||
return object
|
||||
},
|
||||
// invalid updateFunc
|
||||
func(obj runtime.Object) runtime.Object {
|
||||
object := obj.(*expapi.DaemonSet)
|
||||
object := obj.(*experimental.DaemonSet)
|
||||
object.UID = "newUID"
|
||||
return object
|
||||
},
|
||||
func(obj runtime.Object) runtime.Object {
|
||||
object := obj.(*expapi.DaemonSet)
|
||||
object := obj.(*experimental.DaemonSet)
|
||||
object.Name = ""
|
||||
return object
|
||||
},
|
||||
func(obj runtime.Object) runtime.Object {
|
||||
object := obj.(*expapi.DaemonSet)
|
||||
object := obj.(*experimental.DaemonSet)
|
||||
object.Spec.Template.Spec.RestartPolicy = api.RestartPolicyOnFailure
|
||||
return object
|
||||
},
|
||||
func(obj runtime.Object) runtime.Object {
|
||||
object := obj.(*expapi.DaemonSet)
|
||||
object := obj.(*experimental.DaemonSet)
|
||||
object.Spec.Selector = map[string]string{}
|
||||
return object
|
||||
},
|
||||
|
@@ -21,8 +21,8 @@ import (
|
||||
"reflect"
|
||||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/expapi/validation"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental/validation"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/registry/generic"
|
||||
@@ -46,16 +46,16 @@ func (daemonSetStrategy) NamespaceScoped() bool {
|
||||
|
||||
// PrepareForCreate clears the status of a daemon set before creation.
|
||||
func (daemonSetStrategy) PrepareForCreate(obj runtime.Object) {
|
||||
daemonSet := obj.(*expapi.DaemonSet)
|
||||
daemonSet.Status = expapi.DaemonSetStatus{}
|
||||
daemonSet := obj.(*experimental.DaemonSet)
|
||||
daemonSet.Status = experimental.DaemonSetStatus{}
|
||||
|
||||
daemonSet.Generation = 1
|
||||
}
|
||||
|
||||
// PrepareForUpdate clears fields that are not allowed to be set by end users on update.
|
||||
func (daemonSetStrategy) PrepareForUpdate(obj, old runtime.Object) {
|
||||
newDaemonSet := obj.(*expapi.DaemonSet)
|
||||
oldDaemonSet := old.(*expapi.DaemonSet)
|
||||
newDaemonSet := obj.(*experimental.DaemonSet)
|
||||
oldDaemonSet := old.(*experimental.DaemonSet)
|
||||
|
||||
// Any changes to the spec increment the generation number, any changes to the
|
||||
// status should reflect the generation number of the corresponding object. We push
|
||||
@@ -75,7 +75,7 @@ func (daemonSetStrategy) PrepareForUpdate(obj, old runtime.Object) {
|
||||
|
||||
// Validate validates a new daemon set.
|
||||
func (daemonSetStrategy) Validate(ctx api.Context, obj runtime.Object) fielderrors.ValidationErrorList {
|
||||
daemonSet := obj.(*expapi.DaemonSet)
|
||||
daemonSet := obj.(*experimental.DaemonSet)
|
||||
return validation.ValidateDaemonSet(daemonSet)
|
||||
}
|
||||
|
||||
@@ -87,8 +87,8 @@ func (daemonSetStrategy) AllowCreateOnUpdate() bool {
|
||||
|
||||
// ValidateUpdate is the default update validation for an end user.
|
||||
func (daemonSetStrategy) ValidateUpdate(ctx api.Context, obj, old runtime.Object) fielderrors.ValidationErrorList {
|
||||
validationErrorList := validation.ValidateDaemonSet(obj.(*expapi.DaemonSet))
|
||||
updateErrorList := validation.ValidateDaemonSetUpdate(old.(*expapi.DaemonSet), obj.(*expapi.DaemonSet))
|
||||
validationErrorList := validation.ValidateDaemonSet(obj.(*experimental.DaemonSet))
|
||||
updateErrorList := validation.ValidateDaemonSetUpdate(old.(*experimental.DaemonSet), obj.(*experimental.DaemonSet))
|
||||
return append(validationErrorList, updateErrorList...)
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ func (daemonSetStrategy) AllowUnconditionalUpdate() bool {
|
||||
}
|
||||
|
||||
// DaemonSetToSelectableFields returns a field set that represents the object.
|
||||
func DaemonSetToSelectableFields(daemon *expapi.DaemonSet) fields.Set {
|
||||
func DaemonSetToSelectableFields(daemon *experimental.DaemonSet) fields.Set {
|
||||
return fields.Set{
|
||||
"metadata.name": daemon.Name,
|
||||
}
|
||||
@@ -112,7 +112,7 @@ func MatchDaemonSet(label labels.Selector, field fields.Selector) generic.Matche
|
||||
Label: label,
|
||||
Field: field,
|
||||
GetAttrs: func(obj runtime.Object) (labels.Set, fields.Set, error) {
|
||||
ds, ok := obj.(*expapi.DaemonSet)
|
||||
ds, ok := obj.(*experimental.DaemonSet)
|
||||
if !ok {
|
||||
return nil, nil, fmt.Errorf("given object is not a ds.")
|
||||
}
|
||||
|
@@ -18,7 +18,7 @@ package etcd
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/registry/deployment"
|
||||
@@ -36,9 +36,9 @@ type REST struct {
|
||||
func NewREST(s storage.Interface) *REST {
|
||||
prefix := "/deployments"
|
||||
store := &etcdgeneric.Etcd{
|
||||
NewFunc: func() runtime.Object { return &expapi.Deployment{} },
|
||||
NewFunc: func() runtime.Object { return &experimental.Deployment{} },
|
||||
// NewListFunc returns an object capable of storing results of an etcd list.
|
||||
NewListFunc: func() runtime.Object { return &expapi.DeploymentList{} },
|
||||
NewListFunc: func() runtime.Object { return &experimental.DeploymentList{} },
|
||||
// Produces a path that etcd understands, to the root of the resource
|
||||
// by combining the namespace in the context with the given prefix.
|
||||
KeyRootFunc: func(ctx api.Context) string {
|
||||
@@ -51,7 +51,7 @@ func NewREST(s storage.Interface) *REST {
|
||||
},
|
||||
// Retrieve the name field of a deployment.
|
||||
ObjectNameFunc: func(obj runtime.Object) (string, error) {
|
||||
return obj.(*expapi.Deployment).Name, nil
|
||||
return obj.(*experimental.Deployment).Name, nil
|
||||
},
|
||||
// Used to match objects based on labels/fields for list.
|
||||
PredicateFunc: func(label labels.Selector, field fields.Selector) generic.Matcher {
|
||||
|
@@ -20,7 +20,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/registry/registrytest"
|
||||
@@ -33,13 +33,13 @@ func newStorage(t *testing.T) (*REST, *tools.FakeEtcdClient) {
|
||||
return NewREST(etcdStorage), fakeClient
|
||||
}
|
||||
|
||||
func validNewDeployment() *expapi.Deployment {
|
||||
return &expapi.Deployment{
|
||||
func validNewDeployment() *experimental.Deployment {
|
||||
return &experimental.Deployment{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "foo",
|
||||
Namespace: api.NamespaceDefault,
|
||||
},
|
||||
Spec: expapi.DeploymentSpec{
|
||||
Spec: experimental.DeploymentSpec{
|
||||
Selector: map[string]string{"a": "b"},
|
||||
Template: &api.PodTemplateSpec{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
@@ -73,8 +73,8 @@ func TestCreate(t *testing.T) {
|
||||
// valid
|
||||
deployment,
|
||||
// invalid (invalid selector)
|
||||
&expapi.Deployment{
|
||||
Spec: expapi.DeploymentSpec{
|
||||
&experimental.Deployment{
|
||||
Spec: experimental.DeploymentSpec{
|
||||
Selector: map[string]string{},
|
||||
Template: validDeployment.Spec.Template,
|
||||
},
|
||||
@@ -90,28 +90,28 @@ func TestUpdate(t *testing.T) {
|
||||
validNewDeployment(),
|
||||
// updateFunc
|
||||
func(obj runtime.Object) runtime.Object {
|
||||
object := obj.(*expapi.Deployment)
|
||||
object := obj.(*experimental.Deployment)
|
||||
object.Spec.Template.Spec.NodeSelector = map[string]string{"c": "d"}
|
||||
return object
|
||||
},
|
||||
// invalid updateFunc
|
||||
func(obj runtime.Object) runtime.Object {
|
||||
object := obj.(*expapi.Deployment)
|
||||
object := obj.(*experimental.Deployment)
|
||||
object.UID = "newUID"
|
||||
return object
|
||||
},
|
||||
func(obj runtime.Object) runtime.Object {
|
||||
object := obj.(*expapi.Deployment)
|
||||
object := obj.(*experimental.Deployment)
|
||||
object.Name = ""
|
||||
return object
|
||||
},
|
||||
func(obj runtime.Object) runtime.Object {
|
||||
object := obj.(*expapi.Deployment)
|
||||
object := obj.(*experimental.Deployment)
|
||||
object.Spec.Template.Spec.RestartPolicy = api.RestartPolicyOnFailure
|
||||
return object
|
||||
},
|
||||
func(obj runtime.Object) runtime.Object {
|
||||
object := obj.(*expapi.Deployment)
|
||||
object := obj.(*experimental.Deployment)
|
||||
object.Spec.Selector = map[string]string{}
|
||||
return object
|
||||
},
|
||||
|
@@ -20,8 +20,8 @@ import (
|
||||
"fmt"
|
||||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/expapi/validation"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental/validation"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/registry/generic"
|
||||
@@ -50,7 +50,7 @@ func (deploymentStrategy) PrepareForCreate(obj runtime.Object) {
|
||||
|
||||
// Validate validates a new deployment.
|
||||
func (deploymentStrategy) Validate(ctx api.Context, obj runtime.Object) errs.ValidationErrorList {
|
||||
deployment := obj.(*expapi.Deployment)
|
||||
deployment := obj.(*experimental.Deployment)
|
||||
return validation.ValidateDeployment(deployment)
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ func (deploymentStrategy) PrepareForUpdate(obj, old runtime.Object) {
|
||||
|
||||
// ValidateUpdate is the default update validation for an end user.
|
||||
func (deploymentStrategy) ValidateUpdate(ctx api.Context, obj, old runtime.Object) errs.ValidationErrorList {
|
||||
return validation.ValidateDeploymentUpdate(old.(*expapi.Deployment), obj.(*expapi.Deployment))
|
||||
return validation.ValidateDeploymentUpdate(old.(*experimental.Deployment), obj.(*experimental.Deployment))
|
||||
}
|
||||
|
||||
func (deploymentStrategy) AllowUnconditionalUpdate() bool {
|
||||
@@ -73,7 +73,7 @@ func (deploymentStrategy) AllowUnconditionalUpdate() bool {
|
||||
}
|
||||
|
||||
// DeploymentToSelectableFields returns a field set that represents the object.
|
||||
func DeploymentToSelectableFields(deployment *expapi.Deployment) fields.Set {
|
||||
func DeploymentToSelectableFields(deployment *experimental.Deployment) fields.Set {
|
||||
return fields.Set{
|
||||
"metadata.name": deployment.Name,
|
||||
}
|
||||
@@ -87,7 +87,7 @@ func MatchDeployment(label labels.Selector, field fields.Selector) generic.Match
|
||||
Label: label,
|
||||
Field: field,
|
||||
GetAttrs: func(obj runtime.Object) (labels.Set, fields.Set, error) {
|
||||
deployment, ok := obj.(*expapi.Deployment)
|
||||
deployment, ok := obj.(*experimental.Deployment)
|
||||
if !ok {
|
||||
return nil, nil, fmt.Errorf("given object is not a deployment.")
|
||||
}
|
||||
|
@@ -28,7 +28,7 @@ import (
|
||||
"k8s.io/kubernetes/pkg/registry/controller"
|
||||
"k8s.io/kubernetes/pkg/registry/controller/etcd"
|
||||
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
)
|
||||
|
||||
// Container includes dummy storage for RC pods and experimental storage for Scale.
|
||||
@@ -55,7 +55,7 @@ var _ = rest.Patcher(&ScaleREST{})
|
||||
|
||||
// New creates a new Scale object
|
||||
func (r *ScaleREST) New() runtime.Object {
|
||||
return &expapi.Scale{}
|
||||
return &experimental.Scale{}
|
||||
}
|
||||
|
||||
func (r *ScaleREST) Get(ctx api.Context, name string) (runtime.Object, error) {
|
||||
@@ -63,16 +63,16 @@ func (r *ScaleREST) Get(ctx api.Context, name string) (runtime.Object, error) {
|
||||
if err != nil {
|
||||
return nil, errors.NewNotFound("scale", name)
|
||||
}
|
||||
return &expapi.Scale{
|
||||
return &experimental.Scale{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: name,
|
||||
Namespace: rc.Namespace,
|
||||
CreationTimestamp: rc.CreationTimestamp,
|
||||
},
|
||||
Spec: expapi.ScaleSpec{
|
||||
Spec: experimental.ScaleSpec{
|
||||
Replicas: rc.Spec.Replicas,
|
||||
},
|
||||
Status: expapi.ScaleStatus{
|
||||
Status: experimental.ScaleStatus{
|
||||
Replicas: rc.Status.Replicas,
|
||||
Selector: rc.Spec.Selector,
|
||||
},
|
||||
@@ -83,7 +83,7 @@ func (r *ScaleREST) Update(ctx api.Context, obj runtime.Object) (runtime.Object,
|
||||
if obj == nil {
|
||||
return nil, false, errors.NewBadRequest(fmt.Sprintf("nil update passed to Scale"))
|
||||
}
|
||||
scale, ok := obj.(*expapi.Scale)
|
||||
scale, ok := obj.(*experimental.Scale)
|
||||
if !ok {
|
||||
return nil, false, errors.NewBadRequest(fmt.Sprintf("wrong object passed to Scale update: %v", obj))
|
||||
}
|
||||
@@ -96,16 +96,16 @@ func (r *ScaleREST) Update(ctx api.Context, obj runtime.Object) (runtime.Object,
|
||||
if err != nil {
|
||||
return nil, false, errors.NewConflict("scale", scale.Name, err)
|
||||
}
|
||||
return &expapi.Scale{
|
||||
return &experimental.Scale{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: rc.Name,
|
||||
Namespace: rc.Namespace,
|
||||
CreationTimestamp: rc.CreationTimestamp,
|
||||
},
|
||||
Spec: expapi.ScaleSpec{
|
||||
Spec: experimental.ScaleSpec{
|
||||
Replicas: rc.Spec.Replicas,
|
||||
},
|
||||
Status: expapi.ScaleStatus{
|
||||
Status: experimental.ScaleStatus{
|
||||
Replicas: rc.Status.Replicas,
|
||||
Selector: rc.Spec.Selector,
|
||||
},
|
||||
@@ -116,5 +116,5 @@ func (r *ScaleREST) Update(ctx api.Context, obj runtime.Object) (runtime.Object,
|
||||
type RcREST struct{}
|
||||
|
||||
func (r *RcREST) New() runtime.Object {
|
||||
return &expapi.ReplicationControllerDummy{}
|
||||
return &experimental.ReplicationControllerDummy{}
|
||||
}
|
||||
|
@@ -21,7 +21,7 @@ import (
|
||||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/testapi"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
"k8s.io/kubernetes/pkg/registry/registrytest"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/tools"
|
||||
@@ -66,12 +66,12 @@ var validController = api.ReplicationController{
|
||||
Spec: validControllerSpec,
|
||||
}
|
||||
|
||||
var validScale = expapi.Scale{
|
||||
var validScale = experimental.Scale{
|
||||
ObjectMeta: api.ObjectMeta{Name: "foo", Namespace: "test"},
|
||||
Spec: expapi.ScaleSpec{
|
||||
Spec: experimental.ScaleSpec{
|
||||
Replicas: validReplicas,
|
||||
},
|
||||
Status: expapi.ScaleStatus{
|
||||
Status: experimental.ScaleStatus{
|
||||
Replicas: 0,
|
||||
Selector: validPodTemplate.Template.Labels,
|
||||
},
|
||||
@@ -88,7 +88,7 @@ func TestGet(t *testing.T) {
|
||||
|
||||
expect := &validScale
|
||||
obj, err := storage.Get(ctx, "foo")
|
||||
scale := obj.(*expapi.Scale)
|
||||
scale := obj.(*experimental.Scale)
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
}
|
||||
@@ -106,9 +106,9 @@ func TestUpdate(t *testing.T) {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
}
|
||||
replicas := 12
|
||||
update := expapi.Scale{
|
||||
update := experimental.Scale{
|
||||
ObjectMeta: api.ObjectMeta{Name: "foo", Namespace: "test"},
|
||||
Spec: expapi.ScaleSpec{
|
||||
Spec: experimental.ScaleSpec{
|
||||
Replicas: replicas,
|
||||
},
|
||||
}
|
||||
|
@@ -18,7 +18,7 @@ package etcd
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/registry/generic"
|
||||
@@ -36,9 +36,9 @@ type REST struct {
|
||||
func NewREST(s storage.Interface) *REST {
|
||||
prefix := "/horizontalpodautoscalers"
|
||||
store := &etcdgeneric.Etcd{
|
||||
NewFunc: func() runtime.Object { return &expapi.HorizontalPodAutoscaler{} },
|
||||
NewFunc: func() runtime.Object { return &experimental.HorizontalPodAutoscaler{} },
|
||||
// NewListFunc returns an object capable of storing results of an etcd list.
|
||||
NewListFunc: func() runtime.Object { return &expapi.HorizontalPodAutoscalerList{} },
|
||||
NewListFunc: func() runtime.Object { return &experimental.HorizontalPodAutoscalerList{} },
|
||||
// Produces a path that etcd understands, to the root of the resource
|
||||
// by combining the namespace in the context with the given prefix
|
||||
KeyRootFunc: func(ctx api.Context) string {
|
||||
@@ -51,7 +51,7 @@ func NewREST(s storage.Interface) *REST {
|
||||
},
|
||||
// Retrieve the name field of an autoscaler
|
||||
ObjectNameFunc: func(obj runtime.Object) (string, error) {
|
||||
return obj.(*expapi.HorizontalPodAutoscaler).Name, nil
|
||||
return obj.(*experimental.HorizontalPodAutoscaler).Name, nil
|
||||
},
|
||||
// Used to match objects based on labels/fields for list
|
||||
PredicateFunc: func(label labels.Selector, field fields.Selector) generic.Matcher {
|
||||
|
@@ -21,9 +21,9 @@ import (
|
||||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/resource"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
// Ensure that expapi/v1 package is initialized.
|
||||
_ "k8s.io/kubernetes/pkg/expapi/v1"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
// Ensure that experimental/v1 package is initialized.
|
||||
_ "k8s.io/kubernetes/pkg/apis/experimental/v1"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/registry/registrytest"
|
||||
@@ -36,19 +36,19 @@ func newStorage(t *testing.T) (*REST, *tools.FakeEtcdClient) {
|
||||
return NewREST(etcdStorage), fakeClient
|
||||
}
|
||||
|
||||
func validNewHorizontalPodAutoscaler(name string) *expapi.HorizontalPodAutoscaler {
|
||||
return &expapi.HorizontalPodAutoscaler{
|
||||
func validNewHorizontalPodAutoscaler(name string) *experimental.HorizontalPodAutoscaler {
|
||||
return &experimental.HorizontalPodAutoscaler{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: name,
|
||||
Namespace: api.NamespaceDefault,
|
||||
},
|
||||
Spec: expapi.HorizontalPodAutoscalerSpec{
|
||||
ScaleRef: &expapi.SubresourceReference{
|
||||
Spec: experimental.HorizontalPodAutoscalerSpec{
|
||||
ScaleRef: &experimental.SubresourceReference{
|
||||
Subresource: "scale",
|
||||
},
|
||||
MinCount: 1,
|
||||
MaxCount: 5,
|
||||
Target: expapi.ResourceConsumption{Resource: api.ResourceCPU, Quantity: resource.MustParse("0.8")},
|
||||
Target: experimental.ResourceConsumption{Resource: api.ResourceCPU, Quantity: resource.MustParse("0.8")},
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -62,7 +62,7 @@ func TestCreate(t *testing.T) {
|
||||
// valid
|
||||
autoscaler,
|
||||
// invalid
|
||||
&expapi.HorizontalPodAutoscaler{},
|
||||
&experimental.HorizontalPodAutoscaler{},
|
||||
)
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ func TestUpdate(t *testing.T) {
|
||||
validNewHorizontalPodAutoscaler("foo"),
|
||||
// updateFunc
|
||||
func(obj runtime.Object) runtime.Object {
|
||||
object := obj.(*expapi.HorizontalPodAutoscaler)
|
||||
object := obj.(*experimental.HorizontalPodAutoscaler)
|
||||
object.Spec.MaxCount = object.Spec.MaxCount + 1
|
||||
return object
|
||||
},
|
||||
|
@@ -20,8 +20,8 @@ import (
|
||||
"fmt"
|
||||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/expapi/validation"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental/validation"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/registry/generic"
|
||||
@@ -46,12 +46,12 @@ func (autoscalerStrategy) NamespaceScoped() bool {
|
||||
|
||||
// PrepareForCreate clears fields that are not allowed to be set by end users on creation.
|
||||
func (autoscalerStrategy) PrepareForCreate(obj runtime.Object) {
|
||||
_ = obj.(*expapi.HorizontalPodAutoscaler)
|
||||
_ = obj.(*experimental.HorizontalPodAutoscaler)
|
||||
}
|
||||
|
||||
// Validate validates a new autoscaler.
|
||||
func (autoscalerStrategy) Validate(ctx api.Context, obj runtime.Object) errs.ValidationErrorList {
|
||||
autoscaler := obj.(*expapi.HorizontalPodAutoscaler)
|
||||
autoscaler := obj.(*experimental.HorizontalPodAutoscaler)
|
||||
return validation.ValidateHorizontalPodAutoscaler(autoscaler)
|
||||
}
|
||||
|
||||
@@ -62,19 +62,19 @@ func (autoscalerStrategy) AllowCreateOnUpdate() bool {
|
||||
|
||||
// PrepareForUpdate clears fields that are not allowed to be set by end users on update.
|
||||
func (autoscalerStrategy) PrepareForUpdate(obj, old runtime.Object) {
|
||||
_ = obj.(*expapi.HorizontalPodAutoscaler)
|
||||
_ = obj.(*experimental.HorizontalPodAutoscaler)
|
||||
}
|
||||
|
||||
// ValidateUpdate is the default update validation for an end user.
|
||||
func (autoscalerStrategy) ValidateUpdate(ctx api.Context, obj, old runtime.Object) errs.ValidationErrorList {
|
||||
return validation.ValidateHorizontalPodAutoscalerUpdate(obj.(*expapi.HorizontalPodAutoscaler), old.(*expapi.HorizontalPodAutoscaler))
|
||||
return validation.ValidateHorizontalPodAutoscalerUpdate(obj.(*experimental.HorizontalPodAutoscaler), old.(*experimental.HorizontalPodAutoscaler))
|
||||
}
|
||||
|
||||
func (autoscalerStrategy) AllowUnconditionalUpdate() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func AutoscalerToSelectableFields(limitRange *expapi.HorizontalPodAutoscaler) fields.Set {
|
||||
func AutoscalerToSelectableFields(limitRange *experimental.HorizontalPodAutoscaler) fields.Set {
|
||||
return fields.Set{}
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ func MatchAutoscaler(label labels.Selector, field fields.Selector) generic.Match
|
||||
Label: label,
|
||||
Field: field,
|
||||
GetAttrs: func(obj runtime.Object) (labels.Set, fields.Set, error) {
|
||||
hpa, ok := obj.(*expapi.HorizontalPodAutoscaler)
|
||||
hpa, ok := obj.(*experimental.HorizontalPodAutoscaler)
|
||||
if !ok {
|
||||
return nil, nil, fmt.Errorf("given object is not a horizontal pod autoscaler.")
|
||||
}
|
||||
|
@@ -18,7 +18,7 @@ package etcd
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/registry/generic"
|
||||
@@ -40,10 +40,10 @@ var jobPrefix = "/jobs"
|
||||
// NewREST returns a RESTStorage object that will work against Jobs.
|
||||
func NewREST(s storage.Interface) *REST {
|
||||
store := &etcdgeneric.Etcd{
|
||||
NewFunc: func() runtime.Object { return &expapi.Job{} },
|
||||
NewFunc: func() runtime.Object { return &experimental.Job{} },
|
||||
|
||||
// NewListFunc returns an object capable of storing results of an etcd list.
|
||||
NewListFunc: func() runtime.Object { return &expapi.JobList{} },
|
||||
NewListFunc: func() runtime.Object { return &experimental.JobList{} },
|
||||
// Produces a path that etcd understands, to the root of the resource
|
||||
// by combining the namespace in the context with the given prefix
|
||||
KeyRootFunc: func(ctx api.Context) string {
|
||||
@@ -56,7 +56,7 @@ func NewREST(s storage.Interface) *REST {
|
||||
},
|
||||
// Retrieve the name field of a job
|
||||
ObjectNameFunc: func(obj runtime.Object) (string, error) {
|
||||
return obj.(*expapi.Job).Name, nil
|
||||
return obj.(*experimental.Job).Name, nil
|
||||
},
|
||||
// Used to match objects based on labels/fields for list and watch
|
||||
PredicateFunc: func(label labels.Selector, field fields.Selector) generic.Matcher {
|
||||
|
@@ -20,9 +20,9 @@ import (
|
||||
"testing"
|
||||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
// Ensure that expapi/v1 package is initialized.
|
||||
_ "k8s.io/kubernetes/pkg/expapi/v1"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
// Ensure that experimental/v1 package is initialized.
|
||||
_ "k8s.io/kubernetes/pkg/apis/experimental/v1"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/registry/registrytest"
|
||||
@@ -35,15 +35,15 @@ func newStorage(t *testing.T) (*REST, *tools.FakeEtcdClient) {
|
||||
return NewREST(etcdStorage), fakeClient
|
||||
}
|
||||
|
||||
func validNewJob() *expapi.Job {
|
||||
func validNewJob() *experimental.Job {
|
||||
completions := 1
|
||||
parallelism := 1
|
||||
return &expapi.Job{
|
||||
return &experimental.Job{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "foo",
|
||||
Namespace: "default",
|
||||
},
|
||||
Spec: expapi.JobSpec{
|
||||
Spec: experimental.JobSpec{
|
||||
Completions: &completions,
|
||||
Parallelism: ¶llelism,
|
||||
Selector: map[string]string{"a": "b"},
|
||||
@@ -76,8 +76,8 @@ func TestCreate(t *testing.T) {
|
||||
// valid
|
||||
validJob,
|
||||
// invalid (empty selector)
|
||||
&expapi.Job{
|
||||
Spec: expapi.JobSpec{
|
||||
&experimental.Job{
|
||||
Spec: experimental.JobSpec{
|
||||
Completions: validJob.Spec.Completions,
|
||||
Selector: map[string]string{},
|
||||
Template: validJob.Spec.Template,
|
||||
@@ -95,13 +95,13 @@ func TestUpdate(t *testing.T) {
|
||||
validNewJob(),
|
||||
// updateFunc
|
||||
func(obj runtime.Object) runtime.Object {
|
||||
object := obj.(*expapi.Job)
|
||||
object := obj.(*experimental.Job)
|
||||
object.Spec.Completions = &completions
|
||||
return object
|
||||
},
|
||||
// invalid updateFunc
|
||||
func(obj runtime.Object) runtime.Object {
|
||||
object := obj.(*expapi.Job)
|
||||
object := obj.(*experimental.Job)
|
||||
object.Spec.Selector = map[string]string{}
|
||||
return object
|
||||
},
|
||||
|
@@ -21,7 +21,7 @@ import (
|
||||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/rest"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/watch"
|
||||
@@ -30,15 +30,15 @@ import (
|
||||
// Registry is an interface for things that know how to store Jobs.
|
||||
type Registry interface {
|
||||
// ListJobs obtains a list of Jobs having labels and fields which match selector.
|
||||
ListJobs(ctx api.Context, label labels.Selector, field fields.Selector) (*expapi.JobList, error)
|
||||
ListJobs(ctx api.Context, label labels.Selector, field fields.Selector) (*experimental.JobList, error)
|
||||
// WatchJobs watch for new/changed/deleted Jobs.
|
||||
WatchJobs(ctx api.Context, label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)
|
||||
// GetJobs gets a specific Job.
|
||||
GetJob(ctx api.Context, name string) (*expapi.Job, error)
|
||||
GetJob(ctx api.Context, name string) (*experimental.Job, error)
|
||||
// CreateJob creates a Job based on a specification.
|
||||
CreateJob(ctx api.Context, job *expapi.Job) (*expapi.Job, error)
|
||||
CreateJob(ctx api.Context, job *experimental.Job) (*experimental.Job, error)
|
||||
// UpdateJob updates an existing Job.
|
||||
UpdateJob(ctx api.Context, job *expapi.Job) (*expapi.Job, error)
|
||||
UpdateJob(ctx api.Context, job *experimental.Job) (*experimental.Job, error)
|
||||
// DeleteJob deletes an existing Job.
|
||||
DeleteJob(ctx api.Context, name string) error
|
||||
}
|
||||
@@ -54,7 +54,7 @@ func NewRegistry(s rest.StandardStorage) Registry {
|
||||
return &storage{s}
|
||||
}
|
||||
|
||||
func (s *storage) ListJobs(ctx api.Context, label labels.Selector, field fields.Selector) (*expapi.JobList, error) {
|
||||
func (s *storage) ListJobs(ctx api.Context, label labels.Selector, field fields.Selector) (*experimental.JobList, error) {
|
||||
if !field.Empty() {
|
||||
return nil, fmt.Errorf("field selector not supported yet")
|
||||
}
|
||||
@@ -62,35 +62,35 @@ func (s *storage) ListJobs(ctx api.Context, label labels.Selector, field fields.
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*expapi.JobList), err
|
||||
return obj.(*experimental.JobList), err
|
||||
}
|
||||
|
||||
func (s *storage) WatchJobs(ctx api.Context, label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error) {
|
||||
return s.Watch(ctx, label, field, resourceVersion)
|
||||
}
|
||||
|
||||
func (s *storage) GetJob(ctx api.Context, name string) (*expapi.Job, error) {
|
||||
func (s *storage) GetJob(ctx api.Context, name string) (*experimental.Job, error) {
|
||||
obj, err := s.Get(ctx, name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*expapi.Job), nil
|
||||
return obj.(*experimental.Job), nil
|
||||
}
|
||||
|
||||
func (s *storage) CreateJob(ctx api.Context, job *expapi.Job) (*expapi.Job, error) {
|
||||
func (s *storage) CreateJob(ctx api.Context, job *experimental.Job) (*experimental.Job, error) {
|
||||
obj, err := s.Create(ctx, job)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*expapi.Job), nil
|
||||
return obj.(*experimental.Job), nil
|
||||
}
|
||||
|
||||
func (s *storage) UpdateJob(ctx api.Context, job *expapi.Job) (*expapi.Job, error) {
|
||||
func (s *storage) UpdateJob(ctx api.Context, job *experimental.Job) (*experimental.Job, error) {
|
||||
obj, _, err := s.Update(ctx, job)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*expapi.Job), nil
|
||||
return obj.(*experimental.Job), nil
|
||||
}
|
||||
|
||||
func (s *storage) DeleteJob(ctx api.Context, name string) error {
|
||||
|
@@ -21,8 +21,8 @@ import (
|
||||
"strconv"
|
||||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/expapi/validation"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental/validation"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/registry/generic"
|
||||
@@ -46,20 +46,20 @@ func (jobStrategy) NamespaceScoped() bool {
|
||||
|
||||
// PrepareForCreate clears the status of a job before creation.
|
||||
func (jobStrategy) PrepareForCreate(obj runtime.Object) {
|
||||
job := obj.(*expapi.Job)
|
||||
job.Status = expapi.JobStatus{}
|
||||
job := obj.(*experimental.Job)
|
||||
job.Status = experimental.JobStatus{}
|
||||
}
|
||||
|
||||
// PrepareForUpdate clears fields that are not allowed to be set by end users on update.
|
||||
func (jobStrategy) PrepareForUpdate(obj, old runtime.Object) {
|
||||
newJob := obj.(*expapi.Job)
|
||||
oldJob := old.(*expapi.Job)
|
||||
newJob := obj.(*experimental.Job)
|
||||
oldJob := old.(*experimental.Job)
|
||||
newJob.Status = oldJob.Status
|
||||
}
|
||||
|
||||
// Validate validates a new job.
|
||||
func (jobStrategy) Validate(ctx api.Context, obj runtime.Object) fielderrors.ValidationErrorList {
|
||||
job := obj.(*expapi.Job)
|
||||
job := obj.(*experimental.Job)
|
||||
return validation.ValidateJob(job)
|
||||
}
|
||||
|
||||
@@ -74,13 +74,13 @@ func (jobStrategy) AllowCreateOnUpdate() bool {
|
||||
|
||||
// ValidateUpdate is the default update validation for an end user.
|
||||
func (jobStrategy) ValidateUpdate(ctx api.Context, obj, old runtime.Object) fielderrors.ValidationErrorList {
|
||||
validationErrorList := validation.ValidateJob(obj.(*expapi.Job))
|
||||
updateErrorList := validation.ValidateJobUpdate(old.(*expapi.Job), obj.(*expapi.Job))
|
||||
validationErrorList := validation.ValidateJob(obj.(*experimental.Job))
|
||||
updateErrorList := validation.ValidateJobUpdate(old.(*experimental.Job), obj.(*experimental.Job))
|
||||
return append(validationErrorList, updateErrorList...)
|
||||
}
|
||||
|
||||
// JobSelectableFields returns a field set that represents the object for matching purposes.
|
||||
func JobToSelectableFields(job *expapi.Job) fields.Set {
|
||||
func JobToSelectableFields(job *experimental.Job) fields.Set {
|
||||
return fields.Set{
|
||||
"metadata.name": job.Name,
|
||||
"status.successful": strconv.Itoa(job.Status.Successful),
|
||||
@@ -95,7 +95,7 @@ func MatchJob(label labels.Selector, field fields.Selector) generic.Matcher {
|
||||
Label: label,
|
||||
Field: field,
|
||||
GetAttrs: func(obj runtime.Object) (labels.Set, fields.Set, error) {
|
||||
job, ok := obj.(*expapi.Job)
|
||||
job, ok := obj.(*experimental.Job)
|
||||
if !ok {
|
||||
return nil, nil, fmt.Errorf("Given object is not a job.")
|
||||
}
|
||||
|
@@ -18,7 +18,7 @@ package etcd
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/registry/generic"
|
||||
@@ -38,8 +38,8 @@ func NewREST(s storage.Interface) *REST {
|
||||
prefix := "/thirdpartyresources"
|
||||
|
||||
store := &etcdgeneric.Etcd{
|
||||
NewFunc: func() runtime.Object { return &expapi.ThirdPartyResource{} },
|
||||
NewListFunc: func() runtime.Object { return &expapi.ThirdPartyResourceList{} },
|
||||
NewFunc: func() runtime.Object { return &experimental.ThirdPartyResource{} },
|
||||
NewListFunc: func() runtime.Object { return &experimental.ThirdPartyResourceList{} },
|
||||
KeyRootFunc: func(ctx api.Context) string {
|
||||
return etcdgeneric.NamespaceKeyRootFunc(ctx, prefix)
|
||||
},
|
||||
@@ -47,7 +47,7 @@ func NewREST(s storage.Interface) *REST {
|
||||
return etcdgeneric.NamespaceKeyFunc(ctx, prefix, id)
|
||||
},
|
||||
ObjectNameFunc: func(obj runtime.Object) (string, error) {
|
||||
return obj.(*expapi.ThirdPartyResource).Name, nil
|
||||
return obj.(*experimental.ThirdPartyResource).Name, nil
|
||||
},
|
||||
PredicateFunc: func(label labels.Selector, field fields.Selector) generic.Matcher {
|
||||
return thirdpartyresource.Matcher(label, field)
|
||||
|
@@ -20,9 +20,9 @@ import (
|
||||
"testing"
|
||||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
// Ensure that expapi/v1 package is initialized.
|
||||
_ "k8s.io/kubernetes/pkg/expapi/v1"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
// Ensure that experimental/v1 package is initialized.
|
||||
_ "k8s.io/kubernetes/pkg/apis/experimental/v1"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/registry/registrytest"
|
||||
@@ -35,13 +35,13 @@ func newStorage(t *testing.T) (*REST, *tools.FakeEtcdClient) {
|
||||
return NewREST(etcdStorage), fakeClient
|
||||
}
|
||||
|
||||
func validNewThirdPartyResource(name string) *expapi.ThirdPartyResource {
|
||||
return &expapi.ThirdPartyResource{
|
||||
func validNewThirdPartyResource(name string) *experimental.ThirdPartyResource {
|
||||
return &experimental.ThirdPartyResource{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: name,
|
||||
Namespace: api.NamespaceDefault,
|
||||
},
|
||||
Versions: []expapi.APIVersion{
|
||||
Versions: []experimental.APIVersion{
|
||||
{
|
||||
Name: "stable/v1",
|
||||
},
|
||||
@@ -58,7 +58,7 @@ func TestCreate(t *testing.T) {
|
||||
// valid
|
||||
rsrc,
|
||||
// invalid
|
||||
&expapi.ThirdPartyResource{},
|
||||
&experimental.ThirdPartyResource{},
|
||||
)
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ func TestUpdate(t *testing.T) {
|
||||
validNewThirdPartyResource("foo"),
|
||||
// updateFunc
|
||||
func(obj runtime.Object) runtime.Object {
|
||||
object := obj.(*expapi.ThirdPartyResource)
|
||||
object := obj.(*experimental.ThirdPartyResource)
|
||||
object.Description = "new description"
|
||||
return object
|
||||
},
|
||||
|
@@ -21,8 +21,8 @@ import (
|
||||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/rest"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/expapi/validation"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental/validation"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/registry/generic"
|
||||
@@ -52,7 +52,7 @@ func (strategy) PrepareForCreate(obj runtime.Object) {
|
||||
}
|
||||
|
||||
func (strategy) Validate(ctx api.Context, obj runtime.Object) fielderrors.ValidationErrorList {
|
||||
return validation.ValidateThirdPartyResource(obj.(*expapi.ThirdPartyResource))
|
||||
return validation.ValidateThirdPartyResource(obj.(*experimental.ThirdPartyResource))
|
||||
}
|
||||
|
||||
func (strategy) AllowCreateOnUpdate() bool {
|
||||
@@ -63,7 +63,7 @@ func (strategy) PrepareForUpdate(obj, old runtime.Object) {
|
||||
}
|
||||
|
||||
func (strategy) ValidateUpdate(ctx api.Context, obj, old runtime.Object) fielderrors.ValidationErrorList {
|
||||
return validation.ValidateThirdPartyResourceUpdate(old.(*expapi.ThirdPartyResource), obj.(*expapi.ThirdPartyResource))
|
||||
return validation.ValidateThirdPartyResourceUpdate(old.(*experimental.ThirdPartyResource), obj.(*experimental.ThirdPartyResource))
|
||||
}
|
||||
|
||||
func (strategy) AllowUnconditionalUpdate() bool {
|
||||
@@ -73,7 +73,7 @@ func (strategy) AllowUnconditionalUpdate() bool {
|
||||
// Matcher returns a generic matcher for a given label and field selector.
|
||||
func Matcher(label labels.Selector, field fields.Selector) generic.Matcher {
|
||||
return generic.MatcherFunc(func(obj runtime.Object) (bool, error) {
|
||||
sa, ok := obj.(*expapi.ThirdPartyResource)
|
||||
sa, ok := obj.(*experimental.ThirdPartyResource)
|
||||
if !ok {
|
||||
return false, fmt.Errorf("not a ThirdPartyResource")
|
||||
}
|
||||
@@ -83,6 +83,6 @@ func Matcher(label labels.Selector, field fields.Selector) generic.Matcher {
|
||||
}
|
||||
|
||||
// SelectableFields returns a label set that can be used for filter selection
|
||||
func SelectableFields(obj *expapi.ThirdPartyResource) labels.Set {
|
||||
func SelectableFields(obj *experimental.ThirdPartyResource) labels.Set {
|
||||
return labels.Set{}
|
||||
}
|
||||
|
@@ -24,8 +24,8 @@ import (
|
||||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/meta"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/expapi/latest"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental/latest"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
)
|
||||
|
||||
@@ -86,7 +86,7 @@ func NewCodec(codec runtime.Codec, kind string) runtime.Codec {
|
||||
return &thirdPartyResourceDataCodec{codec, kind}
|
||||
}
|
||||
|
||||
func (t *thirdPartyResourceDataCodec) populate(objIn *expapi.ThirdPartyResourceData, data []byte) error {
|
||||
func (t *thirdPartyResourceDataCodec) populate(objIn *experimental.ThirdPartyResourceData, data []byte) error {
|
||||
var obj interface{}
|
||||
if err := json.Unmarshal(data, &obj); err != nil {
|
||||
fmt.Printf("Invalid JSON:\n%s\n", string(data))
|
||||
@@ -99,7 +99,7 @@ func (t *thirdPartyResourceDataCodec) populate(objIn *expapi.ThirdPartyResourceD
|
||||
return t.populateFromObject(objIn, mapObj, data)
|
||||
}
|
||||
|
||||
func (t *thirdPartyResourceDataCodec) populateFromObject(objIn *expapi.ThirdPartyResourceData, mapObj map[string]interface{}, data []byte) error {
|
||||
func (t *thirdPartyResourceDataCodec) populateFromObject(objIn *experimental.ThirdPartyResourceData, mapObj map[string]interface{}, data []byte) error {
|
||||
typeMeta := api.TypeMeta{}
|
||||
if err := json.Unmarshal(data, &typeMeta); err != nil {
|
||||
return err
|
||||
@@ -127,7 +127,7 @@ func (t *thirdPartyResourceDataCodec) populateFromObject(objIn *expapi.ThirdPart
|
||||
}
|
||||
|
||||
func (t *thirdPartyResourceDataCodec) Decode(data []byte) (runtime.Object, error) {
|
||||
result := &expapi.ThirdPartyResourceData{}
|
||||
result := &experimental.ThirdPartyResourceData{}
|
||||
if err := t.populate(result, data); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -148,7 +148,7 @@ func (t *thirdPartyResourceDataCodec) DecodeToVersion(data []byte, version strin
|
||||
}
|
||||
|
||||
func (t *thirdPartyResourceDataCodec) DecodeInto(data []byte, obj runtime.Object) error {
|
||||
thirdParty, ok := obj.(*expapi.ThirdPartyResourceData)
|
||||
thirdParty, ok := obj.(*experimental.ThirdPartyResourceData)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected object: %#v", obj)
|
||||
}
|
||||
@@ -156,7 +156,7 @@ func (t *thirdPartyResourceDataCodec) DecodeInto(data []byte, obj runtime.Object
|
||||
}
|
||||
|
||||
func (t *thirdPartyResourceDataCodec) DecodeIntoWithSpecifiedVersionKind(data []byte, obj runtime.Object, version, kind string) error {
|
||||
thirdParty, ok := obj.(*expapi.ThirdPartyResourceData)
|
||||
thirdParty, ok := obj.(*experimental.ThirdPartyResourceData)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected object: %#v", obj)
|
||||
}
|
||||
@@ -207,7 +207,7 @@ const template = `{
|
||||
"items": [ %s ]
|
||||
}`
|
||||
|
||||
func encodeToJSON(obj *expapi.ThirdPartyResourceData) ([]byte, error) {
|
||||
func encodeToJSON(obj *experimental.ThirdPartyResourceData) ([]byte, error) {
|
||||
var objOut interface{}
|
||||
if err := json.Unmarshal(obj.Data, &objOut); err != nil {
|
||||
return nil, err
|
||||
@@ -222,9 +222,9 @@ func encodeToJSON(obj *expapi.ThirdPartyResourceData) ([]byte, error) {
|
||||
|
||||
func (t *thirdPartyResourceDataCodec) Encode(obj runtime.Object) (data []byte, err error) {
|
||||
switch obj := obj.(type) {
|
||||
case *expapi.ThirdPartyResourceData:
|
||||
case *experimental.ThirdPartyResourceData:
|
||||
return encodeToJSON(obj)
|
||||
case *expapi.ThirdPartyResourceDataList:
|
||||
case *experimental.ThirdPartyResourceDataList:
|
||||
// TODO: There must be a better way to do this...
|
||||
buff := &bytes.Buffer{}
|
||||
dataStrings := make([]string, len(obj.Items))
|
||||
@@ -259,9 +259,9 @@ func (t *thirdPartyResourceDataCreator) New(version, kind string) (out runtime.O
|
||||
}
|
||||
switch kind {
|
||||
case "ThirdPartyResourceData":
|
||||
return &expapi.ThirdPartyResourceData{}, nil
|
||||
return &experimental.ThirdPartyResourceData{}, nil
|
||||
case "ThirdPartyResourceDataList":
|
||||
return &expapi.ThirdPartyResourceDataList{}, nil
|
||||
return &experimental.ThirdPartyResourceDataList{}, nil
|
||||
default:
|
||||
return t.delegate.New(latest.Version, kind)
|
||||
}
|
||||
|
@@ -23,7 +23,7 @@ import (
|
||||
"time"
|
||||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
"k8s.io/kubernetes/pkg/util"
|
||||
)
|
||||
|
||||
@@ -101,7 +101,7 @@ func TestCodec(t *testing.T) {
|
||||
}
|
||||
continue
|
||||
}
|
||||
rsrcObj, ok := obj.(*expapi.ThirdPartyResourceData)
|
||||
rsrcObj, ok := obj.(*experimental.ThirdPartyResourceData)
|
||||
if !ok {
|
||||
t.Errorf("[%s] unexpected object: %v", test.name, obj)
|
||||
continue
|
||||
|
@@ -20,7 +20,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/registry/generic"
|
||||
@@ -40,8 +40,8 @@ func NewREST(s storage.Interface, group, kind string) *REST {
|
||||
prefix := "/ThirdPartyResourceData/" + group + "/" + strings.ToLower(kind) + "s"
|
||||
|
||||
store := &etcdgeneric.Etcd{
|
||||
NewFunc: func() runtime.Object { return &expapi.ThirdPartyResourceData{} },
|
||||
NewListFunc: func() runtime.Object { return &expapi.ThirdPartyResourceDataList{} },
|
||||
NewFunc: func() runtime.Object { return &experimental.ThirdPartyResourceData{} },
|
||||
NewListFunc: func() runtime.Object { return &experimental.ThirdPartyResourceDataList{} },
|
||||
KeyRootFunc: func(ctx api.Context) string {
|
||||
return etcdgeneric.NamespaceKeyRootFunc(ctx, prefix)
|
||||
},
|
||||
@@ -49,7 +49,7 @@ func NewREST(s storage.Interface, group, kind string) *REST {
|
||||
return etcdgeneric.NamespaceKeyFunc(ctx, prefix, id)
|
||||
},
|
||||
ObjectNameFunc: func(obj runtime.Object) (string, error) {
|
||||
return obj.(*expapi.ThirdPartyResourceData).Name, nil
|
||||
return obj.(*experimental.ThirdPartyResourceData).Name, nil
|
||||
},
|
||||
PredicateFunc: func(label labels.Selector, field fields.Selector) generic.Matcher {
|
||||
return thirdpartyresourcedata.Matcher(label, field)
|
||||
|
@@ -20,9 +20,9 @@ import (
|
||||
"testing"
|
||||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
// Ensure that expapi/v1 package is initialized.
|
||||
_ "k8s.io/kubernetes/pkg/expapi/v1"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
// Ensure that experimental/v1 package is initialized.
|
||||
_ "k8s.io/kubernetes/pkg/apis/experimental/v1"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/registry/registrytest"
|
||||
@@ -35,8 +35,8 @@ func newStorage(t *testing.T) (*REST, *tools.FakeEtcdClient) {
|
||||
return NewREST(etcdStorage, "foo", "bar"), fakeClient
|
||||
}
|
||||
|
||||
func validNewThirdPartyResourceData(name string) *expapi.ThirdPartyResourceData {
|
||||
return &expapi.ThirdPartyResourceData{
|
||||
func validNewThirdPartyResourceData(name string) *experimental.ThirdPartyResourceData {
|
||||
return &experimental.ThirdPartyResourceData{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: name,
|
||||
Namespace: api.NamespaceDefault,
|
||||
@@ -54,7 +54,7 @@ func TestCreate(t *testing.T) {
|
||||
// valid
|
||||
rsrc,
|
||||
// invalid
|
||||
&expapi.ThirdPartyResourceData{},
|
||||
&experimental.ThirdPartyResourceData{},
|
||||
)
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ func TestUpdate(t *testing.T) {
|
||||
validNewThirdPartyResourceData("foo"),
|
||||
// updateFunc
|
||||
func(obj runtime.Object) runtime.Object {
|
||||
object := obj.(*expapi.ThirdPartyResourceData)
|
||||
object := obj.(*experimental.ThirdPartyResourceData)
|
||||
object.Data = []byte("new description")
|
||||
return object
|
||||
},
|
||||
|
@@ -19,7 +19,7 @@ package thirdpartyresourcedata
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/rest"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/watch"
|
||||
@@ -28,15 +28,15 @@ import (
|
||||
// Registry is an interface implemented by things that know how to store ThirdPartyResourceData objects.
|
||||
type Registry interface {
|
||||
// ListThirdPartyResourceData obtains a list of ThirdPartyResourceData having labels which match selector.
|
||||
ListThirdPartyResourceData(ctx api.Context, selector labels.Selector) (*expapi.ThirdPartyResourceDataList, error)
|
||||
ListThirdPartyResourceData(ctx api.Context, selector labels.Selector) (*experimental.ThirdPartyResourceDataList, error)
|
||||
// Watch for new/changed/deleted ThirdPartyResourceData
|
||||
WatchThirdPartyResourceData(ctx api.Context, label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)
|
||||
// Get a specific ThirdPartyResourceData
|
||||
GetThirdPartyResourceData(ctx api.Context, name string) (*expapi.ThirdPartyResourceData, error)
|
||||
GetThirdPartyResourceData(ctx api.Context, name string) (*experimental.ThirdPartyResourceData, error)
|
||||
// Create a ThirdPartyResourceData based on a specification.
|
||||
CreateThirdPartyResourceData(ctx api.Context, resource *expapi.ThirdPartyResourceData) (*expapi.ThirdPartyResourceData, error)
|
||||
CreateThirdPartyResourceData(ctx api.Context, resource *experimental.ThirdPartyResourceData) (*experimental.ThirdPartyResourceData, error)
|
||||
// Update an existing ThirdPartyResourceData
|
||||
UpdateThirdPartyResourceData(ctx api.Context, resource *expapi.ThirdPartyResourceData) (*expapi.ThirdPartyResourceData, error)
|
||||
UpdateThirdPartyResourceData(ctx api.Context, resource *experimental.ThirdPartyResourceData) (*experimental.ThirdPartyResourceData, error)
|
||||
// Delete an existing ThirdPartyResourceData
|
||||
DeleteThirdPartyResourceData(ctx api.Context, name string) error
|
||||
}
|
||||
@@ -52,34 +52,34 @@ func NewRegistry(s rest.StandardStorage) Registry {
|
||||
return &storage{s}
|
||||
}
|
||||
|
||||
func (s *storage) ListThirdPartyResourceData(ctx api.Context, label labels.Selector) (*expapi.ThirdPartyResourceDataList, error) {
|
||||
func (s *storage) ListThirdPartyResourceData(ctx api.Context, label labels.Selector) (*experimental.ThirdPartyResourceDataList, error) {
|
||||
obj, err := s.List(ctx, label, fields.Everything())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*expapi.ThirdPartyResourceDataList), nil
|
||||
return obj.(*experimental.ThirdPartyResourceDataList), nil
|
||||
}
|
||||
|
||||
func (s *storage) WatchThirdPartyResourceData(ctx api.Context, label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error) {
|
||||
return s.Watch(ctx, label, field, resourceVersion)
|
||||
}
|
||||
|
||||
func (s *storage) GetThirdPartyResourceData(ctx api.Context, name string) (*expapi.ThirdPartyResourceData, error) {
|
||||
func (s *storage) GetThirdPartyResourceData(ctx api.Context, name string) (*experimental.ThirdPartyResourceData, error) {
|
||||
obj, err := s.Get(ctx, name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*expapi.ThirdPartyResourceData), nil
|
||||
return obj.(*experimental.ThirdPartyResourceData), nil
|
||||
}
|
||||
|
||||
func (s *storage) CreateThirdPartyResourceData(ctx api.Context, ThirdPartyResourceData *expapi.ThirdPartyResourceData) (*expapi.ThirdPartyResourceData, error) {
|
||||
func (s *storage) CreateThirdPartyResourceData(ctx api.Context, ThirdPartyResourceData *experimental.ThirdPartyResourceData) (*experimental.ThirdPartyResourceData, error) {
|
||||
obj, err := s.Create(ctx, ThirdPartyResourceData)
|
||||
return obj.(*expapi.ThirdPartyResourceData), err
|
||||
return obj.(*experimental.ThirdPartyResourceData), err
|
||||
}
|
||||
|
||||
func (s *storage) UpdateThirdPartyResourceData(ctx api.Context, ThirdPartyResourceData *expapi.ThirdPartyResourceData) (*expapi.ThirdPartyResourceData, error) {
|
||||
func (s *storage) UpdateThirdPartyResourceData(ctx api.Context, ThirdPartyResourceData *experimental.ThirdPartyResourceData) (*experimental.ThirdPartyResourceData, error) {
|
||||
obj, _, err := s.Update(ctx, ThirdPartyResourceData)
|
||||
return obj.(*expapi.ThirdPartyResourceData), err
|
||||
return obj.(*experimental.ThirdPartyResourceData), err
|
||||
}
|
||||
|
||||
func (s *storage) DeleteThirdPartyResourceData(ctx api.Context, name string) error {
|
||||
|
@@ -21,8 +21,8 @@ import (
|
||||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/rest"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/expapi/validation"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental/validation"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/registry/generic"
|
||||
@@ -52,7 +52,7 @@ func (strategy) PrepareForCreate(obj runtime.Object) {
|
||||
}
|
||||
|
||||
func (strategy) Validate(ctx api.Context, obj runtime.Object) fielderrors.ValidationErrorList {
|
||||
return validation.ValidateThirdPartyResourceData(obj.(*expapi.ThirdPartyResourceData))
|
||||
return validation.ValidateThirdPartyResourceData(obj.(*experimental.ThirdPartyResourceData))
|
||||
}
|
||||
|
||||
func (strategy) AllowCreateOnUpdate() bool {
|
||||
@@ -63,7 +63,7 @@ func (strategy) PrepareForUpdate(obj, old runtime.Object) {
|
||||
}
|
||||
|
||||
func (strategy) ValidateUpdate(ctx api.Context, obj, old runtime.Object) fielderrors.ValidationErrorList {
|
||||
return validation.ValidateThirdPartyResourceDataUpdate(old.(*expapi.ThirdPartyResourceData), obj.(*expapi.ThirdPartyResourceData))
|
||||
return validation.ValidateThirdPartyResourceDataUpdate(old.(*experimental.ThirdPartyResourceData), obj.(*experimental.ThirdPartyResourceData))
|
||||
}
|
||||
|
||||
func (strategy) AllowUnconditionalUpdate() bool {
|
||||
@@ -73,7 +73,7 @@ func (strategy) AllowUnconditionalUpdate() bool {
|
||||
// Matcher returns a generic matcher for a given label and field selector.
|
||||
func Matcher(label labels.Selector, field fields.Selector) generic.Matcher {
|
||||
return generic.MatcherFunc(func(obj runtime.Object) (bool, error) {
|
||||
sa, ok := obj.(*expapi.ThirdPartyResourceData)
|
||||
sa, ok := obj.(*experimental.ThirdPartyResourceData)
|
||||
if !ok {
|
||||
return false, fmt.Errorf("not a ThirdPartyResourceData")
|
||||
}
|
||||
@@ -83,6 +83,6 @@ func Matcher(label labels.Selector, field fields.Selector) generic.Matcher {
|
||||
}
|
||||
|
||||
// SelectableFields returns a label set that can be used for filter selection
|
||||
func SelectableFields(obj *expapi.ThirdPartyResourceData) labels.Set {
|
||||
func SelectableFields(obj *experimental.ThirdPartyResourceData) labels.Set {
|
||||
return labels.Set{}
|
||||
}
|
||||
|
@@ -20,7 +20,7 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
)
|
||||
|
||||
func convertToCamelCase(input string) string {
|
||||
@@ -40,7 +40,7 @@ func convertToCamelCase(input string) string {
|
||||
return result
|
||||
}
|
||||
|
||||
func ExtractApiGroupAndKind(rsrc *expapi.ThirdPartyResource) (kind string, group string, err error) {
|
||||
func ExtractApiGroupAndKind(rsrc *experimental.ThirdPartyResource) (kind string, group string, err error) {
|
||||
parts := strings.Split(rsrc.Name, ".")
|
||||
if len(parts) < 3 {
|
||||
return "", "", fmt.Errorf("unexpectedly short resource name: %s, expected at least <kind>.<domain>.<tld>", rsrc.Name)
|
||||
|
@@ -20,7 +20,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
)
|
||||
|
||||
func TestExtractAPIGroupAndKind(t *testing.T) {
|
||||
@@ -47,7 +47,7 @@ func TestExtractAPIGroupAndKind(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
kind, group, err := ExtractApiGroupAndKind(&expapi.ThirdPartyResource{ObjectMeta: api.ObjectMeta{Name: test.input}})
|
||||
kind, group, err := ExtractApiGroupAndKind(&experimental.ThirdPartyResource{ObjectMeta: api.ObjectMeta{Name: test.input}})
|
||||
if err != nil && !test.expectErr {
|
||||
t.Errorf("unexpected error: %v", err)
|
||||
continue
|
||||
|
@@ -21,7 +21,7 @@ import (
|
||||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/resource"
|
||||
"k8s.io/kubernetes/pkg/expapi"
|
||||
"k8s.io/kubernetes/pkg/apis/experimental"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
)
|
||||
@@ -101,13 +101,13 @@ var _ = Describe("Horizontal pod autoscaling", func() {
|
||||
})
|
||||
|
||||
func createHorizontalPodAutoscaler(rc *ResourceConsumer, cpu string) {
|
||||
hpa := &expapi.HorizontalPodAutoscaler{
|
||||
hpa := &experimental.HorizontalPodAutoscaler{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: rc.name,
|
||||
Namespace: rc.framework.Namespace.Name,
|
||||
},
|
||||
Spec: expapi.HorizontalPodAutoscalerSpec{
|
||||
ScaleRef: &expapi.SubresourceReference{
|
||||
Spec: experimental.HorizontalPodAutoscalerSpec{
|
||||
ScaleRef: &experimental.SubresourceReference{
|
||||
Kind: "replicationController",
|
||||
Name: rc.name,
|
||||
Namespace: rc.framework.Namespace.Name,
|
||||
@@ -115,7 +115,7 @@ func createHorizontalPodAutoscaler(rc *ResourceConsumer, cpu string) {
|
||||
},
|
||||
MinCount: 1,
|
||||
MaxCount: 5,
|
||||
Target: expapi.ResourceConsumption{Resource: api.ResourceCPU, Quantity: resource.MustParse(cpu)},
|
||||
Target: experimental.ResourceConsumption{Resource: api.ResourceCPU, Quantity: resource.MustParse(cpu)},
|
||||
},
|
||||
}
|
||||
_, errHPA := rc.framework.Client.Experimental().HorizontalPodAutoscalers(rc.framework.Namespace.Name).Create(hpa)
|
||||
|
@@ -29,11 +29,11 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/latest"
|
||||
"k8s.io/kubernetes/pkg/api/testapi"
|
||||
explatest "k8s.io/kubernetes/pkg/apis/experimental/latest"
|
||||
"k8s.io/kubernetes/pkg/apiserver"
|
||||
"k8s.io/kubernetes/pkg/client/record"
|
||||
client "k8s.io/kubernetes/pkg/client/unversioned"
|
||||
"k8s.io/kubernetes/pkg/controller/replication"
|
||||
explatest "k8s.io/kubernetes/pkg/expapi/latest"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/kubectl"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
|
Reference in New Issue
Block a user