Commit fa557f61 authored by k8s-merge-robot's avatar k8s-merge-robot

Merge pull request #15409 from caesarxuchao/extension/v1beta1

Auto commit by PR queue bot
parents dfbad569 3a2e0012
...@@ -64,7 +64,7 @@ TEST_CLUSTER_LOG_LEVEL="${TEST_CLUSTER_LOG_LEVEL:---v=4}" ...@@ -64,7 +64,7 @@ TEST_CLUSTER_LOG_LEVEL="${TEST_CLUSTER_LOG_LEVEL:---v=4}"
TEST_CLUSTER_RESYNC_PERIOD="${TEST_CLUSTER_RESYNC_PERIOD:---min-resync-period=3m}" TEST_CLUSTER_RESYNC_PERIOD="${TEST_CLUSTER_RESYNC_PERIOD:---min-resync-period=3m}"
KUBELET_TEST_ARGS="--max-pods=100 $TEST_CLUSTER_LOG_LEVEL" KUBELET_TEST_ARGS="--max-pods=100 $TEST_CLUSTER_LOG_LEVEL"
APISERVER_TEST_ARGS="--runtime-config=experimental/v1alpha1 ${TEST_CLUSTER_LOG_LEVEL}" APISERVER_TEST_ARGS="--runtime-config=extensions/v1beta1 ${TEST_CLUSTER_LOG_LEVEL}"
CONTROLLER_MANAGER_TEST_ARGS="${TEST_CLUSTER_LOG_LEVEL} ${TEST_CLUSTER_RESYNC_PERIOD}" CONTROLLER_MANAGER_TEST_ARGS="${TEST_CLUSTER_LOG_LEVEL} ${TEST_CLUSTER_RESYNC_PERIOD}"
SCHEDULER_TEST_ARGS="${TEST_CLUSTER_LOG_LEVEL}" SCHEDULER_TEST_ARGS="${TEST_CLUSTER_LOG_LEVEL}"
KUBEPROXY_TEST_ARGS="${TEST_CLUSTER_LOG_LEVEL}" KUBEPROXY_TEST_ARGS="${TEST_CLUSTER_LOG_LEVEL}"
......
...@@ -57,10 +57,10 @@ function join_csv { ...@@ -57,10 +57,10 @@ function join_csv {
function verify-prereqs { function verify-prereqs {
if [[ "${ENABLE_EXPERIMENTAL_API}" == "true" ]]; then if [[ "${ENABLE_EXPERIMENTAL_API}" == "true" ]]; then
if [[ -z "${RUNTIME_CONFIG}" ]]; then if [[ -z "${RUNTIME_CONFIG}" ]]; then
RUNTIME_CONFIG="experimental/v1alpha1=true" RUNTIME_CONFIG="extensions/v1beta1=true"
else else
# TODO: add checking if RUNTIME_CONFIG contains "experimental/v1alpha1=false" and appending "experimental/v1alpha1=true" if not. # TODO: add checking if RUNTIME_CONFIG contains "extensions/v1beta1=false" and appending "extensions/v1beta1=true" if not.
if echo "${RUNTIME_CONFIG}" | grep -q -v "experimental/v1alpha1=true"; then if echo "${RUNTIME_CONFIG}" | grep -q -v "extensions/v1beta1=true"; then
echo "Experimental API should be turned on, but is not turned on in RUNTIME_CONFIG!" >&2 echo "Experimental API should be turned on, but is not turned on in RUNTIME_CONFIG!" >&2
exit 1 exit 1
fi fi
......
...@@ -36,10 +36,10 @@ function detect-minions { ...@@ -36,10 +36,10 @@ function detect-minions {
function verify-prereqs { function verify-prereqs {
if [[ "${ENABLE_EXPERIMENTAL_API}" == "true" ]]; then if [[ "${ENABLE_EXPERIMENTAL_API}" == "true" ]]; then
if [[ -z "${RUNTIME_CONFIG}" ]]; then if [[ -z "${RUNTIME_CONFIG}" ]]; then
RUNTIME_CONFIG="experimental/v1alpha1" RUNTIME_CONFIG="extensions/v1beta1"
else else
# TODO: add checking if RUNTIME_CONFIG contains "experimental/v1=false" and appending "experimental/v1=true" if not. # TODO: add checking if RUNTIME_CONFIG contains "experimental/v1=false" and appending "experimental/v1=true" if not.
if echo "${RUNTIME_CONFIG}" | grep -q -v "experimental/v1alpha1=true"; then if echo "${RUNTIME_CONFIG}" | grep -q -v "extensions/v1beta1=true"; then
echo "Experimental API should be turned on, but is not turned on in RUNTIME_CONFIG!" echo "Experimental API should be turned on, but is not turned on in RUNTIME_CONFIG!"
exit 1 exit 1
fi fi
......
...@@ -27,8 +27,8 @@ import ( ...@@ -27,8 +27,8 @@ import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
_ "k8s.io/kubernetes/pkg/api/v1" _ "k8s.io/kubernetes/pkg/api/v1"
_ "k8s.io/kubernetes/pkg/apis/experimental" _ "k8s.io/kubernetes/pkg/apis/extensions"
_ "k8s.io/kubernetes/pkg/apis/experimental/v1alpha1" _ "k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
pkg_runtime "k8s.io/kubernetes/pkg/runtime" pkg_runtime "k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/util/sets" "k8s.io/kubernetes/pkg/util/sets"
......
...@@ -27,8 +27,8 @@ import ( ...@@ -27,8 +27,8 @@ import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
_ "k8s.io/kubernetes/pkg/api/v1" _ "k8s.io/kubernetes/pkg/api/v1"
_ "k8s.io/kubernetes/pkg/apis/experimental" _ "k8s.io/kubernetes/pkg/apis/extensions"
_ "k8s.io/kubernetes/pkg/apis/experimental/v1alpha1" _ "k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
pkg_runtime "k8s.io/kubernetes/pkg/runtime" pkg_runtime "k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/util/sets" "k8s.io/kubernetes/pkg/util/sets"
......
...@@ -135,7 +135,7 @@ func startComponents(firstManifestURL, secondManifestURL string) (string, string ...@@ -135,7 +135,7 @@ func startComponents(firstManifestURL, secondManifestURL string) (string, string
// TODO: caesarxuchao: hacky way to specify version of Experimental client. // TODO: caesarxuchao: hacky way to specify version of Experimental client.
// We will fix this by supporting multiple group versions in Config // We will fix this by supporting multiple group versions in Config
cl.ExperimentalClient = client.NewExperimentalOrDie(&client.Config{Host: apiServer.URL, Version: testapi.Experimental.GroupAndVersion()}) cl.ExperimentalClient = client.NewExperimentalOrDie(&client.Config{Host: apiServer.URL, Version: testapi.Extensions.GroupAndVersion()})
storageVersions := make(map[string]string) storageVersions := make(map[string]string)
etcdStorage, err := master.NewEtcdStorage(etcdClient, latest.GroupOrDie("").InterfacesFor, testapi.Default.GroupAndVersion(), etcdtest.PathPrefix()) etcdStorage, err := master.NewEtcdStorage(etcdClient, latest.GroupOrDie("").InterfacesFor, testapi.Default.GroupAndVersion(), etcdtest.PathPrefix())
...@@ -143,14 +143,14 @@ func startComponents(firstManifestURL, secondManifestURL string) (string, string ...@@ -143,14 +143,14 @@ func startComponents(firstManifestURL, secondManifestURL string) (string, string
if err != nil { if err != nil {
glog.Fatalf("Unable to get etcd storage: %v", err) glog.Fatalf("Unable to get etcd storage: %v", err)
} }
expEtcdStorage, err := master.NewEtcdStorage(etcdClient, latest.GroupOrDie("experimental").InterfacesFor, testapi.Experimental.GroupAndVersion(), etcdtest.PathPrefix()) expEtcdStorage, err := master.NewEtcdStorage(etcdClient, latest.GroupOrDie("extensions").InterfacesFor, testapi.Extensions.GroupAndVersion(), etcdtest.PathPrefix())
storageVersions["experimental"] = testapi.Experimental.GroupAndVersion() storageVersions["extensions"] = testapi.Extensions.GroupAndVersion()
if err != nil { if err != nil {
glog.Fatalf("Unable to get etcd storage for experimental: %v", err) glog.Fatalf("Unable to get etcd storage for experimental: %v", err)
} }
storageDestinations := master.NewStorageDestinations() storageDestinations := master.NewStorageDestinations()
storageDestinations.AddAPIGroup("", etcdStorage) storageDestinations.AddAPIGroup("", etcdStorage)
storageDestinations.AddAPIGroup("experimental", expEtcdStorage) storageDestinations.AddAPIGroup("extensions", expEtcdStorage)
// Master // Master
host, port, err := net.SplitHostPort(strings.TrimLeft(apiServer.URL, "http://")) host, port, err := net.SplitHostPort(strings.TrimLeft(apiServer.URL, "http://"))
...@@ -985,7 +985,7 @@ func main() { ...@@ -985,7 +985,7 @@ func main() {
kubeClient := client.NewOrDie(&client.Config{Host: apiServerURL, Version: testapi.Default.GroupAndVersion()}) kubeClient := client.NewOrDie(&client.Config{Host: apiServerURL, Version: testapi.Default.GroupAndVersion()})
// TODO: caesarxuchao: hacky way to specify version of Experimental client. // TODO: caesarxuchao: hacky way to specify version of Experimental client.
// We will fix this by supporting multiple group versions in Config // We will fix this by supporting multiple group versions in Config
kubeClient.ExperimentalClient = client.NewExperimentalOrDie(&client.Config{Host: apiServerURL, Version: testapi.Experimental.GroupAndVersion()}) kubeClient.ExperimentalClient = client.NewExperimentalOrDie(&client.Config{Host: apiServerURL, Version: testapi.Extensions.GroupAndVersion()})
// Run tests in parallel // Run tests in parallel
testFuncs := []testFunc{ testFuncs := []testFunc{
......
...@@ -401,9 +401,9 @@ func (s *APIServer) Run(_ []string) error { ...@@ -401,9 +401,9 @@ func (s *APIServer) Run(_ []string) error {
disableV1 := disableAllAPIs disableV1 := disableAllAPIs
disableV1 = !s.getRuntimeConfigValue("api/v1", !disableV1) disableV1 = !s.getRuntimeConfigValue("api/v1", !disableV1)
// "experimental/v1alpha1={true|false} allows users to enable/disable the experimental API. // "extensions/v1beta1={true|false} allows users to enable/disable the experimental API.
// This takes preference over api/all, if specified. // This takes preference over api/all, if specified.
enableExp := s.getRuntimeConfigValue("experimental/v1alpha1", false) enableExp := s.getRuntimeConfigValue("extensions/v1beta1", false)
clientConfig := &client.Config{ clientConfig := &client.Config{
Host: net.JoinHostPort(s.InsecureBindAddress.String(), strconv.Itoa(s.InsecurePort)), Host: net.JoinHostPort(s.InsecureBindAddress.String(), strconv.Itoa(s.InsecurePort)),
...@@ -432,7 +432,7 @@ func (s *APIServer) Run(_ []string) error { ...@@ -432,7 +432,7 @@ func (s *APIServer) Run(_ []string) error {
storageDestinations.AddAPIGroup("", etcdStorage) storageDestinations.AddAPIGroup("", etcdStorage)
if enableExp { if enableExp {
expGroup, err := latest.Group("experimental") expGroup, err := latest.Group("extensions")
if err != nil { if err != nil {
glog.Fatalf("experimental API is enabled in runtime config, but not enabled in the environment variable KUBE_API_VERSIONS. Error: %v", err) glog.Fatalf("experimental API is enabled in runtime config, but not enabled in the environment variable KUBE_API_VERSIONS. Error: %v", err)
} }
...@@ -443,7 +443,7 @@ func (s *APIServer) Run(_ []string) error { ...@@ -443,7 +443,7 @@ func (s *APIServer) Run(_ []string) error {
if err != nil { if err != nil {
glog.Fatalf("Invalid experimental storage version or misconfigured etcd: %v", err) glog.Fatalf("Invalid experimental storage version or misconfigured etcd: %v", err)
} }
storageDestinations.AddAPIGroup("experimental", expEtcdStorage) storageDestinations.AddAPIGroup("extensions", expEtcdStorage)
} }
updateEtcdOverrides(s.EtcdServersOverrides, storageVersions, s.EtcdPathPrefix, &storageDestinations, newEtcd) updateEtcdOverrides(s.EtcdServersOverrides, storageVersions, s.EtcdPathPrefix, &storageDestinations, newEtcd)
......
...@@ -76,18 +76,18 @@ func TestGenerateStorageVersionMap(t *testing.T) { ...@@ -76,18 +76,18 @@ func TestGenerateStorageVersionMap(t *testing.T) {
}{ }{
{ {
legacyVersion: "v1", legacyVersion: "v1",
storageVersions: "v1,experimental/v1alpha1", storageVersions: "v1,extensions/v1beta1",
expectedMap: map[string]string{ expectedMap: map[string]string{
"": "v1", "": "v1",
"experimental": "experimental/v1alpha1", "extensions": "extensions/v1beta1",
}, },
}, },
{ {
legacyVersion: "", legacyVersion: "",
storageVersions: "experimental/v1alpha1,v1", storageVersions: "extensions/v1beta1,v1",
expectedMap: map[string]string{ expectedMap: map[string]string{
"": "v1", "": "v1",
"experimental": "experimental/v1alpha1", "extensions": "extensions/v1beta1",
}, },
}, },
{ {
...@@ -105,7 +105,7 @@ func TestGenerateStorageVersionMap(t *testing.T) { ...@@ -105,7 +105,7 @@ func TestGenerateStorageVersionMap(t *testing.T) {
} }
func TestUpdateEtcdOverrides(t *testing.T) { func TestUpdateEtcdOverrides(t *testing.T) {
storageVersions := generateStorageVersionMap("", "v1,experimental/v1alpha1") storageVersions := generateStorageVersionMap("", "v1,extensions/v1beta1")
testCases := []struct { testCases := []struct {
apigroup string apigroup string
...@@ -123,7 +123,7 @@ func TestUpdateEtcdOverrides(t *testing.T) { ...@@ -123,7 +123,7 @@ func TestUpdateEtcdOverrides(t *testing.T) {
servers: []string{"http://127.0.0.1:10000", "http://127.0.0.1:20000"}, servers: []string{"http://127.0.0.1:10000", "http://127.0.0.1:20000"},
}, },
{ {
apigroup: "experimental", apigroup: "extensions",
resource: "resource", resource: "resource",
servers: []string{"http://127.0.0.1:10000"}, servers: []string{"http://127.0.0.1:10000"},
}, },
......
...@@ -19,5 +19,5 @@ package main ...@@ -19,5 +19,5 @@ package main
// These imports are the API groups the kube-version-change tool will support. // These imports are the API groups the kube-version-change tool will support.
import ( import (
_ "k8s.io/kubernetes/pkg/api/install" _ "k8s.io/kubernetes/pkg/api/install"
_ "k8s.io/kubernetes/pkg/apis/experimental/install" _ "k8s.io/kubernetes/pkg/apis/extensions/install"
) )
apiVersion: experimental/v1alpha1 apiVersion: extensions/v1beta1
kind: DaemonSet kind: DaemonSet
metadata: metadata:
name: prometheus-node-exporter name: prometheus-node-exporter
......
apiVersion: experimental/v1alpha1 apiVersion: extensions/v1beta1
kind: Job kind: Job
metadata: metadata:
name: pi name: pi
......
...@@ -70,7 +70,7 @@ It takes around 10s to complete. ...@@ -70,7 +70,7 @@ It takes around 10s to complete.
<!-- BEGIN MUNGE: EXAMPLE job.yaml --> <!-- BEGIN MUNGE: EXAMPLE job.yaml -->
```yaml ```yaml
apiVersion: experimental/v1alpha1 apiVersion: extensions/v1beta1
kind: Job kind: Job
metadata: metadata:
name: pi name: pi
......
...@@ -29,8 +29,8 @@ import ( ...@@ -29,8 +29,8 @@ import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/testapi" "k8s.io/kubernetes/pkg/api/testapi"
"k8s.io/kubernetes/pkg/api/validation" "k8s.io/kubernetes/pkg/api/validation"
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
expValidation "k8s.io/kubernetes/pkg/apis/experimental/validation" expValidation "k8s.io/kubernetes/pkg/apis/extensions/validation"
"k8s.io/kubernetes/pkg/capabilities" "k8s.io/kubernetes/pkg/capabilities"
"k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/util/yaml" "k8s.io/kubernetes/pkg/util/yaml"
...@@ -101,17 +101,17 @@ func validateObject(obj runtime.Object) (errors []error) { ...@@ -101,17 +101,17 @@ func validateObject(obj runtime.Object) (errors []error) {
t.Namespace = api.NamespaceDefault t.Namespace = api.NamespaceDefault
} }
errors = validation.ValidateResourceQuota(t) errors = validation.ValidateResourceQuota(t)
case *experimental.Deployment: case *extensions.Deployment:
if t.Namespace == "" { if t.Namespace == "" {
t.Namespace = api.NamespaceDefault t.Namespace = api.NamespaceDefault
} }
errors = expValidation.ValidateDeployment(t) errors = expValidation.ValidateDeployment(t)
case *experimental.Job: case *extensions.Job:
if t.Namespace == "" { if t.Namespace == "" {
t.Namespace = api.NamespaceDefault t.Namespace = api.NamespaceDefault
} }
errors = expValidation.ValidateJob(t) errors = expValidation.ValidateJob(t)
case *experimental.DaemonSet: case *extensions.DaemonSet:
if t.Namespace == "" { if t.Namespace == "" {
t.Namespace = api.NamespaceDefault t.Namespace = api.NamespaceDefault
} }
...@@ -221,10 +221,10 @@ func TestExampleObjectSchemas(t *testing.T) { ...@@ -221,10 +221,10 @@ func TestExampleObjectSchemas(t *testing.T) {
"multi-pod": nil, "multi-pod": nil,
"pod": &api.Pod{}, "pod": &api.Pod{},
"replication": &api.ReplicationController{}, "replication": &api.ReplicationController{},
"job": &experimental.Job{}, "job": &extensions.Job{},
}, },
"../docs/admin": { "../docs/admin": {
"daemon": &experimental.DaemonSet{}, "daemon": &extensions.DaemonSet{},
}, },
"../examples": { "../examples": {
"scheduler-policy-config": &schedulerapi.Policy{}, "scheduler-policy-config": &schedulerapi.Policy{},
...@@ -364,7 +364,7 @@ func TestExampleObjectSchemas(t *testing.T) { ...@@ -364,7 +364,7 @@ func TestExampleObjectSchemas(t *testing.T) {
"fc": &api.Pod{}, "fc": &api.Pod{},
}, },
"../examples/experimental": { "../examples/experimental": {
"deployment": &experimental.Deployment{}, "deployment": &extensions.Deployment{},
}, },
"../examples/javaweb-tomcat-sidecar": { "../examples/javaweb-tomcat-sidecar": {
"javaweb": &api.Pod{}, "javaweb": &api.Pod{},
......
apiVersion: experimental/v1alpha1 apiVersion: extensions/v1beta1
kind: Deployment kind: Deployment
metadata: metadata:
name: nginx-deployment name: nginx-deployment
......
...@@ -43,7 +43,7 @@ EOF ...@@ -43,7 +43,7 @@ EOF
} }
# TODO(lavalamp): get this list by listing the pkg/apis/ directory? # TODO(lavalamp): get this list by listing the pkg/apis/ directory?
DEFAULT_GROUP_VERSIONS="v1 experimental/v1alpha1" DEFAULT_GROUP_VERSIONS="v1 extensions/v1beta1"
VERSIONS=${VERSIONS:-$DEFAULT_GROUP_VERSIONS} VERSIONS=${VERSIONS:-$DEFAULT_GROUP_VERSIONS}
for ver in $VERSIONS; do for ver in $VERSIONS; do
# Ensure that the version being processed is registered by setting # Ensure that the version being processed is registered by setting
......
...@@ -57,6 +57,6 @@ function generate_deep_copies() { ...@@ -57,6 +57,6 @@ function generate_deep_copies() {
} }
# v1 is in the group "" # v1 is in the group ""
DEFAULT_VERSIONS="/ v1 experimental/ experimental/v1alpha1" DEFAULT_VERSIONS="/ v1 extensions/ extensions/v1beta1"
VERSIONS=${VERSIONS:-$DEFAULT_VERSIONS} VERSIONS=${VERSIONS:-$DEFAULT_VERSIONS}
generate_deep_copies "$VERSIONS" generate_deep_copies "$VERSIONS"
...@@ -50,7 +50,7 @@ kube::etcd::start ...@@ -50,7 +50,7 @@ kube::etcd::start
# Start kube-apiserver # Start kube-apiserver
kube::log::status "Starting kube-apiserver" kube::log::status "Starting kube-apiserver"
KUBE_API_VERSIONS="v1,experimental/v1alpha1" "${KUBE_OUTPUT_HOSTBIN}/kube-apiserver" \ KUBE_API_VERSIONS="v1,extensions/v1beta1" "${KUBE_OUTPUT_HOSTBIN}/kube-apiserver" \
--address="127.0.0.1" \ --address="127.0.0.1" \
--public-address-override="127.0.0.1" \ --public-address-override="127.0.0.1" \
--port="${API_PORT}" \ --port="${API_PORT}" \
......
...@@ -23,7 +23,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh" ...@@ -23,7 +23,7 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
kube::golang::setup_env kube::golang::setup_env
APIROOTS=${APIROOTS:-pkg/api pkg/apis/experimental} APIROOTS=${APIROOTS:-pkg/api pkg/apis/extensions}
_tmp="${KUBE_ROOT}/_tmp" _tmp="${KUBE_ROOT}/_tmp"
cleanup() { cleanup() {
......
...@@ -25,7 +25,7 @@ kube::golang::setup_env ...@@ -25,7 +25,7 @@ kube::golang::setup_env
gendeepcopy=$(kube::util::find-binary "gendeepcopy") gendeepcopy=$(kube::util::find-binary "gendeepcopy")
APIROOTS=${APIROOTS:-pkg/api pkg/apis/experimental} APIROOTS=${APIROOTS:-pkg/api pkg/apis/extensions}
_tmp="${KUBE_ROOT}/_tmp" _tmp="${KUBE_ROOT}/_tmp"
cleanup() { cleanup() {
......
...@@ -242,7 +242,7 @@ kube::util::analytics-link() { ...@@ -242,7 +242,7 @@ kube::util::analytics-link() {
# Takes a group/version and returns the path to its location on disk, sans # Takes a group/version and returns the path to its location on disk, sans
# "pkg". E.g.: # "pkg". E.g.:
# * default behavior: experimental/v1alpha1 -> apis/experimental/v1alpha1 # * default behavior: extensions/v1beta1 -> apis/extensions/v1beta1
# * default behavior for only a group: experimental -> apis/experimental # * default behavior for only a group: experimental -> apis/experimental
# * Special handling for empty group: v1 -> api/v1, unversioned -> api/unversioned # * Special handling for empty group: v1 -> api/v1, unversioned -> api/unversioned
# * Very special handling for when both group and version are "": / -> api # * Very special handling for when both group and version are "": / -> api
......
...@@ -127,7 +127,7 @@ kube::util::wait_for_url "http://127.0.0.1:${KUBELET_HEALTHZ_PORT}/healthz" "kub ...@@ -127,7 +127,7 @@ kube::util::wait_for_url "http://127.0.0.1:${KUBELET_HEALTHZ_PORT}/healthz" "kub
# Start kube-apiserver # Start kube-apiserver
kube::log::status "Starting kube-apiserver" kube::log::status "Starting kube-apiserver"
KUBE_API_VERSIONS="v1,experimental/v1alpha1" "${KUBE_OUTPUT_HOSTBIN}/kube-apiserver" \ KUBE_API_VERSIONS="v1,extensions/v1beta1" "${KUBE_OUTPUT_HOSTBIN}/kube-apiserver" \
--address="127.0.0.1" \ --address="127.0.0.1" \
--public-address-override="127.0.0.1" \ --public-address-override="127.0.0.1" \
--port="${API_PORT}" \ --port="${API_PORT}" \
...@@ -905,7 +905,7 @@ kube_api_versions=( ...@@ -905,7 +905,7 @@ kube_api_versions=(
v1 v1
) )
for version in "${kube_api_versions[@]}"; do for version in "${kube_api_versions[@]}"; do
KUBE_API_VERSIONS="v1,experimental/v1alpha1" runTests "${version}" KUBE_API_VERSIONS="v1,extensions/v1beta1" runTests "${version}"
done done
kube::log::status "TEST PASSED" kube::log::status "TEST PASSED"
...@@ -57,8 +57,8 @@ KUBE_GOVERALLS_BIN=${KUBE_GOVERALLS_BIN:-} ...@@ -57,8 +57,8 @@ KUBE_GOVERALLS_BIN=${KUBE_GOVERALLS_BIN:-}
# separated by comma, lists are separated by semicolon. e.g., # separated by comma, lists are separated by semicolon. e.g.,
# "v1,compute/v1alpha1,experimental/v1alpha2;v1,compute/v2,experimental/v1alpha3" # "v1,compute/v1alpha1,experimental/v1alpha2;v1,compute/v2,experimental/v1alpha3"
# TODO: It's going to be: # TODO: It's going to be:
# KUBE_TEST_API_VERSIONS=${KUBE_TEST_API_VERSIONS:-"v1,experimental/v1alpha1"} # KUBE_TEST_API_VERSIONS=${KUBE_TEST_API_VERSIONS:-"v1,extensions/v1beta1"}
KUBE_TEST_API_VERSIONS=${KUBE_TEST_API_VERSIONS:-"v1,experimental/v1alpha1"} KUBE_TEST_API_VERSIONS=${KUBE_TEST_API_VERSIONS:-"v1,extensions/v1beta1"}
# once we have multiple group supports # once we have multiple group supports
# Run tests with the standard (registry) and a custom etcd prefix # Run tests with the standard (registry) and a custom etcd prefix
# (kubernetes.io/registry). # (kubernetes.io/registry).
...@@ -315,7 +315,7 @@ for (( i=0, j=0; ; )); do ...@@ -315,7 +315,7 @@ for (( i=0, j=0; ; )); do
# KUBE_TEST_API sets the version of each group to be tested. KUBE_API_VERSIONS # KUBE_TEST_API sets the version of each group to be tested. KUBE_API_VERSIONS
# register the groups/versions as supported by k8s. So KUBE_API_VERSIONS # register the groups/versions as supported by k8s. So KUBE_API_VERSIONS
# needs to be the superset of KUBE_TEST_API. # needs to be the superset of KUBE_TEST_API.
KUBE_TEST_API="${apiVersion}" KUBE_API_VERSIONS="v1,experimental/v1alpha1" ETCD_PREFIX=${etcdPrefix} runTests "$@" KUBE_TEST_API="${apiVersion}" KUBE_API_VERSIONS="v1,extensions/v1beta1" ETCD_PREFIX=${etcdPrefix} runTests "$@"
i=${i}+1 i=${i}+1
j=${j}+1 j=${j}+1
if [[ i -eq ${apiVersionsCount} ]] && [[ j -eq ${etcdPrefixesCount} ]]; then if [[ i -eq ${apiVersionsCount} ]] && [[ j -eq ${etcdPrefixesCount} ]]; then
......
...@@ -28,8 +28,8 @@ source "${KUBE_ROOT}/hack/lib/init.sh" ...@@ -28,8 +28,8 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
# separated by comma, lists are separated by semicolon. e.g., # separated by comma, lists are separated by semicolon. e.g.,
# "v1,compute/v1alpha1,experimental/v1alpha2;v1,compute/v2,experimental/v1alpha3" # "v1,compute/v1alpha1,experimental/v1alpha2;v1,compute/v2,experimental/v1alpha3"
# TODO: It's going to be: # TODO: It's going to be:
# KUBE_TEST_API_VERSIONS=${KUBE_TEST_API_VERSIONS:-"v1,experimental/v1alpha1"} # KUBE_TEST_API_VERSIONS=${KUBE_TEST_API_VERSIONS:-"v1,extensions/v1beta1"}
KUBE_TEST_API_VERSIONS=${KUBE_TEST_API_VERSIONS:-"v1,experimental/v1alpha1"} KUBE_TEST_API_VERSIONS=${KUBE_TEST_API_VERSIONS:-"v1,extensions/v1beta1"}
# Give integration tests longer to run # Give integration tests longer to run
KUBE_TIMEOUT=${KUBE_TIMEOUT:--timeout 240s} KUBE_TIMEOUT=${KUBE_TIMEOUT:--timeout 240s}
...@@ -52,18 +52,18 @@ runTests() { ...@@ -52,18 +52,18 @@ runTests() {
KUBE_RACE="" \ KUBE_RACE="" \
KUBE_TIMEOUT="${KUBE_TIMEOUT}" \ KUBE_TIMEOUT="${KUBE_TIMEOUT}" \
KUBE_TEST_API_VERSIONS="$1" \ KUBE_TEST_API_VERSIONS="$1" \
KUBE_API_VERSIONS="v1,experimental/v1alpha1" \ KUBE_API_VERSIONS="v1,extensions/v1beta1" \
"${KUBE_ROOT}/hack/test-go.sh" test/integration "${KUBE_ROOT}/hack/test-go.sh" test/integration
kube::log::status "Running integration test scenario" kube::log::status "Running integration test scenario"
KUBE_API_VERSIONS="v1,experimental/v1alpha1" KUBE_TEST_API_VERSIONS="$1" "${KUBE_OUTPUT_HOSTBIN}/integration" --v=${LOG_LEVEL} \ KUBE_API_VERSIONS="v1,extensions/v1beta1" KUBE_TEST_API_VERSIONS="$1" "${KUBE_OUTPUT_HOSTBIN}/integration" --v=${LOG_LEVEL} \
--max-concurrency="${KUBE_INTEGRATION_TEST_MAX_CONCURRENCY}" --max-concurrency="${KUBE_INTEGRATION_TEST_MAX_CONCURRENCY}"
cleanup cleanup
} }
KUBE_API_VERSIONS="v1,experimental/v1alpha1" "${KUBE_ROOT}/hack/build-go.sh" "$@" cmd/integration KUBE_API_VERSIONS="v1,extensions/v1beta1" "${KUBE_ROOT}/hack/build-go.sh" "$@" cmd/integration
# Run cleanup to stop etcd on interrupt or other kill signal. # Run cleanup to stop etcd on interrupt or other kill signal.
trap cleanup EXIT trap cleanup EXIT
......
...@@ -56,7 +56,7 @@ EOF ...@@ -56,7 +56,7 @@ EOF
mv "$TMPFILE" "pkg/$(kube::util::group-version-to-pkg-path "${group_version}")/types_swagger_doc_generated.go" mv "$TMPFILE" "pkg/$(kube::util::group-version-to-pkg-path "${group_version}")/types_swagger_doc_generated.go"
} }
GROUP_VERSIONS=(unversioned v1 experimental/v1alpha1) GROUP_VERSIONS=(unversioned v1 extensions/v1beta1)
# To avoid compile errors, remove the currently existing files. # To avoid compile errors, remove the currently existing files.
for group_version in "${GROUP_VERSIONS[@]}"; do for group_version in "${GROUP_VERSIONS[@]}"; do
rm -f "pkg/$(kube::util::group-version-to-pkg-path "${group_version}")/types_swagger_doc_generated.go" rm -f "pkg/$(kube::util::group-version-to-pkg-path "${group_version}")/types_swagger_doc_generated.go"
......
...@@ -42,7 +42,7 @@ func NewDefaultRESTMapper(group string, versions []string, interfacesFunc meta.V ...@@ -42,7 +42,7 @@ func NewDefaultRESTMapper(group string, versions []string, interfacesFunc meta.V
for _, version := range versions { for _, version := range versions {
for kind, oType := range Scheme.KnownTypes(version) { for kind, oType := range Scheme.KnownTypes(version) {
// TODO: Remove import path prefix check. // TODO: Remove import path prefix check.
// We check the import path prefix because we currently stuff both "api" and "experimental" objects // We check the import path prefix because we currently stuff both "api" and "extensions" objects
// into the same group within Scheme since Scheme has no notion of groups yet. // into the same group within Scheme since Scheme has no notion of groups yet.
if !strings.HasPrefix(oType.PkgPath(), importPathPrefix) || ignoredKinds.Has(kind) { if !strings.HasPrefix(oType.PkgPath(), importPathPrefix) || ignoredKinds.Has(kind) {
continue continue
......
...@@ -32,12 +32,12 @@ var RegisteredVersions []string ...@@ -32,12 +32,12 @@ var RegisteredVersions []string
func init() { func init() {
// TODO: caesarxuchao: rename this variable to validGroupVersions // TODO: caesarxuchao: rename this variable to validGroupVersions
validAPIVersions := map[string]bool{ validAPIVersions := map[string]bool{
"v1": true, "v1": true,
"experimental/v1alpha1": true, "extensions/v1beta1": true,
} }
// The default list of supported api versions, in order of most preferred to the least. // The default list of supported api versions, in order of most preferred to the least.
defaultSupportedVersions := "v1,experimental/v1alpha1" defaultSupportedVersions := "v1,extensions/v1beta1"
// Env var KUBE_API_VERSIONS is a comma separated list of API versions that should be registered in the scheme. // Env var KUBE_API_VERSIONS is a comma separated list of API versions that should be registered in the scheme.
// The versions should be in the order of most preferred to the least. // The versions should be in the order of most preferred to the least.
supportedVersions := os.Getenv("KUBE_API_VERSIONS") supportedVersions := os.Getenv("KUBE_API_VERSIONS")
......
...@@ -32,8 +32,8 @@ import ( ...@@ -32,8 +32,8 @@ import (
"k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/sets" "k8s.io/kubernetes/pkg/util/sets"
_ "k8s.io/kubernetes/pkg/apis/experimental" _ "k8s.io/kubernetes/pkg/apis/extensions"
_ "k8s.io/kubernetes/pkg/apis/experimental/v1alpha1" _ "k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
flag "github.com/spf13/pflag" flag "github.com/spf13/pflag"
) )
......
...@@ -24,7 +24,7 @@ import ( ...@@ -24,7 +24,7 @@ import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
_ "k8s.io/kubernetes/pkg/api/install" _ "k8s.io/kubernetes/pkg/api/install"
_ "k8s.io/kubernetes/pkg/apis/experimental/install" _ "k8s.io/kubernetes/pkg/apis/extensions/install"
"k8s.io/kubernetes/pkg/api/latest" "k8s.io/kubernetes/pkg/api/latest"
"k8s.io/kubernetes/pkg/api/meta" "k8s.io/kubernetes/pkg/api/meta"
...@@ -33,9 +33,9 @@ import ( ...@@ -33,9 +33,9 @@ import (
) )
var ( var (
Groups = make(map[string]TestGroup) Groups = make(map[string]TestGroup)
Default TestGroup Default TestGroup
Experimental TestGroup Extensions TestGroup
) )
type TestGroup struct { type TestGroup struct {
...@@ -66,12 +66,12 @@ func init() { ...@@ -66,12 +66,12 @@ func init() {
// have multiple group support // have multiple group support
Groups[""] = TestGroup{"", latest.GroupOrDie("").Version, latest.GroupOrDie("").GroupVersion} Groups[""] = TestGroup{"", latest.GroupOrDie("").Version, latest.GroupOrDie("").GroupVersion}
} }
if _, ok := Groups["experimental"]; !ok { if _, ok := Groups["extensions"]; !ok {
Groups["experimental"] = TestGroup{"experimental", latest.GroupOrDie("experimental").Version, latest.GroupOrDie("experimental").GroupVersion} Groups["extensions"] = TestGroup{"extensions", latest.GroupOrDie("extensions").Version, latest.GroupOrDie("extensions").GroupVersion}
} }
Default = Groups[""] Default = Groups[""]
Experimental = Groups["experimental"] Extensions = Groups["extensions"]
} }
// Version returns the API version to test against, as set by the KUBE_TEST_API env var. // Version returns the API version to test against, as set by the KUBE_TEST_API env var.
...@@ -97,8 +97,8 @@ func (g TestGroup) Codec() runtime.Codec { ...@@ -97,8 +97,8 @@ func (g TestGroup) Codec() runtime.Codec {
} }
return interfaces.Codec return interfaces.Codec
} }
if g.Group == "experimental" { if g.Group == "extensions" {
interfaces, err := latest.GroupOrDie("experimental").InterfacesFor(g.GroupVersionUnderTest) interfaces, err := latest.GroupOrDie("extensions").InterfacesFor(g.GroupVersionUnderTest)
if err != nil { if err != nil {
panic(err) panic(err)
} }
...@@ -118,8 +118,8 @@ func (g TestGroup) Converter() runtime.ObjectConvertor { ...@@ -118,8 +118,8 @@ func (g TestGroup) Converter() runtime.ObjectConvertor {
} }
return interfaces.ObjectConvertor return interfaces.ObjectConvertor
} }
if g.Group == "experimental" { if g.Group == "extensions" {
interfaces, err := latest.GroupOrDie("experimental").InterfacesFor(g.VersionUnderTest) interfaces, err := latest.GroupOrDie("extensions").InterfacesFor(g.VersionUnderTest)
if err != nil { if err != nil {
panic(err) panic(err)
} }
...@@ -140,8 +140,8 @@ func (g TestGroup) MetadataAccessor() meta.MetadataAccessor { ...@@ -140,8 +140,8 @@ func (g TestGroup) MetadataAccessor() meta.MetadataAccessor {
} }
return interfaces.MetadataAccessor return interfaces.MetadataAccessor
} }
if g.Group == "experimental" { if g.Group == "extensions" {
interfaces, err := latest.GroupOrDie("experimental").InterfacesFor(g.VersionUnderTest) interfaces, err := latest.GroupOrDie("extensions").InterfacesFor(g.VersionUnderTest)
if err != nil { if err != nil {
panic(err) panic(err)
} }
......
...@@ -28,7 +28,7 @@ import ( ...@@ -28,7 +28,7 @@ import (
"k8s.io/kubernetes/pkg/api/registered" "k8s.io/kubernetes/pkg/api/registered"
"k8s.io/kubernetes/pkg/api/resource" "k8s.io/kubernetes/pkg/api/resource"
"k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/runtime"
...@@ -126,15 +126,15 @@ func FuzzerFor(t *testing.T, version string, src rand.Source) *fuzz.Fuzzer { ...@@ -126,15 +126,15 @@ func FuzzerFor(t *testing.T, version string, src rand.Source) *fuzz.Fuzzer {
c.FuzzNoCustom(j) // fuzz self without calling this function again c.FuzzNoCustom(j) // fuzz self without calling this function again
//j.TemplateRef = nil // this is required for round trip //j.TemplateRef = nil // this is required for round trip
}, },
func(j *experimental.DeploymentStrategy, c fuzz.Continue) { func(j *extensions.DeploymentStrategy, c fuzz.Continue) {
c.FuzzNoCustom(j) // fuzz self without calling this function again c.FuzzNoCustom(j) // fuzz self without calling this function again
// Ensure that strategyType is one of valid values. // Ensure that strategyType is one of valid values.
strategyTypes := []experimental.DeploymentStrategyType{experimental.RecreateDeploymentStrategyType, experimental.RollingUpdateDeploymentStrategyType} strategyTypes := []extensions.DeploymentStrategyType{extensions.RecreateDeploymentStrategyType, extensions.RollingUpdateDeploymentStrategyType}
j.Type = strategyTypes[c.Rand.Intn(len(strategyTypes))] j.Type = strategyTypes[c.Rand.Intn(len(strategyTypes))]
if j.Type != experimental.RollingUpdateDeploymentStrategyType { if j.Type != extensions.RollingUpdateDeploymentStrategyType {
j.RollingUpdate = nil j.RollingUpdate = nil
} else { } else {
rollingUpdate := experimental.RollingUpdateDeployment{} rollingUpdate := extensions.RollingUpdateDeployment{}
if c.RandBool() { if c.RandBool() {
rollingUpdate.MaxUnavailable = util.NewIntOrStringFromInt(int(c.RandUint64())) rollingUpdate.MaxUnavailable = util.NewIntOrStringFromInt(int(c.RandUint64()))
rollingUpdate.MaxSurge = util.NewIntOrStringFromInt(int(c.RandUint64())) rollingUpdate.MaxSurge = util.NewIntOrStringFromInt(int(c.RandUint64()))
...@@ -144,7 +144,7 @@ func FuzzerFor(t *testing.T, version string, src rand.Source) *fuzz.Fuzzer { ...@@ -144,7 +144,7 @@ func FuzzerFor(t *testing.T, version string, src rand.Source) *fuzz.Fuzzer {
j.RollingUpdate = &rollingUpdate j.RollingUpdate = &rollingUpdate
} }
}, },
func(j *experimental.JobSpec, c fuzz.Continue) { func(j *extensions.JobSpec, c fuzz.Continue) {
c.FuzzNoCustom(j) // fuzz self without calling this function again c.FuzzNoCustom(j) // fuzz self without calling this function again
completions := c.Rand.Int() completions := c.Rand.Int()
parallelism := c.Rand.Int() parallelism := c.Rand.Int()
...@@ -363,7 +363,7 @@ func FuzzerFor(t *testing.T, version string, src rand.Source) *fuzz.Fuzzer { ...@@ -363,7 +363,7 @@ func FuzzerFor(t *testing.T, version string, src rand.Source) *fuzz.Fuzzer {
c.FuzzNoCustom(n) c.FuzzNoCustom(n)
n.Spec.ExternalID = "external" n.Spec.ExternalID = "external"
}, },
func(s *experimental.APIVersion, c fuzz.Continue) { func(s *extensions.APIVersion, c fuzz.Continue) {
// We can't use c.RandString() here because it may generate empty // We can't use c.RandString() here because it may generate empty
// string, which will cause tests failure. // string, which will cause tests failure.
s.APIGroup = "something" s.APIGroup = "something"
......
...@@ -28,8 +28,8 @@ func TestGetVersion(t *testing.T) { ...@@ -28,8 +28,8 @@ func TestGetVersion(t *testing.T) {
"v1", "v1",
}, },
{ {
"experimental/v1alpha1", "extensions/v1beta1",
"v1alpha1", "v1beta1",
}, },
} }
for _, test := range testCases { for _, test := range testCases {
...@@ -50,8 +50,8 @@ func TestGetGroup(t *testing.T) { ...@@ -50,8 +50,8 @@ func TestGetGroup(t *testing.T) {
"", "",
}, },
{ {
"experimental/v1alpha1", "extensions/v1beta1",
"experimental", "extensions",
}, },
} }
for _, test := range testCases { for _, test := range testCases {
......
...@@ -136,7 +136,7 @@ func TestVersionRegex(t *testing.T) { ...@@ -136,7 +136,7 @@ func TestVersionRegex(t *testing.T) {
match: true, match: true,
}, },
{ {
typeName: "v1alpha1.Binding", typeName: "v1beta1.Binding",
match: true, match: true,
}, },
{ {
......
...@@ -29,23 +29,23 @@ import ( ...@@ -29,23 +29,23 @@ import (
"k8s.io/kubernetes/pkg/api/meta" "k8s.io/kubernetes/pkg/api/meta"
"k8s.io/kubernetes/pkg/api/registered" "k8s.io/kubernetes/pkg/api/registered"
apiutil "k8s.io/kubernetes/pkg/api/util" apiutil "k8s.io/kubernetes/pkg/api/util"
_ "k8s.io/kubernetes/pkg/apis/experimental" _ "k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/apis/experimental/v1alpha1" "k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
"k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/util/sets" "k8s.io/kubernetes/pkg/util/sets"
) )
const importPrefix = "k8s.io/kubernetes/pkg/apis/experimental" const importPrefix = "k8s.io/kubernetes/pkg/apis/extensions"
var accessor = meta.NewAccessor() var accessor = meta.NewAccessor()
func init() { func init() {
groupMeta, err := latest.RegisterGroup("experimental") groupMeta, err := latest.RegisterGroup("extensions")
if err != nil { if err != nil {
glog.V(4).Infof("%v", err) glog.V(4).Infof("%v", err)
return return
} }
registeredGroupVersions := registered.GroupVersionsForGroup("experimental") registeredGroupVersions := registered.GroupVersionsForGroup("extensions")
groupVersion := registeredGroupVersions[0] groupVersion := registeredGroupVersions[0]
*groupMeta = latest.GroupMeta{ *groupMeta = latest.GroupMeta{
GroupVersion: groupVersion, GroupVersion: groupVersion,
...@@ -70,7 +70,7 @@ func init() { ...@@ -70,7 +70,7 @@ func init() {
ignoredKinds := sets.NewString() ignoredKinds := sets.NewString()
groupMeta.RESTMapper = api.NewDefaultRESTMapper("experimental", groupVersions, interfacesFor, importPrefix, ignoredKinds, rootScoped) groupMeta.RESTMapper = api.NewDefaultRESTMapper("extensions", groupVersions, interfacesFor, importPrefix, ignoredKinds, rootScoped)
api.RegisterRESTMapper(groupMeta.RESTMapper) api.RegisterRESTMapper(groupMeta.RESTMapper)
groupMeta.InterfacesFor = interfacesFor groupMeta.InterfacesFor = interfacesFor
} }
...@@ -79,14 +79,14 @@ func init() { ...@@ -79,14 +79,14 @@ func init() {
// string, or an error if the version is not known. // string, or an error if the version is not known.
func interfacesFor(version string) (*meta.VersionInterfaces, error) { func interfacesFor(version string) (*meta.VersionInterfaces, error) {
switch version { switch version {
case "experimental/v1alpha1": case "extensions/v1beta1":
return &meta.VersionInterfaces{ return &meta.VersionInterfaces{
Codec: v1alpha1.Codec, Codec: v1beta1.Codec,
ObjectConvertor: api.Scheme, ObjectConvertor: api.Scheme,
MetadataAccessor: accessor, MetadataAccessor: accessor,
}, nil }, nil
default: default:
g, _ := latest.Group("experimental") g, _ := latest.Group("extensions")
return nil, fmt.Errorf("unsupported storage version: %s (valid: %s)", version, strings.Join(g.Versions, ", ")) return nil, fmt.Errorf("unsupported storage version: %s (valid: %s)", version, strings.Join(g.Versions, ", "))
} }
} }
...@@ -23,11 +23,11 @@ import ( ...@@ -23,11 +23,11 @@ import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/latest" "k8s.io/kubernetes/pkg/api/latest"
"k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
) )
func TestResourceVersioner(t *testing.T) { func TestResourceVersioner(t *testing.T) {
daemonSet := experimental.DaemonSet{ObjectMeta: api.ObjectMeta{ResourceVersion: "10"}} daemonSet := extensions.DaemonSet{ObjectMeta: api.ObjectMeta{ResourceVersion: "10"}}
version, err := accessor.ResourceVersion(&daemonSet) version, err := accessor.ResourceVersion(&daemonSet)
if err != nil { if err != nil {
t.Fatalf("unexpected error: %v", err) t.Fatalf("unexpected error: %v", err)
...@@ -36,7 +36,7 @@ func TestResourceVersioner(t *testing.T) { ...@@ -36,7 +36,7 @@ func TestResourceVersioner(t *testing.T) {
t.Errorf("unexpected version %v", version) t.Errorf("unexpected version %v", version)
} }
daemonSetList := experimental.DaemonSetList{ListMeta: unversioned.ListMeta{ResourceVersion: "10"}} daemonSetList := extensions.DaemonSetList{ListMeta: unversioned.ListMeta{ResourceVersion: "10"}}
version, err = accessor.ResourceVersion(&daemonSetList) version, err = accessor.ResourceVersion(&daemonSetList)
if err != nil { if err != nil {
t.Fatalf("unexpected error: %v", err) t.Fatalf("unexpected error: %v", err)
...@@ -47,44 +47,44 @@ func TestResourceVersioner(t *testing.T) { ...@@ -47,44 +47,44 @@ func TestResourceVersioner(t *testing.T) {
} }
func TestCodec(t *testing.T) { func TestCodec(t *testing.T) {
daemonSet := experimental.DaemonSet{} daemonSet := extensions.DaemonSet{}
// We do want to use package latest rather than testapi here, because we // We do want to use package latest rather than testapi here, because we
// want to test if the package install and package latest work as expected. // want to test if the package install and package latest work as expected.
data, err := latest.GroupOrDie("experimental").Codec.Encode(&daemonSet) data, err := latest.GroupOrDie("extensions").Codec.Encode(&daemonSet)
if err != nil { if err != nil {
t.Fatalf("unexpected error: %v", err) t.Fatalf("unexpected error: %v", err)
} }
other := experimental.DaemonSet{} other := extensions.DaemonSet{}
if err := json.Unmarshal(data, &other); err != nil { if err := json.Unmarshal(data, &other); err != nil {
t.Fatalf("unexpected error: %v", err) t.Fatalf("unexpected error: %v", err)
} }
if other.APIVersion != latest.GroupOrDie("experimental").GroupVersion || other.Kind != "DaemonSet" { if other.APIVersion != latest.GroupOrDie("extensions").GroupVersion || other.Kind != "DaemonSet" {
t.Errorf("unexpected unmarshalled object %#v", other) t.Errorf("unexpected unmarshalled object %#v", other)
} }
} }
func TestInterfacesFor(t *testing.T) { func TestInterfacesFor(t *testing.T) {
if _, err := latest.GroupOrDie("experimental").InterfacesFor(""); err == nil { if _, err := latest.GroupOrDie("extensions").InterfacesFor(""); err == nil {
t.Fatalf("unexpected non-error: %v", err) t.Fatalf("unexpected non-error: %v", err)
} }
for i, groupVersion := range append([]string{latest.GroupOrDie("experimental").GroupVersion}, latest.GroupOrDie("experimental").GroupVersions...) { for i, groupVersion := range append([]string{latest.GroupOrDie("extensions").GroupVersion}, latest.GroupOrDie("extensions").GroupVersions...) {
if vi, err := latest.GroupOrDie("experimental").InterfacesFor(groupVersion); err != nil || vi == nil { if vi, err := latest.GroupOrDie("extensions").InterfacesFor(groupVersion); err != nil || vi == nil {
t.Fatalf("%d: unexpected result: %v", i, err) t.Fatalf("%d: unexpected result: %v", i, err)
} }
} }
} }
func TestRESTMapper(t *testing.T) { func TestRESTMapper(t *testing.T) {
if v, k, err := latest.GroupOrDie("experimental").RESTMapper.VersionAndKindForResource("horizontalpodautoscalers"); err != nil || v != "experimental/v1alpha1" || k != "HorizontalPodAutoscaler" { if v, k, err := latest.GroupOrDie("extensions").RESTMapper.VersionAndKindForResource("horizontalpodautoscalers"); err != nil || v != "extensions/v1beta1" || k != "HorizontalPodAutoscaler" {
t.Errorf("unexpected version mapping: %s %s %v", v, k, err) t.Errorf("unexpected version mapping: %s %s %v", v, k, err)
} }
if m, err := latest.GroupOrDie("experimental").RESTMapper.RESTMapping("DaemonSet", ""); err != nil || m.APIVersion != "experimental/v1alpha1" || m.Resource != "daemonsets" { if m, err := latest.GroupOrDie("extensions").RESTMapper.RESTMapping("DaemonSet", ""); err != nil || m.APIVersion != "extensions/v1beta1" || m.Resource != "daemonsets" {
t.Errorf("unexpected version mapping: %#v %v", m, err) t.Errorf("unexpected version mapping: %#v %v", m, err)
} }
for _, groupVersion := range latest.GroupOrDie("experimental").GroupVersions { for _, groupVersion := range latest.GroupOrDie("extensions").GroupVersions {
mapping, err := latest.GroupOrDie("experimental").RESTMapper.RESTMapping("HorizontalPodAutoscaler", groupVersion) mapping, err := latest.GroupOrDie("extensions").RESTMapper.RESTMapping("HorizontalPodAutoscaler", groupVersion)
if err != nil { if err != nil {
t.Errorf("unexpected error: %v", err) t.Errorf("unexpected error: %v", err)
} }
...@@ -96,12 +96,12 @@ func TestRESTMapper(t *testing.T) { ...@@ -96,12 +96,12 @@ func TestRESTMapper(t *testing.T) {
t.Errorf("incorrect groupVersion: %v", mapping) t.Errorf("incorrect groupVersion: %v", mapping)
} }
interfaces, _ := latest.GroupOrDie("experimental").InterfacesFor(groupVersion) interfaces, _ := latest.GroupOrDie("extensions").InterfacesFor(groupVersion)
if mapping.Codec != interfaces.Codec { if mapping.Codec != interfaces.Codec {
t.Errorf("unexpected codec: %#v, expected: %#v", mapping, interfaces) t.Errorf("unexpected codec: %#v, expected: %#v", mapping, interfaces)
} }
rc := &experimental.HorizontalPodAutoscaler{ObjectMeta: api.ObjectMeta{Name: "foo"}} rc := &extensions.HorizontalPodAutoscaler{ObjectMeta: api.ObjectMeta{Name: "foo"}}
name, err := mapping.MetadataAccessor.Name(rc) name, err := mapping.MetadataAccessor.Name(rc)
if err != nil { if err != nil {
t.Errorf("unexpected error: %v", err) t.Errorf("unexpected error: %v", err)
......
...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and ...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package experimental package extensions
import ( import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
......
...@@ -15,7 +15,7 @@ limitations under the License. ...@@ -15,7 +15,7 @@ limitations under the License.
*/ */
/* /*
This file (together with pkg/apis/experimental/v1alpha1/types.go) contain the experimental This file (together with pkg/apis/extensions/v1beta1/types.go) contain the experimental
types in kubernetes. These API objects are experimental, meaning that the types in kubernetes. These API objects are experimental, meaning that the
APIs may be broken at any time by the kubernetes team. APIs may be broken at any time by the kubernetes team.
...@@ -26,7 +26,7 @@ beyond registration differences. In other words, experimental API group ...@@ -26,7 +26,7 @@ beyond registration differences. In other words, experimental API group
support is experimental. support is experimental.
*/ */
package experimental package extensions
import ( import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
......
...@@ -14,14 +14,14 @@ See the License for the specific language governing permissions and ...@@ -14,14 +14,14 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package v1alpha1 package v1beta1
import ( import (
"reflect" "reflect"
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
v1 "k8s.io/kubernetes/pkg/api/v1" v1 "k8s.io/kubernetes/pkg/api/v1"
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/conversion" "k8s.io/kubernetes/pkg/conversion"
"k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util"
) )
...@@ -31,12 +31,12 @@ func addConversionFuncs() { ...@@ -31,12 +31,12 @@ func addConversionFuncs() {
err := api.Scheme.AddConversionFuncs( err := api.Scheme.AddConversionFuncs(
convert_api_PodSpec_To_v1_PodSpec, convert_api_PodSpec_To_v1_PodSpec,
convert_v1_PodSpec_To_api_PodSpec, convert_v1_PodSpec_To_api_PodSpec,
convert_experimental_DeploymentSpec_To_v1alpha1_DeploymentSpec, convert_extensions_DeploymentSpec_To_v1beta1_DeploymentSpec,
convert_v1alpha1_DeploymentSpec_To_experimental_DeploymentSpec, convert_v1beta1_DeploymentSpec_To_extensions_DeploymentSpec,
convert_experimental_DeploymentStrategy_To_v1alpha1_DeploymentStrategy, convert_extensions_DeploymentStrategy_To_v1beta1_DeploymentStrategy,
convert_v1alpha1_DeploymentStrategy_To_experimental_DeploymentStrategy, convert_v1beta1_DeploymentStrategy_To_extensions_DeploymentStrategy,
convert_experimental_RollingUpdateDeployment_To_v1alpha1_RollingUpdateDeployment, convert_extensions_RollingUpdateDeployment_To_v1beta1_RollingUpdateDeployment,
convert_v1alpha1_RollingUpdateDeployment_To_experimental_RollingUpdateDeployment, convert_v1beta1_RollingUpdateDeployment_To_extensions_RollingUpdateDeployment,
) )
if err != nil { if err != nil {
// If one of the conversion functions is malformed, detect it immediately. // If one of the conversion functions is malformed, detect it immediately.
...@@ -199,9 +199,9 @@ func convert_v1_PodSpec_To_api_PodSpec(in *v1.PodSpec, out *api.PodSpec, s conve ...@@ -199,9 +199,9 @@ func convert_v1_PodSpec_To_api_PodSpec(in *v1.PodSpec, out *api.PodSpec, s conve
return nil return nil
} }
func convert_experimental_DeploymentSpec_To_v1alpha1_DeploymentSpec(in *experimental.DeploymentSpec, out *DeploymentSpec, s conversion.Scope) error { func convert_extensions_DeploymentSpec_To_v1beta1_DeploymentSpec(in *extensions.DeploymentSpec, out *DeploymentSpec, s conversion.Scope) error {
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
defaulting.(func(*experimental.DeploymentSpec))(in) defaulting.(func(*extensions.DeploymentSpec))(in)
} }
out.Replicas = new(int) out.Replicas = new(int)
*out.Replicas = in.Replicas *out.Replicas = in.Replicas
...@@ -221,7 +221,7 @@ func convert_experimental_DeploymentSpec_To_v1alpha1_DeploymentSpec(in *experime ...@@ -221,7 +221,7 @@ func convert_experimental_DeploymentSpec_To_v1alpha1_DeploymentSpec(in *experime
} else { } else {
out.Template = nil out.Template = nil
} }
if err := convert_experimental_DeploymentStrategy_To_v1alpha1_DeploymentStrategy(&in.Strategy, &out.Strategy, s); err != nil { if err := convert_extensions_DeploymentStrategy_To_v1beta1_DeploymentStrategy(&in.Strategy, &out.Strategy, s); err != nil {
return err return err
} }
out.UniqueLabelKey = new(string) out.UniqueLabelKey = new(string)
...@@ -229,7 +229,7 @@ func convert_experimental_DeploymentSpec_To_v1alpha1_DeploymentSpec(in *experime ...@@ -229,7 +229,7 @@ func convert_experimental_DeploymentSpec_To_v1alpha1_DeploymentSpec(in *experime
return nil return nil
} }
func convert_v1alpha1_DeploymentSpec_To_experimental_DeploymentSpec(in *DeploymentSpec, out *experimental.DeploymentSpec, s conversion.Scope) error { func convert_v1beta1_DeploymentSpec_To_extensions_DeploymentSpec(in *DeploymentSpec, out *extensions.DeploymentSpec, s conversion.Scope) error {
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
defaulting.(func(*DeploymentSpec))(in) defaulting.(func(*DeploymentSpec))(in)
} }
...@@ -252,7 +252,7 @@ func convert_v1alpha1_DeploymentSpec_To_experimental_DeploymentSpec(in *Deployme ...@@ -252,7 +252,7 @@ func convert_v1alpha1_DeploymentSpec_To_experimental_DeploymentSpec(in *Deployme
} else { } else {
out.Template = nil out.Template = nil
} }
if err := convert_v1alpha1_DeploymentStrategy_To_experimental_DeploymentStrategy(&in.Strategy, &out.Strategy, s); err != nil { if err := convert_v1beta1_DeploymentStrategy_To_extensions_DeploymentStrategy(&in.Strategy, &out.Strategy, s); err != nil {
return err return err
} }
if in.UniqueLabelKey != nil { if in.UniqueLabelKey != nil {
...@@ -261,14 +261,14 @@ func convert_v1alpha1_DeploymentSpec_To_experimental_DeploymentSpec(in *Deployme ...@@ -261,14 +261,14 @@ func convert_v1alpha1_DeploymentSpec_To_experimental_DeploymentSpec(in *Deployme
return nil return nil
} }
func convert_experimental_DeploymentStrategy_To_v1alpha1_DeploymentStrategy(in *experimental.DeploymentStrategy, out *DeploymentStrategy, s conversion.Scope) error { func convert_extensions_DeploymentStrategy_To_v1beta1_DeploymentStrategy(in *extensions.DeploymentStrategy, out *DeploymentStrategy, s conversion.Scope) error {
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
defaulting.(func(*experimental.DeploymentStrategy))(in) defaulting.(func(*extensions.DeploymentStrategy))(in)
} }
out.Type = DeploymentStrategyType(in.Type) out.Type = DeploymentStrategyType(in.Type)
if in.RollingUpdate != nil { if in.RollingUpdate != nil {
out.RollingUpdate = new(RollingUpdateDeployment) out.RollingUpdate = new(RollingUpdateDeployment)
if err := convert_experimental_RollingUpdateDeployment_To_v1alpha1_RollingUpdateDeployment(in.RollingUpdate, out.RollingUpdate, s); err != nil { if err := convert_extensions_RollingUpdateDeployment_To_v1beta1_RollingUpdateDeployment(in.RollingUpdate, out.RollingUpdate, s); err != nil {
return err return err
} }
} else { } else {
...@@ -277,14 +277,14 @@ func convert_experimental_DeploymentStrategy_To_v1alpha1_DeploymentStrategy(in * ...@@ -277,14 +277,14 @@ func convert_experimental_DeploymentStrategy_To_v1alpha1_DeploymentStrategy(in *
return nil return nil
} }
func convert_v1alpha1_DeploymentStrategy_To_experimental_DeploymentStrategy(in *DeploymentStrategy, out *experimental.DeploymentStrategy, s conversion.Scope) error { func convert_v1beta1_DeploymentStrategy_To_extensions_DeploymentStrategy(in *DeploymentStrategy, out *extensions.DeploymentStrategy, s conversion.Scope) error {
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
defaulting.(func(*DeploymentStrategy))(in) defaulting.(func(*DeploymentStrategy))(in)
} }
out.Type = experimental.DeploymentStrategyType(in.Type) out.Type = extensions.DeploymentStrategyType(in.Type)
if in.RollingUpdate != nil { if in.RollingUpdate != nil {
out.RollingUpdate = new(experimental.RollingUpdateDeployment) out.RollingUpdate = new(extensions.RollingUpdateDeployment)
if err := convert_v1alpha1_RollingUpdateDeployment_To_experimental_RollingUpdateDeployment(in.RollingUpdate, out.RollingUpdate, s); err != nil { if err := convert_v1beta1_RollingUpdateDeployment_To_extensions_RollingUpdateDeployment(in.RollingUpdate, out.RollingUpdate, s); err != nil {
return err return err
} }
} else { } else {
...@@ -293,9 +293,9 @@ func convert_v1alpha1_DeploymentStrategy_To_experimental_DeploymentStrategy(in * ...@@ -293,9 +293,9 @@ func convert_v1alpha1_DeploymentStrategy_To_experimental_DeploymentStrategy(in *
return nil return nil
} }
func convert_experimental_RollingUpdateDeployment_To_v1alpha1_RollingUpdateDeployment(in *experimental.RollingUpdateDeployment, out *RollingUpdateDeployment, s conversion.Scope) error { func convert_extensions_RollingUpdateDeployment_To_v1beta1_RollingUpdateDeployment(in *extensions.RollingUpdateDeployment, out *RollingUpdateDeployment, s conversion.Scope) error {
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
defaulting.(func(*experimental.RollingUpdateDeployment))(in) defaulting.(func(*extensions.RollingUpdateDeployment))(in)
} }
if out.MaxUnavailable == nil { if out.MaxUnavailable == nil {
out.MaxUnavailable = &util.IntOrString{} out.MaxUnavailable = &util.IntOrString{}
...@@ -313,7 +313,7 @@ func convert_experimental_RollingUpdateDeployment_To_v1alpha1_RollingUpdateDeplo ...@@ -313,7 +313,7 @@ func convert_experimental_RollingUpdateDeployment_To_v1alpha1_RollingUpdateDeplo
return nil return nil
} }
func convert_v1alpha1_RollingUpdateDeployment_To_experimental_RollingUpdateDeployment(in *RollingUpdateDeployment, out *experimental.RollingUpdateDeployment, s conversion.Scope) error { func convert_v1beta1_RollingUpdateDeployment_To_extensions_RollingUpdateDeployment(in *RollingUpdateDeployment, out *extensions.RollingUpdateDeployment, s conversion.Scope) error {
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found { if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
defaulting.(func(*RollingUpdateDeployment))(in) defaulting.(func(*RollingUpdateDeployment))(in)
} }
......
...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and ...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package v1alpha1 package v1beta1
import ( import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
...@@ -25,7 +25,7 @@ func addDefaultingFuncs() { ...@@ -25,7 +25,7 @@ func addDefaultingFuncs() {
api.Scheme.AddDefaultingFuncs( api.Scheme.AddDefaultingFuncs(
func(obj *APIVersion) { func(obj *APIVersion) {
if len(obj.APIGroup) == 0 { if len(obj.APIGroup) == 0 {
obj.APIGroup = "experimental" obj.APIGroup = "extensions"
} }
}, },
func(obj *DaemonSet) { func(obj *DaemonSet) {
......
...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and ...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package v1alpha1 package v1beta1
import ( import (
"reflect" "reflect"
......
...@@ -14,14 +14,14 @@ See the License for the specific language governing permissions and ...@@ -14,14 +14,14 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package v1alpha1 package v1beta1
import ( import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/runtime"
) )
var Codec = runtime.CodecFor(api.Scheme, "experimental/v1alpha1") var Codec = runtime.CodecFor(api.Scheme, "extensions/v1beta1")
func init() { func init() {
addKnownTypes() addKnownTypes()
...@@ -31,7 +31,7 @@ func init() { ...@@ -31,7 +31,7 @@ func init() {
// Adds the list of known types to api.Scheme. // Adds the list of known types to api.Scheme.
func addKnownTypes() { func addKnownTypes() {
api.Scheme.AddKnownTypes("experimental/v1alpha1", api.Scheme.AddKnownTypes("extensions/v1beta1",
&ClusterAutoscaler{}, &ClusterAutoscaler{},
&ClusterAutoscalerList{}, &ClusterAutoscalerList{},
&Deployment{}, &Deployment{},
......
...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and ...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package v1alpha1 package v1beta1
import ( import (
"k8s.io/kubernetes/pkg/api/resource" "k8s.io/kubernetes/pkg/api/resource"
......
...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and ...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package v1alpha1 package v1beta1
// This file contains a collection of methods that can be used from go-resful to // 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 // generate Swagger API documentation for its models. Please read this PR for more
......
...@@ -271,7 +271,7 @@ func AddApisWebService(container *restful.Container, apiPrefix string, groups [] ...@@ -271,7 +271,7 @@ func AddApisWebService(container *restful.Container, apiPrefix string, groups []
} }
// Adds a service to return the supported versions, preferred version, and name // Adds a service to return the supported versions, preferred version, and name
// of a group. E.g., a such web service will be registered at /apis/experimental. // of a group. E.g., a such web service will be registered at /apis/extensions.
func AddGroupWebService(container *restful.Container, path string, group api.APIGroup) { func AddGroupWebService(container *restful.Container, path string, group api.APIGroup) {
groupHandler := GroupHandler(group) groupHandler := GroupHandler(group)
ws := new(restful.WebService) ws := new(restful.WebService)
...@@ -286,7 +286,7 @@ func AddGroupWebService(container *restful.Container, path string, group api.API ...@@ -286,7 +286,7 @@ func AddGroupWebService(container *restful.Container, path string, group api.API
} }
// Adds a service to return the supported resources, E.g., a such web service // Adds a service to return the supported resources, E.g., a such web service
// will be registered at /apis/experimental/v1. // will be registered at /apis/extensions/v1.
func AddSupportedResourcesWebService(ws *restful.WebService, groupVersion string, apiResources []api.APIResource) { func AddSupportedResourcesWebService(ws *restful.WebService, groupVersion string, apiResources []api.APIResource) {
resourceHandler := SupportedResourcesHandler(groupVersion, apiResources) resourceHandler := SupportedResourcesHandler(groupVersion, apiResources)
ws.Route(ws.GET("/").To(resourceHandler). ws.Route(ws.GET("/").To(resourceHandler).
......
...@@ -242,10 +242,10 @@ func TestGetAPIRequestInfo(t *testing.T) { ...@@ -242,10 +242,10 @@ func TestGetAPIRequestInfo(t *testing.T) {
{"POST", "/api/v1/namespaces/other/pods", "create", "api", "", "v1", "other", "pods", "", "", []string{"pods"}}, {"POST", "/api/v1/namespaces/other/pods", "create", "api", "", "v1", "other", "pods", "", "", []string{"pods"}},
// api group identification // api group identification
{"POST", "/apis/experimental/v1/namespaces/other/pods", "create", "api", "experimental", "v1", "other", "pods", "", "", []string{"pods"}}, {"POST", "/apis/extensions/v1/namespaces/other/pods", "create", "api", "extensions", "v1", "other", "pods", "", "", []string{"pods"}},
// api version identification // api version identification
{"POST", "/apis/experimental/v1beta3/namespaces/other/pods", "create", "api", "experimental", "v1beta3", "other", "pods", "", "", []string{"pods"}}, {"POST", "/apis/extensions/v1beta3/namespaces/other/pods", "create", "api", "extensions", "v1beta3", "other", "pods", "", "", []string{"pods"}},
} }
apiRequestInfoResolver := newTestAPIRequestInfoResolver() apiRequestInfoResolver := newTestAPIRequestInfoResolver()
......
...@@ -21,7 +21,7 @@ import ( ...@@ -21,7 +21,7 @@ import (
"github.com/golang/glog" "github.com/golang/glog"
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
) )
...@@ -232,7 +232,7 @@ type StoreToDaemonSetLister struct { ...@@ -232,7 +232,7 @@ type StoreToDaemonSetLister struct {
} }
// Exists checks if the given daemon set exists in the store. // Exists checks if the given daemon set exists in the store.
func (s *StoreToDaemonSetLister) Exists(ds *experimental.DaemonSet) (bool, error) { func (s *StoreToDaemonSetLister) Exists(ds *extensions.DaemonSet) (bool, error) {
_, exists, err := s.Store.Get(ds) _, exists, err := s.Store.Get(ds)
if err != nil { if err != nil {
return false, err return false, err
...@@ -242,18 +242,18 @@ func (s *StoreToDaemonSetLister) Exists(ds *experimental.DaemonSet) (bool, error ...@@ -242,18 +242,18 @@ func (s *StoreToDaemonSetLister) Exists(ds *experimental.DaemonSet) (bool, error
// List lists all daemon sets in the store. // List lists all daemon sets in the store.
// TODO: converge on the interface in pkg/client // TODO: converge on the interface in pkg/client
func (s *StoreToDaemonSetLister) List() (dss []experimental.DaemonSet, err error) { func (s *StoreToDaemonSetLister) List() (dss []extensions.DaemonSet, err error) {
for _, c := range s.Store.List() { for _, c := range s.Store.List() {
dss = append(dss, *(c.(*experimental.DaemonSet))) dss = append(dss, *(c.(*extensions.DaemonSet)))
} }
return dss, nil return dss, nil
} }
// GetPodDaemonSets returns a list of daemon sets managing a pod. // GetPodDaemonSets returns a list of daemon sets managing a pod.
// Returns an error if and only if no matching daemon sets are found. // Returns an error if and only if no matching daemon sets are found.
func (s *StoreToDaemonSetLister) GetPodDaemonSets(pod *api.Pod) (daemonSets []experimental.DaemonSet, err error) { func (s *StoreToDaemonSetLister) GetPodDaemonSets(pod *api.Pod) (daemonSets []extensions.DaemonSet, err error) {
var selector labels.Selector var selector labels.Selector
var daemonSet experimental.DaemonSet var daemonSet extensions.DaemonSet
if len(pod.Labels) == 0 { if len(pod.Labels) == 0 {
err = fmt.Errorf("No daemon sets found for pod %v because it has no labels", pod.Name) err = fmt.Errorf("No daemon sets found for pod %v because it has no labels", pod.Name)
...@@ -261,7 +261,7 @@ func (s *StoreToDaemonSetLister) GetPodDaemonSets(pod *api.Pod) (daemonSets []ex ...@@ -261,7 +261,7 @@ func (s *StoreToDaemonSetLister) GetPodDaemonSets(pod *api.Pod) (daemonSets []ex
} }
for _, m := range s.Store.List() { for _, m := range s.Store.List() {
daemonSet = *m.(*experimental.DaemonSet) daemonSet = *m.(*extensions.DaemonSet)
if daemonSet.Namespace != pod.Namespace { if daemonSet.Namespace != pod.Namespace {
continue continue
} }
...@@ -351,7 +351,7 @@ type StoreToJobLister struct { ...@@ -351,7 +351,7 @@ type StoreToJobLister struct {
} }
// Exists checks if the given job exists in the store. // Exists checks if the given job exists in the store.
func (s *StoreToJobLister) Exists(job *experimental.Job) (bool, error) { func (s *StoreToJobLister) Exists(job *extensions.Job) (bool, error) {
_, exists, err := s.Store.Get(job) _, exists, err := s.Store.Get(job)
if err != nil { if err != nil {
return false, err return false, err
...@@ -360,17 +360,17 @@ func (s *StoreToJobLister) Exists(job *experimental.Job) (bool, error) { ...@@ -360,17 +360,17 @@ func (s *StoreToJobLister) Exists(job *experimental.Job) (bool, error) {
} }
// StoreToJobLister lists all jobs in the store. // StoreToJobLister lists all jobs in the store.
func (s *StoreToJobLister) List() (jobs []experimental.Job, err error) { func (s *StoreToJobLister) List() (jobs []extensions.Job, err error) {
for _, c := range s.Store.List() { for _, c := range s.Store.List() {
jobs = append(jobs, *(c.(*experimental.Job))) jobs = append(jobs, *(c.(*extensions.Job)))
} }
return jobs, nil return jobs, nil
} }
// GetPodControllers returns a list of jobs managing a pod. Returns an error only if no matching jobs are found. // GetPodControllers returns a list of jobs managing a pod. Returns an error only if no matching jobs are found.
func (s *StoreToJobLister) GetPodJobs(pod *api.Pod) (jobs []experimental.Job, err error) { func (s *StoreToJobLister) GetPodJobs(pod *api.Pod) (jobs []extensions.Job, err error) {
var selector labels.Selector var selector labels.Selector
var job experimental.Job var job extensions.Job
if len(pod.Labels) == 0 { if len(pod.Labels) == 0 {
err = fmt.Errorf("No jobs found for pod %v because it has no labels", pod.Name) err = fmt.Errorf("No jobs found for pod %v because it has no labels", pod.Name)
...@@ -378,7 +378,7 @@ func (s *StoreToJobLister) GetPodJobs(pod *api.Pod) (jobs []experimental.Job, er ...@@ -378,7 +378,7 @@ func (s *StoreToJobLister) GetPodJobs(pod *api.Pod) (jobs []experimental.Job, er
} }
for _, m := range s.Store.List() { for _, m := range s.Store.List() {
job = *m.(*experimental.Job) job = *m.(*extensions.Job)
if job.Namespace != pod.Namespace { if job.Namespace != pod.Namespace {
continue continue
} }
......
...@@ -20,7 +20,7 @@ import ( ...@@ -20,7 +20,7 @@ import (
"testing" "testing"
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/util/sets" "k8s.io/kubernetes/pkg/util/sets"
) )
...@@ -160,44 +160,44 @@ func TestStoreToDaemonSetLister(t *testing.T) { ...@@ -160,44 +160,44 @@ func TestStoreToDaemonSetLister(t *testing.T) {
store := NewStore(MetaNamespaceKeyFunc) store := NewStore(MetaNamespaceKeyFunc)
lister := StoreToDaemonSetLister{store} lister := StoreToDaemonSetLister{store}
testCases := []struct { testCases := []struct {
inDSs []*experimental.DaemonSet inDSs []*extensions.DaemonSet
list func() ([]experimental.DaemonSet, error) list func() ([]extensions.DaemonSet, error)
outDaemonSetNames sets.String outDaemonSetNames sets.String
expectErr bool expectErr bool
}{ }{
// Basic listing // Basic listing
{ {
inDSs: []*experimental.DaemonSet{ inDSs: []*extensions.DaemonSet{
{ObjectMeta: api.ObjectMeta{Name: "basic"}}, {ObjectMeta: api.ObjectMeta{Name: "basic"}},
}, },
list: func() ([]experimental.DaemonSet, error) { list: func() ([]extensions.DaemonSet, error) {
return lister.List() return lister.List()
}, },
outDaemonSetNames: sets.NewString("basic"), outDaemonSetNames: sets.NewString("basic"),
}, },
// Listing multiple daemon sets // Listing multiple daemon sets
{ {
inDSs: []*experimental.DaemonSet{ inDSs: []*extensions.DaemonSet{
{ObjectMeta: api.ObjectMeta{Name: "basic"}}, {ObjectMeta: api.ObjectMeta{Name: "basic"}},
{ObjectMeta: api.ObjectMeta{Name: "complex"}}, {ObjectMeta: api.ObjectMeta{Name: "complex"}},
{ObjectMeta: api.ObjectMeta{Name: "complex2"}}, {ObjectMeta: api.ObjectMeta{Name: "complex2"}},
}, },
list: func() ([]experimental.DaemonSet, error) { list: func() ([]extensions.DaemonSet, error) {
return lister.List() return lister.List()
}, },
outDaemonSetNames: sets.NewString("basic", "complex", "complex2"), outDaemonSetNames: sets.NewString("basic", "complex", "complex2"),
}, },
// No pod labels // No pod labels
{ {
inDSs: []*experimental.DaemonSet{ inDSs: []*extensions.DaemonSet{
{ {
ObjectMeta: api.ObjectMeta{Name: "basic", Namespace: "ns"}, ObjectMeta: api.ObjectMeta{Name: "basic", Namespace: "ns"},
Spec: experimental.DaemonSetSpec{ Spec: extensions.DaemonSetSpec{
Selector: map[string]string{"foo": "baz"}, Selector: map[string]string{"foo": "baz"},
}, },
}, },
}, },
list: func() ([]experimental.DaemonSet, error) { list: func() ([]extensions.DaemonSet, error) {
pod := &api.Pod{ pod := &api.Pod{
ObjectMeta: api.ObjectMeta{Name: "pod1", Namespace: "ns"}, ObjectMeta: api.ObjectMeta{Name: "pod1", Namespace: "ns"},
} }
...@@ -208,12 +208,12 @@ func TestStoreToDaemonSetLister(t *testing.T) { ...@@ -208,12 +208,12 @@ func TestStoreToDaemonSetLister(t *testing.T) {
}, },
// No DS selectors // No DS selectors
{ {
inDSs: []*experimental.DaemonSet{ inDSs: []*extensions.DaemonSet{
{ {
ObjectMeta: api.ObjectMeta{Name: "basic", Namespace: "ns"}, ObjectMeta: api.ObjectMeta{Name: "basic", Namespace: "ns"},
}, },
}, },
list: func() ([]experimental.DaemonSet, error) { list: func() ([]extensions.DaemonSet, error) {
pod := &api.Pod{ pod := &api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "pod1", Name: "pod1",
...@@ -228,21 +228,21 @@ func TestStoreToDaemonSetLister(t *testing.T) { ...@@ -228,21 +228,21 @@ func TestStoreToDaemonSetLister(t *testing.T) {
}, },
// Matching labels to selectors and namespace // Matching labels to selectors and namespace
{ {
inDSs: []*experimental.DaemonSet{ inDSs: []*extensions.DaemonSet{
{ {
ObjectMeta: api.ObjectMeta{Name: "foo"}, ObjectMeta: api.ObjectMeta{Name: "foo"},
Spec: experimental.DaemonSetSpec{ Spec: extensions.DaemonSetSpec{
Selector: map[string]string{"foo": "bar"}, Selector: map[string]string{"foo": "bar"},
}, },
}, },
{ {
ObjectMeta: api.ObjectMeta{Name: "bar", Namespace: "ns"}, ObjectMeta: api.ObjectMeta{Name: "bar", Namespace: "ns"},
Spec: experimental.DaemonSetSpec{ Spec: extensions.DaemonSetSpec{
Selector: map[string]string{"foo": "bar"}, Selector: map[string]string{"foo": "bar"},
}, },
}, },
}, },
list: func() ([]experimental.DaemonSet, error) { list: func() ([]extensions.DaemonSet, error) {
pod := &api.Pod{ pod := &api.Pod{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "pod1", Name: "pod1",
......
...@@ -92,7 +92,7 @@ func (c *testClient) Setup(t *testing.T) *testClient { ...@@ -92,7 +92,7 @@ func (c *testClient) Setup(t *testing.T) *testClient {
// We will fix this by supporting multiple group versions in Config // We will fix this by supporting multiple group versions in Config
version = c.Version version = c.Version
if len(version) == 0 { if len(version) == 0 {
version = testapi.Experimental.Version() version = testapi.Extensions.Version()
} }
c.ExperimentalClient = NewExperimentalOrDie(&Config{ c.ExperimentalClient = NewExperimentalOrDie(&Config{
Host: c.server.URL, Host: c.server.URL,
...@@ -229,8 +229,8 @@ func body(t *testing.T, obj runtime.Object, raw *string) *string { ...@@ -229,8 +229,8 @@ func body(t *testing.T, obj runtime.Object, raw *string) *string {
if err != nil { if err != nil {
t.Errorf("unexpected encoding error: %v", err) t.Errorf("unexpected encoding error: %v", err)
} }
} else if api.Scheme.Recognizes(testapi.Experimental.GroupAndVersion(), kind) { } else if api.Scheme.Recognizes(testapi.Extensions.GroupAndVersion(), kind) {
bs, err = testapi.Experimental.Codec().Encode(obj) bs, err = testapi.Extensions.Codec().Encode(obj)
if err != nil { if err != nil {
t.Errorf("unexpected encoding error: %v", err) t.Errorf("unexpected encoding error: %v", err)
} }
......
...@@ -18,7 +18,7 @@ package unversioned ...@@ -18,7 +18,7 @@ package unversioned
import ( import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/util/wait"
) )
...@@ -45,7 +45,7 @@ func ControllerHasDesiredReplicas(c Interface, controller *api.ReplicationContro ...@@ -45,7 +45,7 @@ func ControllerHasDesiredReplicas(c Interface, controller *api.ReplicationContro
// JobHasDesiredParallelism returns a condition that will be true if the desired parallelism count // JobHasDesiredParallelism returns a condition that will be true if the desired parallelism count
// for a job equals the current active counts or is less by an appropriate successful/unsuccessful count. // for a job equals the current active counts or is less by an appropriate successful/unsuccessful count.
func JobHasDesiredParallelism(c Interface, job *experimental.Job) wait.ConditionFunc { func JobHasDesiredParallelism(c Interface, job *extensions.Job) wait.ConditionFunc {
return func() (bool, error) { return func() (bool, error) {
job, err := c.Experimental().Jobs(job.Namespace).Get(job.Name) job, err := c.Experimental().Jobs(job.Namespace).Get(job.Name)
......
...@@ -17,7 +17,7 @@ limitations under the License. ...@@ -17,7 +17,7 @@ limitations under the License.
package unversioned package unversioned
import ( import (
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/watch" "k8s.io/kubernetes/pkg/watch"
...@@ -29,11 +29,11 @@ type DaemonSetsNamespacer interface { ...@@ -29,11 +29,11 @@ type DaemonSetsNamespacer interface {
} }
type DaemonSetInterface interface { type DaemonSetInterface interface {
List(selector labels.Selector) (*experimental.DaemonSetList, error) List(selector labels.Selector) (*extensions.DaemonSetList, error)
Get(name string) (*experimental.DaemonSet, error) Get(name string) (*extensions.DaemonSet, error)
Create(ctrl *experimental.DaemonSet) (*experimental.DaemonSet, error) Create(ctrl *extensions.DaemonSet) (*extensions.DaemonSet, error)
Update(ctrl *experimental.DaemonSet) (*experimental.DaemonSet, error) Update(ctrl *extensions.DaemonSet) (*extensions.DaemonSet, error)
UpdateStatus(ctrl *experimental.DaemonSet) (*experimental.DaemonSet, error) UpdateStatus(ctrl *extensions.DaemonSet) (*extensions.DaemonSet, error)
Delete(name string) error Delete(name string) error
Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)
} }
...@@ -51,36 +51,36 @@ func newDaemonSets(c *ExperimentalClient, namespace string) *daemonSets { ...@@ -51,36 +51,36 @@ func newDaemonSets(c *ExperimentalClient, namespace string) *daemonSets {
// Ensure statically that daemonSets implements DaemonSetsInterface. // Ensure statically that daemonSets implements DaemonSetsInterface.
var _ DaemonSetInterface = &daemonSets{} var _ DaemonSetInterface = &daemonSets{}
func (c *daemonSets) List(selector labels.Selector) (result *experimental.DaemonSetList, err error) { func (c *daemonSets) List(selector labels.Selector) (result *extensions.DaemonSetList, err error) {
result = &experimental.DaemonSetList{} result = &extensions.DaemonSetList{}
err = c.r.Get().Namespace(c.ns).Resource("daemonsets").LabelsSelectorParam(selector).Do().Into(result) err = c.r.Get().Namespace(c.ns).Resource("daemonsets").LabelsSelectorParam(selector).Do().Into(result)
return return
} }
// Get returns information about a particular daemon set. // Get returns information about a particular daemon set.
func (c *daemonSets) Get(name string) (result *experimental.DaemonSet, err error) { func (c *daemonSets) Get(name string) (result *extensions.DaemonSet, err error) {
result = &experimental.DaemonSet{} result = &extensions.DaemonSet{}
err = c.r.Get().Namespace(c.ns).Resource("daemonsets").Name(name).Do().Into(result) err = c.r.Get().Namespace(c.ns).Resource("daemonsets").Name(name).Do().Into(result)
return return
} }
// Create creates a new daemon set. // Create creates a new daemon set.
func (c *daemonSets) Create(daemon *experimental.DaemonSet) (result *experimental.DaemonSet, err error) { func (c *daemonSets) Create(daemon *extensions.DaemonSet) (result *extensions.DaemonSet, err error) {
result = &experimental.DaemonSet{} result = &extensions.DaemonSet{}
err = c.r.Post().Namespace(c.ns).Resource("daemonsets").Body(daemon).Do().Into(result) err = c.r.Post().Namespace(c.ns).Resource("daemonsets").Body(daemon).Do().Into(result)
return return
} }
// Update updates an existing daemon set. // Update updates an existing daemon set.
func (c *daemonSets) Update(daemon *experimental.DaemonSet) (result *experimental.DaemonSet, err error) { func (c *daemonSets) Update(daemon *extensions.DaemonSet) (result *extensions.DaemonSet, err error) {
result = &experimental.DaemonSet{} result = &extensions.DaemonSet{}
err = c.r.Put().Namespace(c.ns).Resource("daemonsets").Name(daemon.Name).Body(daemon).Do().Into(result) err = c.r.Put().Namespace(c.ns).Resource("daemonsets").Name(daemon.Name).Body(daemon).Do().Into(result)
return return
} }
// UpdateStatus updates an existing daemon set status // UpdateStatus updates an existing daemon set status
func (c *daemonSets) UpdateStatus(daemon *experimental.DaemonSet) (result *experimental.DaemonSet, err error) { func (c *daemonSets) UpdateStatus(daemon *extensions.DaemonSet) (result *extensions.DaemonSet, err error) {
result = &experimental.DaemonSet{} result = &extensions.DaemonSet{}
err = c.r.Put().Namespace(c.ns).Resource("daemonsets").Name(daemon.Name).SubResource("status").Body(daemon).Do().Into(result) err = c.r.Put().Namespace(c.ns).Resource("daemonsets").Name(daemon.Name).SubResource("status").Body(daemon).Do().Into(result)
return return
} }
......
...@@ -21,7 +21,7 @@ import ( ...@@ -21,7 +21,7 @@ import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/testapi" "k8s.io/kubernetes/pkg/api/testapi"
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
) )
...@@ -34,11 +34,11 @@ func TestListDaemonSets(t *testing.T) { ...@@ -34,11 +34,11 @@ func TestListDaemonSets(t *testing.T) {
c := &testClient{ c := &testClient{
Request: testRequest{ Request: testRequest{
Method: "GET", Method: "GET",
Path: testapi.Experimental.ResourcePath(getDSResourceName(), ns, ""), Path: testapi.Extensions.ResourcePath(getDSResourceName(), ns, ""),
}, },
Response: Response{StatusCode: 200, Response: Response{StatusCode: 200,
Body: &experimental.DaemonSetList{ Body: &extensions.DaemonSetList{
Items: []experimental.DaemonSet{ Items: []extensions.DaemonSet{
{ {
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "foo", Name: "foo",
...@@ -47,7 +47,7 @@ func TestListDaemonSets(t *testing.T) { ...@@ -47,7 +47,7 @@ func TestListDaemonSets(t *testing.T) {
"name": "baz", "name": "baz",
}, },
}, },
Spec: experimental.DaemonSetSpec{ Spec: extensions.DaemonSetSpec{
Template: &api.PodTemplateSpec{}, Template: &api.PodTemplateSpec{},
}, },
}, },
...@@ -63,10 +63,10 @@ func TestListDaemonSets(t *testing.T) { ...@@ -63,10 +63,10 @@ func TestListDaemonSets(t *testing.T) {
func TestGetDaemonSet(t *testing.T) { func TestGetDaemonSet(t *testing.T) {
ns := api.NamespaceDefault ns := api.NamespaceDefault
c := &testClient{ c := &testClient{
Request: testRequest{Method: "GET", Path: testapi.Experimental.ResourcePath(getDSResourceName(), ns, "foo"), Query: buildQueryValues(nil)}, Request: testRequest{Method: "GET", Path: testapi.Extensions.ResourcePath(getDSResourceName(), ns, "foo"), Query: buildQueryValues(nil)},
Response: Response{ Response: Response{
StatusCode: 200, StatusCode: 200,
Body: &experimental.DaemonSet{ Body: &extensions.DaemonSet{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "foo", Name: "foo",
Labels: map[string]string{ Labels: map[string]string{
...@@ -74,7 +74,7 @@ func TestGetDaemonSet(t *testing.T) { ...@@ -74,7 +74,7 @@ func TestGetDaemonSet(t *testing.T) {
"name": "baz", "name": "baz",
}, },
}, },
Spec: experimental.DaemonSetSpec{ Spec: extensions.DaemonSetSpec{
Template: &api.PodTemplateSpec{}, Template: &api.PodTemplateSpec{},
}, },
}, },
...@@ -97,14 +97,14 @@ func TestGetDaemonSetWithNoName(t *testing.T) { ...@@ -97,14 +97,14 @@ func TestGetDaemonSetWithNoName(t *testing.T) {
func TestUpdateDaemonSet(t *testing.T) { func TestUpdateDaemonSet(t *testing.T) {
ns := api.NamespaceDefault ns := api.NamespaceDefault
requestDaemonSet := &experimental.DaemonSet{ requestDaemonSet := &extensions.DaemonSet{
ObjectMeta: api.ObjectMeta{Name: "foo", ResourceVersion: "1"}, ObjectMeta: api.ObjectMeta{Name: "foo", ResourceVersion: "1"},
} }
c := &testClient{ c := &testClient{
Request: testRequest{Method: "PUT", Path: testapi.Experimental.ResourcePath(getDSResourceName(), ns, "foo"), Query: buildQueryValues(nil)}, Request: testRequest{Method: "PUT", Path: testapi.Extensions.ResourcePath(getDSResourceName(), ns, "foo"), Query: buildQueryValues(nil)},
Response: Response{ Response: Response{
StatusCode: 200, StatusCode: 200,
Body: &experimental.DaemonSet{ Body: &extensions.DaemonSet{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "foo", Name: "foo",
Labels: map[string]string{ Labels: map[string]string{
...@@ -112,7 +112,7 @@ func TestUpdateDaemonSet(t *testing.T) { ...@@ -112,7 +112,7 @@ func TestUpdateDaemonSet(t *testing.T) {
"name": "baz", "name": "baz",
}, },
}, },
Spec: experimental.DaemonSetSpec{ Spec: extensions.DaemonSetSpec{
Template: &api.PodTemplateSpec{}, Template: &api.PodTemplateSpec{},
}, },
}, },
...@@ -124,14 +124,14 @@ func TestUpdateDaemonSet(t *testing.T) { ...@@ -124,14 +124,14 @@ func TestUpdateDaemonSet(t *testing.T) {
func TestUpdateDaemonSetUpdateStatus(t *testing.T) { func TestUpdateDaemonSetUpdateStatus(t *testing.T) {
ns := api.NamespaceDefault ns := api.NamespaceDefault
requestDaemonSet := &experimental.DaemonSet{ requestDaemonSet := &extensions.DaemonSet{
ObjectMeta: api.ObjectMeta{Name: "foo", ResourceVersion: "1"}, ObjectMeta: api.ObjectMeta{Name: "foo", ResourceVersion: "1"},
} }
c := &testClient{ c := &testClient{
Request: testRequest{Method: "PUT", Path: testapi.Experimental.ResourcePath(getDSResourceName(), ns, "foo") + "/status", Query: buildQueryValues(nil)}, Request: testRequest{Method: "PUT", Path: testapi.Extensions.ResourcePath(getDSResourceName(), ns, "foo") + "/status", Query: buildQueryValues(nil)},
Response: Response{ Response: Response{
StatusCode: 200, StatusCode: 200,
Body: &experimental.DaemonSet{ Body: &extensions.DaemonSet{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "foo", Name: "foo",
Labels: map[string]string{ Labels: map[string]string{
...@@ -139,10 +139,10 @@ func TestUpdateDaemonSetUpdateStatus(t *testing.T) { ...@@ -139,10 +139,10 @@ func TestUpdateDaemonSetUpdateStatus(t *testing.T) {
"name": "baz", "name": "baz",
}, },
}, },
Spec: experimental.DaemonSetSpec{ Spec: extensions.DaemonSetSpec{
Template: &api.PodTemplateSpec{}, Template: &api.PodTemplateSpec{},
}, },
Status: experimental.DaemonSetStatus{}, Status: extensions.DaemonSetStatus{},
}, },
}, },
} }
...@@ -153,7 +153,7 @@ func TestUpdateDaemonSetUpdateStatus(t *testing.T) { ...@@ -153,7 +153,7 @@ func TestUpdateDaemonSetUpdateStatus(t *testing.T) {
func TestDeleteDaemon(t *testing.T) { func TestDeleteDaemon(t *testing.T) {
ns := api.NamespaceDefault ns := api.NamespaceDefault
c := &testClient{ c := &testClient{
Request: testRequest{Method: "DELETE", Path: testapi.Experimental.ResourcePath(getDSResourceName(), ns, "foo"), Query: buildQueryValues(nil)}, Request: testRequest{Method: "DELETE", Path: testapi.Extensions.ResourcePath(getDSResourceName(), ns, "foo"), Query: buildQueryValues(nil)},
Response: Response{StatusCode: 200}, Response: Response{StatusCode: 200},
} }
err := c.Setup(t).Experimental().DaemonSets(ns).Delete("foo") err := c.Setup(t).Experimental().DaemonSets(ns).Delete("foo")
...@@ -162,14 +162,14 @@ func TestDeleteDaemon(t *testing.T) { ...@@ -162,14 +162,14 @@ func TestDeleteDaemon(t *testing.T) {
func TestCreateDaemonSet(t *testing.T) { func TestCreateDaemonSet(t *testing.T) {
ns := api.NamespaceDefault ns := api.NamespaceDefault
requestDaemonSet := &experimental.DaemonSet{ requestDaemonSet := &extensions.DaemonSet{
ObjectMeta: api.ObjectMeta{Name: "foo"}, ObjectMeta: api.ObjectMeta{Name: "foo"},
} }
c := &testClient{ c := &testClient{
Request: testRequest{Method: "POST", Path: testapi.Experimental.ResourcePath(getDSResourceName(), ns, ""), Body: requestDaemonSet, Query: buildQueryValues(nil)}, Request: testRequest{Method: "POST", Path: testapi.Extensions.ResourcePath(getDSResourceName(), ns, ""), Body: requestDaemonSet, Query: buildQueryValues(nil)},
Response: Response{ Response: Response{
StatusCode: 200, StatusCode: 200,
Body: &experimental.DaemonSet{ Body: &extensions.DaemonSet{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "foo", Name: "foo",
Labels: map[string]string{ Labels: map[string]string{
...@@ -177,7 +177,7 @@ func TestCreateDaemonSet(t *testing.T) { ...@@ -177,7 +177,7 @@ func TestCreateDaemonSet(t *testing.T) {
"name": "baz", "name": "baz",
}, },
}, },
Spec: experimental.DaemonSetSpec{ Spec: extensions.DaemonSetSpec{
Template: &api.PodTemplateSpec{}, Template: &api.PodTemplateSpec{},
}, },
}, },
......
...@@ -18,7 +18,7 @@ package unversioned ...@@ -18,7 +18,7 @@ package unversioned
import ( import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/watch" "k8s.io/kubernetes/pkg/watch"
...@@ -31,11 +31,11 @@ type DeploymentsNamespacer interface { ...@@ -31,11 +31,11 @@ type DeploymentsNamespacer interface {
// DeploymentInterface has methods to work with Deployment resources. // DeploymentInterface has methods to work with Deployment resources.
type DeploymentInterface interface { type DeploymentInterface interface {
List(label labels.Selector, field fields.Selector) (*experimental.DeploymentList, error) List(label labels.Selector, field fields.Selector) (*extensions.DeploymentList, error)
Get(name string) (*experimental.Deployment, error) Get(name string) (*extensions.Deployment, error)
Delete(name string, options *api.DeleteOptions) error Delete(name string, options *api.DeleteOptions) error
Create(Deployment *experimental.Deployment) (*experimental.Deployment, error) Create(Deployment *extensions.Deployment) (*extensions.Deployment, error)
Update(Deployment *experimental.Deployment) (*experimental.Deployment, error) Update(Deployment *extensions.Deployment) (*extensions.Deployment, error)
Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)
} }
...@@ -54,15 +54,15 @@ func newDeployments(c *ExperimentalClient, namespace string) *deployments { ...@@ -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. // 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 *experimental.DeploymentList, err error) { func (c *deployments) List(label labels.Selector, field fields.Selector) (result *extensions.DeploymentList, err error) {
result = &experimental.DeploymentList{} result = &extensions.DeploymentList{}
err = c.client.Get().Namespace(c.ns).Resource("deployments").LabelsSelectorParam(label).FieldsSelectorParam(field).Do().Into(result) err = c.client.Get().Namespace(c.ns).Resource("deployments").LabelsSelectorParam(label).FieldsSelectorParam(field).Do().Into(result)
return return
} }
// Get takes name of the deployment, and returns the corresponding deployment object, and an error if there is any. // 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 *experimental.Deployment, err error) { func (c *deployments) Get(name string) (result *extensions.Deployment, err error) {
result = &experimental.Deployment{} result = &extensions.Deployment{}
err = c.client.Get().Namespace(c.ns).Resource("deployments").Name(name).Do().Into(result) err = c.client.Get().Namespace(c.ns).Resource("deployments").Name(name).Do().Into(result)
return return
} }
...@@ -80,15 +80,15 @@ func (c *deployments) Delete(name string, options *api.DeleteOptions) error { ...@@ -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. // 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 *experimental.Deployment) (result *experimental.Deployment, err error) { func (c *deployments) Create(deployment *extensions.Deployment) (result *extensions.Deployment, err error) {
result = &experimental.Deployment{} result = &extensions.Deployment{}
err = c.client.Post().Namespace(c.ns).Resource("deployments").Body(deployment).Do().Into(result) err = c.client.Post().Namespace(c.ns).Resource("deployments").Body(deployment).Do().Into(result)
return 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. // 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 *experimental.Deployment) (result *experimental.Deployment, err error) { func (c *deployments) Update(deployment *extensions.Deployment) (result *extensions.Deployment, err error) {
result = &experimental.Deployment{} result = &extensions.Deployment{}
err = c.client.Put().Namespace(c.ns).Resource("deployments").Name(deployment.Name).Body(deployment).Do().Into(result) err = c.client.Put().Namespace(c.ns).Resource("deployments").Name(deployment.Name).Body(deployment).Do().Into(result)
return return
} }
......
...@@ -22,7 +22,7 @@ import ( ...@@ -22,7 +22,7 @@ import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/testapi" "k8s.io/kubernetes/pkg/api/testapi"
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
) )
...@@ -33,7 +33,7 @@ func getDeploymentsResoureName() string { ...@@ -33,7 +33,7 @@ func getDeploymentsResoureName() string {
func TestDeploymentCreate(t *testing.T) { func TestDeploymentCreate(t *testing.T) {
ns := api.NamespaceDefault ns := api.NamespaceDefault
deployment := experimental.Deployment{ deployment := extensions.Deployment{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "abc", Name: "abc",
Namespace: ns, Namespace: ns,
...@@ -42,7 +42,7 @@ func TestDeploymentCreate(t *testing.T) { ...@@ -42,7 +42,7 @@ func TestDeploymentCreate(t *testing.T) {
c := &testClient{ c := &testClient{
Request: testRequest{ Request: testRequest{
Method: "POST", Method: "POST",
Path: testapi.Experimental.ResourcePath(getDeploymentsResoureName(), ns, ""), Path: testapi.Extensions.ResourcePath(getDeploymentsResoureName(), ns, ""),
Query: buildQueryValues(nil), Query: buildQueryValues(nil),
Body: &deployment, Body: &deployment,
}, },
...@@ -58,7 +58,7 @@ func TestDeploymentCreate(t *testing.T) { ...@@ -58,7 +58,7 @@ func TestDeploymentCreate(t *testing.T) {
func TestDeploymentGet(t *testing.T) { func TestDeploymentGet(t *testing.T) {
ns := api.NamespaceDefault ns := api.NamespaceDefault
deployment := &experimental.Deployment{ deployment := &extensions.Deployment{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "abc", Name: "abc",
Namespace: ns, Namespace: ns,
...@@ -67,7 +67,7 @@ func TestDeploymentGet(t *testing.T) { ...@@ -67,7 +67,7 @@ func TestDeploymentGet(t *testing.T) {
c := &testClient{ c := &testClient{
Request: testRequest{ Request: testRequest{
Method: "GET", Method: "GET",
Path: testapi.Experimental.ResourcePath(getDeploymentsResoureName(), ns, "abc"), Path: testapi.Extensions.ResourcePath(getDeploymentsResoureName(), ns, "abc"),
Query: buildQueryValues(nil), Query: buildQueryValues(nil),
Body: nil, Body: nil,
}, },
...@@ -80,8 +80,8 @@ func TestDeploymentGet(t *testing.T) { ...@@ -80,8 +80,8 @@ func TestDeploymentGet(t *testing.T) {
func TestDeploymentList(t *testing.T) { func TestDeploymentList(t *testing.T) {
ns := api.NamespaceDefault ns := api.NamespaceDefault
deploymentList := &experimental.DeploymentList{ deploymentList := &extensions.DeploymentList{
Items: []experimental.Deployment{ Items: []extensions.Deployment{
{ {
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "foo", Name: "foo",
...@@ -93,7 +93,7 @@ func TestDeploymentList(t *testing.T) { ...@@ -93,7 +93,7 @@ func TestDeploymentList(t *testing.T) {
c := &testClient{ c := &testClient{
Request: testRequest{ Request: testRequest{
Method: "GET", Method: "GET",
Path: testapi.Experimental.ResourcePath(getDeploymentsResoureName(), ns, ""), Path: testapi.Extensions.ResourcePath(getDeploymentsResoureName(), ns, ""),
Query: buildQueryValues(nil), Query: buildQueryValues(nil),
Body: nil, Body: nil,
}, },
...@@ -105,7 +105,7 @@ func TestDeploymentList(t *testing.T) { ...@@ -105,7 +105,7 @@ func TestDeploymentList(t *testing.T) {
func TestDeploymentUpdate(t *testing.T) { func TestDeploymentUpdate(t *testing.T) {
ns := api.NamespaceDefault ns := api.NamespaceDefault
deployment := &experimental.Deployment{ deployment := &extensions.Deployment{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "abc", Name: "abc",
Namespace: ns, Namespace: ns,
...@@ -115,7 +115,7 @@ func TestDeploymentUpdate(t *testing.T) { ...@@ -115,7 +115,7 @@ func TestDeploymentUpdate(t *testing.T) {
c := &testClient{ c := &testClient{
Request: testRequest{ Request: testRequest{
Method: "PUT", Method: "PUT",
Path: testapi.Experimental.ResourcePath(getDeploymentsResoureName(), ns, "abc"), Path: testapi.Extensions.ResourcePath(getDeploymentsResoureName(), ns, "abc"),
Query: buildQueryValues(nil), Query: buildQueryValues(nil),
}, },
Response: Response{StatusCode: 200, Body: deployment}, Response: Response{StatusCode: 200, Body: deployment},
...@@ -129,7 +129,7 @@ func TestDeploymentDelete(t *testing.T) { ...@@ -129,7 +129,7 @@ func TestDeploymentDelete(t *testing.T) {
c := &testClient{ c := &testClient{
Request: testRequest{ Request: testRequest{
Method: "DELETE", Method: "DELETE",
Path: testapi.Experimental.ResourcePath(getDeploymentsResoureName(), ns, "foo"), Path: testapi.Extensions.ResourcePath(getDeploymentsResoureName(), ns, "foo"),
Query: buildQueryValues(nil), Query: buildQueryValues(nil),
}, },
Response: Response{StatusCode: 200}, Response: Response{StatusCode: 200},
...@@ -142,7 +142,7 @@ func TestDeploymentWatch(t *testing.T) { ...@@ -142,7 +142,7 @@ func TestDeploymentWatch(t *testing.T) {
c := &testClient{ c := &testClient{
Request: testRequest{ Request: testRequest{
Method: "GET", Method: "GET",
Path: testapi.Experimental.ResourcePathWithPrefix("watch", getDeploymentsResoureName(), "", ""), Path: testapi.Extensions.ResourcePathWithPrefix("watch", getDeploymentsResoureName(), "", ""),
Query: url.Values{"resourceVersion": []string{}}, Query: url.Values{"resourceVersion": []string{}},
}, },
Response: Response{StatusCode: 200}, Response: Response{StatusCode: 200},
......
...@@ -130,7 +130,7 @@ func NewExperimentalOrDie(c *Config) *ExperimentalClient { ...@@ -130,7 +130,7 @@ func NewExperimentalOrDie(c *Config) *ExperimentalClient {
func setExperimentalDefaults(config *Config) error { func setExperimentalDefaults(config *Config) error {
// if experimental group is not registered, return an error // if experimental group is not registered, return an error
g, err := latest.Group("experimental") g, err := latest.Group("extensions")
if err != nil { if err != nil {
return err return err
} }
...@@ -146,7 +146,7 @@ func setExperimentalDefaults(config *Config) error { ...@@ -146,7 +146,7 @@ func setExperimentalDefaults(config *Config) error {
versionInterfaces, err := g.InterfacesFor(config.Version) versionInterfaces, err := g.InterfacesFor(config.Version)
if err != nil { if err != nil {
return fmt.Errorf("Experimental API version '%s' is not recognized (valid values: %s)", return fmt.Errorf("Experimental API version '%s' is not recognized (valid values: %s)",
config.Version, strings.Join(latest.GroupOrDie("experimental").Versions, ", ")) config.Version, strings.Join(latest.GroupOrDie("extensions").Versions, ", "))
} }
config.Codec = versionInterfaces.Codec config.Codec = versionInterfaces.Codec
if config.QPS == 0 { if config.QPS == 0 {
......
...@@ -144,7 +144,7 @@ func New(c *Config) (*Client, error) { ...@@ -144,7 +144,7 @@ func New(c *Config) (*Client, error) {
return nil, err return nil, err
} }
if _, err := latest.Group("experimental"); err != nil { if _, err := latest.Group("extensions"); err != nil {
return &Client{RESTClient: client, ExperimentalClient: nil}, nil return &Client{RESTClient: client, ExperimentalClient: nil}, nil
} }
experimentalConfig := *c experimentalConfig := *c
......
...@@ -18,7 +18,7 @@ package unversioned ...@@ -18,7 +18,7 @@ package unversioned
import ( import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/watch" "k8s.io/kubernetes/pkg/watch"
...@@ -31,11 +31,11 @@ type HorizontalPodAutoscalersNamespacer interface { ...@@ -31,11 +31,11 @@ type HorizontalPodAutoscalersNamespacer interface {
// HorizontalPodAutoscalerInterface has methods to work with HorizontalPodAutoscaler resources. // HorizontalPodAutoscalerInterface has methods to work with HorizontalPodAutoscaler resources.
type HorizontalPodAutoscalerInterface interface { type HorizontalPodAutoscalerInterface interface {
List(label labels.Selector, field fields.Selector) (*experimental.HorizontalPodAutoscalerList, error) List(label labels.Selector, field fields.Selector) (*extensions.HorizontalPodAutoscalerList, error)
Get(name string) (*experimental.HorizontalPodAutoscaler, error) Get(name string) (*extensions.HorizontalPodAutoscaler, error)
Delete(name string, options *api.DeleteOptions) error Delete(name string, options *api.DeleteOptions) error
Create(horizontalPodAutoscaler *experimental.HorizontalPodAutoscaler) (*experimental.HorizontalPodAutoscaler, error) Create(horizontalPodAutoscaler *extensions.HorizontalPodAutoscaler) (*extensions.HorizontalPodAutoscaler, error)
Update(horizontalPodAutoscaler *experimental.HorizontalPodAutoscaler) (*experimental.HorizontalPodAutoscaler, error) Update(horizontalPodAutoscaler *extensions.HorizontalPodAutoscaler) (*extensions.HorizontalPodAutoscaler, error)
Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)
} }
...@@ -54,15 +54,15 @@ func newHorizontalPodAutoscalers(c *ExperimentalClient, namespace string) *horiz ...@@ -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. // 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 *experimental.HorizontalPodAutoscalerList, err error) { func (c *horizontalPodAutoscalers) List(label labels.Selector, field fields.Selector) (result *extensions.HorizontalPodAutoscalerList, err error) {
result = &experimental.HorizontalPodAutoscalerList{} result = &extensions.HorizontalPodAutoscalerList{}
err = c.client.Get().Namespace(c.ns).Resource("horizontalPodAutoscalers").LabelsSelectorParam(label).FieldsSelectorParam(field).Do().Into(result) err = c.client.Get().Namespace(c.ns).Resource("horizontalPodAutoscalers").LabelsSelectorParam(label).FieldsSelectorParam(field).Do().Into(result)
return return
} }
// Get takes the name of the horizontalPodAutoscaler, and returns the corresponding HorizontalPodAutoscaler object, and an error if it occurs // 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 *experimental.HorizontalPodAutoscaler, err error) { func (c *horizontalPodAutoscalers) Get(name string) (result *extensions.HorizontalPodAutoscaler, err error) {
result = &experimental.HorizontalPodAutoscaler{} result = &extensions.HorizontalPodAutoscaler{}
err = c.client.Get().Namespace(c.ns).Resource("horizontalPodAutoscalers").Name(name).Do().Into(result) err = c.client.Get().Namespace(c.ns).Resource("horizontalPodAutoscalers").Name(name).Do().Into(result)
return return
} }
...@@ -81,15 +81,15 @@ func (c *horizontalPodAutoscalers) Delete(name string, options *api.DeleteOption ...@@ -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. // 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 *experimental.HorizontalPodAutoscaler) (result *experimental.HorizontalPodAutoscaler, err error) { func (c *horizontalPodAutoscalers) Create(horizontalPodAutoscaler *extensions.HorizontalPodAutoscaler) (result *extensions.HorizontalPodAutoscaler, err error) {
result = &experimental.HorizontalPodAutoscaler{} result = &extensions.HorizontalPodAutoscaler{}
err = c.client.Post().Namespace(c.ns).Resource("horizontalPodAutoscalers").Body(horizontalPodAutoscaler).Do().Into(result) err = c.client.Post().Namespace(c.ns).Resource("horizontalPodAutoscalers").Body(horizontalPodAutoscaler).Do().Into(result)
return 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. // 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 *experimental.HorizontalPodAutoscaler) (result *experimental.HorizontalPodAutoscaler, err error) { func (c *horizontalPodAutoscalers) Update(horizontalPodAutoscaler *extensions.HorizontalPodAutoscaler) (result *extensions.HorizontalPodAutoscaler, err error) {
result = &experimental.HorizontalPodAutoscaler{} result = &extensions.HorizontalPodAutoscaler{}
err = c.client.Put().Namespace(c.ns).Resource("horizontalPodAutoscalers").Name(horizontalPodAutoscaler.Name).Body(horizontalPodAutoscaler).Do().Into(result) err = c.client.Put().Namespace(c.ns).Resource("horizontalPodAutoscalers").Name(horizontalPodAutoscaler.Name).Body(horizontalPodAutoscaler).Do().Into(result)
return return
} }
......
...@@ -22,7 +22,7 @@ import ( ...@@ -22,7 +22,7 @@ import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/testapi" "k8s.io/kubernetes/pkg/api/testapi"
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
) )
...@@ -33,7 +33,7 @@ func getHorizontalPodAutoscalersResoureName() string { ...@@ -33,7 +33,7 @@ func getHorizontalPodAutoscalersResoureName() string {
func TestHorizontalPodAutoscalerCreate(t *testing.T) { func TestHorizontalPodAutoscalerCreate(t *testing.T) {
ns := api.NamespaceDefault ns := api.NamespaceDefault
horizontalPodAutoscaler := experimental.HorizontalPodAutoscaler{ horizontalPodAutoscaler := extensions.HorizontalPodAutoscaler{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "abc", Name: "abc",
Namespace: ns, Namespace: ns,
...@@ -42,7 +42,7 @@ func TestHorizontalPodAutoscalerCreate(t *testing.T) { ...@@ -42,7 +42,7 @@ func TestHorizontalPodAutoscalerCreate(t *testing.T) {
c := &testClient{ c := &testClient{
Request: testRequest{ Request: testRequest{
Method: "POST", Method: "POST",
Path: testapi.Experimental.ResourcePath(getHorizontalPodAutoscalersResoureName(), ns, ""), Path: testapi.Extensions.ResourcePath(getHorizontalPodAutoscalersResoureName(), ns, ""),
Query: buildQueryValues(nil), Query: buildQueryValues(nil),
Body: &horizontalPodAutoscaler, Body: &horizontalPodAutoscaler,
}, },
...@@ -58,7 +58,7 @@ func TestHorizontalPodAutoscalerCreate(t *testing.T) { ...@@ -58,7 +58,7 @@ func TestHorizontalPodAutoscalerCreate(t *testing.T) {
func TestHorizontalPodAutoscalerGet(t *testing.T) { func TestHorizontalPodAutoscalerGet(t *testing.T) {
ns := api.NamespaceDefault ns := api.NamespaceDefault
horizontalPodAutoscaler := &experimental.HorizontalPodAutoscaler{ horizontalPodAutoscaler := &extensions.HorizontalPodAutoscaler{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "abc", Name: "abc",
Namespace: ns, Namespace: ns,
...@@ -67,7 +67,7 @@ func TestHorizontalPodAutoscalerGet(t *testing.T) { ...@@ -67,7 +67,7 @@ func TestHorizontalPodAutoscalerGet(t *testing.T) {
c := &testClient{ c := &testClient{
Request: testRequest{ Request: testRequest{
Method: "GET", Method: "GET",
Path: testapi.Experimental.ResourcePath(getHorizontalPodAutoscalersResoureName(), ns, "abc"), Path: testapi.Extensions.ResourcePath(getHorizontalPodAutoscalersResoureName(), ns, "abc"),
Query: buildQueryValues(nil), Query: buildQueryValues(nil),
Body: nil, Body: nil,
}, },
...@@ -80,8 +80,8 @@ func TestHorizontalPodAutoscalerGet(t *testing.T) { ...@@ -80,8 +80,8 @@ func TestHorizontalPodAutoscalerGet(t *testing.T) {
func TestHorizontalPodAutoscalerList(t *testing.T) { func TestHorizontalPodAutoscalerList(t *testing.T) {
ns := api.NamespaceDefault ns := api.NamespaceDefault
horizontalPodAutoscalerList := &experimental.HorizontalPodAutoscalerList{ horizontalPodAutoscalerList := &extensions.HorizontalPodAutoscalerList{
Items: []experimental.HorizontalPodAutoscaler{ Items: []extensions.HorizontalPodAutoscaler{
{ {
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "foo", Name: "foo",
...@@ -93,7 +93,7 @@ func TestHorizontalPodAutoscalerList(t *testing.T) { ...@@ -93,7 +93,7 @@ func TestHorizontalPodAutoscalerList(t *testing.T) {
c := &testClient{ c := &testClient{
Request: testRequest{ Request: testRequest{
Method: "GET", Method: "GET",
Path: testapi.Experimental.ResourcePath(getHorizontalPodAutoscalersResoureName(), ns, ""), Path: testapi.Extensions.ResourcePath(getHorizontalPodAutoscalersResoureName(), ns, ""),
Query: buildQueryValues(nil), Query: buildQueryValues(nil),
Body: nil, Body: nil,
}, },
...@@ -105,7 +105,7 @@ func TestHorizontalPodAutoscalerList(t *testing.T) { ...@@ -105,7 +105,7 @@ func TestHorizontalPodAutoscalerList(t *testing.T) {
func TestHorizontalPodAutoscalerUpdate(t *testing.T) { func TestHorizontalPodAutoscalerUpdate(t *testing.T) {
ns := api.NamespaceDefault ns := api.NamespaceDefault
horizontalPodAutoscaler := &experimental.HorizontalPodAutoscaler{ horizontalPodAutoscaler := &extensions.HorizontalPodAutoscaler{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "abc", Name: "abc",
Namespace: ns, Namespace: ns,
...@@ -113,7 +113,7 @@ func TestHorizontalPodAutoscalerUpdate(t *testing.T) { ...@@ -113,7 +113,7 @@ func TestHorizontalPodAutoscalerUpdate(t *testing.T) {
}, },
} }
c := &testClient{ c := &testClient{
Request: testRequest{Method: "PUT", Path: testapi.Experimental.ResourcePath(getHorizontalPodAutoscalersResoureName(), ns, "abc"), Query: buildQueryValues(nil)}, Request: testRequest{Method: "PUT", Path: testapi.Extensions.ResourcePath(getHorizontalPodAutoscalersResoureName(), ns, "abc"), Query: buildQueryValues(nil)},
Response: Response{StatusCode: 200, Body: horizontalPodAutoscaler}, Response: Response{StatusCode: 200, Body: horizontalPodAutoscaler},
} }
response, err := c.Setup(t).Experimental().HorizontalPodAutoscalers(ns).Update(horizontalPodAutoscaler) response, err := c.Setup(t).Experimental().HorizontalPodAutoscalers(ns).Update(horizontalPodAutoscaler)
...@@ -123,7 +123,7 @@ func TestHorizontalPodAutoscalerUpdate(t *testing.T) { ...@@ -123,7 +123,7 @@ func TestHorizontalPodAutoscalerUpdate(t *testing.T) {
func TestHorizontalPodAutoscalerDelete(t *testing.T) { func TestHorizontalPodAutoscalerDelete(t *testing.T) {
ns := api.NamespaceDefault ns := api.NamespaceDefault
c := &testClient{ c := &testClient{
Request: testRequest{Method: "DELETE", Path: testapi.Experimental.ResourcePath(getHorizontalPodAutoscalersResoureName(), ns, "foo"), Query: buildQueryValues(nil)}, Request: testRequest{Method: "DELETE", Path: testapi.Extensions.ResourcePath(getHorizontalPodAutoscalersResoureName(), ns, "foo"), Query: buildQueryValues(nil)},
Response: Response{StatusCode: 200}, Response: Response{StatusCode: 200},
} }
err := c.Setup(t).Experimental().HorizontalPodAutoscalers(ns).Delete("foo", nil) err := c.Setup(t).Experimental().HorizontalPodAutoscalers(ns).Delete("foo", nil)
...@@ -134,7 +134,7 @@ func TestHorizontalPodAutoscalerWatch(t *testing.T) { ...@@ -134,7 +134,7 @@ func TestHorizontalPodAutoscalerWatch(t *testing.T) {
c := &testClient{ c := &testClient{
Request: testRequest{ Request: testRequest{
Method: "GET", Method: "GET",
Path: testapi.Experimental.ResourcePathWithPrefix("watch", getHorizontalPodAutoscalersResoureName(), "", ""), Path: testapi.Extensions.ResourcePathWithPrefix("watch", getHorizontalPodAutoscalersResoureName(), "", ""),
Query: url.Values{"resourceVersion": []string{}}}, Query: url.Values{"resourceVersion": []string{}}},
Response: Response{StatusCode: 200}, Response: Response{StatusCode: 200},
} }
......
...@@ -19,5 +19,5 @@ package unversioned ...@@ -19,5 +19,5 @@ package unversioned
// These imports are the API groups the client will support. // These imports are the API groups the client will support.
import ( import (
_ "k8s.io/kubernetes/pkg/api/install" _ "k8s.io/kubernetes/pkg/api/install"
_ "k8s.io/kubernetes/pkg/apis/experimental/install" _ "k8s.io/kubernetes/pkg/apis/extensions/install"
) )
...@@ -18,7 +18,7 @@ package unversioned ...@@ -18,7 +18,7 @@ package unversioned
import ( import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/watch" "k8s.io/kubernetes/pkg/watch"
...@@ -31,13 +31,13 @@ type IngressNamespacer interface { ...@@ -31,13 +31,13 @@ type IngressNamespacer interface {
// IngressInterface exposes methods to work on Ingress resources. // IngressInterface exposes methods to work on Ingress resources.
type IngressInterface interface { type IngressInterface interface {
List(label labels.Selector, field fields.Selector) (*experimental.IngressList, error) List(label labels.Selector, field fields.Selector) (*extensions.IngressList, error)
Get(name string) (*experimental.Ingress, error) Get(name string) (*extensions.Ingress, error)
Create(ingress *experimental.Ingress) (*experimental.Ingress, error) Create(ingress *extensions.Ingress) (*extensions.Ingress, error)
Update(ingress *experimental.Ingress) (*experimental.Ingress, error) Update(ingress *extensions.Ingress) (*extensions.Ingress, error)
Delete(name string, options *api.DeleteOptions) error Delete(name string, options *api.DeleteOptions) error
Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)
UpdateStatus(ingress *experimental.Ingress) (*experimental.Ingress, error) UpdateStatus(ingress *extensions.Ingress) (*extensions.Ingress, error)
} }
// ingress implements IngressNamespacer interface // ingress implements IngressNamespacer interface
...@@ -52,29 +52,29 @@ func newIngress(c *ExperimentalClient, namespace string) *ingress { ...@@ -52,29 +52,29 @@ func newIngress(c *ExperimentalClient, namespace string) *ingress {
} }
// List returns a list of ingress that match the label and field selectors. // List returns a list of ingress that match the label and field selectors.
func (c *ingress) List(label labels.Selector, field fields.Selector) (result *experimental.IngressList, err error) { func (c *ingress) List(label labels.Selector, field fields.Selector) (result *extensions.IngressList, err error) {
result = &experimental.IngressList{} result = &extensions.IngressList{}
err = c.r.Get().Namespace(c.ns).Resource("ingress").LabelsSelectorParam(label).FieldsSelectorParam(field).Do().Into(result) err = c.r.Get().Namespace(c.ns).Resource("ingress").LabelsSelectorParam(label).FieldsSelectorParam(field).Do().Into(result)
return return
} }
// Get returns information about a particular ingress. // Get returns information about a particular ingress.
func (c *ingress) Get(name string) (result *experimental.Ingress, err error) { func (c *ingress) Get(name string) (result *extensions.Ingress, err error) {
result = &experimental.Ingress{} result = &extensions.Ingress{}
err = c.r.Get().Namespace(c.ns).Resource("ingress").Name(name).Do().Into(result) err = c.r.Get().Namespace(c.ns).Resource("ingress").Name(name).Do().Into(result)
return return
} }
// Create creates a new ingress. // Create creates a new ingress.
func (c *ingress) Create(ingress *experimental.Ingress) (result *experimental.Ingress, err error) { func (c *ingress) Create(ingress *extensions.Ingress) (result *extensions.Ingress, err error) {
result = &experimental.Ingress{} result = &extensions.Ingress{}
err = c.r.Post().Namespace(c.ns).Resource("ingress").Body(ingress).Do().Into(result) err = c.r.Post().Namespace(c.ns).Resource("ingress").Body(ingress).Do().Into(result)
return return
} }
// Update updates an existing ingress. // Update updates an existing ingress.
func (c *ingress) Update(ingress *experimental.Ingress) (result *experimental.Ingress, err error) { func (c *ingress) Update(ingress *extensions.Ingress) (result *extensions.Ingress, err error) {
result = &experimental.Ingress{} result = &extensions.Ingress{}
err = c.r.Put().Namespace(c.ns).Resource("ingress").Name(ingress.Name).Body(ingress).Do().Into(result) err = c.r.Put().Namespace(c.ns).Resource("ingress").Name(ingress.Name).Body(ingress).Do().Into(result)
return return
} }
...@@ -105,8 +105,8 @@ func (c *ingress) Watch(label labels.Selector, field fields.Selector, resourceVe ...@@ -105,8 +105,8 @@ func (c *ingress) Watch(label labels.Selector, field fields.Selector, resourceVe
} }
// UpdateStatus takes the name of the ingress and the new status. Returns the server's representation of the ingress, and an error, if it occurs. // UpdateStatus takes the name of the ingress and the new status. Returns the server's representation of the ingress, and an error, if it occurs.
func (c *ingress) UpdateStatus(ingress *experimental.Ingress) (result *experimental.Ingress, err error) { func (c *ingress) UpdateStatus(ingress *extensions.Ingress) (result *extensions.Ingress, err error) {
result = &experimental.Ingress{} result = &extensions.Ingress{}
err = c.r.Put().Namespace(c.ns).Resource("ingress").Name(ingress.Name).SubResource("status").Body(ingress).Do().Into(result) err = c.r.Put().Namespace(c.ns).Resource("ingress").Name(ingress.Name).SubResource("status").Body(ingress).Do().Into(result)
return return
} }
...@@ -21,7 +21,7 @@ import ( ...@@ -21,7 +21,7 @@ import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/testapi" "k8s.io/kubernetes/pkg/api/testapi"
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
) )
...@@ -35,11 +35,11 @@ func TestListIngress(t *testing.T) { ...@@ -35,11 +35,11 @@ func TestListIngress(t *testing.T) {
c := &testClient{ c := &testClient{
Request: testRequest{ Request: testRequest{
Method: "GET", Method: "GET",
Path: testapi.Experimental.ResourcePath(getIngressResourceName(), ns, ""), Path: testapi.Extensions.ResourcePath(getIngressResourceName(), ns, ""),
}, },
Response: Response{StatusCode: 200, Response: Response{StatusCode: 200,
Body: &experimental.IngressList{ Body: &extensions.IngressList{
Items: []experimental.Ingress{ Items: []extensions.Ingress{
{ {
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "foo", Name: "foo",
...@@ -48,8 +48,8 @@ func TestListIngress(t *testing.T) { ...@@ -48,8 +48,8 @@ func TestListIngress(t *testing.T) {
"name": "baz", "name": "baz",
}, },
}, },
Spec: experimental.IngressSpec{ Spec: extensions.IngressSpec{
Rules: []experimental.IngressRule{}, Rules: []extensions.IngressRule{},
}, },
}, },
}, },
...@@ -65,12 +65,12 @@ func TestGetIngress(t *testing.T) { ...@@ -65,12 +65,12 @@ func TestGetIngress(t *testing.T) {
c := &testClient{ c := &testClient{
Request: testRequest{ Request: testRequest{
Method: "GET", Method: "GET",
Path: testapi.Experimental.ResourcePath(getIngressResourceName(), ns, "foo"), Path: testapi.Extensions.ResourcePath(getIngressResourceName(), ns, "foo"),
Query: buildQueryValues(nil), Query: buildQueryValues(nil),
}, },
Response: Response{ Response: Response{
StatusCode: 200, StatusCode: 200,
Body: &experimental.Ingress{ Body: &extensions.Ingress{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "foo", Name: "foo",
Labels: map[string]string{ Labels: map[string]string{
...@@ -78,8 +78,8 @@ func TestGetIngress(t *testing.T) { ...@@ -78,8 +78,8 @@ func TestGetIngress(t *testing.T) {
"name": "baz", "name": "baz",
}, },
}, },
Spec: experimental.IngressSpec{ Spec: extensions.IngressSpec{
Rules: []experimental.IngressRule{}, Rules: []extensions.IngressRule{},
}, },
}, },
}, },
...@@ -101,7 +101,7 @@ func TestGetIngressWithNoName(t *testing.T) { ...@@ -101,7 +101,7 @@ func TestGetIngressWithNoName(t *testing.T) {
func TestUpdateIngress(t *testing.T) { func TestUpdateIngress(t *testing.T) {
ns := api.NamespaceDefault ns := api.NamespaceDefault
requestIngress := &experimental.Ingress{ requestIngress := &extensions.Ingress{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "foo", Name: "foo",
Namespace: ns, Namespace: ns,
...@@ -111,12 +111,12 @@ func TestUpdateIngress(t *testing.T) { ...@@ -111,12 +111,12 @@ func TestUpdateIngress(t *testing.T) {
c := &testClient{ c := &testClient{
Request: testRequest{ Request: testRequest{
Method: "PUT", Method: "PUT",
Path: testapi.Experimental.ResourcePath(getIngressResourceName(), ns, "foo"), Path: testapi.Extensions.ResourcePath(getIngressResourceName(), ns, "foo"),
Query: buildQueryValues(nil), Query: buildQueryValues(nil),
}, },
Response: Response{ Response: Response{
StatusCode: 200, StatusCode: 200,
Body: &experimental.Ingress{ Body: &extensions.Ingress{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "foo", Name: "foo",
Labels: map[string]string{ Labels: map[string]string{
...@@ -124,8 +124,8 @@ func TestUpdateIngress(t *testing.T) { ...@@ -124,8 +124,8 @@ func TestUpdateIngress(t *testing.T) {
"name": "baz", "name": "baz",
}, },
}, },
Spec: experimental.IngressSpec{ Spec: extensions.IngressSpec{
Rules: []experimental.IngressRule{}, Rules: []extensions.IngressRule{},
}, },
}, },
}, },
...@@ -141,25 +141,25 @@ func TestUpdateIngressStatus(t *testing.T) { ...@@ -141,25 +141,25 @@ func TestUpdateIngressStatus(t *testing.T) {
{IP: "127.0.0.1"}, {IP: "127.0.0.1"},
}, },
} }
requestIngress := &experimental.Ingress{ requestIngress := &extensions.Ingress{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "foo", Name: "foo",
Namespace: ns, Namespace: ns,
ResourceVersion: "1", ResourceVersion: "1",
}, },
Status: experimental.IngressStatus{ Status: extensions.IngressStatus{
LoadBalancer: lbStatus, LoadBalancer: lbStatus,
}, },
} }
c := &testClient{ c := &testClient{
Request: testRequest{ Request: testRequest{
Method: "PUT", Method: "PUT",
Path: testapi.Experimental.ResourcePath(getIngressResourceName(), ns, "foo") + "/status", Path: testapi.Extensions.ResourcePath(getIngressResourceName(), ns, "foo") + "/status",
Query: buildQueryValues(nil), Query: buildQueryValues(nil),
}, },
Response: Response{ Response: Response{
StatusCode: 200, StatusCode: 200,
Body: &experimental.Ingress{ Body: &extensions.Ingress{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "foo", Name: "foo",
Labels: map[string]string{ Labels: map[string]string{
...@@ -167,10 +167,10 @@ func TestUpdateIngressStatus(t *testing.T) { ...@@ -167,10 +167,10 @@ func TestUpdateIngressStatus(t *testing.T) {
"name": "baz", "name": "baz",
}, },
}, },
Spec: experimental.IngressSpec{ Spec: extensions.IngressSpec{
Rules: []experimental.IngressRule{}, Rules: []extensions.IngressRule{},
}, },
Status: experimental.IngressStatus{ Status: extensions.IngressStatus{
LoadBalancer: lbStatus, LoadBalancer: lbStatus,
}, },
}, },
...@@ -185,7 +185,7 @@ func TestDeleteIngress(t *testing.T) { ...@@ -185,7 +185,7 @@ func TestDeleteIngress(t *testing.T) {
c := &testClient{ c := &testClient{
Request: testRequest{ Request: testRequest{
Method: "DELETE", Method: "DELETE",
Path: testapi.Experimental.ResourcePath(getIngressResourceName(), ns, "foo"), Path: testapi.Extensions.ResourcePath(getIngressResourceName(), ns, "foo"),
Query: buildQueryValues(nil), Query: buildQueryValues(nil),
}, },
Response: Response{StatusCode: 200}, Response: Response{StatusCode: 200},
...@@ -196,7 +196,7 @@ func TestDeleteIngress(t *testing.T) { ...@@ -196,7 +196,7 @@ func TestDeleteIngress(t *testing.T) {
func TestCreateIngress(t *testing.T) { func TestCreateIngress(t *testing.T) {
ns := api.NamespaceDefault ns := api.NamespaceDefault
requestIngress := &experimental.Ingress{ requestIngress := &extensions.Ingress{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "foo", Name: "foo",
Namespace: ns, Namespace: ns,
...@@ -205,13 +205,13 @@ func TestCreateIngress(t *testing.T) { ...@@ -205,13 +205,13 @@ func TestCreateIngress(t *testing.T) {
c := &testClient{ c := &testClient{
Request: testRequest{ Request: testRequest{
Method: "POST", Method: "POST",
Path: testapi.Experimental.ResourcePath(getIngressResourceName(), ns, ""), Path: testapi.Extensions.ResourcePath(getIngressResourceName(), ns, ""),
Body: requestIngress, Body: requestIngress,
Query: buildQueryValues(nil), Query: buildQueryValues(nil),
}, },
Response: Response{ Response: Response{
StatusCode: 200, StatusCode: 200,
Body: &experimental.Ingress{ Body: &extensions.Ingress{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "foo", Name: "foo",
Labels: map[string]string{ Labels: map[string]string{
...@@ -219,8 +219,8 @@ func TestCreateIngress(t *testing.T) { ...@@ -219,8 +219,8 @@ func TestCreateIngress(t *testing.T) {
"name": "baz", "name": "baz",
}, },
}, },
Spec: experimental.IngressSpec{ Spec: extensions.IngressSpec{
Rules: []experimental.IngressRule{}, Rules: []extensions.IngressRule{},
}, },
}, },
}, },
......
...@@ -19,7 +19,7 @@ package unversioned ...@@ -19,7 +19,7 @@ package unversioned
import ( import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/latest" "k8s.io/kubernetes/pkg/api/latest"
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/watch" "k8s.io/kubernetes/pkg/watch"
...@@ -32,13 +32,13 @@ type JobsNamespacer interface { ...@@ -32,13 +32,13 @@ type JobsNamespacer interface {
// JobInterface exposes methods to work on Job resources. // JobInterface exposes methods to work on Job resources.
type JobInterface interface { type JobInterface interface {
List(label labels.Selector, field fields.Selector) (*experimental.JobList, error) List(label labels.Selector, field fields.Selector) (*extensions.JobList, error)
Get(name string) (*experimental.Job, error) Get(name string) (*extensions.Job, error)
Create(job *experimental.Job) (*experimental.Job, error) Create(job *extensions.Job) (*extensions.Job, error)
Update(job *experimental.Job) (*experimental.Job, error) Update(job *extensions.Job) (*extensions.Job, error)
Delete(name string, options *api.DeleteOptions) error Delete(name string, options *api.DeleteOptions) error
Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)
UpdateStatus(job *experimental.Job) (*experimental.Job, error) UpdateStatus(job *extensions.Job) (*extensions.Job, error)
} }
// jobs implements JobsNamespacer interface // jobs implements JobsNamespacer interface
...@@ -56,29 +56,29 @@ func newJobs(c *ExperimentalClient, namespace string) *jobs { ...@@ -56,29 +56,29 @@ func newJobs(c *ExperimentalClient, namespace string) *jobs {
var _ JobInterface = &jobs{} var _ JobInterface = &jobs{}
// List returns a list of jobs that match the label and field selectors. // List returns a list of jobs that match the label and field selectors.
func (c *jobs) List(label labels.Selector, field fields.Selector) (result *experimental.JobList, err error) { func (c *jobs) List(label labels.Selector, field fields.Selector) (result *extensions.JobList, err error) {
result = &experimental.JobList{} result = &extensions.JobList{}
err = c.r.Get().Namespace(c.ns).Resource("jobs").LabelsSelectorParam(label).FieldsSelectorParam(field).Do().Into(result) err = c.r.Get().Namespace(c.ns).Resource("jobs").LabelsSelectorParam(label).FieldsSelectorParam(field).Do().Into(result)
return return
} }
// Get returns information about a particular job. // Get returns information about a particular job.
func (c *jobs) Get(name string) (result *experimental.Job, err error) { func (c *jobs) Get(name string) (result *extensions.Job, err error) {
result = &experimental.Job{} result = &extensions.Job{}
err = c.r.Get().Namespace(c.ns).Resource("jobs").Name(name).Do().Into(result) err = c.r.Get().Namespace(c.ns).Resource("jobs").Name(name).Do().Into(result)
return return
} }
// Create creates a new job. // Create creates a new job.
func (c *jobs) Create(job *experimental.Job) (result *experimental.Job, err error) { func (c *jobs) Create(job *extensions.Job) (result *extensions.Job, err error) {
result = &experimental.Job{} result = &extensions.Job{}
err = c.r.Post().Namespace(c.ns).Resource("jobs").Body(job).Do().Into(result) err = c.r.Post().Namespace(c.ns).Resource("jobs").Body(job).Do().Into(result)
return return
} }
// Update updates an existing job. // Update updates an existing job.
func (c *jobs) Update(job *experimental.Job) (result *experimental.Job, err error) { func (c *jobs) Update(job *extensions.Job) (result *extensions.Job, err error) {
result = &experimental.Job{} result = &extensions.Job{}
err = c.r.Put().Namespace(c.ns).Resource("jobs").Name(job.Name).Body(job).Do().Into(result) err = c.r.Put().Namespace(c.ns).Resource("jobs").Name(job.Name).Body(job).Do().Into(result)
return return
} }
...@@ -109,8 +109,8 @@ func (c *jobs) Watch(label labels.Selector, field fields.Selector, resourceVersi ...@@ -109,8 +109,8 @@ func (c *jobs) Watch(label labels.Selector, field fields.Selector, resourceVersi
} }
// UpdateStatus takes the name of the job and the new status. Returns the server's representation of the job, and an error, if it occurs. // UpdateStatus takes the name of the job and the new status. Returns the server's representation of the job, and an error, if it occurs.
func (c *jobs) UpdateStatus(job *experimental.Job) (result *experimental.Job, err error) { func (c *jobs) UpdateStatus(job *extensions.Job) (result *extensions.Job, err error) {
result = &experimental.Job{} result = &extensions.Job{}
err = c.r.Put().Namespace(c.ns).Resource("jobs").Name(job.Name).SubResource("status").Body(job).Do().Into(result) err = c.r.Put().Namespace(c.ns).Resource("jobs").Name(job.Name).SubResource("status").Body(job).Do().Into(result)
return return
} }
...@@ -21,7 +21,7 @@ import ( ...@@ -21,7 +21,7 @@ import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/testapi" "k8s.io/kubernetes/pkg/api/testapi"
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
) )
...@@ -35,11 +35,11 @@ func TestListJobs(t *testing.T) { ...@@ -35,11 +35,11 @@ func TestListJobs(t *testing.T) {
c := &testClient{ c := &testClient{
Request: testRequest{ Request: testRequest{
Method: "GET", Method: "GET",
Path: testapi.Experimental.ResourcePath(getJobResourceName(), ns, ""), Path: testapi.Extensions.ResourcePath(getJobResourceName(), ns, ""),
}, },
Response: Response{StatusCode: 200, Response: Response{StatusCode: 200,
Body: &experimental.JobList{ Body: &extensions.JobList{
Items: []experimental.Job{ Items: []extensions.Job{
{ {
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "foo", Name: "foo",
...@@ -48,7 +48,7 @@ func TestListJobs(t *testing.T) { ...@@ -48,7 +48,7 @@ func TestListJobs(t *testing.T) {
"name": "baz", "name": "baz",
}, },
}, },
Spec: experimental.JobSpec{ Spec: extensions.JobSpec{
Template: &api.PodTemplateSpec{}, Template: &api.PodTemplateSpec{},
}, },
}, },
...@@ -65,12 +65,12 @@ func TestGetJob(t *testing.T) { ...@@ -65,12 +65,12 @@ func TestGetJob(t *testing.T) {
c := &testClient{ c := &testClient{
Request: testRequest{ Request: testRequest{
Method: "GET", Method: "GET",
Path: testapi.Experimental.ResourcePath(getJobResourceName(), ns, "foo"), Path: testapi.Extensions.ResourcePath(getJobResourceName(), ns, "foo"),
Query: buildQueryValues(nil), Query: buildQueryValues(nil),
}, },
Response: Response{ Response: Response{
StatusCode: 200, StatusCode: 200,
Body: &experimental.Job{ Body: &extensions.Job{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "foo", Name: "foo",
Labels: map[string]string{ Labels: map[string]string{
...@@ -78,7 +78,7 @@ func TestGetJob(t *testing.T) { ...@@ -78,7 +78,7 @@ func TestGetJob(t *testing.T) {
"name": "baz", "name": "baz",
}, },
}, },
Spec: experimental.JobSpec{ Spec: extensions.JobSpec{
Template: &api.PodTemplateSpec{}, Template: &api.PodTemplateSpec{},
}, },
}, },
...@@ -101,7 +101,7 @@ func TestGetJobWithNoName(t *testing.T) { ...@@ -101,7 +101,7 @@ func TestGetJobWithNoName(t *testing.T) {
func TestUpdateJob(t *testing.T) { func TestUpdateJob(t *testing.T) {
ns := api.NamespaceDefault ns := api.NamespaceDefault
requestJob := &experimental.Job{ requestJob := &extensions.Job{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "foo", Name: "foo",
Namespace: ns, Namespace: ns,
...@@ -111,12 +111,12 @@ func TestUpdateJob(t *testing.T) { ...@@ -111,12 +111,12 @@ func TestUpdateJob(t *testing.T) {
c := &testClient{ c := &testClient{
Request: testRequest{ Request: testRequest{
Method: "PUT", Method: "PUT",
Path: testapi.Experimental.ResourcePath(getJobResourceName(), ns, "foo"), Path: testapi.Extensions.ResourcePath(getJobResourceName(), ns, "foo"),
Query: buildQueryValues(nil), Query: buildQueryValues(nil),
}, },
Response: Response{ Response: Response{
StatusCode: 200, StatusCode: 200,
Body: &experimental.Job{ Body: &extensions.Job{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "foo", Name: "foo",
Labels: map[string]string{ Labels: map[string]string{
...@@ -124,7 +124,7 @@ func TestUpdateJob(t *testing.T) { ...@@ -124,7 +124,7 @@ func TestUpdateJob(t *testing.T) {
"name": "baz", "name": "baz",
}, },
}, },
Spec: experimental.JobSpec{ Spec: extensions.JobSpec{
Template: &api.PodTemplateSpec{}, Template: &api.PodTemplateSpec{},
}, },
}, },
...@@ -136,7 +136,7 @@ func TestUpdateJob(t *testing.T) { ...@@ -136,7 +136,7 @@ func TestUpdateJob(t *testing.T) {
func TestUpdateJobStatus(t *testing.T) { func TestUpdateJobStatus(t *testing.T) {
ns := api.NamespaceDefault ns := api.NamespaceDefault
requestJob := &experimental.Job{ requestJob := &extensions.Job{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "foo", Name: "foo",
Namespace: ns, Namespace: ns,
...@@ -146,12 +146,12 @@ func TestUpdateJobStatus(t *testing.T) { ...@@ -146,12 +146,12 @@ func TestUpdateJobStatus(t *testing.T) {
c := &testClient{ c := &testClient{
Request: testRequest{ Request: testRequest{
Method: "PUT", Method: "PUT",
Path: testapi.Experimental.ResourcePath(getJobResourceName(), ns, "foo") + "/status", Path: testapi.Extensions.ResourcePath(getJobResourceName(), ns, "foo") + "/status",
Query: buildQueryValues(nil), Query: buildQueryValues(nil),
}, },
Response: Response{ Response: Response{
StatusCode: 200, StatusCode: 200,
Body: &experimental.Job{ Body: &extensions.Job{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "foo", Name: "foo",
Labels: map[string]string{ Labels: map[string]string{
...@@ -159,10 +159,10 @@ func TestUpdateJobStatus(t *testing.T) { ...@@ -159,10 +159,10 @@ func TestUpdateJobStatus(t *testing.T) {
"name": "baz", "name": "baz",
}, },
}, },
Spec: experimental.JobSpec{ Spec: extensions.JobSpec{
Template: &api.PodTemplateSpec{}, Template: &api.PodTemplateSpec{},
}, },
Status: experimental.JobStatus{ Status: extensions.JobStatus{
Active: 1, Active: 1,
}, },
}, },
...@@ -177,7 +177,7 @@ func TestDeleteJob(t *testing.T) { ...@@ -177,7 +177,7 @@ func TestDeleteJob(t *testing.T) {
c := &testClient{ c := &testClient{
Request: testRequest{ Request: testRequest{
Method: "DELETE", Method: "DELETE",
Path: testapi.Experimental.ResourcePath(getJobResourceName(), ns, "foo"), Path: testapi.Extensions.ResourcePath(getJobResourceName(), ns, "foo"),
Query: buildQueryValues(nil), Query: buildQueryValues(nil),
}, },
Response: Response{StatusCode: 200}, Response: Response{StatusCode: 200},
...@@ -188,7 +188,7 @@ func TestDeleteJob(t *testing.T) { ...@@ -188,7 +188,7 @@ func TestDeleteJob(t *testing.T) {
func TestCreateJob(t *testing.T) { func TestCreateJob(t *testing.T) {
ns := api.NamespaceDefault ns := api.NamespaceDefault
requestJob := &experimental.Job{ requestJob := &extensions.Job{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "foo", Name: "foo",
Namespace: ns, Namespace: ns,
...@@ -197,13 +197,13 @@ func TestCreateJob(t *testing.T) { ...@@ -197,13 +197,13 @@ func TestCreateJob(t *testing.T) {
c := &testClient{ c := &testClient{
Request: testRequest{ Request: testRequest{
Method: "POST", Method: "POST",
Path: testapi.Experimental.ResourcePath(getJobResourceName(), ns, ""), Path: testapi.Extensions.ResourcePath(getJobResourceName(), ns, ""),
Body: requestJob, Body: requestJob,
Query: buildQueryValues(nil), Query: buildQueryValues(nil),
}, },
Response: Response{ Response: Response{
StatusCode: 200, StatusCode: 200,
Body: &experimental.Job{ Body: &extensions.Job{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "foo", Name: "foo",
Labels: map[string]string{ Labels: map[string]string{
...@@ -211,7 +211,7 @@ func TestCreateJob(t *testing.T) { ...@@ -211,7 +211,7 @@ func TestCreateJob(t *testing.T) {
"name": "baz", "name": "baz",
}, },
}, },
Spec: experimental.JobSpec{ Spec: extensions.JobSpec{
Template: &api.PodTemplateSpec{}, Template: &api.PodTemplateSpec{},
}, },
}, },
......
...@@ -18,7 +18,7 @@ package unversioned ...@@ -18,7 +18,7 @@ package unversioned
import ( import (
"k8s.io/kubernetes/pkg/api/meta" "k8s.io/kubernetes/pkg/api/meta"
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
) )
type ScaleNamespacer interface { type ScaleNamespacer interface {
...@@ -27,8 +27,8 @@ type ScaleNamespacer interface { ...@@ -27,8 +27,8 @@ type ScaleNamespacer interface {
// ScaleInterface has methods to work with Scale (sub)resources. // ScaleInterface has methods to work with Scale (sub)resources.
type ScaleInterface interface { type ScaleInterface interface {
Get(string, string) (*experimental.Scale, error) Get(string, string) (*extensions.Scale, error)
Update(string, *experimental.Scale) (*experimental.Scale, error) Update(string, *extensions.Scale) (*extensions.Scale, error)
} }
// horizontalPodAutoscalers implements HorizontalPodAutoscalersNamespacer interface // horizontalPodAutoscalers implements HorizontalPodAutoscalersNamespacer interface
...@@ -46,15 +46,15 @@ func newScales(c *ExperimentalClient, namespace string) *scales { ...@@ -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. // 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 *experimental.Scale, err error) { func (c *scales) Get(kind string, name string) (result *extensions.Scale, err error) {
result = &experimental.Scale{} result = &extensions.Scale{}
resource, _ := meta.KindToResource(kind, false) resource, _ := meta.KindToResource(kind, false)
err = c.client.Get().Namespace(c.ns).Resource(resource).Name(name).SubResource("scale").Do().Into(result) err = c.client.Get().Namespace(c.ns).Resource(resource).Name(name).SubResource("scale").Do().Into(result)
return return
} }
func (c *scales) Update(kind string, scale *experimental.Scale) (result *experimental.Scale, err error) { func (c *scales) Update(kind string, scale *extensions.Scale) (result *extensions.Scale, err error) {
result = &experimental.Scale{} result = &extensions.Scale{}
resource, _ := meta.KindToResource(kind, false) resource, _ := meta.KindToResource(kind, false)
err = c.client.Put(). err = c.client.Put().
Namespace(scale.Namespace). Namespace(scale.Namespace).
......
...@@ -17,7 +17,7 @@ limitations under the License. ...@@ -17,7 +17,7 @@ limitations under the License.
package testclient package testclient
import ( import (
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
kClientLib "k8s.io/kubernetes/pkg/client/unversioned" kClientLib "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
...@@ -34,48 +34,48 @@ type FakeDaemonSets struct { ...@@ -34,48 +34,48 @@ type FakeDaemonSets struct {
// Ensure statically that FakeDaemonSets implements DaemonInterface. // Ensure statically that FakeDaemonSets implements DaemonInterface.
var _ kClientLib.DaemonSetInterface = &FakeDaemonSets{} var _ kClientLib.DaemonSetInterface = &FakeDaemonSets{}
func (c *FakeDaemonSets) Get(name string) (*experimental.DaemonSet, error) { func (c *FakeDaemonSets) Get(name string) (*extensions.DaemonSet, error) {
obj, err := c.Fake.Invokes(NewGetAction("daemonsets", c.Namespace, name), &experimental.DaemonSet{}) obj, err := c.Fake.Invokes(NewGetAction("daemonsets", c.Namespace, name), &extensions.DaemonSet{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*experimental.DaemonSet), err return obj.(*extensions.DaemonSet), err
} }
func (c *FakeDaemonSets) List(label labels.Selector) (*experimental.DaemonSetList, error) { func (c *FakeDaemonSets) List(label labels.Selector) (*extensions.DaemonSetList, error) {
obj, err := c.Fake.Invokes(NewListAction("daemonsets", c.Namespace, label, nil), &experimental.DaemonSetList{}) obj, err := c.Fake.Invokes(NewListAction("daemonsets", c.Namespace, label, nil), &extensions.DaemonSetList{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*experimental.DaemonSetList), err return obj.(*extensions.DaemonSetList), err
} }
func (c *FakeDaemonSets) Create(daemon *experimental.DaemonSet) (*experimental.DaemonSet, error) { func (c *FakeDaemonSets) Create(daemon *extensions.DaemonSet) (*extensions.DaemonSet, error) {
obj, err := c.Fake.Invokes(NewCreateAction("daemonsets", c.Namespace, daemon), &experimental.DaemonSet{}) obj, err := c.Fake.Invokes(NewCreateAction("daemonsets", c.Namespace, daemon), &extensions.DaemonSet{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*experimental.DaemonSet), err return obj.(*extensions.DaemonSet), err
} }
func (c *FakeDaemonSets) Update(daemon *experimental.DaemonSet) (*experimental.DaemonSet, error) { func (c *FakeDaemonSets) Update(daemon *extensions.DaemonSet) (*extensions.DaemonSet, error) {
obj, err := c.Fake.Invokes(NewUpdateAction("daemonsets", c.Namespace, daemon), &experimental.DaemonSet{}) obj, err := c.Fake.Invokes(NewUpdateAction("daemonsets", c.Namespace, daemon), &extensions.DaemonSet{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*experimental.DaemonSet), err return obj.(*extensions.DaemonSet), err
} }
func (c *FakeDaemonSets) UpdateStatus(daemon *experimental.DaemonSet) (*experimental.DaemonSet, error) { func (c *FakeDaemonSets) UpdateStatus(daemon *extensions.DaemonSet) (*extensions.DaemonSet, error) {
obj, err := c.Fake.Invokes(NewUpdateSubresourceAction("daemonsets", "status", c.Namespace, daemon), &experimental.DaemonSet{}) obj, err := c.Fake.Invokes(NewUpdateSubresourceAction("daemonsets", "status", c.Namespace, daemon), &extensions.DaemonSet{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*experimental.DaemonSet), err return obj.(*extensions.DaemonSet), err
} }
func (c *FakeDaemonSets) Delete(name string) error { func (c *FakeDaemonSets) Delete(name string) error {
_, err := c.Fake.Invokes(NewDeleteAction("daemonsets", c.Namespace, name), &experimental.DaemonSet{}) _, err := c.Fake.Invokes(NewDeleteAction("daemonsets", c.Namespace, name), &extensions.DaemonSet{})
return err return err
} }
......
...@@ -18,7 +18,7 @@ package testclient ...@@ -18,7 +18,7 @@ package testclient
import ( import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/watch" "k8s.io/kubernetes/pkg/watch"
...@@ -31,22 +31,22 @@ type FakeDeployments struct { ...@@ -31,22 +31,22 @@ type FakeDeployments struct {
Namespace string Namespace string
} }
func (c *FakeDeployments) Get(name string) (*experimental.Deployment, error) { func (c *FakeDeployments) Get(name string) (*extensions.Deployment, error) {
obj, err := c.Fake.Invokes(NewGetAction("deployments", c.Namespace, name), &experimental.Deployment{}) obj, err := c.Fake.Invokes(NewGetAction("deployments", c.Namespace, name), &extensions.Deployment{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*experimental.Deployment), err return obj.(*extensions.Deployment), err
} }
func (c *FakeDeployments) List(label labels.Selector, field fields.Selector) (*experimental.DeploymentList, error) { func (c *FakeDeployments) List(label labels.Selector, field fields.Selector) (*extensions.DeploymentList, error) {
obj, err := c.Fake.Invokes(NewListAction("deployments", c.Namespace, label, field), &experimental.DeploymentList{}) obj, err := c.Fake.Invokes(NewListAction("deployments", c.Namespace, label, field), &extensions.DeploymentList{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
list := &experimental.DeploymentList{} list := &extensions.DeploymentList{}
for _, deployment := range obj.(*experimental.DeploymentList).Items { for _, deployment := range obj.(*extensions.DeploymentList).Items {
if label.Matches(labels.Set(deployment.Labels)) { if label.Matches(labels.Set(deployment.Labels)) {
list.Items = append(list.Items, deployment) list.Items = append(list.Items, deployment)
} }
...@@ -54,26 +54,26 @@ func (c *FakeDeployments) List(label labels.Selector, field fields.Selector) (*e ...@@ -54,26 +54,26 @@ func (c *FakeDeployments) List(label labels.Selector, field fields.Selector) (*e
return list, err return list, err
} }
func (c *FakeDeployments) Create(deployment *experimental.Deployment) (*experimental.Deployment, error) { func (c *FakeDeployments) Create(deployment *extensions.Deployment) (*extensions.Deployment, error) {
obj, err := c.Fake.Invokes(NewCreateAction("deployments", c.Namespace, deployment), deployment) obj, err := c.Fake.Invokes(NewCreateAction("deployments", c.Namespace, deployment), deployment)
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*experimental.Deployment), err return obj.(*extensions.Deployment), err
} }
func (c *FakeDeployments) Update(deployment *experimental.Deployment) (*experimental.Deployment, error) { func (c *FakeDeployments) Update(deployment *extensions.Deployment) (*extensions.Deployment, error) {
obj, err := c.Fake.Invokes(NewUpdateAction("deployments", c.Namespace, deployment), deployment) obj, err := c.Fake.Invokes(NewUpdateAction("deployments", c.Namespace, deployment), deployment)
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*experimental.Deployment), err return obj.(*extensions.Deployment), err
} }
func (c *FakeDeployments) Delete(name string, options *api.DeleteOptions) error { func (c *FakeDeployments) Delete(name string, options *api.DeleteOptions) error {
_, err := c.Fake.Invokes(NewDeleteAction("deployments", c.Namespace, name), &experimental.Deployment{}) _, err := c.Fake.Invokes(NewDeleteAction("deployments", c.Namespace, name), &extensions.Deployment{})
return err return err
} }
......
...@@ -18,7 +18,7 @@ package testclient ...@@ -18,7 +18,7 @@ package testclient
import ( import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/watch" "k8s.io/kubernetes/pkg/watch"
...@@ -31,22 +31,22 @@ type FakeHorizontalPodAutoscalers struct { ...@@ -31,22 +31,22 @@ type FakeHorizontalPodAutoscalers struct {
Namespace string Namespace string
} }
func (c *FakeHorizontalPodAutoscalers) Get(name string) (*experimental.HorizontalPodAutoscaler, error) { func (c *FakeHorizontalPodAutoscalers) Get(name string) (*extensions.HorizontalPodAutoscaler, error) {
obj, err := c.Fake.Invokes(NewGetAction("horizontalpodautoscalers", c.Namespace, name), &experimental.HorizontalPodAutoscaler{}) obj, err := c.Fake.Invokes(NewGetAction("horizontalpodautoscalers", c.Namespace, name), &extensions.HorizontalPodAutoscaler{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*experimental.HorizontalPodAutoscaler), err return obj.(*extensions.HorizontalPodAutoscaler), err
} }
func (c *FakeHorizontalPodAutoscalers) List(label labels.Selector, field fields.Selector) (*experimental.HorizontalPodAutoscalerList, error) { func (c *FakeHorizontalPodAutoscalers) List(label labels.Selector, field fields.Selector) (*extensions.HorizontalPodAutoscalerList, error) {
obj, err := c.Fake.Invokes(NewListAction("horizontalpodautoscalers", c.Namespace, label, field), &experimental.HorizontalPodAutoscalerList{}) obj, err := c.Fake.Invokes(NewListAction("horizontalpodautoscalers", c.Namespace, label, field), &extensions.HorizontalPodAutoscalerList{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
list := &experimental.HorizontalPodAutoscalerList{} list := &extensions.HorizontalPodAutoscalerList{}
for _, a := range obj.(*experimental.HorizontalPodAutoscalerList).Items { for _, a := range obj.(*extensions.HorizontalPodAutoscalerList).Items {
if label.Matches(labels.Set(a.Labels)) { if label.Matches(labels.Set(a.Labels)) {
list.Items = append(list.Items, a) list.Items = append(list.Items, a)
} }
...@@ -54,26 +54,26 @@ func (c *FakeHorizontalPodAutoscalers) List(label labels.Selector, field fields. ...@@ -54,26 +54,26 @@ func (c *FakeHorizontalPodAutoscalers) List(label labels.Selector, field fields.
return list, err return list, err
} }
func (c *FakeHorizontalPodAutoscalers) Create(a *experimental.HorizontalPodAutoscaler) (*experimental.HorizontalPodAutoscaler, error) { func (c *FakeHorizontalPodAutoscalers) Create(a *extensions.HorizontalPodAutoscaler) (*extensions.HorizontalPodAutoscaler, error) {
obj, err := c.Fake.Invokes(NewCreateAction("horizontalpodautoscalers", c.Namespace, a), a) obj, err := c.Fake.Invokes(NewCreateAction("horizontalpodautoscalers", c.Namespace, a), a)
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*experimental.HorizontalPodAutoscaler), err return obj.(*extensions.HorizontalPodAutoscaler), err
} }
func (c *FakeHorizontalPodAutoscalers) Update(a *experimental.HorizontalPodAutoscaler) (*experimental.HorizontalPodAutoscaler, error) { func (c *FakeHorizontalPodAutoscalers) Update(a *extensions.HorizontalPodAutoscaler) (*extensions.HorizontalPodAutoscaler, error) {
obj, err := c.Fake.Invokes(NewUpdateAction("horizontalpodautoscalers", c.Namespace, a), a) obj, err := c.Fake.Invokes(NewUpdateAction("horizontalpodautoscalers", c.Namespace, a), a)
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*experimental.HorizontalPodAutoscaler), err return obj.(*extensions.HorizontalPodAutoscaler), err
} }
func (c *FakeHorizontalPodAutoscalers) Delete(name string, options *api.DeleteOptions) error { func (c *FakeHorizontalPodAutoscalers) Delete(name string, options *api.DeleteOptions) error {
_, err := c.Fake.Invokes(NewDeleteAction("horizontalpodautoscalers", c.Namespace, name), &experimental.HorizontalPodAutoscaler{}) _, err := c.Fake.Invokes(NewDeleteAction("horizontalpodautoscalers", c.Namespace, name), &extensions.HorizontalPodAutoscaler{})
return err return err
} }
......
...@@ -18,7 +18,7 @@ package testclient ...@@ -18,7 +18,7 @@ package testclient
import ( import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/watch" "k8s.io/kubernetes/pkg/watch"
...@@ -31,44 +31,44 @@ type FakeIngress struct { ...@@ -31,44 +31,44 @@ type FakeIngress struct {
Namespace string Namespace string
} }
func (c *FakeIngress) Get(name string) (*experimental.Ingress, error) { func (c *FakeIngress) Get(name string) (*extensions.Ingress, error) {
obj, err := c.Fake.Invokes(NewGetAction("ingress", c.Namespace, name), &experimental.Ingress{}) obj, err := c.Fake.Invokes(NewGetAction("ingress", c.Namespace, name), &extensions.Ingress{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*experimental.Ingress), err return obj.(*extensions.Ingress), err
} }
func (c *FakeIngress) List(label labels.Selector, fields fields.Selector) (*experimental.IngressList, error) { func (c *FakeIngress) List(label labels.Selector, fields fields.Selector) (*extensions.IngressList, error) {
obj, err := c.Fake.Invokes(NewListAction("ingress", c.Namespace, label, nil), &experimental.IngressList{}) obj, err := c.Fake.Invokes(NewListAction("ingress", c.Namespace, label, nil), &extensions.IngressList{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*experimental.IngressList), err return obj.(*extensions.IngressList), err
} }
func (c *FakeIngress) Create(ingress *experimental.Ingress) (*experimental.Ingress, error) { func (c *FakeIngress) Create(ingress *extensions.Ingress) (*extensions.Ingress, error) {
obj, err := c.Fake.Invokes(NewCreateAction("ingress", c.Namespace, ingress), ingress) obj, err := c.Fake.Invokes(NewCreateAction("ingress", c.Namespace, ingress), ingress)
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*experimental.Ingress), err return obj.(*extensions.Ingress), err
} }
func (c *FakeIngress) Update(ingress *experimental.Ingress) (*experimental.Ingress, error) { func (c *FakeIngress) Update(ingress *extensions.Ingress) (*extensions.Ingress, error) {
obj, err := c.Fake.Invokes(NewUpdateAction("ingress", c.Namespace, ingress), ingress) obj, err := c.Fake.Invokes(NewUpdateAction("ingress", c.Namespace, ingress), ingress)
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*experimental.Ingress), err return obj.(*extensions.Ingress), err
} }
func (c *FakeIngress) Delete(name string, options *api.DeleteOptions) error { func (c *FakeIngress) Delete(name string, options *api.DeleteOptions) error {
_, err := c.Fake.Invokes(NewDeleteAction("ingress", c.Namespace, name), &experimental.Ingress{}) _, err := c.Fake.Invokes(NewDeleteAction("ingress", c.Namespace, name), &extensions.Ingress{})
return err return err
} }
...@@ -76,11 +76,11 @@ func (c *FakeIngress) Watch(label labels.Selector, field fields.Selector, resour ...@@ -76,11 +76,11 @@ func (c *FakeIngress) Watch(label labels.Selector, field fields.Selector, resour
return c.Fake.InvokesWatch(NewWatchAction("ingress", c.Namespace, label, field, resourceVersion)) return c.Fake.InvokesWatch(NewWatchAction("ingress", c.Namespace, label, field, resourceVersion))
} }
func (c *FakeIngress) UpdateStatus(ingress *experimental.Ingress) (result *experimental.Ingress, err error) { func (c *FakeIngress) UpdateStatus(ingress *extensions.Ingress) (result *extensions.Ingress, err error) {
obj, err := c.Fake.Invokes(NewUpdateSubresourceAction("ingress", "status", c.Namespace, ingress), ingress) obj, err := c.Fake.Invokes(NewUpdateSubresourceAction("ingress", "status", c.Namespace, ingress), ingress)
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*experimental.Ingress), err return obj.(*extensions.Ingress), err
} }
...@@ -18,7 +18,7 @@ package testclient ...@@ -18,7 +18,7 @@ package testclient
import ( import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/watch" "k8s.io/kubernetes/pkg/watch"
...@@ -31,44 +31,44 @@ type FakeJobs struct { ...@@ -31,44 +31,44 @@ type FakeJobs struct {
Namespace string Namespace string
} }
func (c *FakeJobs) Get(name string) (*experimental.Job, error) { func (c *FakeJobs) Get(name string) (*extensions.Job, error) {
obj, err := c.Fake.Invokes(NewGetAction("jobs", c.Namespace, name), &experimental.Job{}) obj, err := c.Fake.Invokes(NewGetAction("jobs", c.Namespace, name), &extensions.Job{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*experimental.Job), err return obj.(*extensions.Job), err
} }
func (c *FakeJobs) List(label labels.Selector, fields fields.Selector) (*experimental.JobList, error) { func (c *FakeJobs) List(label labels.Selector, fields fields.Selector) (*extensions.JobList, error) {
obj, err := c.Fake.Invokes(NewListAction("jobs", c.Namespace, label, nil), &experimental.JobList{}) obj, err := c.Fake.Invokes(NewListAction("jobs", c.Namespace, label, nil), &extensions.JobList{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*experimental.JobList), err return obj.(*extensions.JobList), err
} }
func (c *FakeJobs) Create(job *experimental.Job) (*experimental.Job, error) { func (c *FakeJobs) Create(job *extensions.Job) (*extensions.Job, error) {
obj, err := c.Fake.Invokes(NewCreateAction("jobs", c.Namespace, job), job) obj, err := c.Fake.Invokes(NewCreateAction("jobs", c.Namespace, job), job)
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*experimental.Job), err return obj.(*extensions.Job), err
} }
func (c *FakeJobs) Update(job *experimental.Job) (*experimental.Job, error) { func (c *FakeJobs) Update(job *extensions.Job) (*extensions.Job, error) {
obj, err := c.Fake.Invokes(NewUpdateAction("jobs", c.Namespace, job), job) obj, err := c.Fake.Invokes(NewUpdateAction("jobs", c.Namespace, job), job)
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*experimental.Job), err return obj.(*extensions.Job), err
} }
func (c *FakeJobs) Delete(name string, options *api.DeleteOptions) error { func (c *FakeJobs) Delete(name string, options *api.DeleteOptions) error {
_, err := c.Fake.Invokes(NewDeleteAction("jobs", c.Namespace, name), &experimental.Job{}) _, err := c.Fake.Invokes(NewDeleteAction("jobs", c.Namespace, name), &extensions.Job{})
return err return err
} }
...@@ -76,11 +76,11 @@ func (c *FakeJobs) Watch(label labels.Selector, field fields.Selector, resourceV ...@@ -76,11 +76,11 @@ func (c *FakeJobs) Watch(label labels.Selector, field fields.Selector, resourceV
return c.Fake.InvokesWatch(NewWatchAction("jobs", c.Namespace, label, field, resourceVersion)) return c.Fake.InvokesWatch(NewWatchAction("jobs", c.Namespace, label, field, resourceVersion))
} }
func (c *FakeJobs) UpdateStatus(job *experimental.Job) (result *experimental.Job, err error) { func (c *FakeJobs) UpdateStatus(job *extensions.Job) (result *extensions.Job, err error) {
obj, err := c.Fake.Invokes(NewUpdateSubresourceAction("jobs", "status", c.Namespace, job), job) obj, err := c.Fake.Invokes(NewUpdateSubresourceAction("jobs", "status", c.Namespace, job), job)
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*experimental.Job), err return obj.(*extensions.Job), err
} }
...@@ -17,7 +17,7 @@ limitations under the License. ...@@ -17,7 +17,7 @@ limitations under the License.
package testclient package testclient
import ( import (
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
) )
// FakeScales implements ScaleInterface. Meant to be embedded into a struct to get a default // FakeScales implements ScaleInterface. Meant to be embedded into a struct to get a default
...@@ -27,19 +27,19 @@ type FakeScales struct { ...@@ -27,19 +27,19 @@ type FakeScales struct {
Namespace string Namespace string
} }
func (c *FakeScales) Get(kind string, name string) (result *experimental.Scale, err error) { func (c *FakeScales) Get(kind string, name string) (result *extensions.Scale, err error) {
action := GetActionImpl{} action := GetActionImpl{}
action.Verb = "get" action.Verb = "get"
action.Namespace = c.Namespace action.Namespace = c.Namespace
action.Resource = kind action.Resource = kind
action.Subresource = "scale" action.Subresource = "scale"
action.Name = name action.Name = name
obj, err := c.Fake.Invokes(action, &experimental.Scale{}) obj, err := c.Fake.Invokes(action, &extensions.Scale{})
result = obj.(*experimental.Scale) result = obj.(*extensions.Scale)
return return
} }
func (c *FakeScales) Update(kind string, scale *experimental.Scale) (result *experimental.Scale, err error) { func (c *FakeScales) Update(kind string, scale *extensions.Scale) (result *extensions.Scale, err error) {
action := UpdateActionImpl{} action := UpdateActionImpl{}
action.Verb = "update" action.Verb = "update"
action.Namespace = c.Namespace action.Namespace = c.Namespace
...@@ -47,6 +47,6 @@ func (c *FakeScales) Update(kind string, scale *experimental.Scale) (result *exp ...@@ -47,6 +47,6 @@ func (c *FakeScales) Update(kind string, scale *experimental.Scale) (result *exp
action.Subresource = "scale" action.Subresource = "scale"
action.Object = scale action.Object = scale
obj, err := c.Fake.Invokes(action, scale) obj, err := c.Fake.Invokes(action, scale)
result = obj.(*experimental.Scale) result = obj.(*extensions.Scale)
return return
} }
...@@ -23,7 +23,7 @@ import ( ...@@ -23,7 +23,7 @@ import (
"github.com/golang/glog" "github.com/golang/glog"
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/client/cache" "k8s.io/kubernetes/pkg/client/cache"
"k8s.io/kubernetes/pkg/client/record" "k8s.io/kubernetes/pkg/client/record"
client "k8s.io/kubernetes/pkg/client/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned"
...@@ -103,22 +103,22 @@ func NewDaemonSetsController(kubeClient client.Interface, resyncPeriod controlle ...@@ -103,22 +103,22 @@ func NewDaemonSetsController(kubeClient client.Interface, resyncPeriod controlle
return dsc.kubeClient.Experimental().DaemonSets(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), rv) return dsc.kubeClient.Experimental().DaemonSets(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), rv)
}, },
}, },
&experimental.DaemonSet{}, &extensions.DaemonSet{},
// TODO: Can we have much longer period here? // TODO: Can we have much longer period here?
FullDaemonSetResyncPeriod, FullDaemonSetResyncPeriod,
framework.ResourceEventHandlerFuncs{ framework.ResourceEventHandlerFuncs{
AddFunc: func(obj interface{}) { AddFunc: func(obj interface{}) {
ds := obj.(*experimental.DaemonSet) ds := obj.(*extensions.DaemonSet)
glog.V(4).Infof("Adding daemon set %s", ds.Name) glog.V(4).Infof("Adding daemon set %s", ds.Name)
dsc.enqueueDaemonSet(obj) dsc.enqueueDaemonSet(obj)
}, },
UpdateFunc: func(old, cur interface{}) { UpdateFunc: func(old, cur interface{}) {
oldDS := old.(*experimental.DaemonSet) oldDS := old.(*extensions.DaemonSet)
glog.V(4).Infof("Updating daemon set %s", oldDS.Name) glog.V(4).Infof("Updating daemon set %s", oldDS.Name)
dsc.enqueueDaemonSet(cur) dsc.enqueueDaemonSet(cur)
}, },
DeleteFunc: func(obj interface{}) { DeleteFunc: func(obj interface{}) {
ds := obj.(*experimental.DaemonSet) ds := obj.(*extensions.DaemonSet)
glog.V(4).Infof("Deleting daemon set %s", ds.Name) glog.V(4).Infof("Deleting daemon set %s", ds.Name)
dsc.enqueueDaemonSet(obj) dsc.enqueueDaemonSet(obj)
}, },
...@@ -218,7 +218,7 @@ func (dsc *DaemonSetsController) enqueueDaemonSet(obj interface{}) { ...@@ -218,7 +218,7 @@ func (dsc *DaemonSetsController) enqueueDaemonSet(obj interface{}) {
dsc.queue.Add(key) dsc.queue.Add(key)
} }
func (dsc *DaemonSetsController) getPodDaemonSet(pod *api.Pod) *experimental.DaemonSet { func (dsc *DaemonSetsController) getPodDaemonSet(pod *api.Pod) *extensions.DaemonSet {
sets, err := dsc.dsStore.GetPodDaemonSets(pod) sets, err := dsc.dsStore.GetPodDaemonSets(pod)
if err != nil { if err != nil {
glog.V(4).Infof("No daemon sets found for pod %v, daemon set controller will avoid syncing", pod.Name) glog.V(4).Infof("No daemon sets found for pod %v, daemon set controller will avoid syncing", pod.Name)
...@@ -321,7 +321,7 @@ func (dsc *DaemonSetsController) updateNode(old, cur interface{}) { ...@@ -321,7 +321,7 @@ func (dsc *DaemonSetsController) updateNode(old, cur interface{}) {
} }
// getNodesToDaemonSetPods returns a map from nodes to daemon pods (corresponding to ds) running on the nodes. // getNodesToDaemonSetPods returns a map from nodes to daemon pods (corresponding to ds) running on the nodes.
func (dsc *DaemonSetsController) getNodesToDaemonPods(ds *experimental.DaemonSet) (map[string][]*api.Pod, error) { func (dsc *DaemonSetsController) getNodesToDaemonPods(ds *extensions.DaemonSet) (map[string][]*api.Pod, error) {
nodeToDaemonPods := make(map[string][]*api.Pod) nodeToDaemonPods := make(map[string][]*api.Pod)
daemonPods, err := dsc.podStore.Pods(ds.Namespace).List(labels.Set(ds.Spec.Selector).AsSelector()) daemonPods, err := dsc.podStore.Pods(ds.Namespace).List(labels.Set(ds.Spec.Selector).AsSelector())
if err != nil { if err != nil {
...@@ -334,7 +334,7 @@ func (dsc *DaemonSetsController) getNodesToDaemonPods(ds *experimental.DaemonSet ...@@ -334,7 +334,7 @@ func (dsc *DaemonSetsController) getNodesToDaemonPods(ds *experimental.DaemonSet
return nodeToDaemonPods, nil return nodeToDaemonPods, nil
} }
func (dsc *DaemonSetsController) manage(ds *experimental.DaemonSet) { func (dsc *DaemonSetsController) manage(ds *extensions.DaemonSet) {
// Find out which nodes are running the daemon pods selected by ds. // Find out which nodes are running the daemon pods selected by ds.
nodeToDaemonPods, err := dsc.getNodesToDaemonPods(ds) nodeToDaemonPods, err := dsc.getNodesToDaemonPods(ds)
if err != nil { if err != nil {
...@@ -401,7 +401,7 @@ func (dsc *DaemonSetsController) manage(ds *experimental.DaemonSet) { ...@@ -401,7 +401,7 @@ func (dsc *DaemonSetsController) manage(ds *experimental.DaemonSet) {
} }
} }
func storeDaemonSetStatus(dsClient client.DaemonSetInterface, ds *experimental.DaemonSet, desiredNumberScheduled, currentNumberScheduled, numberMisscheduled int) error { func storeDaemonSetStatus(dsClient client.DaemonSetInterface, ds *extensions.DaemonSet, desiredNumberScheduled, currentNumberScheduled, numberMisscheduled int) error {
if ds.Status.DesiredNumberScheduled == desiredNumberScheduled && ds.Status.CurrentNumberScheduled == currentNumberScheduled && ds.Status.NumberMisscheduled == numberMisscheduled { if ds.Status.DesiredNumberScheduled == desiredNumberScheduled && ds.Status.CurrentNumberScheduled == currentNumberScheduled && ds.Status.NumberMisscheduled == numberMisscheduled {
return nil return nil
} }
...@@ -426,7 +426,7 @@ func storeDaemonSetStatus(dsClient client.DaemonSetInterface, ds *experimental.D ...@@ -426,7 +426,7 @@ func storeDaemonSetStatus(dsClient client.DaemonSetInterface, ds *experimental.D
return updateErr return updateErr
} }
func (dsc *DaemonSetsController) updateDaemonSetStatus(ds *experimental.DaemonSet) { func (dsc *DaemonSetsController) updateDaemonSetStatus(ds *extensions.DaemonSet) {
glog.V(4).Infof("Updating daemon set status") glog.V(4).Infof("Updating daemon set status")
nodeToDaemonPods, err := dsc.getNodesToDaemonPods(ds) nodeToDaemonPods, err := dsc.getNodesToDaemonPods(ds)
if err != nil { if err != nil {
...@@ -482,7 +482,7 @@ func (dsc *DaemonSetsController) syncDaemonSet(key string) error { ...@@ -482,7 +482,7 @@ func (dsc *DaemonSetsController) syncDaemonSet(key string) error {
dsc.expectations.DeleteExpectations(key) dsc.expectations.DeleteExpectations(key)
return nil return nil
} }
ds := obj.(*experimental.DaemonSet) ds := obj.(*extensions.DaemonSet)
if !dsc.podStoreSynced() { if !dsc.podStoreSynced() {
// Sleep so we give the pod reflector goroutine a chance to run. // Sleep so we give the pod reflector goroutine a chance to run.
time.Sleep(PodStoreSyncedPollPeriod) time.Sleep(PodStoreSyncedPollPeriod)
...@@ -509,7 +509,7 @@ func (dsc *DaemonSetsController) syncDaemonSet(key string) error { ...@@ -509,7 +509,7 @@ func (dsc *DaemonSetsController) syncDaemonSet(key string) error {
} }
// byCreationTimestamp sorts a list by creation timestamp, using their names as a tie breaker. // byCreationTimestamp sorts a list by creation timestamp, using their names as a tie breaker.
type byCreationTimestamp []experimental.DaemonSet type byCreationTimestamp []extensions.DaemonSet
func (o byCreationTimestamp) Len() int { return len(o) } func (o byCreationTimestamp) Len() int { return len(o) }
func (o byCreationTimestamp) Swap(i, j int) { o[i], o[j] = o[j], o[i] } func (o byCreationTimestamp) Swap(i, j int) { o[i], o[j] = o[j], o[i] }
......
...@@ -23,7 +23,7 @@ import ( ...@@ -23,7 +23,7 @@ import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/testapi" "k8s.io/kubernetes/pkg/api/testapi"
"k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/client/cache" "k8s.io/kubernetes/pkg/client/cache"
client "k8s.io/kubernetes/pkg/client/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/controller" "k8s.io/kubernetes/pkg/controller"
...@@ -42,7 +42,7 @@ func init() { ...@@ -42,7 +42,7 @@ func init() {
api.ForTesting_ReferencesAllowBlankSelfLinks = true api.ForTesting_ReferencesAllowBlankSelfLinks = true
} }
func getKey(ds *experimental.DaemonSet, t *testing.T) string { func getKey(ds *extensions.DaemonSet, t *testing.T) string {
if key, err := controller.KeyFunc(ds); err != nil { if key, err := controller.KeyFunc(ds); err != nil {
t.Errorf("Unexpected error getting key for ds %v: %v", ds.Name, err) t.Errorf("Unexpected error getting key for ds %v: %v", ds.Name, err)
return "" return ""
...@@ -51,14 +51,14 @@ func getKey(ds *experimental.DaemonSet, t *testing.T) string { ...@@ -51,14 +51,14 @@ func getKey(ds *experimental.DaemonSet, t *testing.T) string {
} }
} }
func newDaemonSet(name string) *experimental.DaemonSet { func newDaemonSet(name string) *extensions.DaemonSet {
return &experimental.DaemonSet{ return &extensions.DaemonSet{
TypeMeta: unversioned.TypeMeta{APIVersion: testapi.Experimental.Version()}, TypeMeta: unversioned.TypeMeta{APIVersion: testapi.Extensions.Version()},
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: name, Name: name,
Namespace: api.NamespaceDefault, Namespace: api.NamespaceDefault,
}, },
Spec: experimental.DaemonSetSpec{ Spec: extensions.DaemonSetSpec{
Selector: simpleDaemonSetLabel, Selector: simpleDaemonSetLabel,
Template: &api.PodTemplateSpec{ Template: &api.PodTemplateSpec{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
...@@ -146,7 +146,7 @@ func validateSyncDaemonSets(t *testing.T, fakePodControl *controller.FakePodCont ...@@ -146,7 +146,7 @@ func validateSyncDaemonSets(t *testing.T, fakePodControl *controller.FakePodCont
} }
} }
func syncAndValidateDaemonSets(t *testing.T, manager *DaemonSetsController, ds *experimental.DaemonSet, podControl *controller.FakePodControl, expectedCreates, expectedDeletes int) { func syncAndValidateDaemonSets(t *testing.T, manager *DaemonSetsController, ds *extensions.DaemonSet, podControl *controller.FakePodControl, expectedCreates, expectedDeletes int) {
key, err := controller.KeyFunc(ds) key, err := controller.KeyFunc(ds)
if err != nil { if err != nil {
t.Errorf("Could not get key for daemon.") t.Errorf("Could not get key for daemon.")
......
...@@ -23,7 +23,7 @@ import ( ...@@ -23,7 +23,7 @@ import (
"github.com/golang/glog" "github.com/golang/glog"
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/client/record" "k8s.io/kubernetes/pkg/client/record"
client "k8s.io/kubernetes/pkg/client/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
...@@ -73,22 +73,22 @@ func (d *DeploymentController) reconcileDeployments() []error { ...@@ -73,22 +73,22 @@ func (d *DeploymentController) reconcileDeployments() []error {
return errs return errs
} }
func (d *DeploymentController) reconcileDeployment(deployment *experimental.Deployment) error { func (d *DeploymentController) reconcileDeployment(deployment *extensions.Deployment) error {
switch deployment.Spec.Strategy.Type { switch deployment.Spec.Strategy.Type {
case experimental.RecreateDeploymentStrategyType: case extensions.RecreateDeploymentStrategyType:
return d.reconcileRecreateDeployment(*deployment) return d.reconcileRecreateDeployment(*deployment)
case experimental.RollingUpdateDeploymentStrategyType: case extensions.RollingUpdateDeploymentStrategyType:
return d.reconcileRollingUpdateDeployment(*deployment) return d.reconcileRollingUpdateDeployment(*deployment)
} }
return fmt.Errorf("unexpected deployment strategy type: %s", deployment.Spec.Strategy.Type) return fmt.Errorf("unexpected deployment strategy type: %s", deployment.Spec.Strategy.Type)
} }
func (d *DeploymentController) reconcileRecreateDeployment(deployment experimental.Deployment) error { func (d *DeploymentController) reconcileRecreateDeployment(deployment extensions.Deployment) error {
// TODO: implement me. // TODO: implement me.
return nil return nil
} }
func (d *DeploymentController) reconcileRollingUpdateDeployment(deployment experimental.Deployment) error { func (d *DeploymentController) reconcileRollingUpdateDeployment(deployment extensions.Deployment) error {
newRC, err := d.getNewRC(deployment) newRC, err := d.getNewRC(deployment)
if err != nil { if err != nil {
return err return err
...@@ -124,13 +124,13 @@ func (d *DeploymentController) reconcileRollingUpdateDeployment(deployment exper ...@@ -124,13 +124,13 @@ func (d *DeploymentController) reconcileRollingUpdateDeployment(deployment exper
return nil return nil
} }
func (d *DeploymentController) getOldRCs(deployment experimental.Deployment) ([]*api.ReplicationController, error) { func (d *DeploymentController) getOldRCs(deployment extensions.Deployment) ([]*api.ReplicationController, error) {
return deploymentUtil.GetOldRCs(deployment, d.client) return deploymentUtil.GetOldRCs(deployment, d.client)
} }
// Returns an RC that matches the intent of the given deployment. // Returns an RC that matches the intent of the given deployment.
// It creates a new RC if required. // It creates a new RC if required.
func (d *DeploymentController) getNewRC(deployment experimental.Deployment) (*api.ReplicationController, error) { func (d *DeploymentController) getNewRC(deployment extensions.Deployment) (*api.ReplicationController, error) {
existingNewRC, err := deploymentUtil.GetNewRC(deployment, d.client) existingNewRC, err := deploymentUtil.GetNewRC(deployment, d.client)
if err != nil || existingNewRC != nil { if err != nil || existingNewRC != nil {
return existingNewRC, err return existingNewRC, err
...@@ -158,7 +158,7 @@ func (d *DeploymentController) getNewRC(deployment experimental.Deployment) (*ap ...@@ -158,7 +158,7 @@ func (d *DeploymentController) getNewRC(deployment experimental.Deployment) (*ap
return createdRC, nil return createdRC, nil
} }
func (d *DeploymentController) reconcileNewRC(allRCs []*api.ReplicationController, newRC *api.ReplicationController, deployment experimental.Deployment) (bool, error) { func (d *DeploymentController) reconcileNewRC(allRCs []*api.ReplicationController, newRC *api.ReplicationController, deployment extensions.Deployment) (bool, error) {
if newRC.Spec.Replicas == deployment.Spec.Replicas { if newRC.Spec.Replicas == deployment.Spec.Replicas {
// Scaling not required. // Scaling not required.
return false, nil return false, nil
...@@ -192,7 +192,7 @@ func (d *DeploymentController) reconcileNewRC(allRCs []*api.ReplicationControlle ...@@ -192,7 +192,7 @@ func (d *DeploymentController) reconcileNewRC(allRCs []*api.ReplicationControlle
return true, err return true, err
} }
func (d *DeploymentController) reconcileOldRCs(allRCs []*api.ReplicationController, oldRCs []*api.ReplicationController, newRC *api.ReplicationController, deployment experimental.Deployment) (bool, error) { func (d *DeploymentController) reconcileOldRCs(allRCs []*api.ReplicationController, oldRCs []*api.ReplicationController, newRC *api.ReplicationController, deployment extensions.Deployment) (bool, error) {
oldPodsCount := deploymentUtil.GetReplicaCountForRCs(oldRCs) oldPodsCount := deploymentUtil.GetReplicaCountForRCs(oldRCs)
if oldPodsCount == 0 { if oldPodsCount == 0 {
// Cant scale down further // Cant scale down further
...@@ -239,12 +239,12 @@ func (d *DeploymentController) reconcileOldRCs(allRCs []*api.ReplicationControll ...@@ -239,12 +239,12 @@ func (d *DeploymentController) reconcileOldRCs(allRCs []*api.ReplicationControll
return true, err return true, err
} }
func (d *DeploymentController) updateDeploymentStatus(allRCs []*api.ReplicationController, newRC *api.ReplicationController, deployment experimental.Deployment) error { func (d *DeploymentController) updateDeploymentStatus(allRCs []*api.ReplicationController, newRC *api.ReplicationController, deployment extensions.Deployment) error {
totalReplicas := deploymentUtil.GetReplicaCountForRCs(allRCs) totalReplicas := deploymentUtil.GetReplicaCountForRCs(allRCs)
updatedReplicas := deploymentUtil.GetReplicaCountForRCs([]*api.ReplicationController{newRC}) updatedReplicas := deploymentUtil.GetReplicaCountForRCs([]*api.ReplicationController{newRC})
newDeployment := deployment newDeployment := deployment
// TODO: Reconcile this with API definition. API definition talks about ready pods, while this just computes created pods. // TODO: Reconcile this with API definition. API definition talks about ready pods, while this just computes created pods.
newDeployment.Status = experimental.DeploymentStatus{ newDeployment.Status = extensions.DeploymentStatus{
Replicas: totalReplicas, Replicas: totalReplicas,
UpdatedReplicas: updatedReplicas, UpdatedReplicas: updatedReplicas,
} }
...@@ -252,7 +252,7 @@ func (d *DeploymentController) updateDeploymentStatus(allRCs []*api.ReplicationC ...@@ -252,7 +252,7 @@ func (d *DeploymentController) updateDeploymentStatus(allRCs []*api.ReplicationC
return err return err
} }
func (d *DeploymentController) scaleRCAndRecordEvent(rc *api.ReplicationController, newScale int, deployment experimental.Deployment) (*api.ReplicationController, error) { func (d *DeploymentController) scaleRCAndRecordEvent(rc *api.ReplicationController, newScale int, deployment extensions.Deployment) (*api.ReplicationController, error) {
scalingOperation := "down" scalingOperation := "down"
if rc.Spec.Replicas < newScale { if rc.Spec.Replicas < newScale {
scalingOperation = "up" scalingOperation = "up"
...@@ -270,7 +270,7 @@ func (d *DeploymentController) scaleRC(rc *api.ReplicationController, newScale i ...@@ -270,7 +270,7 @@ func (d *DeploymentController) scaleRC(rc *api.ReplicationController, newScale i
return d.client.ReplicationControllers(rc.ObjectMeta.Namespace).Update(rc) return d.client.ReplicationControllers(rc.ObjectMeta.Namespace).Update(rc)
} }
func (d *DeploymentController) updateDeployment(deployment *experimental.Deployment) (*experimental.Deployment, error) { func (d *DeploymentController) updateDeployment(deployment *extensions.Deployment) (*extensions.Deployment, error) {
// TODO: Using client for now, update to use store when it is ready. // TODO: Using client for now, update to use store when it is ready.
return d.client.Experimental().Deployments(deployment.ObjectMeta.Namespace).Update(deployment) return d.client.Experimental().Deployments(deployment.ObjectMeta.Namespace).Update(deployment)
} }
...@@ -21,7 +21,7 @@ import ( ...@@ -21,7 +21,7 @@ import (
"testing" "testing"
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
exp "k8s.io/kubernetes/pkg/apis/experimental" exp "k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/client/record" "k8s.io/kubernetes/pkg/client/record"
"k8s.io/kubernetes/pkg/client/unversioned/testclient" "k8s.io/kubernetes/pkg/client/unversioned/testclient"
"k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/runtime"
......
...@@ -25,7 +25,7 @@ import ( ...@@ -25,7 +25,7 @@ import (
"github.com/golang/glog" "github.com/golang/glog"
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/client/cache" "k8s.io/kubernetes/pkg/client/cache"
"k8s.io/kubernetes/pkg/client/record" "k8s.io/kubernetes/pkg/client/record"
client "k8s.io/kubernetes/pkg/client/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned"
...@@ -45,7 +45,7 @@ type JobController struct { ...@@ -45,7 +45,7 @@ type JobController struct {
podControl controller.PodControlInterface podControl controller.PodControlInterface
// To allow injection of updateJobStatus for testing. // To allow injection of updateJobStatus for testing.
updateHandler func(job *experimental.Job) error updateHandler func(job *extensions.Job) error
syncHandler func(jobKey string) error syncHandler func(jobKey string) error
// podStoreSynced returns true if the pod store has been synced at least once. // podStoreSynced returns true if the pod store has been synced at least once.
// Added as a member to the struct to allow injection for testing. // Added as a member to the struct to allow injection for testing.
...@@ -92,13 +92,13 @@ func NewJobController(kubeClient client.Interface, resyncPeriod controller.Resyn ...@@ -92,13 +92,13 @@ func NewJobController(kubeClient client.Interface, resyncPeriod controller.Resyn
return jm.kubeClient.Experimental().Jobs(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), rv) return jm.kubeClient.Experimental().Jobs(api.NamespaceAll).Watch(labels.Everything(), fields.Everything(), rv)
}, },
}, },
&experimental.Job{}, &extensions.Job{},
// TODO: Can we have much longer period here? // TODO: Can we have much longer period here?
replicationcontroller.FullControllerResyncPeriod, replicationcontroller.FullControllerResyncPeriod,
framework.ResourceEventHandlerFuncs{ framework.ResourceEventHandlerFuncs{
AddFunc: jm.enqueueController, AddFunc: jm.enqueueController,
UpdateFunc: func(old, cur interface{}) { UpdateFunc: func(old, cur interface{}) {
if job := cur.(*experimental.Job); !isJobFinished(job) { if job := cur.(*extensions.Job); !isJobFinished(job) {
jm.enqueueController(job) jm.enqueueController(job)
} }
}, },
...@@ -144,7 +144,7 @@ func (jm *JobController) Run(workers int, stopCh <-chan struct{}) { ...@@ -144,7 +144,7 @@ func (jm *JobController) Run(workers int, stopCh <-chan struct{}) {
} }
// getPodJob returns the job managing the given pod. // getPodJob returns the job managing the given pod.
func (jm *JobController) getPodJob(pod *api.Pod) *experimental.Job { func (jm *JobController) getPodJob(pod *api.Pod) *extensions.Job {
jobs, err := jm.jobStore.GetPodJobs(pod) jobs, err := jm.jobStore.GetPodJobs(pod)
if err != nil { if err != nil {
glog.V(4).Infof("No jobs found for pod %v, job controller will avoid syncing", pod.Name) glog.V(4).Infof("No jobs found for pod %v, job controller will avoid syncing", pod.Name)
...@@ -240,7 +240,7 @@ func (jm *JobController) deletePod(obj interface{}) { ...@@ -240,7 +240,7 @@ func (jm *JobController) deletePod(obj interface{}) {
} }
} }
// obj could be an *experimental.Job, or a DeletionFinalStateUnknown marker item. // obj could be an *extensions.Job, or a DeletionFinalStateUnknown marker item.
func (jm *JobController) enqueueController(obj interface{}) { func (jm *JobController) enqueueController(obj interface{}) {
key, err := controller.KeyFunc(obj) key, err := controller.KeyFunc(obj)
if err != nil { if err != nil {
...@@ -295,7 +295,7 @@ func (jm *JobController) syncJob(key string) error { ...@@ -295,7 +295,7 @@ func (jm *JobController) syncJob(key string) error {
jm.queue.Add(key) jm.queue.Add(key)
return err return err
} }
job := *obj.(*experimental.Job) job := *obj.(*extensions.Job)
if !jm.podStoreSynced() { if !jm.podStoreSynced() {
// Sleep so we give the pod reflector goroutine a chance to run. // Sleep so we give the pod reflector goroutine a chance to run.
time.Sleep(replicationcontroller.PodStoreSyncedPollPeriod) time.Sleep(replicationcontroller.PodStoreSyncedPollPeriod)
...@@ -345,9 +345,9 @@ func (jm *JobController) syncJob(key string) error { ...@@ -345,9 +345,9 @@ func (jm *JobController) syncJob(key string) error {
return nil return nil
} }
func newCondition() experimental.JobCondition { func newCondition() extensions.JobCondition {
return experimental.JobCondition{ return extensions.JobCondition{
Type: experimental.JobComplete, Type: extensions.JobComplete,
Status: api.ConditionTrue, Status: api.ConditionTrue,
LastProbeTime: unversioned.Now(), LastProbeTime: unversioned.Now(),
LastTransitionTime: unversioned.Now(), LastTransitionTime: unversioned.Now(),
...@@ -360,7 +360,7 @@ func getStatus(pods []api.Pod) (succeeded, failed int) { ...@@ -360,7 +360,7 @@ func getStatus(pods []api.Pod) (succeeded, failed int) {
return return
} }
func (jm *JobController) manageJob(activePods []*api.Pod, succeeded int, job *experimental.Job) int { func (jm *JobController) manageJob(activePods []*api.Pod, succeeded int, job *extensions.Job) int {
var activeLock sync.Mutex var activeLock sync.Mutex
active := len(activePods) active := len(activePods)
parallelism := *job.Spec.Parallelism parallelism := *job.Spec.Parallelism
...@@ -430,7 +430,7 @@ func (jm *JobController) manageJob(activePods []*api.Pod, succeeded int, job *ex ...@@ -430,7 +430,7 @@ func (jm *JobController) manageJob(activePods []*api.Pod, succeeded int, job *ex
return active return active
} }
func (jm *JobController) updateJobStatus(job *experimental.Job) error { func (jm *JobController) updateJobStatus(job *extensions.Job) error {
_, err := jm.kubeClient.Experimental().Jobs(job.Namespace).UpdateStatus(job) _, err := jm.kubeClient.Experimental().Jobs(job.Namespace).UpdateStatus(job)
return err return err
} }
...@@ -446,9 +446,9 @@ func filterPods(pods []api.Pod, phase api.PodPhase) int { ...@@ -446,9 +446,9 @@ func filterPods(pods []api.Pod, phase api.PodPhase) int {
return result return result
} }
func isJobFinished(j *experimental.Job) bool { func isJobFinished(j *extensions.Job) bool {
for _, c := range j.Status.Conditions { for _, c := range j.Status.Conditions {
if c.Type == experimental.JobComplete && c.Status == api.ConditionTrue { if c.Type == extensions.JobComplete && c.Status == api.ConditionTrue {
return true return true
} }
} }
...@@ -456,7 +456,7 @@ func isJobFinished(j *experimental.Job) bool { ...@@ -456,7 +456,7 @@ func isJobFinished(j *experimental.Job) bool {
} }
// byCreationTimestamp sorts a list by creation timestamp, using their names as a tie breaker. // byCreationTimestamp sorts a list by creation timestamp, using their names as a tie breaker.
type byCreationTimestamp []experimental.Job type byCreationTimestamp []extensions.Job
func (o byCreationTimestamp) Len() int { return len(o) } func (o byCreationTimestamp) Len() int { return len(o) }
func (o byCreationTimestamp) Swap(i, j int) { o[i], o[j] = o[j], o[i] } func (o byCreationTimestamp) Swap(i, j int) { o[i], o[j] = o[j], o[i] }
......
...@@ -24,7 +24,7 @@ import ( ...@@ -24,7 +24,7 @@ import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/testapi" "k8s.io/kubernetes/pkg/api/testapi"
"k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
client "k8s.io/kubernetes/pkg/client/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/client/unversioned/testclient" "k8s.io/kubernetes/pkg/client/unversioned/testclient"
"k8s.io/kubernetes/pkg/controller" "k8s.io/kubernetes/pkg/controller"
...@@ -34,13 +34,13 @@ import ( ...@@ -34,13 +34,13 @@ import (
var alwaysReady = func() bool { return true } var alwaysReady = func() bool { return true }
func newJob(parallelism, completions int) *experimental.Job { func newJob(parallelism, completions int) *extensions.Job {
return &experimental.Job{ return &extensions.Job{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "foobar", Name: "foobar",
Namespace: api.NamespaceDefault, Namespace: api.NamespaceDefault,
}, },
Spec: experimental.JobSpec{ Spec: extensions.JobSpec{
Parallelism: &parallelism, Parallelism: &parallelism,
Completions: &completions, Completions: &completions,
Selector: map[string]string{"foo": "bar"}, Selector: map[string]string{"foo": "bar"},
...@@ -60,7 +60,7 @@ func newJob(parallelism, completions int) *experimental.Job { ...@@ -60,7 +60,7 @@ func newJob(parallelism, completions int) *experimental.Job {
} }
} }
func getKey(job *experimental.Job, t *testing.T) string { func getKey(job *extensions.Job, t *testing.T) string {
if key, err := controller.KeyFunc(job); err != nil { if key, err := controller.KeyFunc(job); err != nil {
t.Errorf("Unexpected error getting key for job %v: %v", job.Name, err) t.Errorf("Unexpected error getting key for job %v: %v", job.Name, err)
return "" return ""
...@@ -70,7 +70,7 @@ func getKey(job *experimental.Job, t *testing.T) string { ...@@ -70,7 +70,7 @@ func getKey(job *experimental.Job, t *testing.T) string {
} }
// create count pods with the given phase for the given job // create count pods with the given phase for the given job
func newPodList(count int, status api.PodPhase, job *experimental.Job) []api.Pod { func newPodList(count int, status api.PodPhase, job *extensions.Job) []api.Pod {
pods := []api.Pod{} pods := []api.Pod{}
for i := 0; i < count; i++ { for i := 0; i < count; i++ {
newPod := api.Pod{ newPod := api.Pod{
...@@ -165,8 +165,8 @@ func TestControllerSyncJob(t *testing.T) { ...@@ -165,8 +165,8 @@ func TestControllerSyncJob(t *testing.T) {
fakePodControl := controller.FakePodControl{Err: tc.podControllerError} fakePodControl := controller.FakePodControl{Err: tc.podControllerError}
manager.podControl = &fakePodControl manager.podControl = &fakePodControl
manager.podStoreSynced = alwaysReady manager.podStoreSynced = alwaysReady
var actual *experimental.Job var actual *extensions.Job
manager.updateHandler = func(job *experimental.Job) error { manager.updateHandler = func(job *extensions.Job) error {
actual = job actual = job
return nil return nil
} }
...@@ -211,7 +211,7 @@ func TestControllerSyncJob(t *testing.T) { ...@@ -211,7 +211,7 @@ func TestControllerSyncJob(t *testing.T) {
if tc.expectedComplete { if tc.expectedComplete {
completed := false completed := false
for _, v := range actual.Status.Conditions { for _, v := range actual.Status.Conditions {
if v.Type == experimental.JobComplete && v.Status == api.ConditionTrue { if v.Type == extensions.JobComplete && v.Status == api.ConditionTrue {
completed = true completed = true
break break
} }
...@@ -229,7 +229,7 @@ func TestSyncJobDeleted(t *testing.T) { ...@@ -229,7 +229,7 @@ func TestSyncJobDeleted(t *testing.T) {
fakePodControl := controller.FakePodControl{} fakePodControl := controller.FakePodControl{}
manager.podControl = &fakePodControl manager.podControl = &fakePodControl
manager.podStoreSynced = alwaysReady manager.podStoreSynced = alwaysReady
manager.updateHandler = func(job *experimental.Job) error { return nil } manager.updateHandler = func(job *extensions.Job) error { return nil }
job := newJob(2, 2) job := newJob(2, 2)
err := manager.syncJob(getKey(job, t)) err := manager.syncJob(getKey(job, t))
if err != nil { if err != nil {
...@@ -249,7 +249,7 @@ func TestSyncJobUpdateRequeue(t *testing.T) { ...@@ -249,7 +249,7 @@ func TestSyncJobUpdateRequeue(t *testing.T) {
fakePodControl := controller.FakePodControl{} fakePodControl := controller.FakePodControl{}
manager.podControl = &fakePodControl manager.podControl = &fakePodControl
manager.podStoreSynced = alwaysReady manager.podStoreSynced = alwaysReady
manager.updateHandler = func(job *experimental.Job) error { return fmt.Errorf("Fake error") } manager.updateHandler = func(job *extensions.Job) error { return fmt.Errorf("Fake error") }
job := newJob(2, 2) job := newJob(2, 2)
manager.jobStore.Store.Add(job) manager.jobStore.Store.Add(job)
err := manager.syncJob(getKey(job, t)) err := manager.syncJob(getKey(job, t))
...@@ -269,14 +269,14 @@ func TestJobPodLookup(t *testing.T) { ...@@ -269,14 +269,14 @@ func TestJobPodLookup(t *testing.T) {
manager := NewJobController(client, controller.NoResyncPeriodFunc) manager := NewJobController(client, controller.NoResyncPeriodFunc)
manager.podStoreSynced = alwaysReady manager.podStoreSynced = alwaysReady
testCases := []struct { testCases := []struct {
job *experimental.Job job *extensions.Job
pod *api.Pod pod *api.Pod
expectedName string expectedName string
}{ }{
// pods without labels don't match any job // pods without labels don't match any job
{ {
job: &experimental.Job{ job: &extensions.Job{
ObjectMeta: api.ObjectMeta{Name: "basic"}, ObjectMeta: api.ObjectMeta{Name: "basic"},
}, },
pod: &api.Pod{ pod: &api.Pod{
...@@ -286,9 +286,9 @@ func TestJobPodLookup(t *testing.T) { ...@@ -286,9 +286,9 @@ func TestJobPodLookup(t *testing.T) {
}, },
// matching labels, different namespace // matching labels, different namespace
{ {
job: &experimental.Job{ job: &extensions.Job{
ObjectMeta: api.ObjectMeta{Name: "foo"}, ObjectMeta: api.ObjectMeta{Name: "foo"},
Spec: experimental.JobSpec{ Spec: extensions.JobSpec{
Selector: map[string]string{"foo": "bar"}, Selector: map[string]string{"foo": "bar"},
}, },
}, },
...@@ -303,9 +303,9 @@ func TestJobPodLookup(t *testing.T) { ...@@ -303,9 +303,9 @@ func TestJobPodLookup(t *testing.T) {
}, },
// matching ns and labels returns // matching ns and labels returns
{ {
job: &experimental.Job{ job: &extensions.Job{
ObjectMeta: api.ObjectMeta{Name: "bar", Namespace: "ns"}, ObjectMeta: api.ObjectMeta{Name: "bar", Namespace: "ns"},
Spec: experimental.JobSpec{ Spec: extensions.JobSpec{
Selector: map[string]string{"foo": "bar"}, Selector: map[string]string{"foo": "bar"},
}, },
}, },
...@@ -350,7 +350,7 @@ func TestSyncJobExpectations(t *testing.T) { ...@@ -350,7 +350,7 @@ func TestSyncJobExpectations(t *testing.T) {
fakePodControl := controller.FakePodControl{} fakePodControl := controller.FakePodControl{}
manager.podControl = &fakePodControl manager.podControl = &fakePodControl
manager.podStoreSynced = alwaysReady manager.podStoreSynced = alwaysReady
manager.updateHandler = func(job *experimental.Job) error { return nil } manager.updateHandler = func(job *extensions.Job) error { return nil }
job := newJob(2, 2) job := newJob(2, 2)
manager.jobStore.Store.Add(job) manager.jobStore.Store.Add(job)
...@@ -386,7 +386,7 @@ func TestWatchJobs(t *testing.T) { ...@@ -386,7 +386,7 @@ func TestWatchJobs(t *testing.T) {
manager := NewJobController(client, controller.NoResyncPeriodFunc) manager := NewJobController(client, controller.NoResyncPeriodFunc)
manager.podStoreSynced = alwaysReady manager.podStoreSynced = alwaysReady
var testJob experimental.Job var testJob extensions.Job
received := make(chan struct{}) received := make(chan struct{})
// The update sent through the fakeWatcher should make its way into the workqueue, // The update sent through the fakeWatcher should make its way into the workqueue,
...@@ -397,7 +397,7 @@ func TestWatchJobs(t *testing.T) { ...@@ -397,7 +397,7 @@ func TestWatchJobs(t *testing.T) {
if !exists || err != nil { if !exists || err != nil {
t.Errorf("Expected to find job under key %v", key) t.Errorf("Expected to find job under key %v", key)
} }
job := *obj.(*experimental.Job) job := *obj.(*extensions.Job)
if !api.Semantic.DeepDerivative(job, testJob) { if !api.Semantic.DeepDerivative(job, testJob) {
t.Errorf("Expected %#v, but got %#v", testJob, job) t.Errorf("Expected %#v, but got %#v", testJob, job)
} }
...@@ -419,10 +419,10 @@ func TestWatchJobs(t *testing.T) { ...@@ -419,10 +419,10 @@ func TestWatchJobs(t *testing.T) {
} }
func TestIsJobFinished(t *testing.T) { func TestIsJobFinished(t *testing.T) {
job := &experimental.Job{ job := &extensions.Job{
Status: experimental.JobStatus{ Status: extensions.JobStatus{
Conditions: []experimental.JobCondition{{ Conditions: []extensions.JobCondition{{
Type: experimental.JobComplete, Type: extensions.JobComplete,
Status: api.ConditionTrue, Status: api.ConditionTrue,
}}, }},
}, },
...@@ -462,7 +462,7 @@ func TestWatchPods(t *testing.T) { ...@@ -462,7 +462,7 @@ func TestWatchPods(t *testing.T) {
if !exists || err != nil { if !exists || err != nil {
t.Errorf("Expected to find job under key %v", key) t.Errorf("Expected to find job under key %v", key)
} }
job := obj.(*experimental.Job) job := obj.(*extensions.Job)
if !api.Semantic.DeepDerivative(job, testJob) { if !api.Semantic.DeepDerivative(job, testJob) {
t.Errorf("\nExpected %#v,\nbut got %#v", testJob, job) t.Errorf("\nExpected %#v,\nbut got %#v", testJob, job)
} }
......
...@@ -29,7 +29,7 @@ const ( ...@@ -29,7 +29,7 @@ const (
// A PV created specifically for one claim must contain this annotation in order to bind to the claim. // A PV created specifically for one claim must contain this annotation in order to bind to the claim.
// The value must be the namespace and name of the claim being bound to (i.e, claim.Namespace/claim.Name) // The value must be the namespace and name of the claim being bound to (i.e, claim.Namespace/claim.Name)
// This is an experimental feature and likely to change in the future. // This is an experimental feature and likely to change in the future.
createdForKey = "volume.experimental.kubernetes.io/provisioned-for" createdForKey = "volume.extensions.kubernetes.io/provisioned-for"
) )
// persistentVolumeOrderedIndex is a cache.Store that keeps persistent volumes indexed by AccessModes and ordered by storage capacity. // persistentVolumeOrderedIndex is a cache.Store that keeps persistent volumes indexed by AccessModes and ordered by storage capacity.
......
...@@ -24,7 +24,7 @@ import ( ...@@ -24,7 +24,7 @@ import (
"github.com/golang/glog" "github.com/golang/glog"
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/client/record" "k8s.io/kubernetes/pkg/client/record"
client "k8s.io/kubernetes/pkg/client/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/controller/podautoscaler/metrics" "k8s.io/kubernetes/pkg/controller/podautoscaler/metrics"
...@@ -68,7 +68,7 @@ func (a *HorizontalController) Run(syncPeriod time.Duration) { ...@@ -68,7 +68,7 @@ func (a *HorizontalController) Run(syncPeriod time.Duration) {
}, syncPeriod, util.NeverStop) }, syncPeriod, util.NeverStop)
} }
func (a *HorizontalController) reconcileAutoscaler(hpa experimental.HorizontalPodAutoscaler) error { func (a *HorizontalController) reconcileAutoscaler(hpa extensions.HorizontalPodAutoscaler) error {
reference := fmt.Sprintf("%s/%s/%s", hpa.Spec.ScaleRef.Kind, hpa.Spec.ScaleRef.Namespace, hpa.Spec.ScaleRef.Name) reference := fmt.Sprintf("%s/%s/%s", hpa.Spec.ScaleRef.Kind, hpa.Spec.ScaleRef.Namespace, hpa.Spec.ScaleRef.Name)
scale, err := a.client.Experimental().Scales(hpa.Spec.ScaleRef.Namespace).Get(hpa.Spec.ScaleRef.Kind, hpa.Spec.ScaleRef.Name) scale, err := a.client.Experimental().Scales(hpa.Spec.ScaleRef.Namespace).Get(hpa.Spec.ScaleRef.Kind, hpa.Spec.ScaleRef.Name)
...@@ -137,7 +137,7 @@ func (a *HorizontalController) reconcileAutoscaler(hpa experimental.HorizontalPo ...@@ -137,7 +137,7 @@ func (a *HorizontalController) reconcileAutoscaler(hpa experimental.HorizontalPo
desiredReplicas = currentReplicas desiredReplicas = currentReplicas
} }
hpa.Status = experimental.HorizontalPodAutoscalerStatus{ hpa.Status = extensions.HorizontalPodAutoscalerStatus{
CurrentReplicas: currentReplicas, CurrentReplicas: currentReplicas,
DesiredReplicas: desiredReplicas, DesiredReplicas: desiredReplicas,
CurrentConsumption: currentConsumption, CurrentConsumption: currentConsumption,
......
...@@ -26,7 +26,7 @@ import ( ...@@ -26,7 +26,7 @@ import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
_ "k8s.io/kubernetes/pkg/api/latest" _ "k8s.io/kubernetes/pkg/api/latest"
"k8s.io/kubernetes/pkg/api/resource" "k8s.io/kubernetes/pkg/api/resource"
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
client "k8s.io/kubernetes/pkg/client/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/client/unversioned/testclient" "k8s.io/kubernetes/pkg/client/unversioned/testclient"
"k8s.io/kubernetes/pkg/controller/podautoscaler/metrics" "k8s.io/kubernetes/pkg/controller/podautoscaler/metrics"
...@@ -77,16 +77,16 @@ func (tc *testCase) prepareTestClient(t *testing.T) *testclient.Fake { ...@@ -77,16 +77,16 @@ func (tc *testCase) prepareTestClient(t *testing.T) *testclient.Fake {
fakeClient := &testclient.Fake{} fakeClient := &testclient.Fake{}
fakeClient.AddReactor("list", "horizontalpodautoscalers", func(action testclient.Action) (handled bool, ret runtime.Object, err error) { fakeClient.AddReactor("list", "horizontalpodautoscalers", func(action testclient.Action) (handled bool, ret runtime.Object, err error) {
obj := &experimental.HorizontalPodAutoscalerList{ obj := &extensions.HorizontalPodAutoscalerList{
Items: []experimental.HorizontalPodAutoscaler{ Items: []extensions.HorizontalPodAutoscaler{
{ {
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: hpaName, Name: hpaName,
Namespace: namespace, Namespace: namespace,
SelfLink: "experimental/v1/namespaces/" + namespace + "/horizontalpodautoscalers/" + hpaName, SelfLink: "experimental/v1/namespaces/" + namespace + "/horizontalpodautoscalers/" + hpaName,
}, },
Spec: experimental.HorizontalPodAutoscalerSpec{ Spec: extensions.HorizontalPodAutoscalerSpec{
ScaleRef: &experimental.SubresourceReference{ ScaleRef: &extensions.SubresourceReference{
Kind: "replicationController", Kind: "replicationController",
Name: rcName, Name: rcName,
Namespace: namespace, Namespace: namespace,
...@@ -94,7 +94,7 @@ func (tc *testCase) prepareTestClient(t *testing.T) *testclient.Fake { ...@@ -94,7 +94,7 @@ func (tc *testCase) prepareTestClient(t *testing.T) *testclient.Fake {
}, },
MinReplicas: tc.minReplicas, MinReplicas: tc.minReplicas,
MaxReplicas: tc.maxReplicas, MaxReplicas: tc.maxReplicas,
Target: experimental.ResourceConsumption{Resource: tc.targetResource, Quantity: tc.targetLevel}, Target: extensions.ResourceConsumption{Resource: tc.targetResource, Quantity: tc.targetLevel},
}, },
}, },
}, },
...@@ -103,15 +103,15 @@ func (tc *testCase) prepareTestClient(t *testing.T) *testclient.Fake { ...@@ -103,15 +103,15 @@ func (tc *testCase) prepareTestClient(t *testing.T) *testclient.Fake {
}) })
fakeClient.AddReactor("get", "replicationController", func(action testclient.Action) (handled bool, ret runtime.Object, err error) { fakeClient.AddReactor("get", "replicationController", func(action testclient.Action) (handled bool, ret runtime.Object, err error) {
obj := &experimental.Scale{ obj := &extensions.Scale{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: rcName, Name: rcName,
Namespace: namespace, Namespace: namespace,
}, },
Spec: experimental.ScaleSpec{ Spec: extensions.ScaleSpec{
Replicas: tc.initialReplicas, Replicas: tc.initialReplicas,
}, },
Status: experimental.ScaleStatus{ Status: extensions.ScaleStatus{
Replicas: tc.initialReplicas, Replicas: tc.initialReplicas,
Selector: map[string]string{"name": podNamePrefix}, Selector: map[string]string{"name": podNamePrefix},
}, },
...@@ -155,15 +155,15 @@ func (tc *testCase) prepareTestClient(t *testing.T) *testclient.Fake { ...@@ -155,15 +155,15 @@ func (tc *testCase) prepareTestClient(t *testing.T) *testclient.Fake {
}) })
fakeClient.AddReactor("update", "replicationController", func(action testclient.Action) (handled bool, ret runtime.Object, err error) { fakeClient.AddReactor("update", "replicationController", func(action testclient.Action) (handled bool, ret runtime.Object, err error) {
obj := action.(testclient.UpdateAction).GetObject().(*experimental.Scale) obj := action.(testclient.UpdateAction).GetObject().(*extensions.Scale)
replicas := action.(testclient.UpdateAction).GetObject().(*experimental.Scale).Spec.Replicas replicas := action.(testclient.UpdateAction).GetObject().(*extensions.Scale).Spec.Replicas
assert.Equal(t, tc.desiredReplicas, replicas) assert.Equal(t, tc.desiredReplicas, replicas)
tc.scaleUpdated = true tc.scaleUpdated = true
return true, obj, nil return true, obj, nil
}) })
fakeClient.AddReactor("update", "horizontalpodautoscalers", func(action testclient.Action) (handled bool, ret runtime.Object, err error) { fakeClient.AddReactor("update", "horizontalpodautoscalers", func(action testclient.Action) (handled bool, ret runtime.Object, err error) {
obj := action.(testclient.UpdateAction).GetObject().(*experimental.HorizontalPodAutoscaler) obj := action.(testclient.UpdateAction).GetObject().(*extensions.HorizontalPodAutoscaler)
assert.Equal(t, namespace, obj.Namespace) assert.Equal(t, namespace, obj.Namespace)
assert.Equal(t, hpaName, obj.Name) assert.Equal(t, hpaName, obj.Name)
assert.Equal(t, tc.desiredReplicas, obj.Status.DesiredReplicas) assert.Equal(t, tc.desiredReplicas, obj.Status.DesiredReplicas)
......
...@@ -25,7 +25,7 @@ import ( ...@@ -25,7 +25,7 @@ import (
"github.com/golang/glog" "github.com/golang/glog"
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/resource" "k8s.io/kubernetes/pkg/api/resource"
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
client "k8s.io/kubernetes/pkg/client/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
...@@ -47,12 +47,12 @@ type MetricsClient interface { ...@@ -47,12 +47,12 @@ type MetricsClient interface {
type ResourceConsumptionClient interface { type ResourceConsumptionClient interface {
// Gets average resource consumption for pods under the given selector. // Gets average resource consumption for pods under the given selector.
Get(resourceName api.ResourceName, selector map[string]string) (*experimental.ResourceConsumption, error) Get(resourceName api.ResourceName, selector map[string]string) (*extensions.ResourceConsumption, error)
} }
// Aggregates results into ResourceConsumption. Also returns number of // Aggregates results into ResourceConsumption. Also returns number of
// pods included in the aggregation. // pods included in the aggregation.
type metricAggregator func(heapster.MetricResultList) (experimental.ResourceConsumption, int) type metricAggregator func(heapster.MetricResultList) (extensions.ResourceConsumption, int)
type metricDefinition struct { type metricDefinition struct {
name string name string
...@@ -76,23 +76,23 @@ func NewHeapsterMetricsClient(client client.Interface) *HeapsterMetricsClient { ...@@ -76,23 +76,23 @@ func NewHeapsterMetricsClient(client client.Interface) *HeapsterMetricsClient {
var heapsterMetricDefinitions = map[api.ResourceName]metricDefinition{ var heapsterMetricDefinitions = map[api.ResourceName]metricDefinition{
api.ResourceCPU: {"cpu-usage", api.ResourceCPU: {"cpu-usage",
func(metrics heapster.MetricResultList) (experimental.ResourceConsumption, int) { func(metrics heapster.MetricResultList) (extensions.ResourceConsumption, int) {
sum, count := calculateSumFromLatestSample(metrics) sum, count := calculateSumFromLatestSample(metrics)
value := "0" value := "0"
if count > 0 { if count > 0 {
// assumes that cpu usage is in millis // assumes that cpu usage is in millis
value = fmt.Sprintf("%dm", sum/uint64(count)) value = fmt.Sprintf("%dm", sum/uint64(count))
} }
return experimental.ResourceConsumption{Resource: api.ResourceCPU, Quantity: resource.MustParse(value)}, count return extensions.ResourceConsumption{Resource: api.ResourceCPU, Quantity: resource.MustParse(value)}, count
}}, }},
api.ResourceMemory: {"memory-usage", api.ResourceMemory: {"memory-usage",
func(metrics heapster.MetricResultList) (experimental.ResourceConsumption, int) { func(metrics heapster.MetricResultList) (extensions.ResourceConsumption, int) {
sum, count := calculateSumFromLatestSample(metrics) sum, count := calculateSumFromLatestSample(metrics)
value := int64(0) value := int64(0)
if count > 0 { if count > 0 {
value = int64(sum) / int64(count) value = int64(sum) / int64(count)
} }
return experimental.ResourceConsumption{Resource: api.ResourceMemory, Quantity: *resource.NewQuantity(value, resource.DecimalSI)}, count return extensions.ResourceConsumption{Resource: api.ResourceMemory, Quantity: *resource.NewQuantity(value, resource.DecimalSI)}, count
}}, }},
} }
...@@ -104,7 +104,7 @@ func (h *HeapsterMetricsClient) ResourceConsumption(namespace string) ResourceCo ...@@ -104,7 +104,7 @@ func (h *HeapsterMetricsClient) ResourceConsumption(namespace string) ResourceCo
} }
} }
func (h *HeapsterResourceConsumptionClient) Get(resourceName api.ResourceName, selector map[string]string) (*experimental.ResourceConsumption, error) { func (h *HeapsterResourceConsumptionClient) Get(resourceName api.ResourceName, selector map[string]string) (*extensions.ResourceConsumption, error) {
podList, err := h.client.Pods(h.namespace). podList, err := h.client.Pods(h.namespace).
List(labels.SelectorFromSet(labels.Set(selector)), fields.Everything()) List(labels.SelectorFromSet(labels.Set(selector)), fields.Everything())
...@@ -118,7 +118,7 @@ func (h *HeapsterResourceConsumptionClient) Get(resourceName api.ResourceName, s ...@@ -118,7 +118,7 @@ func (h *HeapsterResourceConsumptionClient) Get(resourceName api.ResourceName, s
return h.getForPods(resourceName, podNames) return h.getForPods(resourceName, podNames)
} }
func (h *HeapsterResourceConsumptionClient) getForPods(resourceName api.ResourceName, podNames []string) (*experimental.ResourceConsumption, error) { func (h *HeapsterResourceConsumptionClient) getForPods(resourceName api.ResourceName, podNames []string) (*extensions.ResourceConsumption, error) {
metricSpec, metricDefined := h.resourceDefinitions[resourceName] metricSpec, metricDefined := h.resourceDefinitions[resourceName]
if !metricDefined { if !metricDefined {
return nil, fmt.Errorf("heapster metric not defined for %v", resourceName) return nil, fmt.Errorf("heapster metric not defined for %v", resourceName)
......
...@@ -25,7 +25,7 @@ import ( ...@@ -25,7 +25,7 @@ import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
_ "k8s.io/kubernetes/pkg/api/latest" _ "k8s.io/kubernetes/pkg/api/latest"
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
client "k8s.io/kubernetes/pkg/client/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/client/unversioned/testclient" "k8s.io/kubernetes/pkg/client/unversioned/testclient"
"k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/runtime"
...@@ -122,7 +122,7 @@ func (tc *testCase) prepareTestClient(t *testing.T) *testclient.Fake { ...@@ -122,7 +122,7 @@ func (tc *testCase) prepareTestClient(t *testing.T) *testclient.Fake {
return fakeClient return fakeClient
} }
func (tc *testCase) verifyResults(t *testing.T, val *experimental.ResourceConsumption, err error) { func (tc *testCase) verifyResults(t *testing.T, val *extensions.ResourceConsumption, err error) {
assert.Equal(t, tc.desiredError, err) assert.Equal(t, tc.desiredError, err)
if tc.desiredError != nil { if tc.desiredError != nil {
return return
......
...@@ -64,10 +64,10 @@ func TestV1EncodeDecodeStatus(t *testing.T) { ...@@ -64,10 +64,10 @@ func TestV1EncodeDecodeStatus(t *testing.T) {
} }
func TestExperimentalEncodeDecodeStatus(t *testing.T) { func TestExperimentalEncodeDecodeStatus(t *testing.T) {
// TODO: caesarxuchao: use the testapi.Experimental.Codec() once the PR that // TODO: caesarxuchao: use the testapi.Extensions.Codec() once the PR that
// moves experimental from v1 to v1alpha1 got merged. // moves experimental from v1 to v1beta1 got merged.
// expCodec := testapi.Experimental.Codec() // expCodec := testapi.Extensions.Codec()
expCodec := runtime.CodecFor(api.Scheme, "experimental/v1alpha1") expCodec := runtime.CodecFor(api.Scheme, "extensions/v1beta1")
encoded, err := expCodec.Encode(status) encoded, err := expCodec.Encode(status)
if err != nil { if err != nil {
t.Errorf("unexpected error: %v", err) t.Errorf("unexpected error: %v", err)
......
...@@ -142,7 +142,7 @@ func NewFactory(optionalClientConfig clientcmd.ClientConfig) *Factory { ...@@ -142,7 +142,7 @@ func NewFactory(optionalClientConfig clientcmd.ClientConfig) *Factory {
switch group { switch group {
case "": case "":
return client.RESTClient, nil return client.RESTClient, nil
case "experimental": case "extensions":
return client.ExperimentalClient.RESTClient, nil return client.ExperimentalClient.RESTClient, nil
} }
return nil, fmt.Errorf("unable to get RESTClient for resource '%s'", mapping.Resource) return nil, fmt.Errorf("unable to get RESTClient for resource '%s'", mapping.Resource)
...@@ -406,7 +406,7 @@ func (c *clientSwaggerSchema) ValidateBytes(data []byte) error { ...@@ -406,7 +406,7 @@ func (c *clientSwaggerSchema) ValidateBytes(data []byte) error {
if err != nil { if err != nil {
return fmt.Errorf("could not find api group for %s: %v", kind, err) return fmt.Errorf("could not find api group for %s: %v", kind, err)
} }
if group == "experimental" { if group == "extensions" {
if c.c.ExperimentalClient == nil { if c.c.ExperimentalClient == nil {
return errors.New("unable to validate: no experimental client") return errors.New("unable to validate: no experimental client")
} }
......
...@@ -28,7 +28,7 @@ import ( ...@@ -28,7 +28,7 @@ import (
"github.com/golang/glog" "github.com/golang/glog"
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/resource" "k8s.io/kubernetes/pkg/api/resource"
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
client "k8s.io/kubernetes/pkg/client/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/fieldpath" "k8s.io/kubernetes/pkg/fieldpath"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
...@@ -113,7 +113,7 @@ func DescriberFor(group string, kind string, c *client.Client) (Describer, bool) ...@@ -113,7 +113,7 @@ func DescriberFor(group string, kind string, c *client.Client) (Describer, bool)
switch group { switch group {
case "": case "":
f, ok = describerMap(c)[kind] f, ok = describerMap(c)[kind]
case "experimental": case "extensions":
f, ok = expDescriberMap(c)[kind] f, ok = expDescriberMap(c)[kind]
} }
...@@ -880,7 +880,7 @@ func (d *JobDescriber) Describe(namespace, name string) (string, error) { ...@@ -880,7 +880,7 @@ func (d *JobDescriber) Describe(namespace, name string) (string, error) {
return describeJob(job, events) return describeJob(job, events)
} }
func describeJob(job *experimental.Job, events *api.EventList) (string, error) { func describeJob(job *extensions.Job, events *api.EventList) (string, error) {
return tabbedString(func(out io.Writer) error { return tabbedString(func(out io.Writer) error {
fmt.Fprintf(out, "Name:\t%s\n", job.Name) fmt.Fprintf(out, "Name:\t%s\n", job.Name)
fmt.Fprintf(out, "Namespace:\t%s\n", job.Namespace) fmt.Fprintf(out, "Namespace:\t%s\n", job.Namespace)
...@@ -928,7 +928,7 @@ func (d *DaemonSetDescriber) Describe(namespace, name string) (string, error) { ...@@ -928,7 +928,7 @@ func (d *DaemonSetDescriber) Describe(namespace, name string) (string, error) {
return describeDaemonSet(daemon, events, running, waiting, succeeded, failed) return describeDaemonSet(daemon, events, running, waiting, succeeded, failed)
} }
func describeDaemonSet(daemon *experimental.DaemonSet, events *api.EventList, running, waiting, succeeded, failed int) (string, error) { func describeDaemonSet(daemon *extensions.DaemonSet, events *api.EventList, running, waiting, succeeded, failed int) (string, error) {
return tabbedString(func(out io.Writer) error { return tabbedString(func(out io.Writer) error {
fmt.Fprintf(out, "Name:\t%s\n", daemon.Name) fmt.Fprintf(out, "Name:\t%s\n", daemon.Name)
if daemon.Spec.Template != nil { if daemon.Spec.Template != nil {
...@@ -1448,7 +1448,7 @@ func (dd *DeploymentDescriber) Describe(namespace, name string) (string, error) ...@@ -1448,7 +1448,7 @@ func (dd *DeploymentDescriber) Describe(namespace, name string) (string, error)
// of getting all DS's and searching through them manually). // of getting all DS's and searching through them manually).
// TODO: write an interface for controllers and fuse getReplicationControllersForLabels // TODO: write an interface for controllers and fuse getReplicationControllersForLabels
// and getDaemonSetsForLabels. // and getDaemonSetsForLabels.
func getDaemonSetsForLabels(c client.DaemonSetInterface, labelsToMatch labels.Labels) ([]experimental.DaemonSet, error) { func getDaemonSetsForLabels(c client.DaemonSetInterface, labelsToMatch labels.Labels) ([]extensions.DaemonSet, error) {
// Get all daemon sets // Get all daemon sets
// TODO: this needs a namespace scope as argument // TODO: this needs a namespace scope as argument
dss, err := c.List(labels.Everything()) dss, err := c.List(labels.Everything())
...@@ -1457,7 +1457,7 @@ func getDaemonSetsForLabels(c client.DaemonSetInterface, labelsToMatch labels.La ...@@ -1457,7 +1457,7 @@ func getDaemonSetsForLabels(c client.DaemonSetInterface, labelsToMatch labels.La
} }
// Find the ones that match labelsToMatch. // Find the ones that match labelsToMatch.
var matchingDaemonSets []experimental.DaemonSet var matchingDaemonSets []extensions.DaemonSet
for _, ds := range dss.Items { for _, ds := range dss.Items {
selector := labels.SelectorFromSet(ds.Spec.Selector) selector := labels.SelectorFromSet(ds.Spec.Selector)
if selector.Matches(labelsToMatch) { if selector.Matches(labelsToMatch) {
......
...@@ -27,7 +27,7 @@ import ( ...@@ -27,7 +27,7 @@ import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/resource" "k8s.io/kubernetes/pkg/api/resource"
"k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
client "k8s.io/kubernetes/pkg/client/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/client/unversioned/testclient" "k8s.io/kubernetes/pkg/client/unversioned/testclient"
) )
...@@ -481,12 +481,12 @@ func TestPersistentVolumeDescriber(t *testing.T) { ...@@ -481,12 +481,12 @@ func TestPersistentVolumeDescriber(t *testing.T) {
} }
func TestDescribeDeployment(t *testing.T) { func TestDescribeDeployment(t *testing.T) {
fake := testclient.NewSimpleFake(&experimental.Deployment{ fake := testclient.NewSimpleFake(&extensions.Deployment{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "bar", Name: "bar",
Namespace: "foo", Namespace: "foo",
}, },
Spec: experimental.DeploymentSpec{ Spec: extensions.DeploymentSpec{
Template: &api.PodTemplateSpec{}, Template: &api.PodTemplateSpec{},
}, },
}) })
......
...@@ -37,7 +37,7 @@ import ( ...@@ -37,7 +37,7 @@ import (
"k8s.io/kubernetes/pkg/api/meta" "k8s.io/kubernetes/pkg/api/meta"
"k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/api/v1" "k8s.io/kubernetes/pkg/api/v1"
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/conversion" "k8s.io/kubernetes/pkg/conversion"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/runtime"
...@@ -723,7 +723,7 @@ func printReplicationControllerList(list *api.ReplicationControllerList, w io.Wr ...@@ -723,7 +723,7 @@ func printReplicationControllerList(list *api.ReplicationControllerList, w io.Wr
return nil return nil
} }
func printJob(job *experimental.Job, w io.Writer, withNamespace bool, wide bool, showAll bool, columnLabels []string) error { func printJob(job *extensions.Job, w io.Writer, withNamespace bool, wide bool, showAll bool, columnLabels []string) error {
name := job.Name name := job.Name
namespace := job.Namespace namespace := job.Namespace
containers := job.Spec.Template.Spec.Containers containers := job.Spec.Template.Spec.Containers
...@@ -766,7 +766,7 @@ func printJob(job *experimental.Job, w io.Writer, withNamespace bool, wide bool, ...@@ -766,7 +766,7 @@ func printJob(job *experimental.Job, w io.Writer, withNamespace bool, wide bool,
return nil return nil
} }
func printJobList(list *experimental.JobList, w io.Writer, withNamespace bool, wide bool, showAll bool, columnLabels []string) error { func printJobList(list *extensions.JobList, w io.Writer, withNamespace bool, wide bool, showAll bool, columnLabels []string) error {
for _, job := range list.Items { for _, job := range list.Items {
if err := printJob(&job, w, withNamespace, wide, showAll, columnLabels); err != nil { if err := printJob(&job, w, withNamespace, wide, showAll, columnLabels); err != nil {
return err return err
...@@ -857,14 +857,14 @@ func printServiceList(list *api.ServiceList, w io.Writer, withNamespace bool, wi ...@@ -857,14 +857,14 @@ func printServiceList(list *api.ServiceList, w io.Writer, withNamespace bool, wi
} }
// backendStringer behaves just like a string interface and converts the given backend to a string. // backendStringer behaves just like a string interface and converts the given backend to a string.
func backendStringer(backend *experimental.IngressBackend) string { func backendStringer(backend *extensions.IngressBackend) string {
if backend == nil { if backend == nil {
return "" return ""
} }
return fmt.Sprintf("%v:%v", backend.ServiceName, backend.ServicePort.String()) return fmt.Sprintf("%v:%v", backend.ServiceName, backend.ServicePort.String())
} }
func printIngress(ingress *experimental.Ingress, w io.Writer, withNamespace, wide bool, showAll bool, columnLabels []string) error { func printIngress(ingress *extensions.Ingress, w io.Writer, withNamespace, wide bool, showAll bool, columnLabels []string) error {
name := ingress.Name name := ingress.Name
namespace := ingress.Namespace namespace := ingress.Namespace
...@@ -912,7 +912,7 @@ func printIngress(ingress *experimental.Ingress, w io.Writer, withNamespace, wid ...@@ -912,7 +912,7 @@ func printIngress(ingress *experimental.Ingress, w io.Writer, withNamespace, wid
return nil return nil
} }
func printIngressList(ingressList *experimental.IngressList, w io.Writer, withNamespace, wide bool, showAll bool, columnLabels []string) error { func printIngressList(ingressList *extensions.IngressList, w io.Writer, withNamespace, wide bool, showAll bool, columnLabels []string) error {
for _, ingress := range ingressList.Items { for _, ingress := range ingressList.Items {
if err := printIngress(&ingress, w, withNamespace, wide, true, columnLabels); err != nil { if err := printIngress(&ingress, w, withNamespace, wide, true, columnLabels); err != nil {
return err return err
...@@ -921,7 +921,7 @@ func printIngressList(ingressList *experimental.IngressList, w io.Writer, withNa ...@@ -921,7 +921,7 @@ func printIngressList(ingressList *experimental.IngressList, w io.Writer, withNa
return nil return nil
} }
func printDaemonSet(ds *experimental.DaemonSet, w io.Writer, withNamespace bool, wide bool, showAll bool, columnLabels []string) error { func printDaemonSet(ds *extensions.DaemonSet, w io.Writer, withNamespace bool, wide bool, showAll bool, columnLabels []string) error {
name := ds.Name name := ds.Name
namespace := ds.Namespace namespace := ds.Namespace
...@@ -966,7 +966,7 @@ func printDaemonSet(ds *experimental.DaemonSet, w io.Writer, withNamespace bool, ...@@ -966,7 +966,7 @@ func printDaemonSet(ds *experimental.DaemonSet, w io.Writer, withNamespace bool,
return nil return nil
} }
func printDaemonSetList(list *experimental.DaemonSetList, w io.Writer, withNamespace bool, wide bool, showAll bool, columnLabels []string) error { func printDaemonSetList(list *extensions.DaemonSetList, w io.Writer, withNamespace bool, wide bool, showAll bool, columnLabels []string) error {
for _, ds := range list.Items { for _, ds := range list.Items {
if err := printDaemonSet(&ds, w, withNamespace, wide, showAll, columnLabels); err != nil { if err := printDaemonSet(&ds, w, withNamespace, wide, showAll, columnLabels); err != nil {
return err return err
...@@ -1330,7 +1330,7 @@ func printComponentStatusList(list *api.ComponentStatusList, w io.Writer, withNa ...@@ -1330,7 +1330,7 @@ func printComponentStatusList(list *api.ComponentStatusList, w io.Writer, withNa
return nil return nil
} }
func printThirdPartyResource(rsrc *experimental.ThirdPartyResource, w io.Writer, withNamespace bool, wide bool, showAll bool, columnLabels []string) error { func printThirdPartyResource(rsrc *extensions.ThirdPartyResource, w io.Writer, withNamespace bool, wide bool, showAll bool, columnLabels []string) error {
versions := make([]string, len(rsrc.Versions)) versions := make([]string, len(rsrc.Versions))
for ix := range rsrc.Versions { for ix := range rsrc.Versions {
version := &rsrc.Versions[ix] version := &rsrc.Versions[ix]
...@@ -1343,7 +1343,7 @@ func printThirdPartyResource(rsrc *experimental.ThirdPartyResource, w io.Writer, ...@@ -1343,7 +1343,7 @@ func printThirdPartyResource(rsrc *experimental.ThirdPartyResource, w io.Writer,
return nil return nil
} }
func printThirdPartyResourceList(list *experimental.ThirdPartyResourceList, w io.Writer, withNamespace bool, wide bool, showAll bool, columnLabels []string) error { func printThirdPartyResourceList(list *extensions.ThirdPartyResourceList, w io.Writer, withNamespace bool, wide bool, showAll bool, columnLabels []string) error {
for _, item := range list.Items { for _, item := range list.Items {
if err := printThirdPartyResource(&item, w, withNamespace, wide, showAll, columnLabels); err != nil { if err := printThirdPartyResource(&item, w, withNamespace, wide, showAll, columnLabels); err != nil {
return err return err
...@@ -1353,7 +1353,7 @@ func printThirdPartyResourceList(list *experimental.ThirdPartyResourceList, w io ...@@ -1353,7 +1353,7 @@ func printThirdPartyResourceList(list *experimental.ThirdPartyResourceList, w io
return nil return nil
} }
func printDeployment(deployment *experimental.Deployment, w io.Writer, withNamespace bool, wide bool, showAll bool, columnLabels []string) error { func printDeployment(deployment *extensions.Deployment, w io.Writer, withNamespace bool, wide bool, showAll bool, columnLabels []string) error {
if withNamespace { if withNamespace {
if _, err := fmt.Fprintf(w, "%s\t", deployment.Namespace); err != nil { if _, err := fmt.Fprintf(w, "%s\t", deployment.Namespace); err != nil {
return err return err
...@@ -1369,7 +1369,7 @@ func printDeployment(deployment *experimental.Deployment, w io.Writer, withNames ...@@ -1369,7 +1369,7 @@ func printDeployment(deployment *experimental.Deployment, w io.Writer, withNames
return err return err
} }
func printDeploymentList(list *experimental.DeploymentList, w io.Writer, withNamespace bool, wide bool, showAll bool, columnLabels []string) error { func printDeploymentList(list *extensions.DeploymentList, w io.Writer, withNamespace bool, wide bool, showAll bool, columnLabels []string) error {
for _, item := range list.Items { for _, item := range list.Items {
if err := printDeployment(&item, w, withNamespace, wide, showAll, columnLabels); err != nil { if err := printDeployment(&item, w, withNamespace, wide, showAll, columnLabels); err != nil {
return err return err
...@@ -1378,7 +1378,7 @@ func printDeploymentList(list *experimental.DeploymentList, w io.Writer, withNam ...@@ -1378,7 +1378,7 @@ func printDeploymentList(list *experimental.DeploymentList, w io.Writer, withNam
return nil return nil
} }
func printHorizontalPodAutoscaler(hpa *experimental.HorizontalPodAutoscaler, w io.Writer, withNamespace bool, wide bool, showAll bool, columnLabels []string) error { func printHorizontalPodAutoscaler(hpa *extensions.HorizontalPodAutoscaler, w io.Writer, withNamespace bool, wide bool, showAll bool, columnLabels []string) error {
namespace := hpa.Namespace namespace := hpa.Namespace
name := hpa.Name name := hpa.Name
reference := fmt.Sprintf("%s/%s/%s/%s", reference := fmt.Sprintf("%s/%s/%s/%s",
...@@ -1415,7 +1415,7 @@ func printHorizontalPodAutoscaler(hpa *experimental.HorizontalPodAutoscaler, w i ...@@ -1415,7 +1415,7 @@ func printHorizontalPodAutoscaler(hpa *experimental.HorizontalPodAutoscaler, w i
return err return err
} }
func printHorizontalPodAutoscalerList(list *experimental.HorizontalPodAutoscalerList, w io.Writer, withNamespace bool, wide bool, showAll bool, columnLabels []string) error { func printHorizontalPodAutoscalerList(list *extensions.HorizontalPodAutoscalerList, w io.Writer, withNamespace bool, wide bool, showAll bool, columnLabels []string) error {
for i := range list.Items { for i := range list.Items {
if err := printHorizontalPodAutoscaler(&list.Items[i], w, withNamespace, wide, showAll, columnLabels); err != nil { if err := printHorizontalPodAutoscaler(&list.Items[i], w, withNamespace, wide, showAll, columnLabels); err != nil {
return err return err
......
...@@ -30,7 +30,7 @@ import ( ...@@ -30,7 +30,7 @@ import (
"k8s.io/kubernetes/pkg/api/testapi" "k8s.io/kubernetes/pkg/api/testapi"
"k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/api/v1" "k8s.io/kubernetes/pkg/api/v1"
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/sets" "k8s.io/kubernetes/pkg/util/sets"
...@@ -1236,22 +1236,22 @@ func TestTranslateTimestamp(t *testing.T) { ...@@ -1236,22 +1236,22 @@ func TestTranslateTimestamp(t *testing.T) {
func TestPrintDeployment(t *testing.T) { func TestPrintDeployment(t *testing.T) {
tests := []struct { tests := []struct {
deployment experimental.Deployment deployment extensions.Deployment
expect string expect string
}{ }{
{ {
experimental.Deployment{ extensions.Deployment{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "test1", Name: "test1",
CreationTimestamp: unversioned.Time{Time: time.Now().Add(1.9e9)}, CreationTimestamp: unversioned.Time{Time: time.Now().Add(1.9e9)},
}, },
Spec: experimental.DeploymentSpec{ Spec: extensions.DeploymentSpec{
Replicas: 5, Replicas: 5,
Template: &api.PodTemplateSpec{ Template: &api.PodTemplateSpec{
Spec: api.PodSpec{Containers: make([]api.Container, 2)}, Spec: api.PodSpec{Containers: make([]api.Container, 2)},
}, },
}, },
Status: experimental.DeploymentStatus{ Status: extensions.DeploymentStatus{
Replicas: 10, Replicas: 10,
UpdatedReplicas: 2, UpdatedReplicas: 2,
}, },
......
...@@ -23,7 +23,7 @@ import ( ...@@ -23,7 +23,7 @@ import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/api/errors"
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
client "k8s.io/kubernetes/pkg/client/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/pkg/util/wait"
) )
...@@ -83,7 +83,7 @@ func (precondition *ScalePrecondition) ValidateReplicationController(controller ...@@ -83,7 +83,7 @@ func (precondition *ScalePrecondition) ValidateReplicationController(controller
} }
// ValidateJob ensures that the preconditions match. Returns nil if they are valid, an error otherwise // ValidateJob ensures that the preconditions match. Returns nil if they are valid, an error otherwise
func (precondition *ScalePrecondition) ValidateJob(job *experimental.Job) error { func (precondition *ScalePrecondition) ValidateJob(job *extensions.Job) error {
if precondition.Size != -1 && job.Spec.Parallelism == nil { if precondition.Size != -1 && job.Spec.Parallelism == nil {
return PreconditionError{"parallelism", strconv.Itoa(precondition.Size), "nil"} return PreconditionError{"parallelism", strconv.Itoa(precondition.Size), "nil"}
} }
......
...@@ -22,7 +22,7 @@ import ( ...@@ -22,7 +22,7 @@ import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
kerrors "k8s.io/kubernetes/pkg/api/errors" kerrors "k8s.io/kubernetes/pkg/api/errors"
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
client "k8s.io/kubernetes/pkg/client/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/client/unversioned/testclient" "k8s.io/kubernetes/pkg/client/unversioned/testclient"
) )
...@@ -53,17 +53,17 @@ type ErrorJobs struct { ...@@ -53,17 +53,17 @@ type ErrorJobs struct {
invalid bool invalid bool
} }
func (c *ErrorJobs) Update(job *experimental.Job) (*experimental.Job, error) { func (c *ErrorJobs) Update(job *extensions.Job) (*extensions.Job, error) {
if c.invalid { if c.invalid {
return nil, kerrors.NewInvalid(job.Kind, job.Name, nil) return nil, kerrors.NewInvalid(job.Kind, job.Name, nil)
} }
return nil, errors.New("Job update failure") return nil, errors.New("Job update failure")
} }
func (c *ErrorJobs) Get(name string) (*experimental.Job, error) { func (c *ErrorJobs) Get(name string) (*extensions.Job, error) {
zero := 0 zero := 0
return &experimental.Job{ return &extensions.Job{
Spec: experimental.JobSpec{ Spec: extensions.JobSpec{
Parallelism: &zero, Parallelism: &zero,
}, },
}, nil }, nil
...@@ -325,7 +325,7 @@ func TestJobScale(t *testing.T) { ...@@ -325,7 +325,7 @@ func TestJobScale(t *testing.T) {
if action, ok := actions[0].(testclient.GetAction); !ok || action.GetResource() != "jobs" || action.GetName() != name { if action, ok := actions[0].(testclient.GetAction); !ok || action.GetResource() != "jobs" || action.GetName() != name {
t.Errorf("unexpected action: %v, expected get-replicationController %s", actions[0], name) t.Errorf("unexpected action: %v, expected get-replicationController %s", actions[0], name)
} }
if action, ok := actions[1].(testclient.UpdateAction); !ok || action.GetResource() != "jobs" || *action.GetObject().(*experimental.Job).Spec.Parallelism != int(count) { if action, ok := actions[1].(testclient.UpdateAction); !ok || action.GetResource() != "jobs" || *action.GetObject().(*extensions.Job).Spec.Parallelism != int(count) {
t.Errorf("unexpected action %v, expected update-job with parallelism = %d", actions[1], count) t.Errorf("unexpected action %v, expected update-job with parallelism = %d", actions[1], count)
} }
} }
...@@ -351,8 +351,8 @@ func TestJobScaleInvalid(t *testing.T) { ...@@ -351,8 +351,8 @@ func TestJobScaleInvalid(t *testing.T) {
func TestJobScaleFailsPreconditions(t *testing.T) { func TestJobScaleFailsPreconditions(t *testing.T) {
ten := 10 ten := 10
fake := testclient.NewSimpleFake(&experimental.Job{ fake := testclient.NewSimpleFake(&extensions.Job{
Spec: experimental.JobSpec{ Spec: extensions.JobSpec{
Parallelism: &ten, Parallelism: &ten,
}, },
}) })
...@@ -375,7 +375,7 @@ func TestValidateJob(t *testing.T) { ...@@ -375,7 +375,7 @@ func TestValidateJob(t *testing.T) {
zero, ten, twenty := 0, 10, 20 zero, ten, twenty := 0, 10, 20
tests := []struct { tests := []struct {
preconditions ScalePrecondition preconditions ScalePrecondition
job experimental.Job job extensions.Job
expectError bool expectError bool
test string test string
}{ }{
...@@ -386,11 +386,11 @@ func TestValidateJob(t *testing.T) { ...@@ -386,11 +386,11 @@ func TestValidateJob(t *testing.T) {
}, },
{ {
preconditions: ScalePrecondition{-1, ""}, preconditions: ScalePrecondition{-1, ""},
job: experimental.Job{ job: extensions.Job{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
ResourceVersion: "foo", ResourceVersion: "foo",
}, },
Spec: experimental.JobSpec{ Spec: extensions.JobSpec{
Parallelism: &ten, Parallelism: &ten,
}, },
}, },
...@@ -399,11 +399,11 @@ func TestValidateJob(t *testing.T) { ...@@ -399,11 +399,11 @@ func TestValidateJob(t *testing.T) {
}, },
{ {
preconditions: ScalePrecondition{0, ""}, preconditions: ScalePrecondition{0, ""},
job: experimental.Job{ job: extensions.Job{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
ResourceVersion: "foo", ResourceVersion: "foo",
}, },
Spec: experimental.JobSpec{ Spec: extensions.JobSpec{
Parallelism: &zero, Parallelism: &zero,
}, },
}, },
...@@ -412,11 +412,11 @@ func TestValidateJob(t *testing.T) { ...@@ -412,11 +412,11 @@ func TestValidateJob(t *testing.T) {
}, },
{ {
preconditions: ScalePrecondition{-1, "foo"}, preconditions: ScalePrecondition{-1, "foo"},
job: experimental.Job{ job: extensions.Job{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
ResourceVersion: "foo", ResourceVersion: "foo",
}, },
Spec: experimental.JobSpec{ Spec: extensions.JobSpec{
Parallelism: &ten, Parallelism: &ten,
}, },
}, },
...@@ -425,11 +425,11 @@ func TestValidateJob(t *testing.T) { ...@@ -425,11 +425,11 @@ func TestValidateJob(t *testing.T) {
}, },
{ {
preconditions: ScalePrecondition{10, "foo"}, preconditions: ScalePrecondition{10, "foo"},
job: experimental.Job{ job: extensions.Job{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
ResourceVersion: "foo", ResourceVersion: "foo",
}, },
Spec: experimental.JobSpec{ Spec: extensions.JobSpec{
Parallelism: &ten, Parallelism: &ten,
}, },
}, },
...@@ -438,11 +438,11 @@ func TestValidateJob(t *testing.T) { ...@@ -438,11 +438,11 @@ func TestValidateJob(t *testing.T) {
}, },
{ {
preconditions: ScalePrecondition{10, "foo"}, preconditions: ScalePrecondition{10, "foo"},
job: experimental.Job{ job: extensions.Job{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
ResourceVersion: "foo", ResourceVersion: "foo",
}, },
Spec: experimental.JobSpec{ Spec: extensions.JobSpec{
Parallelism: &twenty, Parallelism: &twenty,
}, },
}, },
...@@ -451,7 +451,7 @@ func TestValidateJob(t *testing.T) { ...@@ -451,7 +451,7 @@ func TestValidateJob(t *testing.T) {
}, },
{ {
preconditions: ScalePrecondition{10, "foo"}, preconditions: ScalePrecondition{10, "foo"},
job: experimental.Job{ job: extensions.Job{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
ResourceVersion: "foo", ResourceVersion: "foo",
}, },
...@@ -461,11 +461,11 @@ func TestValidateJob(t *testing.T) { ...@@ -461,11 +461,11 @@ func TestValidateJob(t *testing.T) {
}, },
{ {
preconditions: ScalePrecondition{10, "foo"}, preconditions: ScalePrecondition{10, "foo"},
job: experimental.Job{ job: extensions.Job{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
ResourceVersion: "bar", ResourceVersion: "bar",
}, },
Spec: experimental.JobSpec{ Spec: extensions.JobSpec{
Parallelism: &ten, Parallelism: &ten,
}, },
}, },
...@@ -474,11 +474,11 @@ func TestValidateJob(t *testing.T) { ...@@ -474,11 +474,11 @@ func TestValidateJob(t *testing.T) {
}, },
{ {
preconditions: ScalePrecondition{10, "foo"}, preconditions: ScalePrecondition{10, "foo"},
job: experimental.Job{ job: extensions.Job{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
ResourceVersion: "bar", ResourceVersion: "bar",
}, },
Spec: experimental.JobSpec{ Spec: extensions.JobSpec{
Parallelism: &twenty, Parallelism: &twenty,
}, },
}, },
......
...@@ -23,7 +23,7 @@ import ( ...@@ -23,7 +23,7 @@ import (
"time" "time"
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
client "k8s.io/kubernetes/pkg/client/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/client/unversioned/testclient" "k8s.io/kubernetes/pkg/client/unversioned/testclient"
"k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/runtime"
...@@ -286,23 +286,23 @@ func TestJobStop(t *testing.T) { ...@@ -286,23 +286,23 @@ func TestJobStop(t *testing.T) {
{ {
Name: "OnlyOneJob", Name: "OnlyOneJob",
Objs: []runtime.Object{ Objs: []runtime.Object{
&experimental.Job{ // GET &extensions.Job{ // GET
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: name, Name: name,
Namespace: ns, Namespace: ns,
}, },
Spec: experimental.JobSpec{ Spec: extensions.JobSpec{
Parallelism: &zero, Parallelism: &zero,
Selector: map[string]string{"k1": "v1"}}, Selector: map[string]string{"k1": "v1"}},
}, },
&experimental.JobList{ // LIST &extensions.JobList{ // LIST
Items: []experimental.Job{ Items: []extensions.Job{
{ {
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: name, Name: name,
Namespace: ns, Namespace: ns,
}, },
Spec: experimental.JobSpec{ Spec: extensions.JobSpec{
Parallelism: &zero, Parallelism: &zero,
Selector: map[string]string{"k1": "v1"}}, Selector: map[string]string{"k1": "v1"}},
}, },
......
...@@ -19,5 +19,5 @@ package master ...@@ -19,5 +19,5 @@ package master
// These imports are the API groups the API server will support. // These imports are the API groups the API server will support.
import ( import (
_ "k8s.io/kubernetes/pkg/api/install" _ "k8s.io/kubernetes/pkg/api/install"
_ "k8s.io/kubernetes/pkg/apis/experimental/install" _ "k8s.io/kubernetes/pkg/apis/extensions/install"
) )
...@@ -38,7 +38,7 @@ import ( ...@@ -38,7 +38,7 @@ import (
"k8s.io/kubernetes/pkg/api/rest" "k8s.io/kubernetes/pkg/api/rest"
apiutil "k8s.io/kubernetes/pkg/api/util" apiutil "k8s.io/kubernetes/pkg/api/util"
"k8s.io/kubernetes/pkg/api/v1" "k8s.io/kubernetes/pkg/api/v1"
expapi "k8s.io/kubernetes/pkg/apis/experimental" expapi "k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/apiserver" "k8s.io/kubernetes/pkg/apiserver"
"k8s.io/kubernetes/pkg/auth/authenticator" "k8s.io/kubernetes/pkg/auth/authenticator"
"k8s.io/kubernetes/pkg/auth/authorizer" "k8s.io/kubernetes/pkg/auth/authorizer"
...@@ -653,7 +653,7 @@ func (m *Master) init(c *Config) { ...@@ -653,7 +653,7 @@ func (m *Master) init(c *Config) {
// allGroups records all supported groups at /apis // allGroups records all supported groups at /apis
allGroups := []api.APIGroup{} allGroups := []api.APIGroup{}
if m.exp { if m.exp {
m.thirdPartyStorage = c.StorageDestinations.APIGroups["experimental"].Default m.thirdPartyStorage = c.StorageDestinations.APIGroups["extensions"].Default
m.thirdPartyResources = map[string]*thirdpartyresourcedataetcd.REST{} m.thirdPartyResources = map[string]*thirdpartyresourcedataetcd.REST{}
expVersion := m.experimental(c) expVersion := m.experimental(c)
...@@ -661,7 +661,7 @@ func (m *Master) init(c *Config) { ...@@ -661,7 +661,7 @@ func (m *Master) init(c *Config) {
if err := expVersion.InstallREST(m.handlerContainer); err != nil { if err := expVersion.InstallREST(m.handlerContainer); err != nil {
glog.Fatalf("Unable to setup experimental api: %v", err) glog.Fatalf("Unable to setup experimental api: %v", err)
} }
g, err := latest.Group("experimental") g, err := latest.Group("extensions")
if err != nil { if err != nil {
glog.Fatalf("Unable to setup experimental api: %v", err) glog.Fatalf("Unable to setup experimental api: %v", err)
} }
...@@ -680,7 +680,7 @@ func (m *Master) init(c *Config) { ...@@ -680,7 +680,7 @@ func (m *Master) init(c *Config) {
Versions: expAPIVersions, Versions: expAPIVersions,
PreferredVersion: api.GroupVersion{GroupVersion: storageVersion, Version: apiutil.GetVersion(storageVersion)}, PreferredVersion: api.GroupVersion{GroupVersion: storageVersion, Version: apiutil.GetVersion(storageVersion)},
} }
apiserver.AddGroupWebService(m.handlerContainer, c.APIGroupPrefix+"/"+latest.GroupOrDie("experimental").Group+"/", group) apiserver.AddGroupWebService(m.handlerContainer, c.APIGroupPrefix+"/"+latest.GroupOrDie("extensions").Group+"/", group)
allGroups = append(allGroups, group) allGroups = append(allGroups, group)
apiserver.InstallServiceErrorHandler(m.handlerContainer, m.newAPIRequestInfoResolver(), []string{expVersion.Version}) apiserver.InstallServiceErrorHandler(m.handlerContainer, m.newAPIRequestInfoResolver(), []string{expVersion.Version})
} }
...@@ -1023,9 +1023,9 @@ func (m *Master) thirdpartyapi(group, kind, version string) *apiserver.APIGroupV ...@@ -1023,9 +1023,9 @@ func (m *Master) thirdpartyapi(group, kind, version string) *apiserver.APIGroupV
Convertor: api.Scheme, Convertor: api.Scheme,
Typer: api.Scheme, Typer: api.Scheme,
Mapper: thirdpartyresourcedata.NewMapper(latest.GroupOrDie("experimental").RESTMapper, kind, version, group), Mapper: thirdpartyresourcedata.NewMapper(latest.GroupOrDie("extensions").RESTMapper, kind, version, group),
Codec: thirdpartyresourcedata.NewCodec(latest.GroupOrDie("experimental").Codec, kind), Codec: thirdpartyresourcedata.NewCodec(latest.GroupOrDie("extensions").Codec, kind),
Linker: latest.GroupOrDie("experimental").SelfLinker, Linker: latest.GroupOrDie("extensions").SelfLinker,
Storage: storage, Storage: storage,
ServerVersion: latest.GroupOrDie("").GroupVersion, ServerVersion: latest.GroupOrDie("").GroupVersion,
...@@ -1040,7 +1040,7 @@ func (m *Master) thirdpartyapi(group, kind, version string) *apiserver.APIGroupV ...@@ -1040,7 +1040,7 @@ func (m *Master) thirdpartyapi(group, kind, version string) *apiserver.APIGroupV
func (m *Master) experimental(c *Config) *apiserver.APIGroupVersion { func (m *Master) experimental(c *Config) *apiserver.APIGroupVersion {
controllerStorage := expcontrolleretcd.NewStorage(c.StorageDestinations.get("", "replicationControllers")) controllerStorage := expcontrolleretcd.NewStorage(c.StorageDestinations.get("", "replicationControllers"))
dbClient := func(resource string) storage.Interface { dbClient := func(resource string) storage.Interface {
return c.StorageDestinations.get("experimental", resource) return c.StorageDestinations.get("extensions", resource)
} }
autoscalerStorage := horizontalpodautoscaleretcd.NewREST(dbClient("horizonalpodautoscalers")) autoscalerStorage := horizontalpodautoscaleretcd.NewREST(dbClient("horizonalpodautoscalers"))
thirdPartyResourceStorage := thirdpartyresourceetcd.NewREST(dbClient("thirdpartyresources")) thirdPartyResourceStorage := thirdpartyresourceetcd.NewREST(dbClient("thirdpartyresources"))
...@@ -1074,7 +1074,7 @@ func (m *Master) experimental(c *Config) *apiserver.APIGroupVersion { ...@@ -1074,7 +1074,7 @@ func (m *Master) experimental(c *Config) *apiserver.APIGroupVersion {
strings.ToLower("ingress"): ingressStorage, strings.ToLower("ingress"): ingressStorage,
} }
expMeta := latest.GroupOrDie("experimental") expMeta := latest.GroupOrDie("extensions")
return &apiserver.APIGroupVersion{ return &apiserver.APIGroupVersion{
Root: m.apiGroupPrefix, Root: m.apiGroupPrefix,
......
...@@ -39,7 +39,7 @@ import ( ...@@ -39,7 +39,7 @@ import (
"k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/api/unversioned"
apiutil "k8s.io/kubernetes/pkg/api/util" apiutil "k8s.io/kubernetes/pkg/api/util"
"k8s.io/kubernetes/pkg/api/v1" "k8s.io/kubernetes/pkg/api/v1"
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/apiserver" "k8s.io/kubernetes/pkg/apiserver"
client "k8s.io/kubernetes/pkg/client/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
...@@ -67,10 +67,10 @@ func setUp(t *testing.T) (Master, Config, *assert.Assertions) { ...@@ -67,10 +67,10 @@ func setUp(t *testing.T) (Master, Config, *assert.Assertions) {
storageVersions := make(map[string]string) storageVersions := make(map[string]string)
storageDestinations := NewStorageDestinations() storageDestinations := NewStorageDestinations()
storageDestinations.AddAPIGroup("", etcdstorage.NewEtcdStorage(fakeClient, testapi.Default.Codec(), etcdtest.PathPrefix())) storageDestinations.AddAPIGroup("", etcdstorage.NewEtcdStorage(fakeClient, testapi.Default.Codec(), etcdtest.PathPrefix()))
storageDestinations.AddAPIGroup("experimental", etcdstorage.NewEtcdStorage(fakeClient, testapi.Experimental.Codec(), etcdtest.PathPrefix())) storageDestinations.AddAPIGroup("extensions", etcdstorage.NewEtcdStorage(fakeClient, testapi.Extensions.Codec(), etcdtest.PathPrefix()))
config.StorageDestinations = storageDestinations config.StorageDestinations = storageDestinations
storageVersions[""] = testapi.Default.Version() storageVersions[""] = testapi.Default.Version()
storageVersions["experimental"] = testapi.Experimental.GroupAndVersion() storageVersions["extensions"] = testapi.Extensions.GroupAndVersion()
config.StorageVersions = storageVersions config.StorageVersions = storageVersions
master.nodeRegistry = registrytest.NewNodeRegistry([]string{"node1", "node2"}, api.NodeResources{}) master.nodeRegistry = registrytest.NewNodeRegistry([]string{"node1", "node2"}, api.NodeResources{})
...@@ -293,10 +293,10 @@ func TestExpapi(t *testing.T) { ...@@ -293,10 +293,10 @@ func TestExpapi(t *testing.T) {
expAPIGroup := master.experimental(&config) expAPIGroup := master.experimental(&config)
assert.Equal(expAPIGroup.Root, master.apiGroupPrefix) assert.Equal(expAPIGroup.Root, master.apiGroupPrefix)
assert.Equal(expAPIGroup.Mapper, latest.GroupOrDie("experimental").RESTMapper) assert.Equal(expAPIGroup.Mapper, latest.GroupOrDie("extensions").RESTMapper)
assert.Equal(expAPIGroup.Codec, latest.GroupOrDie("experimental").Codec) assert.Equal(expAPIGroup.Codec, latest.GroupOrDie("extensions").Codec)
assert.Equal(expAPIGroup.Linker, latest.GroupOrDie("experimental").SelfLinker) assert.Equal(expAPIGroup.Linker, latest.GroupOrDie("extensions").SelfLinker)
assert.Equal(expAPIGroup.Version, latest.GroupOrDie("experimental").GroupVersion) assert.Equal(expAPIGroup.Version, latest.GroupOrDie("extensions").GroupVersion)
} }
// TestSecondsSinceSync verifies that proper results are returned // TestSecondsSinceSync verifies that proper results are returned
...@@ -471,16 +471,16 @@ func TestDiscoveryAtAPIS(t *testing.T) { ...@@ -471,16 +471,16 @@ func TestDiscoveryAtAPIS(t *testing.T) {
t.Fatalf("unexpected error: %v", err) t.Fatalf("unexpected error: %v", err)
} }
expectGroupName := "experimental" expectGroupName := "extensions"
expectVersions := []api.GroupVersion{ expectVersions := []api.GroupVersion{
{ {
GroupVersion: testapi.Experimental.GroupAndVersion(), GroupVersion: testapi.Extensions.GroupAndVersion(),
Version: testapi.Experimental.Version(), Version: testapi.Extensions.Version(),
}, },
} }
expectPreferredVersion := api.GroupVersion{ expectPreferredVersion := api.GroupVersion{
GroupVersion: config.StorageVersions["experimental"], GroupVersion: config.StorageVersions["extensions"],
Version: apiutil.GetVersion(config.StorageVersions["experimental"]), Version: apiutil.GetVersion(config.StorageVersions["extensions"]),
} }
assert.Equal(expectGroupName, groupList.Groups[0].Name) assert.Equal(expectGroupName, groupList.Groups[0].Name)
assert.Equal(expectVersions, groupList.Groups[0].Versions) assert.Equal(expectVersions, groupList.Groups[0].Versions)
...@@ -507,11 +507,11 @@ type FooList struct { ...@@ -507,11 +507,11 @@ type FooList struct {
func initThirdParty(t *testing.T, version string) (*Master, *tools.FakeEtcdClient, *httptest.Server, *assert.Assertions) { func initThirdParty(t *testing.T, version string) (*Master, *tools.FakeEtcdClient, *httptest.Server, *assert.Assertions) {
master, _, assert := setUp(t) master, _, assert := setUp(t)
master.thirdPartyResources = map[string]*thirdpartyresourcedatastorage.REST{} master.thirdPartyResources = map[string]*thirdpartyresourcedatastorage.REST{}
api := &experimental.ThirdPartyResource{ api := &extensions.ThirdPartyResource{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "foo.company.com", Name: "foo.company.com",
}, },
Versions: []experimental.APIVersion{ Versions: []extensions.APIVersion{
{ {
APIGroup: "group", APIGroup: "group",
Name: version, Name: version,
...@@ -522,7 +522,7 @@ func initThirdParty(t *testing.T, version string) (*Master, *tools.FakeEtcdClien ...@@ -522,7 +522,7 @@ func initThirdParty(t *testing.T, version string) (*Master, *tools.FakeEtcdClien
fakeClient := tools.NewFakeEtcdClient(t) fakeClient := tools.NewFakeEtcdClient(t)
fakeClient.Machines = []string{"http://machine1:4001", "http://machine2", "http://machine3:4003"} fakeClient.Machines = []string{"http://machine1:4001", "http://machine2", "http://machine3:4003"}
master.thirdPartyStorage = etcdstorage.NewEtcdStorage(fakeClient, testapi.Experimental.Codec(), etcdtest.PathPrefix()) master.thirdPartyStorage = etcdstorage.NewEtcdStorage(fakeClient, testapi.Extensions.Codec(), etcdtest.PathPrefix())
if !assert.NoError(master.InstallThirdPartyResource(api)) { if !assert.NoError(master.InstallThirdPartyResource(api)) {
t.FailNow() t.FailNow()
...@@ -630,11 +630,11 @@ func encodeToThirdParty(name string, obj interface{}) ([]byte, error) { ...@@ -630,11 +630,11 @@ func encodeToThirdParty(name string, obj interface{}) ([]byte, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
thirdPartyData := experimental.ThirdPartyResourceData{ thirdPartyData := extensions.ThirdPartyResourceData{
ObjectMeta: api.ObjectMeta{Name: name}, ObjectMeta: api.ObjectMeta{Name: name},
Data: serial, Data: serial,
} }
return testapi.Experimental.Codec().Encode(&thirdPartyData) return testapi.Extensions.Codec().Encode(&thirdPartyData)
} }
func storeToEtcd(fakeClient *tools.FakeEtcdClient, path, name string, obj interface{}) error { func storeToEtcd(fakeClient *tools.FakeEtcdClient, path, name string, obj interface{}) error {
...@@ -774,11 +774,11 @@ func testInstallThirdPartyAPIPostForVersion(t *testing.T, version string) { ...@@ -774,11 +774,11 @@ func testInstallThirdPartyAPIPostForVersion(t *testing.T, version string) {
t.FailNow() t.FailNow()
} }
obj, err := testapi.Experimental.Codec().Decode([]byte(etcdResp.Node.Value)) obj, err := testapi.Extensions.Codec().Decode([]byte(etcdResp.Node.Value))
if err != nil { if err != nil {
t.Errorf("unexpected error: %v", err) t.Errorf("unexpected error: %v", err)
} }
thirdPartyObj, ok := obj.(*experimental.ThirdPartyResourceData) thirdPartyObj, ok := obj.(*extensions.ThirdPartyResourceData)
if !ok { if !ok {
t.Errorf("unexpected object: %v", obj) t.Errorf("unexpected object: %v", obj)
} }
......
...@@ -21,7 +21,7 @@ import ( ...@@ -21,7 +21,7 @@ import (
"strings" "strings"
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
expapi "k8s.io/kubernetes/pkg/apis/experimental" expapi "k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
thirdpartyresourceetcd "k8s.io/kubernetes/pkg/registry/thirdpartyresource/etcd" thirdpartyresourceetcd "k8s.io/kubernetes/pkg/registry/thirdpartyresource/etcd"
......
...@@ -20,7 +20,7 @@ import ( ...@@ -20,7 +20,7 @@ import (
"testing" "testing"
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
expapi "k8s.io/kubernetes/pkg/apis/experimental" expapi "k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/registry/thirdpartyresourcedata" "k8s.io/kubernetes/pkg/registry/thirdpartyresourcedata"
"k8s.io/kubernetes/pkg/util/sets" "k8s.io/kubernetes/pkg/util/sets"
) )
......
...@@ -18,7 +18,7 @@ package etcd ...@@ -18,7 +18,7 @@ package etcd
import ( import (
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/registry/daemonset" "k8s.io/kubernetes/pkg/registry/daemonset"
...@@ -39,10 +39,10 @@ var daemonPrefix = "/daemonsets" ...@@ -39,10 +39,10 @@ var daemonPrefix = "/daemonsets"
// NewREST returns a RESTStorage object that will work against DaemonSets. // NewREST returns a RESTStorage object that will work against DaemonSets.
func NewREST(s storage.Interface) (*REST, *StatusREST) { func NewREST(s storage.Interface) (*REST, *StatusREST) {
store := &etcdgeneric.Etcd{ store := &etcdgeneric.Etcd{
NewFunc: func() runtime.Object { return &experimental.DaemonSet{} }, NewFunc: func() runtime.Object { return &extensions.DaemonSet{} },
// NewListFunc returns an object capable of storing results of an etcd list. // NewListFunc returns an object capable of storing results of an etcd list.
NewListFunc: func() runtime.Object { return &experimental.DaemonSetList{} }, NewListFunc: func() runtime.Object { return &extensions.DaemonSetList{} },
// Produces a path that etcd understands, to the root of the resource // Produces a path that etcd understands, to the root of the resource
// by combining the namespace in the context with the given prefix // by combining the namespace in the context with the given prefix
KeyRootFunc: func(ctx api.Context) string { KeyRootFunc: func(ctx api.Context) string {
...@@ -55,7 +55,7 @@ func NewREST(s storage.Interface) (*REST, *StatusREST) { ...@@ -55,7 +55,7 @@ func NewREST(s storage.Interface) (*REST, *StatusREST) {
}, },
// Retrieve the name field of a daemon set // Retrieve the name field of a daemon set
ObjectNameFunc: func(obj runtime.Object) (string, error) { ObjectNameFunc: func(obj runtime.Object) (string, error) {
return obj.(*experimental.DaemonSet).Name, nil return obj.(*extensions.DaemonSet).Name, nil
}, },
// Used to match objects based on labels/fields for list and watch // Used to match objects based on labels/fields for list and watch
PredicateFunc: func(label labels.Selector, field fields.Selector) generic.Matcher { PredicateFunc: func(label labels.Selector, field fields.Selector) generic.Matcher {
...@@ -83,7 +83,7 @@ type StatusREST struct { ...@@ -83,7 +83,7 @@ type StatusREST struct {
} }
func (r *StatusREST) New() runtime.Object { func (r *StatusREST) New() runtime.Object {
return &experimental.DaemonSet{} return &extensions.DaemonSet{}
} }
// Update alters the status subset of an object. // Update alters the status subset of an object.
......
...@@ -20,7 +20,7 @@ import ( ...@@ -20,7 +20,7 @@ import (
"testing" "testing"
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/registry/registrytest" "k8s.io/kubernetes/pkg/registry/registrytest"
...@@ -29,18 +29,18 @@ import ( ...@@ -29,18 +29,18 @@ import (
) )
func newStorage(t *testing.T) (*REST, *StatusREST, *tools.FakeEtcdClient) { func newStorage(t *testing.T) (*REST, *StatusREST, *tools.FakeEtcdClient) {
etcdStorage, fakeClient := registrytest.NewEtcdStorage(t, "experimental") etcdStorage, fakeClient := registrytest.NewEtcdStorage(t, "extensions")
storage, statusStorage := NewREST(etcdStorage) storage, statusStorage := NewREST(etcdStorage)
return storage, statusStorage, fakeClient return storage, statusStorage, fakeClient
} }
func newValidDaemonSet() *experimental.DaemonSet { func newValidDaemonSet() *extensions.DaemonSet {
return &experimental.DaemonSet{ return &extensions.DaemonSet{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "foo", Name: "foo",
Namespace: api.NamespaceDefault, Namespace: api.NamespaceDefault,
}, },
Spec: experimental.DaemonSetSpec{ Spec: extensions.DaemonSetSpec{
Selector: map[string]string{"a": "b"}, Selector: map[string]string{"a": "b"},
Template: &api.PodTemplateSpec{ Template: &api.PodTemplateSpec{
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
...@@ -73,8 +73,8 @@ func TestCreate(t *testing.T) { ...@@ -73,8 +73,8 @@ func TestCreate(t *testing.T) {
// valid // valid
ds, ds,
// invalid (invalid selector) // invalid (invalid selector)
&experimental.DaemonSet{ &extensions.DaemonSet{
Spec: experimental.DaemonSetSpec{ Spec: extensions.DaemonSetSpec{
Selector: map[string]string{}, Selector: map[string]string{},
Template: validDaemonSet.Spec.Template, Template: validDaemonSet.Spec.Template,
}, },
...@@ -90,28 +90,28 @@ func TestUpdate(t *testing.T) { ...@@ -90,28 +90,28 @@ func TestUpdate(t *testing.T) {
newValidDaemonSet(), newValidDaemonSet(),
// updateFunc // updateFunc
func(obj runtime.Object) runtime.Object { func(obj runtime.Object) runtime.Object {
object := obj.(*experimental.DaemonSet) object := obj.(*extensions.DaemonSet)
object.Spec.Template.Spec.NodeSelector = map[string]string{"c": "d"} object.Spec.Template.Spec.NodeSelector = map[string]string{"c": "d"}
return object return object
}, },
// invalid updateFunc // invalid updateFunc
func(obj runtime.Object) runtime.Object { func(obj runtime.Object) runtime.Object {
object := obj.(*experimental.DaemonSet) object := obj.(*extensions.DaemonSet)
object.UID = "newUID" object.UID = "newUID"
return object return object
}, },
func(obj runtime.Object) runtime.Object { func(obj runtime.Object) runtime.Object {
object := obj.(*experimental.DaemonSet) object := obj.(*extensions.DaemonSet)
object.Name = "" object.Name = ""
return object return object
}, },
func(obj runtime.Object) runtime.Object { func(obj runtime.Object) runtime.Object {
object := obj.(*experimental.DaemonSet) object := obj.(*extensions.DaemonSet)
object.Spec.Template.Spec.RestartPolicy = api.RestartPolicyOnFailure object.Spec.Template.Spec.RestartPolicy = api.RestartPolicyOnFailure
return object return object
}, },
func(obj runtime.Object) runtime.Object { func(obj runtime.Object) runtime.Object {
object := obj.(*experimental.DaemonSet) object := obj.(*extensions.DaemonSet)
object.Spec.Selector = map[string]string{} object.Spec.Selector = map[string]string{}
return object return object
}, },
......
...@@ -21,8 +21,8 @@ import ( ...@@ -21,8 +21,8 @@ import (
"reflect" "reflect"
"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/apis/experimental" "k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/apis/experimental/validation" "k8s.io/kubernetes/pkg/apis/extensions/validation"
"k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/registry/generic" "k8s.io/kubernetes/pkg/registry/generic"
...@@ -46,16 +46,16 @@ func (daemonSetStrategy) NamespaceScoped() bool { ...@@ -46,16 +46,16 @@ func (daemonSetStrategy) NamespaceScoped() bool {
// PrepareForCreate clears the status of a daemon set before creation. // PrepareForCreate clears the status of a daemon set before creation.
func (daemonSetStrategy) PrepareForCreate(obj runtime.Object) { func (daemonSetStrategy) PrepareForCreate(obj runtime.Object) {
daemonSet := obj.(*experimental.DaemonSet) daemonSet := obj.(*extensions.DaemonSet)
daemonSet.Status = experimental.DaemonSetStatus{} daemonSet.Status = extensions.DaemonSetStatus{}
daemonSet.Generation = 1 daemonSet.Generation = 1
} }
// PrepareForUpdate clears fields that are not allowed to be set by end users on update. // PrepareForUpdate clears fields that are not allowed to be set by end users on update.
func (daemonSetStrategy) PrepareForUpdate(obj, old runtime.Object) { func (daemonSetStrategy) PrepareForUpdate(obj, old runtime.Object) {
newDaemonSet := obj.(*experimental.DaemonSet) newDaemonSet := obj.(*extensions.DaemonSet)
oldDaemonSet := old.(*experimental.DaemonSet) oldDaemonSet := old.(*extensions.DaemonSet)
// update is not allowed to set status // update is not allowed to set status
newDaemonSet.Status = oldDaemonSet.Status newDaemonSet.Status = oldDaemonSet.Status
...@@ -78,7 +78,7 @@ func (daemonSetStrategy) PrepareForUpdate(obj, old runtime.Object) { ...@@ -78,7 +78,7 @@ func (daemonSetStrategy) PrepareForUpdate(obj, old runtime.Object) {
// Validate validates a new daemon set. // Validate validates a new daemon set.
func (daemonSetStrategy) Validate(ctx api.Context, obj runtime.Object) fielderrors.ValidationErrorList { func (daemonSetStrategy) Validate(ctx api.Context, obj runtime.Object) fielderrors.ValidationErrorList {
daemonSet := obj.(*experimental.DaemonSet) daemonSet := obj.(*extensions.DaemonSet)
return validation.ValidateDaemonSet(daemonSet) return validation.ValidateDaemonSet(daemonSet)
} }
...@@ -90,8 +90,8 @@ func (daemonSetStrategy) AllowCreateOnUpdate() bool { ...@@ -90,8 +90,8 @@ func (daemonSetStrategy) AllowCreateOnUpdate() bool {
// ValidateUpdate is the default update validation for an end user. // ValidateUpdate is the default update validation for an end user.
func (daemonSetStrategy) ValidateUpdate(ctx api.Context, obj, old runtime.Object) fielderrors.ValidationErrorList { func (daemonSetStrategy) ValidateUpdate(ctx api.Context, obj, old runtime.Object) fielderrors.ValidationErrorList {
validationErrorList := validation.ValidateDaemonSet(obj.(*experimental.DaemonSet)) validationErrorList := validation.ValidateDaemonSet(obj.(*extensions.DaemonSet))
updateErrorList := validation.ValidateDaemonSetUpdate(old.(*experimental.DaemonSet), obj.(*experimental.DaemonSet)) updateErrorList := validation.ValidateDaemonSetUpdate(old.(*extensions.DaemonSet), obj.(*extensions.DaemonSet))
return append(validationErrorList, updateErrorList...) return append(validationErrorList, updateErrorList...)
} }
...@@ -101,7 +101,7 @@ func (daemonSetStrategy) AllowUnconditionalUpdate() bool { ...@@ -101,7 +101,7 @@ func (daemonSetStrategy) AllowUnconditionalUpdate() bool {
} }
// DaemonSetToSelectableFields returns a field set that represents the object. // DaemonSetToSelectableFields returns a field set that represents the object.
func DaemonSetToSelectableFields(daemon *experimental.DaemonSet) fields.Set { func DaemonSetToSelectableFields(daemon *extensions.DaemonSet) fields.Set {
return fields.Set{ return fields.Set{
"metadata.name": daemon.Name, "metadata.name": daemon.Name,
} }
...@@ -115,7 +115,7 @@ func MatchDaemonSet(label labels.Selector, field fields.Selector) generic.Matche ...@@ -115,7 +115,7 @@ func MatchDaemonSet(label labels.Selector, field fields.Selector) generic.Matche
Label: label, Label: label,
Field: field, Field: field,
GetAttrs: func(obj runtime.Object) (labels.Set, fields.Set, error) { GetAttrs: func(obj runtime.Object) (labels.Set, fields.Set, error) {
ds, ok := obj.(*experimental.DaemonSet) ds, ok := obj.(*extensions.DaemonSet)
if !ok { if !ok {
return nil, nil, fmt.Errorf("given object is not a ds.") return nil, nil, fmt.Errorf("given object is not a ds.")
} }
...@@ -131,11 +131,11 @@ type daemonSetStatusStrategy struct { ...@@ -131,11 +131,11 @@ type daemonSetStatusStrategy struct {
var StatusStrategy = daemonSetStatusStrategy{Strategy} var StatusStrategy = daemonSetStatusStrategy{Strategy}
func (daemonSetStatusStrategy) PrepareForUpdate(obj, old runtime.Object) { func (daemonSetStatusStrategy) PrepareForUpdate(obj, old runtime.Object) {
newDaemonSet := obj.(*experimental.DaemonSet) newDaemonSet := obj.(*extensions.DaemonSet)
oldDaemonSet := old.(*experimental.DaemonSet) oldDaemonSet := old.(*extensions.DaemonSet)
newDaemonSet.Spec = oldDaemonSet.Spec newDaemonSet.Spec = oldDaemonSet.Spec
} }
func (daemonSetStatusStrategy) ValidateUpdate(ctx api.Context, obj, old runtime.Object) fielderrors.ValidationErrorList { func (daemonSetStatusStrategy) ValidateUpdate(ctx api.Context, obj, old runtime.Object) fielderrors.ValidationErrorList {
return validation.ValidateDaemonSetStatusUpdate(obj.(*experimental.DaemonSet), old.(*experimental.DaemonSet)) return validation.ValidateDaemonSetStatusUpdate(obj.(*extensions.DaemonSet), old.(*extensions.DaemonSet))
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment