Unverified Commit 1df4f8ea authored by k8s-ci-robot's avatar k8s-ci-robot Committed by GitHub

Merge pull request #70028 from liggitt/move-extensions-types

move internal apps API types out of extensions package
parents 1355e6b2 572dfe6c
...@@ -24,8 +24,6 @@ API rule violation: names_match,k8s.io/api/core/v1,RBDVolumeSource,RBDPool ...@@ -24,8 +24,6 @@ API rule violation: names_match,k8s.io/api/core/v1,RBDVolumeSource,RBDPool
API rule violation: names_match,k8s.io/api/core/v1,RBDVolumeSource,RadosUser API rule violation: names_match,k8s.io/api/core/v1,RBDVolumeSource,RadosUser
API rule violation: names_match,k8s.io/api/core/v1,VolumeSource,CephFS API rule violation: names_match,k8s.io/api/core/v1,VolumeSource,CephFS
API rule violation: names_match,k8s.io/api/core/v1,VolumeSource,StorageOS API rule violation: names_match,k8s.io/api/core/v1,VolumeSource,StorageOS
API rule violation: names_match,k8s.io/api/extensions/v1beta1,CustomMetricCurrentStatus,CurrentValue
API rule violation: names_match,k8s.io/api/extensions/v1beta1,CustomMetricTarget,TargetValue
API rule violation: names_match,k8s.io/api/policy/v1beta1,PodDisruptionBudgetStatus,PodDisruptionsAllowed API rule violation: names_match,k8s.io/api/policy/v1beta1,PodDisruptionBudgetStatus,PodDisruptionsAllowed
API rule violation: names_match,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1,CustomResourceColumnDefinition,JSONPath API rule violation: names_match,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1,CustomResourceColumnDefinition,JSONPath
API rule violation: names_match,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1,JSON,Raw API rule violation: names_match,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1,JSON,Raw
......
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
"k8s.io/kubernetes/pkg/apis/autoscaling", "k8s.io/kubernetes/pkg/apis/autoscaling",
"k8s.io/kubernetes/pkg/apis/core", "k8s.io/kubernetes/pkg/apis/core",
"k8s.io/kubernetes/pkg/api/service", "k8s.io/kubernetes/pkg/api/service",
"k8s.io/kubernetes/pkg/apis/apps",
"k8s.io/kubernetes/pkg/apis/extensions", "k8s.io/kubernetes/pkg/apis/extensions",
"k8s.io/kubernetes/pkg/apis/networking", "k8s.io/kubernetes/pkg/apis/networking",
"k8s.io/kubernetes/pkg/apis/policy", "k8s.io/kubernetes/pkg/apis/policy",
......
...@@ -11,10 +11,10 @@ ...@@ -11,10 +11,10 @@
# the following are temporary and should go away. Think twice (or more) before adding anything here. # the following are temporary and should go away. Think twice (or more) before adding anything here.
# Main goal: pkg/apis should be as self-contained as possible. # Main goal: pkg/apis should be as self-contained as possible.
- k8s.io/kubernetes/pkg/apis/extensions - k8s.io/kubernetes/pkg/apis/apps
- k8s.io/kubernetes/pkg/api/legacyscheme - k8s.io/kubernetes/pkg/api/legacyscheme
- k8s.io/kubernetes/pkg/api/testapi - k8s.io/kubernetes/pkg/api/testapi
- k8s.io/api/extensions/v1beta1 - k8s.io/api/apps/v1
ignoredSubTrees: ignoredSubTrees:
- "./pkg/apis/core/validation" - "./pkg/apis/core/validation"
......
...@@ -18,6 +18,7 @@ go_library( ...@@ -18,6 +18,7 @@ go_library(
deps = [ deps = [
"//pkg/api/legacyscheme:go_default_library", "//pkg/api/legacyscheme:go_default_library",
"//pkg/apis/admissionregistration/fuzzer:go_default_library", "//pkg/apis/admissionregistration/fuzzer:go_default_library",
"//pkg/apis/apps:go_default_library",
"//pkg/apis/apps/fuzzer:go_default_library", "//pkg/apis/apps/fuzzer:go_default_library",
"//pkg/apis/auditregistration/fuzzer:go_default_library", "//pkg/apis/auditregistration/fuzzer:go_default_library",
"//pkg/apis/autoscaling/fuzzer:go_default_library", "//pkg/apis/autoscaling/fuzzer:go_default_library",
...@@ -25,13 +26,12 @@ go_library( ...@@ -25,13 +26,12 @@ go_library(
"//pkg/apis/certificates/fuzzer:go_default_library", "//pkg/apis/certificates/fuzzer:go_default_library",
"//pkg/apis/core:go_default_library", "//pkg/apis/core:go_default_library",
"//pkg/apis/core/fuzzer:go_default_library", "//pkg/apis/core/fuzzer:go_default_library",
"//pkg/apis/extensions:go_default_library",
"//pkg/apis/extensions/fuzzer:go_default_library", "//pkg/apis/extensions/fuzzer:go_default_library",
"//pkg/apis/extensions/v1beta1:go_default_library",
"//pkg/apis/networking/fuzzer:go_default_library", "//pkg/apis/networking/fuzzer:go_default_library",
"//pkg/apis/policy/fuzzer:go_default_library", "//pkg/apis/policy/fuzzer:go_default_library",
"//pkg/apis/rbac/fuzzer:go_default_library", "//pkg/apis/rbac/fuzzer:go_default_library",
"//pkg/apis/storage/fuzzer:go_default_library", "//pkg/apis/storage/fuzzer:go_default_library",
"//staging/src/k8s.io/api/apps/v1:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library", "//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/apitesting:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/api/apitesting:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/apitesting/fuzzer:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/api/apitesting/fuzzer:go_default_library",
...@@ -78,12 +78,15 @@ go_test( ...@@ -78,12 +78,15 @@ go_test(
"//pkg/api/legacyscheme:go_default_library", "//pkg/api/legacyscheme:go_default_library",
"//pkg/api/testapi:go_default_library", "//pkg/api/testapi:go_default_library",
"//pkg/api/testing/compat:go_default_library", "//pkg/api/testing/compat:go_default_library",
"//pkg/apis/apps:go_default_library",
"//pkg/apis/apps/v1:go_default_library",
"//pkg/apis/core:go_default_library", "//pkg/apis/core:go_default_library",
"//pkg/apis/core/install:go_default_library", "//pkg/apis/core/install:go_default_library",
"//pkg/apis/core/v1:go_default_library", "//pkg/apis/core/v1:go_default_library",
"//pkg/apis/core/validation:go_default_library", "//pkg/apis/core/validation:go_default_library",
"//pkg/apis/extensions:go_default_library", "//pkg/apis/extensions:go_default_library",
"//pkg/apis/extensions/v1beta1:go_default_library", "//pkg/apis/extensions/v1beta1:go_default_library",
"//staging/src/k8s.io/api/apps/v1:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library", "//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/api/extensions/v1beta1:go_default_library", "//staging/src/k8s.io/api/extensions/v1beta1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/apitesting/fuzzer:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/api/apitesting/fuzzer:go_default_library",
......
...@@ -21,6 +21,7 @@ import ( ...@@ -21,6 +21,7 @@ import (
fuzz "github.com/google/gofuzz" fuzz "github.com/google/gofuzz"
appsv1 "k8s.io/api/apps/v1"
"k8s.io/api/core/v1" "k8s.io/api/core/v1"
apitesting "k8s.io/apimachinery/pkg/api/apitesting" apitesting "k8s.io/apimachinery/pkg/api/apitesting"
"k8s.io/apimachinery/pkg/api/apitesting/fuzzer" "k8s.io/apimachinery/pkg/api/apitesting/fuzzer"
...@@ -28,6 +29,7 @@ import ( ...@@ -28,6 +29,7 @@ import (
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer" runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer"
admissionregistrationfuzzer "k8s.io/kubernetes/pkg/apis/admissionregistration/fuzzer" admissionregistrationfuzzer "k8s.io/kubernetes/pkg/apis/admissionregistration/fuzzer"
"k8s.io/kubernetes/pkg/apis/apps"
appsfuzzer "k8s.io/kubernetes/pkg/apis/apps/fuzzer" appsfuzzer "k8s.io/kubernetes/pkg/apis/apps/fuzzer"
auditregistrationfuzzer "k8s.io/kubernetes/pkg/apis/auditregistration/fuzzer" auditregistrationfuzzer "k8s.io/kubernetes/pkg/apis/auditregistration/fuzzer"
autoscalingfuzzer "k8s.io/kubernetes/pkg/apis/autoscaling/fuzzer" autoscalingfuzzer "k8s.io/kubernetes/pkg/apis/autoscaling/fuzzer"
...@@ -35,9 +37,7 @@ import ( ...@@ -35,9 +37,7 @@ import (
certificatesfuzzer "k8s.io/kubernetes/pkg/apis/certificates/fuzzer" certificatesfuzzer "k8s.io/kubernetes/pkg/apis/certificates/fuzzer"
api "k8s.io/kubernetes/pkg/apis/core" api "k8s.io/kubernetes/pkg/apis/core"
corefuzzer "k8s.io/kubernetes/pkg/apis/core/fuzzer" corefuzzer "k8s.io/kubernetes/pkg/apis/core/fuzzer"
"k8s.io/kubernetes/pkg/apis/extensions"
extensionsfuzzer "k8s.io/kubernetes/pkg/apis/extensions/fuzzer" extensionsfuzzer "k8s.io/kubernetes/pkg/apis/extensions/fuzzer"
extensionsv1beta1 "k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
networkingfuzzer "k8s.io/kubernetes/pkg/apis/networking/fuzzer" networkingfuzzer "k8s.io/kubernetes/pkg/apis/networking/fuzzer"
policyfuzzer "k8s.io/kubernetes/pkg/apis/policy/fuzzer" policyfuzzer "k8s.io/kubernetes/pkg/apis/policy/fuzzer"
rbacfuzzer "k8s.io/kubernetes/pkg/apis/rbac/fuzzer" rbacfuzzer "k8s.io/kubernetes/pkg/apis/rbac/fuzzer"
...@@ -65,14 +65,14 @@ func overrideGenericFuncs(codecs runtimeserializer.CodecFactory) []interface{} { ...@@ -65,14 +65,14 @@ func overrideGenericFuncs(codecs runtimeserializer.CodecFactory) []interface{} {
}, },
func(r *runtime.RawExtension, c fuzz.Continue) { func(r *runtime.RawExtension, c fuzz.Continue) {
// Pick an arbitrary type and fuzz it // Pick an arbitrary type and fuzz it
types := []runtime.Object{&api.Pod{}, &extensions.Deployment{}, &api.Service{}} types := []runtime.Object{&api.Pod{}, &apps.Deployment{}, &api.Service{}}
obj := types[c.Rand.Intn(len(types))] obj := types[c.Rand.Intn(len(types))]
c.Fuzz(obj) c.Fuzz(obj)
var codec runtime.Codec var codec runtime.Codec
switch obj.(type) { switch obj.(type) {
case *extensions.Deployment: case *apps.Deployment:
codec = apitesting.TestCodec(codecs, extensionsv1beta1.SchemeGroupVersion) codec = apitesting.TestCodec(codecs, appsv1.SchemeGroupVersion)
default: default:
codec = apitesting.TestCodec(codecs, v1.SchemeGroupVersion) codec = apitesting.TestCodec(codecs, v1.SchemeGroupVersion)
} }
......
...@@ -27,8 +27,8 @@ import ( ...@@ -27,8 +27,8 @@ import (
jsoniter "github.com/json-iterator/go" jsoniter "github.com/json-iterator/go"
appsv1 "k8s.io/api/apps/v1"
"k8s.io/api/core/v1" "k8s.io/api/core/v1"
"k8s.io/api/extensions/v1beta1"
"k8s.io/apimachinery/pkg/api/apitesting/fuzzer" "k8s.io/apimachinery/pkg/api/apitesting/fuzzer"
"k8s.io/apimachinery/pkg/api/apitesting/roundtrip" "k8s.io/apimachinery/pkg/api/apitesting/roundtrip"
apiequality "k8s.io/apimachinery/pkg/api/equality" apiequality "k8s.io/apimachinery/pkg/api/equality"
...@@ -44,10 +44,10 @@ import ( ...@@ -44,10 +44,10 @@ import (
"k8s.io/apimachinery/pkg/watch" "k8s.io/apimachinery/pkg/watch"
"k8s.io/kubernetes/pkg/api/legacyscheme" "k8s.io/kubernetes/pkg/api/legacyscheme"
"k8s.io/kubernetes/pkg/api/testapi" "k8s.io/kubernetes/pkg/api/testapi"
"k8s.io/kubernetes/pkg/apis/apps"
k8s_apps_v1 "k8s.io/kubernetes/pkg/apis/apps/v1"
api "k8s.io/kubernetes/pkg/apis/core" api "k8s.io/kubernetes/pkg/apis/core"
k8s_api_v1 "k8s.io/kubernetes/pkg/apis/core/v1" k8s_api_v1 "k8s.io/kubernetes/pkg/apis/core/v1"
"k8s.io/kubernetes/pkg/apis/extensions"
k8s_v1beta1 "k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
) )
// fuzzInternalObject fuzzes an arbitrary runtime object using the appropriate // fuzzInternalObject fuzzes an arbitrary runtime object using the appropriate
...@@ -65,14 +65,14 @@ func fuzzInternalObject(t *testing.T, forVersion schema.GroupVersion, item runti ...@@ -65,14 +65,14 @@ func fuzzInternalObject(t *testing.T, forVersion schema.GroupVersion, item runti
return item return item
} }
func ConvertV1beta1ReplicaSetToAPIReplicationController(in *v1beta1.ReplicaSet, out *api.ReplicationController, s conversion.Scope) error { func ConvertV1ReplicaSetToAPIReplicationController(in *appsv1.ReplicaSet, out *api.ReplicationController, s conversion.Scope) error {
intermediate1 := &extensions.ReplicaSet{} intermediate1 := &apps.ReplicaSet{}
if err := k8s_v1beta1.Convert_v1beta1_ReplicaSet_To_extensions_ReplicaSet(in, intermediate1, s); err != nil { if err := k8s_apps_v1.Convert_v1_ReplicaSet_To_apps_ReplicaSet(in, intermediate1, s); err != nil {
return err return err
} }
intermediate2 := &v1.ReplicationController{} intermediate2 := &v1.ReplicationController{}
if err := k8s_api_v1.Convert_extensions_ReplicaSet_To_v1_ReplicationController(intermediate1, intermediate2, s); err != nil { if err := k8s_api_v1.Convert_apps_ReplicaSet_To_v1_ReplicationController(intermediate1, intermediate2, s); err != nil {
return err return err
} }
...@@ -80,17 +80,17 @@ func ConvertV1beta1ReplicaSetToAPIReplicationController(in *v1beta1.ReplicaSet, ...@@ -80,17 +80,17 @@ func ConvertV1beta1ReplicaSetToAPIReplicationController(in *v1beta1.ReplicaSet,
} }
func TestSetControllerConversion(t *testing.T) { func TestSetControllerConversion(t *testing.T) {
if err := legacyscheme.Scheme.AddConversionFuncs(ConvertV1beta1ReplicaSetToAPIReplicationController); err != nil { if err := legacyscheme.Scheme.AddConversionFuncs(ConvertV1ReplicaSetToAPIReplicationController); err != nil {
t.Fatal(err) t.Fatal(err)
} }
rs := &extensions.ReplicaSet{} rs := &apps.ReplicaSet{}
rc := &api.ReplicationController{} rc := &api.ReplicationController{}
extGroup := testapi.Extensions extGroup := testapi.Apps
defaultGroup := testapi.Default defaultGroup := testapi.Default
fuzzInternalObject(t, schema.GroupVersion{Group: "extensions", Version: runtime.APIVersionInternal}, rs, rand.Int63()) fuzzInternalObject(t, schema.GroupVersion{Group: "apps", Version: runtime.APIVersionInternal}, rs, rand.Int63())
// explicitly set the selector to something that is convertible to old-style selectors // explicitly set the selector to something that is convertible to old-style selectors
// (since normally we'll fuzz the selectors with things that aren't convertible) // (since normally we'll fuzz the selectors with things that aren't convertible)
...@@ -101,7 +101,7 @@ func TestSetControllerConversion(t *testing.T) { ...@@ -101,7 +101,7 @@ func TestSetControllerConversion(t *testing.T) {
}, },
} }
t.Logf("rs._internal.extensions -> rs.v1beta1.extensions") t.Logf("rs._internal.apps -> rs.v1.apps")
data, err := runtime.Encode(extGroup.Codec(), rs) data, err := runtime.Encode(extGroup.Codec(), rs)
if err != nil { if err != nil {
t.Fatalf("unexpected encoding error: %v", err) t.Fatalf("unexpected encoding error: %v", err)
...@@ -116,7 +116,7 @@ func TestSetControllerConversion(t *testing.T) { ...@@ -116,7 +116,7 @@ func TestSetControllerConversion(t *testing.T) {
), ),
) )
t.Logf("rs.v1beta1.extensions -> rc._internal") t.Logf("rs.v1.apps -> rc._internal")
if err := runtime.DecodeInto(decoder, data, rc); err != nil { if err := runtime.DecodeInto(decoder, data, rc); err != nil {
t.Fatalf("unexpected decoding error: %v", err) t.Fatalf("unexpected decoding error: %v", err)
} }
...@@ -127,7 +127,7 @@ func TestSetControllerConversion(t *testing.T) { ...@@ -127,7 +127,7 @@ func TestSetControllerConversion(t *testing.T) {
t.Fatalf("unexpected encoding error: %v", err) t.Fatalf("unexpected encoding error: %v", err)
} }
t.Logf("rc.v1 -> rs._internal.extensions") t.Logf("rc.v1 -> rs._internal.apps")
if err := runtime.DecodeInto(decoder, data, rs); err != nil { if err := runtime.DecodeInto(decoder, data, rs); err != nil {
t.Fatalf("unexpected decoding error: %v", err) t.Fatalf("unexpected decoding error: %v", err)
} }
...@@ -138,7 +138,7 @@ func TestSetControllerConversion(t *testing.T) { ...@@ -138,7 +138,7 @@ func TestSetControllerConversion(t *testing.T) {
func TestSpecificKind(t *testing.T) { func TestSpecificKind(t *testing.T) {
// Uncomment the following line to enable logging of which conversions // Uncomment the following line to enable logging of which conversions
// legacyscheme.Scheme.Log(t) // legacyscheme.Scheme.Log(t)
internalGVK := schema.GroupVersionKind{Group: "extensions", Version: runtime.APIVersionInternal, Kind: "DaemonSet"} internalGVK := schema.GroupVersionKind{Group: "apps", Version: runtime.APIVersionInternal, Kind: "DaemonSet"}
seed := rand.Int63() seed := rand.Int63()
fuzzer := fuzzer.FuzzerFor(FuzzerFuncs, rand.NewSource(seed), legacyscheme.Codecs) fuzzer := fuzzer.FuzzerFor(FuzzerFuncs, rand.NewSource(seed), legacyscheme.Codecs)
......
...@@ -17,10 +17,10 @@ go_library( ...@@ -17,10 +17,10 @@ go_library(
deps = [ deps = [
"//pkg/apis/autoscaling:go_default_library", "//pkg/apis/autoscaling:go_default_library",
"//pkg/apis/core:go_default_library", "//pkg/apis/core:go_default_library",
"//pkg/apis/extensions:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/intstr:go_default_library",
], ],
) )
......
...@@ -13,6 +13,7 @@ go_library( ...@@ -13,6 +13,7 @@ go_library(
"//pkg/apis/apps:go_default_library", "//pkg/apis/apps:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime/serializer:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime/serializer:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/intstr:go_default_library",
"//vendor/github.com/google/gofuzz:go_default_library", "//vendor/github.com/google/gofuzz:go_default_library",
], ],
) )
......
...@@ -17,10 +17,13 @@ limitations under the License. ...@@ -17,10 +17,13 @@ limitations under the License.
package fuzzer package fuzzer
import ( import (
"fmt"
fuzz "github.com/google/gofuzz" fuzz "github.com/google/gofuzz"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer" runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer"
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/kubernetes/pkg/apis/apps" "k8s.io/kubernetes/pkg/apis/apps"
) )
...@@ -54,5 +57,85 @@ var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} { ...@@ -54,5 +57,85 @@ var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} {
s.Labels = s.Spec.Template.Labels s.Labels = s.Spec.Template.Labels
} }
}, },
func(j *apps.Deployment, c fuzz.Continue) {
c.FuzzNoCustom(j)
// match defaulting
if j.Spec.Selector == nil {
j.Spec.Selector = &metav1.LabelSelector{MatchLabels: j.Spec.Template.Labels}
}
if len(j.Labels) == 0 {
j.Labels = j.Spec.Template.Labels
}
},
func(j *apps.DeploymentSpec, c fuzz.Continue) {
c.FuzzNoCustom(j) // fuzz self without calling this function again
rhl := int32(c.Rand.Int31())
pds := int32(c.Rand.Int31())
j.RevisionHistoryLimit = &rhl
j.ProgressDeadlineSeconds = &pds
},
func(j *apps.DeploymentStrategy, c fuzz.Continue) {
c.FuzzNoCustom(j) // fuzz self without calling this function again
// Ensure that strategyType is one of valid values.
strategyTypes := []apps.DeploymentStrategyType{apps.RecreateDeploymentStrategyType, apps.RollingUpdateDeploymentStrategyType}
j.Type = strategyTypes[c.Rand.Intn(len(strategyTypes))]
if j.Type != apps.RollingUpdateDeploymentStrategyType {
j.RollingUpdate = nil
} else {
rollingUpdate := apps.RollingUpdateDeployment{}
if c.RandBool() {
rollingUpdate.MaxUnavailable = intstr.FromInt(int(c.Rand.Int31()))
rollingUpdate.MaxSurge = intstr.FromInt(int(c.Rand.Int31()))
} else {
rollingUpdate.MaxSurge = intstr.FromString(fmt.Sprintf("%d%%", c.Rand.Int31()))
}
j.RollingUpdate = &rollingUpdate
}
},
func(j *apps.DaemonSet, c fuzz.Continue) {
c.FuzzNoCustom(j)
// match defaulter
j.Spec.Template.Generation = 0
if len(j.ObjectMeta.Labels) == 0 {
j.ObjectMeta.Labels = j.Spec.Template.ObjectMeta.Labels
}
},
func(j *apps.DaemonSetSpec, c fuzz.Continue) {
c.FuzzNoCustom(j) // fuzz self without calling this function again
rhl := int32(c.Rand.Int31())
j.RevisionHistoryLimit = &rhl
},
func(j *apps.DaemonSetUpdateStrategy, c fuzz.Continue) {
c.FuzzNoCustom(j) // fuzz self without calling this function again
// Ensure that strategyType is one of valid values.
strategyTypes := []apps.DaemonSetUpdateStrategyType{apps.RollingUpdateDaemonSetStrategyType, apps.OnDeleteDaemonSetStrategyType}
j.Type = strategyTypes[c.Rand.Intn(len(strategyTypes))]
if j.Type != apps.RollingUpdateDaemonSetStrategyType {
j.RollingUpdate = nil
} else {
rollingUpdate := apps.RollingUpdateDaemonSet{}
if c.RandBool() {
if c.RandBool() {
rollingUpdate.MaxUnavailable = intstr.FromInt(1 + int(c.Rand.Int31()))
} else {
rollingUpdate.MaxUnavailable = intstr.FromString(fmt.Sprintf("%d%%", 1+c.Rand.Int31()))
}
}
j.RollingUpdate = &rollingUpdate
}
},
func(j *apps.ReplicaSet, c fuzz.Continue) {
c.FuzzNoCustom(j)
// match defaulter
if j.Spec.Selector == nil {
j.Spec.Selector = &metav1.LabelSelector{MatchLabels: j.Spec.Template.Labels}
}
if len(j.Labels) == 0 {
j.Labels = j.Spec.Template.Labels
}
},
} }
} }
...@@ -20,7 +20,6 @@ import ( ...@@ -20,7 +20,6 @@ import (
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/kubernetes/pkg/apis/autoscaling" "k8s.io/kubernetes/pkg/apis/autoscaling"
"k8s.io/kubernetes/pkg/apis/extensions"
) )
var ( var (
...@@ -48,18 +47,18 @@ func Resource(resource string) schema.GroupResource { ...@@ -48,18 +47,18 @@ func Resource(resource string) schema.GroupResource {
func addKnownTypes(scheme *runtime.Scheme) error { func addKnownTypes(scheme *runtime.Scheme) error {
// TODO this will get cleaned up with the scheme types are fixed // TODO this will get cleaned up with the scheme types are fixed
scheme.AddKnownTypes(SchemeGroupVersion, scheme.AddKnownTypes(SchemeGroupVersion,
&extensions.DaemonSet{}, &DaemonSet{},
&extensions.DaemonSetList{}, &DaemonSetList{},
&extensions.Deployment{}, &Deployment{},
&extensions.DeploymentList{}, &DeploymentList{},
&extensions.DeploymentRollback{}, &DeploymentRollback{},
&autoscaling.Scale{}, &autoscaling.Scale{},
&StatefulSet{}, &StatefulSet{},
&StatefulSetList{}, &StatefulSetList{},
&ControllerRevision{}, &ControllerRevision{},
&ControllerRevisionList{}, &ControllerRevisionList{},
&extensions.ReplicaSet{}, &ReplicaSet{},
&extensions.ReplicaSetList{}, &ReplicaSetList{},
) )
return nil return nil
} }
...@@ -16,7 +16,6 @@ go_library( ...@@ -16,7 +16,6 @@ go_library(
"//pkg/apis/apps:go_default_library", "//pkg/apis/apps:go_default_library",
"//pkg/apis/core:go_default_library", "//pkg/apis/core:go_default_library",
"//pkg/apis/core/v1:go_default_library", "//pkg/apis/core/v1:go_default_library",
"//pkg/apis/extensions:go_default_library",
"//staging/src/k8s.io/api/apps/v1:go_default_library", "//staging/src/k8s.io/api/apps/v1:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library", "//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
...@@ -40,7 +39,6 @@ go_test( ...@@ -40,7 +39,6 @@ go_test(
"//pkg/apis/apps/install:go_default_library", "//pkg/apis/apps/install:go_default_library",
"//pkg/apis/core:go_default_library", "//pkg/apis/core:go_default_library",
"//pkg/apis/core/install:go_default_library", "//pkg/apis/core/install:go_default_library",
"//pkg/apis/extensions:go_default_library",
"//staging/src/k8s.io/api/apps/v1:go_default_library", "//staging/src/k8s.io/api/apps/v1:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library", "//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/equality:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/api/equality:go_default_library",
......
...@@ -15,7 +15,6 @@ limitations under the License. ...@@ -15,7 +15,6 @@ limitations under the License.
*/ */
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/apps // +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/apps
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/extensions
// +k8s:conversion-gen-external-types=k8s.io/api/apps/v1 // +k8s:conversion-gen-external-types=k8s.io/api/apps/v1
// +k8s:defaulter-gen=TypeMeta // +k8s:defaulter-gen=TypeMeta
// +k8s:defaulter-gen-input=../../../../vendor/k8s.io/api/apps/v1 // +k8s:defaulter-gen-input=../../../../vendor/k8s.io/api/apps/v1
......
...@@ -22,7 +22,6 @@ go_library( ...@@ -22,7 +22,6 @@ go_library(
"//pkg/apis/autoscaling:go_default_library", "//pkg/apis/autoscaling:go_default_library",
"//pkg/apis/core:go_default_library", "//pkg/apis/core:go_default_library",
"//pkg/apis/core/v1:go_default_library", "//pkg/apis/core/v1:go_default_library",
"//pkg/apis/extensions:go_default_library",
"//staging/src/k8s.io/api/apps/v1beta1:go_default_library", "//staging/src/k8s.io/api/apps/v1beta1:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library", "//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
......
...@@ -30,7 +30,6 @@ import ( ...@@ -30,7 +30,6 @@ import (
"k8s.io/kubernetes/pkg/apis/autoscaling" "k8s.io/kubernetes/pkg/apis/autoscaling"
api "k8s.io/kubernetes/pkg/apis/core" api "k8s.io/kubernetes/pkg/apis/core"
k8s_api_v1 "k8s.io/kubernetes/pkg/apis/core/v1" k8s_api_v1 "k8s.io/kubernetes/pkg/apis/core/v1"
"k8s.io/kubernetes/pkg/apis/extensions"
) )
func addConversionFuncs(scheme *runtime.Scheme) error { func addConversionFuncs(scheme *runtime.Scheme) error {
...@@ -48,12 +47,12 @@ func addConversionFuncs(scheme *runtime.Scheme) error { ...@@ -48,12 +47,12 @@ func addConversionFuncs(scheme *runtime.Scheme) error {
// ones, see https://github.com/kubernetes/kubernetes/issues/39865 // ones, see https://github.com/kubernetes/kubernetes/issues/39865
Convert_v1beta1_ScaleStatus_To_autoscaling_ScaleStatus, Convert_v1beta1_ScaleStatus_To_autoscaling_ScaleStatus,
Convert_autoscaling_ScaleStatus_To_v1beta1_ScaleStatus, Convert_autoscaling_ScaleStatus_To_v1beta1_ScaleStatus,
Convert_v1beta1_DeploymentSpec_To_extensions_DeploymentSpec, Convert_v1beta1_DeploymentSpec_To_apps_DeploymentSpec,
Convert_extensions_DeploymentSpec_To_v1beta1_DeploymentSpec, Convert_apps_DeploymentSpec_To_v1beta1_DeploymentSpec,
Convert_v1beta1_DeploymentStrategy_To_extensions_DeploymentStrategy, Convert_v1beta1_DeploymentStrategy_To_apps_DeploymentStrategy,
Convert_extensions_DeploymentStrategy_To_v1beta1_DeploymentStrategy, Convert_apps_DeploymentStrategy_To_v1beta1_DeploymentStrategy,
Convert_v1beta1_RollingUpdateDeployment_To_extensions_RollingUpdateDeployment, Convert_v1beta1_RollingUpdateDeployment_To_apps_RollingUpdateDeployment,
Convert_extensions_RollingUpdateDeployment_To_v1beta1_RollingUpdateDeployment, Convert_apps_RollingUpdateDeployment_To_v1beta1_RollingUpdateDeployment,
) )
if err != nil { if err != nil {
return err return err
...@@ -213,7 +212,7 @@ func Convert_v1beta1_ScaleStatus_To_autoscaling_ScaleStatus(in *appsv1beta1.Scal ...@@ -213,7 +212,7 @@ func Convert_v1beta1_ScaleStatus_To_autoscaling_ScaleStatus(in *appsv1beta1.Scal
return nil return nil
} }
func Convert_v1beta1_DeploymentSpec_To_extensions_DeploymentSpec(in *appsv1beta1.DeploymentSpec, out *extensions.DeploymentSpec, s conversion.Scope) error { func Convert_v1beta1_DeploymentSpec_To_apps_DeploymentSpec(in *appsv1beta1.DeploymentSpec, out *apps.DeploymentSpec, s conversion.Scope) error {
if in.Replicas != nil { if in.Replicas != nil {
out.Replicas = *in.Replicas out.Replicas = *in.Replicas
} }
...@@ -221,14 +220,14 @@ func Convert_v1beta1_DeploymentSpec_To_extensions_DeploymentSpec(in *appsv1beta1 ...@@ -221,14 +220,14 @@ func Convert_v1beta1_DeploymentSpec_To_extensions_DeploymentSpec(in *appsv1beta1
if err := k8s_api_v1.Convert_v1_PodTemplateSpec_To_core_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { if err := k8s_api_v1.Convert_v1_PodTemplateSpec_To_core_PodTemplateSpec(&in.Template, &out.Template, s); err != nil {
return err return err
} }
if err := Convert_v1beta1_DeploymentStrategy_To_extensions_DeploymentStrategy(&in.Strategy, &out.Strategy, s); err != nil { if err := Convert_v1beta1_DeploymentStrategy_To_apps_DeploymentStrategy(&in.Strategy, &out.Strategy, s); err != nil {
return err return err
} }
out.RevisionHistoryLimit = in.RevisionHistoryLimit out.RevisionHistoryLimit = in.RevisionHistoryLimit
out.MinReadySeconds = in.MinReadySeconds out.MinReadySeconds = in.MinReadySeconds
out.Paused = in.Paused out.Paused = in.Paused
if in.RollbackTo != nil { if in.RollbackTo != nil {
out.RollbackTo = new(extensions.RollbackConfig) out.RollbackTo = new(apps.RollbackConfig)
out.RollbackTo.Revision = in.RollbackTo.Revision out.RollbackTo.Revision = in.RollbackTo.Revision
} else { } else {
out.RollbackTo = nil out.RollbackTo = nil
...@@ -240,13 +239,13 @@ func Convert_v1beta1_DeploymentSpec_To_extensions_DeploymentSpec(in *appsv1beta1 ...@@ -240,13 +239,13 @@ func Convert_v1beta1_DeploymentSpec_To_extensions_DeploymentSpec(in *appsv1beta1
return nil return nil
} }
func Convert_extensions_DeploymentSpec_To_v1beta1_DeploymentSpec(in *extensions.DeploymentSpec, out *appsv1beta1.DeploymentSpec, s conversion.Scope) error { func Convert_apps_DeploymentSpec_To_v1beta1_DeploymentSpec(in *apps.DeploymentSpec, out *appsv1beta1.DeploymentSpec, s conversion.Scope) error {
out.Replicas = &in.Replicas out.Replicas = &in.Replicas
out.Selector = in.Selector out.Selector = in.Selector
if err := k8s_api_v1.Convert_core_PodTemplateSpec_To_v1_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { if err := k8s_api_v1.Convert_core_PodTemplateSpec_To_v1_PodTemplateSpec(&in.Template, &out.Template, s); err != nil {
return err return err
} }
if err := Convert_extensions_DeploymentStrategy_To_v1beta1_DeploymentStrategy(&in.Strategy, &out.Strategy, s); err != nil { if err := Convert_apps_DeploymentStrategy_To_v1beta1_DeploymentStrategy(&in.Strategy, &out.Strategy, s); err != nil {
return err return err
} }
if in.RevisionHistoryLimit != nil { if in.RevisionHistoryLimit != nil {
...@@ -268,11 +267,11 @@ func Convert_extensions_DeploymentSpec_To_v1beta1_DeploymentSpec(in *extensions. ...@@ -268,11 +267,11 @@ func Convert_extensions_DeploymentSpec_To_v1beta1_DeploymentSpec(in *extensions.
return nil return nil
} }
func Convert_extensions_DeploymentStrategy_To_v1beta1_DeploymentStrategy(in *extensions.DeploymentStrategy, out *appsv1beta1.DeploymentStrategy, s conversion.Scope) error { func Convert_apps_DeploymentStrategy_To_v1beta1_DeploymentStrategy(in *apps.DeploymentStrategy, out *appsv1beta1.DeploymentStrategy, s conversion.Scope) error {
out.Type = appsv1beta1.DeploymentStrategyType(in.Type) out.Type = appsv1beta1.DeploymentStrategyType(in.Type)
if in.RollingUpdate != nil { if in.RollingUpdate != nil {
out.RollingUpdate = new(appsv1beta1.RollingUpdateDeployment) out.RollingUpdate = new(appsv1beta1.RollingUpdateDeployment)
if err := Convert_extensions_RollingUpdateDeployment_To_v1beta1_RollingUpdateDeployment(in.RollingUpdate, out.RollingUpdate, s); err != nil { if err := Convert_apps_RollingUpdateDeployment_To_v1beta1_RollingUpdateDeployment(in.RollingUpdate, out.RollingUpdate, s); err != nil {
return err return err
} }
} else { } else {
...@@ -281,11 +280,11 @@ func Convert_extensions_DeploymentStrategy_To_v1beta1_DeploymentStrategy(in *ext ...@@ -281,11 +280,11 @@ func Convert_extensions_DeploymentStrategy_To_v1beta1_DeploymentStrategy(in *ext
return nil return nil
} }
func Convert_v1beta1_DeploymentStrategy_To_extensions_DeploymentStrategy(in *appsv1beta1.DeploymentStrategy, out *extensions.DeploymentStrategy, s conversion.Scope) error { func Convert_v1beta1_DeploymentStrategy_To_apps_DeploymentStrategy(in *appsv1beta1.DeploymentStrategy, out *apps.DeploymentStrategy, s conversion.Scope) error {
out.Type = extensions.DeploymentStrategyType(in.Type) out.Type = apps.DeploymentStrategyType(in.Type)
if in.RollingUpdate != nil { if in.RollingUpdate != nil {
out.RollingUpdate = new(extensions.RollingUpdateDeployment) out.RollingUpdate = new(apps.RollingUpdateDeployment)
if err := Convert_v1beta1_RollingUpdateDeployment_To_extensions_RollingUpdateDeployment(in.RollingUpdate, out.RollingUpdate, s); err != nil { if err := Convert_v1beta1_RollingUpdateDeployment_To_apps_RollingUpdateDeployment(in.RollingUpdate, out.RollingUpdate, s); err != nil {
return err return err
} }
} else { } else {
...@@ -294,7 +293,7 @@ func Convert_v1beta1_DeploymentStrategy_To_extensions_DeploymentStrategy(in *app ...@@ -294,7 +293,7 @@ func Convert_v1beta1_DeploymentStrategy_To_extensions_DeploymentStrategy(in *app
return nil return nil
} }
func Convert_v1beta1_RollingUpdateDeployment_To_extensions_RollingUpdateDeployment(in *appsv1beta1.RollingUpdateDeployment, out *extensions.RollingUpdateDeployment, s conversion.Scope) error { func Convert_v1beta1_RollingUpdateDeployment_To_apps_RollingUpdateDeployment(in *appsv1beta1.RollingUpdateDeployment, out *apps.RollingUpdateDeployment, s conversion.Scope) error {
if err := s.Convert(in.MaxUnavailable, &out.MaxUnavailable, 0); err != nil { if err := s.Convert(in.MaxUnavailable, &out.MaxUnavailable, 0); err != nil {
return err return err
} }
...@@ -304,7 +303,7 @@ func Convert_v1beta1_RollingUpdateDeployment_To_extensions_RollingUpdateDeployme ...@@ -304,7 +303,7 @@ func Convert_v1beta1_RollingUpdateDeployment_To_extensions_RollingUpdateDeployme
return nil return nil
} }
func Convert_extensions_RollingUpdateDeployment_To_v1beta1_RollingUpdateDeployment(in *extensions.RollingUpdateDeployment, out *appsv1beta1.RollingUpdateDeployment, s conversion.Scope) error { func Convert_apps_RollingUpdateDeployment_To_v1beta1_RollingUpdateDeployment(in *apps.RollingUpdateDeployment, out *appsv1beta1.RollingUpdateDeployment, s conversion.Scope) error {
if out.MaxUnavailable == nil { if out.MaxUnavailable == nil {
out.MaxUnavailable = &intstr.IntOrString{} out.MaxUnavailable = &intstr.IntOrString{}
} }
......
...@@ -16,7 +16,6 @@ limitations under the License. ...@@ -16,7 +16,6 @@ limitations under the License.
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/apps // +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/apps
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/autoscaling // +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/autoscaling
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/extensions
// +k8s:conversion-gen-external-types=k8s.io/api/apps/v1beta1 // +k8s:conversion-gen-external-types=k8s.io/api/apps/v1beta1
// +k8s:defaulter-gen=TypeMeta // +k8s:defaulter-gen=TypeMeta
// +k8s:defaulter-gen-input=../../../../vendor/k8s.io/api/apps/v1beta1 // +k8s:defaulter-gen-input=../../../../vendor/k8s.io/api/apps/v1beta1
......
...@@ -22,7 +22,6 @@ go_library( ...@@ -22,7 +22,6 @@ go_library(
"//pkg/apis/autoscaling:go_default_library", "//pkg/apis/autoscaling:go_default_library",
"//pkg/apis/core:go_default_library", "//pkg/apis/core:go_default_library",
"//pkg/apis/core/v1:go_default_library", "//pkg/apis/core/v1:go_default_library",
"//pkg/apis/extensions:go_default_library",
"//staging/src/k8s.io/api/apps/v1beta2:go_default_library", "//staging/src/k8s.io/api/apps/v1beta2:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library", "//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
...@@ -61,7 +60,6 @@ go_test( ...@@ -61,7 +60,6 @@ go_test(
"//pkg/apis/autoscaling:go_default_library", "//pkg/apis/autoscaling:go_default_library",
"//pkg/apis/core:go_default_library", "//pkg/apis/core:go_default_library",
"//pkg/apis/core/install:go_default_library", "//pkg/apis/core/install:go_default_library",
"//pkg/apis/extensions:go_default_library",
"//staging/src/k8s.io/api/apps/v1beta2:go_default_library", "//staging/src/k8s.io/api/apps/v1beta2:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library", "//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/equality:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/api/equality:go_default_library",
......
...@@ -26,7 +26,6 @@ import ( ...@@ -26,7 +26,6 @@ import (
"k8s.io/kubernetes/pkg/apis/apps" "k8s.io/kubernetes/pkg/apis/apps"
"k8s.io/kubernetes/pkg/apis/autoscaling" "k8s.io/kubernetes/pkg/apis/autoscaling"
api "k8s.io/kubernetes/pkg/apis/core" api "k8s.io/kubernetes/pkg/apis/core"
"k8s.io/kubernetes/pkg/apis/extensions"
apiequality "k8s.io/apimachinery/pkg/api/equality" apiequality "k8s.io/apimachinery/pkg/api/equality"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
...@@ -155,11 +154,11 @@ func TestV1beta2StatefulSetUpdateStrategyConversion(t *testing.T) { ...@@ -155,11 +154,11 @@ func TestV1beta2StatefulSetUpdateStrategyConversion(t *testing.T) {
func TestV1beta2RollingUpdateDaemonSetConversion(t *testing.T) { func TestV1beta2RollingUpdateDaemonSetConversion(t *testing.T) {
intorstr := intstr.FromInt(1) intorstr := intstr.FromInt(1)
testcases := map[string]struct { testcases := map[string]struct {
rollingUpdateDs1 *extensions.RollingUpdateDaemonSet rollingUpdateDs1 *apps.RollingUpdateDaemonSet
rollingUpdateDs2 *v1beta2.RollingUpdateDaemonSet rollingUpdateDs2 *v1beta2.RollingUpdateDaemonSet
}{ }{
"RollingUpdateDaemonSet Conversion 2": { "RollingUpdateDaemonSet Conversion 2": {
rollingUpdateDs1: &extensions.RollingUpdateDaemonSet{MaxUnavailable: intorstr}, rollingUpdateDs1: &apps.RollingUpdateDaemonSet{MaxUnavailable: intorstr},
rollingUpdateDs2: &v1beta2.RollingUpdateDaemonSet{MaxUnavailable: &intorstr}, rollingUpdateDs2: &v1beta2.RollingUpdateDaemonSet{MaxUnavailable: &intorstr},
}, },
} }
...@@ -175,7 +174,7 @@ func TestV1beta2RollingUpdateDaemonSetConversion(t *testing.T) { ...@@ -175,7 +174,7 @@ func TestV1beta2RollingUpdateDaemonSetConversion(t *testing.T) {
} }
// v1beta2 -> extensions // v1beta2 -> extensions
internal2 := &extensions.RollingUpdateDaemonSet{} internal2 := &apps.RollingUpdateDaemonSet{}
if err := legacyscheme.Scheme.Convert(tc.rollingUpdateDs2, internal2, nil); err != nil { if err := legacyscheme.Scheme.Convert(tc.rollingUpdateDs2, internal2, nil); err != nil {
t.Errorf("%q - %q: unexpected error: %v", k, "from v1beta2 to extensions", err) t.Errorf("%q - %q: unexpected error: %v", k, "from v1beta2 to extensions", err)
} }
...@@ -262,15 +261,15 @@ func TestV1beta2StatefulSetStatusConversion(t *testing.T) { ...@@ -262,15 +261,15 @@ func TestV1beta2StatefulSetStatusConversion(t *testing.T) {
func TestV1beta2DeploymentConversion(t *testing.T) { func TestV1beta2DeploymentConversion(t *testing.T) {
replica := utilpointer.Int32Ptr(2) replica := utilpointer.Int32Ptr(2)
rollbackTo := new(extensions.RollbackConfig) rollbackTo := new(apps.RollbackConfig)
rollbackTo.Revision = int64(2) rollbackTo.Revision = int64(2)
testcases := map[string]struct { testcases := map[string]struct {
deployment1 *extensions.Deployment deployment1 *apps.Deployment
deployment2 *v1beta2.Deployment deployment2 *v1beta2.Deployment
}{ }{
"Deployment Conversion 1": { "Deployment Conversion 1": {
deployment1: &extensions.Deployment{ deployment1: &apps.Deployment{
Spec: extensions.DeploymentSpec{ Spec: apps.DeploymentSpec{
Replicas: *replica, Replicas: *replica,
RollbackTo: rollbackTo, RollbackTo: rollbackTo,
Template: api.PodTemplateSpec{ Template: api.PodTemplateSpec{
...@@ -295,8 +294,8 @@ func TestV1beta2DeploymentConversion(t *testing.T) { ...@@ -295,8 +294,8 @@ func TestV1beta2DeploymentConversion(t *testing.T) {
}, },
}, },
"Deployment Conversion 2": { "Deployment Conversion 2": {
deployment1: &extensions.Deployment{ deployment1: &apps.Deployment{
Spec: extensions.DeploymentSpec{ Spec: apps.DeploymentSpec{
Replicas: *replica, Replicas: *replica,
Template: api.PodTemplateSpec{ Template: api.PodTemplateSpec{
Spec: api.PodSpec{ Spec: api.PodSpec{
...@@ -329,7 +328,7 @@ func TestV1beta2DeploymentConversion(t *testing.T) { ...@@ -329,7 +328,7 @@ func TestV1beta2DeploymentConversion(t *testing.T) {
} }
// v1beta2 -> extensions // v1beta2 -> extensions
internal2 := &extensions.Deployment{} internal2 := &apps.Deployment{}
if err := legacyscheme.Scheme.Convert(tc.deployment2, internal2, nil); err != nil { if err := legacyscheme.Scheme.Convert(tc.deployment2, internal2, nil); err != nil {
t.Errorf("%q - %q: unexpected error: %v", k, "from v1beta2 to extensions", err) t.Errorf("%q - %q: unexpected error: %v", k, "from v1beta2 to extensions", err)
} }
...@@ -396,11 +395,11 @@ func TestV1beta2DeploymentSpecConversion(t *testing.T) { ...@@ -396,11 +395,11 @@ func TestV1beta2DeploymentSpecConversion(t *testing.T) {
progressDeadlineSeconds := utilpointer.Int32Ptr(2) progressDeadlineSeconds := utilpointer.Int32Ptr(2)
testcases := map[string]struct { testcases := map[string]struct {
deploymentSpec1 *extensions.DeploymentSpec deploymentSpec1 *apps.DeploymentSpec
deploymentSpec2 *v1beta2.DeploymentSpec deploymentSpec2 *v1beta2.DeploymentSpec
}{ }{
"DeploymentSpec Conversion 1": { "DeploymentSpec Conversion 1": {
deploymentSpec1: &extensions.DeploymentSpec{ deploymentSpec1: &apps.DeploymentSpec{
Replicas: *replica, Replicas: *replica,
Template: api.PodTemplateSpec{ Template: api.PodTemplateSpec{
Spec: api.PodSpec{ Spec: api.PodSpec{
...@@ -418,7 +417,7 @@ func TestV1beta2DeploymentSpecConversion(t *testing.T) { ...@@ -418,7 +417,7 @@ func TestV1beta2DeploymentSpecConversion(t *testing.T) {
}, },
}, },
"DeploymentSpec Conversion 2": { "DeploymentSpec Conversion 2": {
deploymentSpec1: &extensions.DeploymentSpec{ deploymentSpec1: &apps.DeploymentSpec{
Replicas: *replica, Replicas: *replica,
RevisionHistoryLimit: revisionHistoryLimit, RevisionHistoryLimit: revisionHistoryLimit,
MinReadySeconds: 2, MinReadySeconds: 2,
...@@ -442,7 +441,7 @@ func TestV1beta2DeploymentSpecConversion(t *testing.T) { ...@@ -442,7 +441,7 @@ func TestV1beta2DeploymentSpecConversion(t *testing.T) {
}, },
}, },
"DeploymentSpec Conversion 3": { "DeploymentSpec Conversion 3": {
deploymentSpec1: &extensions.DeploymentSpec{ deploymentSpec1: &apps.DeploymentSpec{
Replicas: *replica, Replicas: *replica,
ProgressDeadlineSeconds: progressDeadlineSeconds, ProgressDeadlineSeconds: progressDeadlineSeconds,
Template: api.PodTemplateSpec{ Template: api.PodTemplateSpec{
...@@ -477,7 +476,7 @@ func TestV1beta2DeploymentSpecConversion(t *testing.T) { ...@@ -477,7 +476,7 @@ func TestV1beta2DeploymentSpecConversion(t *testing.T) {
// v1beta2 -> extensions // v1beta2 -> extensions
for k, tc := range testcases { for k, tc := range testcases {
internal := &extensions.DeploymentSpec{} internal := &apps.DeploymentSpec{}
if err := legacyscheme.Scheme.Convert(tc.deploymentSpec2, internal, nil); err != nil { if err := legacyscheme.Scheme.Convert(tc.deploymentSpec2, internal, nil); err != nil {
t.Errorf("%q - %q: unexpected error: %v", "v1beta2 -> extensions", k, err) t.Errorf("%q - %q: unexpected error: %v", "v1beta2 -> extensions", k, err)
} }
...@@ -491,18 +490,18 @@ func TestV1beta2DeploymentSpecConversion(t *testing.T) { ...@@ -491,18 +490,18 @@ func TestV1beta2DeploymentSpecConversion(t *testing.T) {
func TestV1beta2DeploymentStrategyConversion(t *testing.T) { func TestV1beta2DeploymentStrategyConversion(t *testing.T) {
maxUnavailable := intstr.FromInt(2) maxUnavailable := intstr.FromInt(2)
maxSurge := intstr.FromInt(2) maxSurge := intstr.FromInt(2)
extensionsRollingUpdate := extensions.RollingUpdateDeployment{MaxUnavailable: maxUnavailable, MaxSurge: maxSurge} extensionsRollingUpdate := apps.RollingUpdateDeployment{MaxUnavailable: maxUnavailable, MaxSurge: maxSurge}
v1beta2RollingUpdate := v1beta2.RollingUpdateDeployment{MaxUnavailable: &maxUnavailable, MaxSurge: &maxSurge} v1beta2RollingUpdate := v1beta2.RollingUpdateDeployment{MaxUnavailable: &maxUnavailable, MaxSurge: &maxSurge}
testcases := map[string]struct { testcases := map[string]struct {
deploymentStrategy1 *extensions.DeploymentStrategy deploymentStrategy1 *apps.DeploymentStrategy
deploymentStrategy2 *v1beta2.DeploymentStrategy deploymentStrategy2 *v1beta2.DeploymentStrategy
}{ }{
"DeploymentStrategy Conversion 1": { "DeploymentStrategy Conversion 1": {
deploymentStrategy1: &extensions.DeploymentStrategy{Type: extensions.DeploymentStrategyType("foo")}, deploymentStrategy1: &apps.DeploymentStrategy{Type: apps.DeploymentStrategyType("foo")},
deploymentStrategy2: &v1beta2.DeploymentStrategy{Type: v1beta2.DeploymentStrategyType("foo")}, deploymentStrategy2: &v1beta2.DeploymentStrategy{Type: v1beta2.DeploymentStrategyType("foo")},
}, },
"DeploymentStrategy Conversion 2": { "DeploymentStrategy Conversion 2": {
deploymentStrategy1: &extensions.DeploymentStrategy{Type: extensions.DeploymentStrategyType("foo"), RollingUpdate: &extensionsRollingUpdate}, deploymentStrategy1: &apps.DeploymentStrategy{Type: apps.DeploymentStrategyType("foo"), RollingUpdate: &extensionsRollingUpdate},
deploymentStrategy2: &v1beta2.DeploymentStrategy{Type: v1beta2.DeploymentStrategyType("foo"), RollingUpdate: &v1beta2RollingUpdate}, deploymentStrategy2: &v1beta2.DeploymentStrategy{Type: v1beta2.DeploymentStrategyType("foo"), RollingUpdate: &v1beta2RollingUpdate},
}, },
} }
...@@ -518,7 +517,7 @@ func TestV1beta2DeploymentStrategyConversion(t *testing.T) { ...@@ -518,7 +517,7 @@ func TestV1beta2DeploymentStrategyConversion(t *testing.T) {
} }
// v1beta2 -> extensions // v1beta2 -> extensions
internal2 := &extensions.DeploymentStrategy{} internal2 := &apps.DeploymentStrategy{}
if err := legacyscheme.Scheme.Convert(tc.deploymentStrategy2, internal2, nil); err != nil { if err := legacyscheme.Scheme.Convert(tc.deploymentStrategy2, internal2, nil); err != nil {
t.Errorf("%q - %q: unexpected error: %v", k, "v1beta2 -> extensions", err) t.Errorf("%q - %q: unexpected error: %v", k, "v1beta2 -> extensions", err)
} }
...@@ -533,23 +532,23 @@ func TestV1beta2RollingUpdateDeploymentConversion(t *testing.T) { ...@@ -533,23 +532,23 @@ func TestV1beta2RollingUpdateDeploymentConversion(t *testing.T) {
maxUnavailable := intstr.FromInt(2) maxUnavailable := intstr.FromInt(2)
maxSurge := intstr.FromInt(2) maxSurge := intstr.FromInt(2)
testcases := map[string]struct { testcases := map[string]struct {
rollingUpdateDeployment1 *extensions.RollingUpdateDeployment rollingUpdateDeployment1 *apps.RollingUpdateDeployment
rollingUpdateDeployment2 *v1beta2.RollingUpdateDeployment rollingUpdateDeployment2 *v1beta2.RollingUpdateDeployment
}{ }{
"RollingUpdateDeployment Conversion 1": { "RollingUpdateDeployment Conversion 1": {
rollingUpdateDeployment1: &extensions.RollingUpdateDeployment{}, rollingUpdateDeployment1: &apps.RollingUpdateDeployment{},
rollingUpdateDeployment2: &v1beta2.RollingUpdateDeployment{MaxUnavailable: &nilIntStr, MaxSurge: &nilIntStr}, rollingUpdateDeployment2: &v1beta2.RollingUpdateDeployment{MaxUnavailable: &nilIntStr, MaxSurge: &nilIntStr},
}, },
"RollingUpdateDeployment Conversion 2": { "RollingUpdateDeployment Conversion 2": {
rollingUpdateDeployment1: &extensions.RollingUpdateDeployment{MaxUnavailable: maxUnavailable}, rollingUpdateDeployment1: &apps.RollingUpdateDeployment{MaxUnavailable: maxUnavailable},
rollingUpdateDeployment2: &v1beta2.RollingUpdateDeployment{MaxUnavailable: &maxUnavailable, MaxSurge: &nilIntStr}, rollingUpdateDeployment2: &v1beta2.RollingUpdateDeployment{MaxUnavailable: &maxUnavailable, MaxSurge: &nilIntStr},
}, },
"RollingUpdateDeployment Conversion 3": { "RollingUpdateDeployment Conversion 3": {
rollingUpdateDeployment1: &extensions.RollingUpdateDeployment{MaxSurge: maxSurge}, rollingUpdateDeployment1: &apps.RollingUpdateDeployment{MaxSurge: maxSurge},
rollingUpdateDeployment2: &v1beta2.RollingUpdateDeployment{MaxSurge: &maxSurge, MaxUnavailable: &nilIntStr}, rollingUpdateDeployment2: &v1beta2.RollingUpdateDeployment{MaxSurge: &maxSurge, MaxUnavailable: &nilIntStr},
}, },
"RollingUpdateDeployment Conversion 4": { "RollingUpdateDeployment Conversion 4": {
rollingUpdateDeployment1: &extensions.RollingUpdateDeployment{MaxUnavailable: maxUnavailable, MaxSurge: maxSurge}, rollingUpdateDeployment1: &apps.RollingUpdateDeployment{MaxUnavailable: maxUnavailable, MaxSurge: maxSurge},
rollingUpdateDeployment2: &v1beta2.RollingUpdateDeployment{MaxUnavailable: &maxUnavailable, MaxSurge: &maxSurge}, rollingUpdateDeployment2: &v1beta2.RollingUpdateDeployment{MaxUnavailable: &maxUnavailable, MaxSurge: &maxSurge},
}, },
} }
...@@ -565,7 +564,7 @@ func TestV1beta2RollingUpdateDeploymentConversion(t *testing.T) { ...@@ -565,7 +564,7 @@ func TestV1beta2RollingUpdateDeploymentConversion(t *testing.T) {
} }
// v1beta2 -> extensions // v1beta2 -> extensions
internal2 := &extensions.RollingUpdateDeployment{} internal2 := &apps.RollingUpdateDeployment{}
if err := legacyscheme.Scheme.Convert(tc.rollingUpdateDeployment2, internal2, nil); err != nil { if err := legacyscheme.Scheme.Convert(tc.rollingUpdateDeployment2, internal2, nil); err != nil {
t.Errorf("%q - %q: unexpected error: %v", k, "v1beta2 -> extensions", err) t.Errorf("%q - %q: unexpected error: %v", k, "v1beta2 -> extensions", err)
} }
...@@ -585,11 +584,11 @@ func TestV1beta2ReplicaSetSpecConversion(t *testing.T) { ...@@ -585,11 +584,11 @@ func TestV1beta2ReplicaSetSpecConversion(t *testing.T) {
selector := &metav1.LabelSelector{MatchLabels: matchLabels, MatchExpressions: matchExpressions} selector := &metav1.LabelSelector{MatchLabels: matchLabels, MatchExpressions: matchExpressions}
testcases := map[string]struct { testcases := map[string]struct {
replicaset1 *extensions.ReplicaSetSpec replicaset1 *apps.ReplicaSetSpec
replicaset2 *v1beta2.ReplicaSetSpec replicaset2 *v1beta2.ReplicaSetSpec
}{ }{
"ReplicaSetSpec Conversion 1": { "ReplicaSetSpec Conversion 1": {
replicaset1: &extensions.ReplicaSetSpec{ replicaset1: &apps.ReplicaSetSpec{
Replicas: *replicas, Replicas: *replicas,
MinReadySeconds: 2, MinReadySeconds: 2,
Template: api.PodTemplateSpec{ Template: api.PodTemplateSpec{
...@@ -609,7 +608,7 @@ func TestV1beta2ReplicaSetSpecConversion(t *testing.T) { ...@@ -609,7 +608,7 @@ func TestV1beta2ReplicaSetSpecConversion(t *testing.T) {
}, },
}, },
"ReplicaSetSpec Conversion 2": { "ReplicaSetSpec Conversion 2": {
replicaset1: &extensions.ReplicaSetSpec{ replicaset1: &apps.ReplicaSetSpec{
Replicas: *replicas, Replicas: *replicas,
Selector: selector, Selector: selector,
Template: api.PodTemplateSpec{ Template: api.PodTemplateSpec{
...@@ -642,7 +641,7 @@ func TestV1beta2ReplicaSetSpecConversion(t *testing.T) { ...@@ -642,7 +641,7 @@ func TestV1beta2ReplicaSetSpecConversion(t *testing.T) {
} }
// v1beta2 -> extensions // v1beta2 -> extensions
internal2 := &extensions.ReplicaSetSpec{} internal2 := &apps.ReplicaSetSpec{}
if err := legacyscheme.Scheme.Convert(tc.replicaset2, internal2, nil); err != nil { if err := legacyscheme.Scheme.Convert(tc.replicaset2, internal2, nil); err != nil {
t.Errorf("%q - %q: unexpected error: %v", k, "v1beta2 -> extensions", err) t.Errorf("%q - %q: unexpected error: %v", k, "v1beta2 -> extensions", err)
} }
......
...@@ -16,7 +16,6 @@ limitations under the License. ...@@ -16,7 +16,6 @@ limitations under the License.
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/apps // +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/apps
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/autoscaling // +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/autoscaling
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/extensions
// +k8s:conversion-gen-external-types=k8s.io/api/apps/v1beta2 // +k8s:conversion-gen-external-types=k8s.io/api/apps/v1beta2
// +k8s:defaulter-gen=TypeMeta // +k8s:defaulter-gen=TypeMeta
// +k8s:defaulter-gen-input=../../../../vendor/k8s.io/api/apps/v1beta2 // +k8s:defaulter-gen-input=../../../../vendor/k8s.io/api/apps/v1beta2
......
...@@ -19,6 +19,8 @@ go_library( ...@@ -19,6 +19,8 @@ go_library(
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/validation:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/validation:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/labels:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/labels:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/intstr:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/validation:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/validation/field:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/validation/field:go_default_library",
], ],
) )
...@@ -32,7 +34,9 @@ go_test( ...@@ -32,7 +34,9 @@ go_test(
"//pkg/apis/core:go_default_library", "//pkg/apis/core:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/intstr:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/validation/field:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/validation/field:go_default_library",
"//vendor/github.com/davecgh/go-spew/spew:go_default_library",
], ],
) )
......
...@@ -13,8 +13,8 @@ go_library( ...@@ -13,8 +13,8 @@ go_library(
importpath = "k8s.io/kubernetes/pkg/apis/core/v1", importpath = "k8s.io/kubernetes/pkg/apis/core/v1",
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
deps = [ deps = [
"//pkg/apis/apps:go_default_library",
"//pkg/apis/core:go_default_library", "//pkg/apis/core:go_default_library",
"//pkg/apis/extensions:go_default_library",
"//pkg/features:go_default_library", "//pkg/features:go_default_library",
"//pkg/util/parsers:go_default_library", "//pkg/util/parsers:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library", "//staging/src/k8s.io/api/core/v1:go_default_library",
...@@ -41,11 +41,11 @@ go_test( ...@@ -41,11 +41,11 @@ go_test(
deps = [ deps = [
"//pkg/api/legacyscheme:go_default_library", "//pkg/api/legacyscheme:go_default_library",
"//pkg/api/testapi:go_default_library", "//pkg/api/testapi:go_default_library",
"//pkg/apis/apps:go_default_library",
"//pkg/apis/core:go_default_library", "//pkg/apis/core:go_default_library",
"//pkg/apis/core/fuzzer:go_default_library", "//pkg/apis/core/fuzzer:go_default_library",
"//pkg/apis/extensions:go_default_library", "//staging/src/k8s.io/api/apps/v1:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library", "//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/api/extensions/v1beta1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/apitesting/fuzzer:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/api/apitesting/fuzzer:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/equality:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/api/equality:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/resource:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/api/resource:go_default_library",
......
...@@ -26,8 +26,8 @@ import ( ...@@ -26,8 +26,8 @@ import (
"k8s.io/apimachinery/pkg/conversion" "k8s.io/apimachinery/pkg/conversion"
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/validation/field" "k8s.io/apimachinery/pkg/util/validation/field"
"k8s.io/kubernetes/pkg/apis/apps"
"k8s.io/kubernetes/pkg/apis/core" "k8s.io/kubernetes/pkg/apis/core"
"k8s.io/kubernetes/pkg/apis/extensions"
) )
func addConversionFuncs(scheme *runtime.Scheme) error { func addConversionFuncs(scheme *runtime.Scheme) error {
...@@ -43,12 +43,12 @@ func addConversionFuncs(scheme *runtime.Scheme) error { ...@@ -43,12 +43,12 @@ func addConversionFuncs(scheme *runtime.Scheme) error {
Convert_v1_Secret_To_core_Secret, Convert_v1_Secret_To_core_Secret,
Convert_v1_ServiceSpec_To_core_ServiceSpec, Convert_v1_ServiceSpec_To_core_ServiceSpec,
Convert_v1_ResourceList_To_core_ResourceList, Convert_v1_ResourceList_To_core_ResourceList,
Convert_v1_ReplicationController_To_extensions_ReplicaSet, Convert_v1_ReplicationController_To_apps_ReplicaSet,
Convert_v1_ReplicationControllerSpec_To_extensions_ReplicaSetSpec, Convert_v1_ReplicationControllerSpec_To_apps_ReplicaSetSpec,
Convert_v1_ReplicationControllerStatus_To_extensions_ReplicaSetStatus, Convert_v1_ReplicationControllerStatus_To_apps_ReplicaSetStatus,
Convert_extensions_ReplicaSet_To_v1_ReplicationController, Convert_apps_ReplicaSet_To_v1_ReplicationController,
Convert_extensions_ReplicaSetSpec_To_v1_ReplicationControllerSpec, Convert_apps_ReplicaSetSpec_To_v1_ReplicationControllerSpec,
Convert_extensions_ReplicaSetStatus_To_v1_ReplicationControllerStatus, Convert_apps_ReplicaSetStatus_To_v1_ReplicationControllerStatus,
) )
if err != nil { if err != nil {
return err return err
...@@ -120,18 +120,18 @@ func addConversionFuncs(scheme *runtime.Scheme) error { ...@@ -120,18 +120,18 @@ func addConversionFuncs(scheme *runtime.Scheme) error {
return nil return nil
} }
func Convert_v1_ReplicationController_To_extensions_ReplicaSet(in *v1.ReplicationController, out *extensions.ReplicaSet, s conversion.Scope) error { func Convert_v1_ReplicationController_To_apps_ReplicaSet(in *v1.ReplicationController, out *apps.ReplicaSet, s conversion.Scope) error {
out.ObjectMeta = in.ObjectMeta out.ObjectMeta = in.ObjectMeta
if err := Convert_v1_ReplicationControllerSpec_To_extensions_ReplicaSetSpec(&in.Spec, &out.Spec, s); err != nil { if err := Convert_v1_ReplicationControllerSpec_To_apps_ReplicaSetSpec(&in.Spec, &out.Spec, s); err != nil {
return err return err
} }
if err := Convert_v1_ReplicationControllerStatus_To_extensions_ReplicaSetStatus(&in.Status, &out.Status, s); err != nil { if err := Convert_v1_ReplicationControllerStatus_To_apps_ReplicaSetStatus(&in.Status, &out.Status, s); err != nil {
return err return err
} }
return nil return nil
} }
func Convert_v1_ReplicationControllerSpec_To_extensions_ReplicaSetSpec(in *v1.ReplicationControllerSpec, out *extensions.ReplicaSetSpec, s conversion.Scope) error { func Convert_v1_ReplicationControllerSpec_To_apps_ReplicaSetSpec(in *v1.ReplicationControllerSpec, out *apps.ReplicaSetSpec, s conversion.Scope) error {
out.Replicas = *in.Replicas out.Replicas = *in.Replicas
out.MinReadySeconds = in.MinReadySeconds out.MinReadySeconds = in.MinReadySeconds
if in.Selector != nil { if in.Selector != nil {
...@@ -146,15 +146,15 @@ func Convert_v1_ReplicationControllerSpec_To_extensions_ReplicaSetSpec(in *v1.Re ...@@ -146,15 +146,15 @@ func Convert_v1_ReplicationControllerSpec_To_extensions_ReplicaSetSpec(in *v1.Re
return nil return nil
} }
func Convert_v1_ReplicationControllerStatus_To_extensions_ReplicaSetStatus(in *v1.ReplicationControllerStatus, out *extensions.ReplicaSetStatus, s conversion.Scope) error { func Convert_v1_ReplicationControllerStatus_To_apps_ReplicaSetStatus(in *v1.ReplicationControllerStatus, out *apps.ReplicaSetStatus, s conversion.Scope) error {
out.Replicas = in.Replicas out.Replicas = in.Replicas
out.FullyLabeledReplicas = in.FullyLabeledReplicas out.FullyLabeledReplicas = in.FullyLabeledReplicas
out.ReadyReplicas = in.ReadyReplicas out.ReadyReplicas = in.ReadyReplicas
out.AvailableReplicas = in.AvailableReplicas out.AvailableReplicas = in.AvailableReplicas
out.ObservedGeneration = in.ObservedGeneration out.ObservedGeneration = in.ObservedGeneration
for _, cond := range in.Conditions { for _, cond := range in.Conditions {
out.Conditions = append(out.Conditions, extensions.ReplicaSetCondition{ out.Conditions = append(out.Conditions, apps.ReplicaSetCondition{
Type: extensions.ReplicaSetConditionType(cond.Type), Type: apps.ReplicaSetConditionType(cond.Type),
Status: core.ConditionStatus(cond.Status), Status: core.ConditionStatus(cond.Status),
LastTransitionTime: cond.LastTransitionTime, LastTransitionTime: cond.LastTransitionTime,
Reason: cond.Reason, Reason: cond.Reason,
...@@ -164,9 +164,9 @@ func Convert_v1_ReplicationControllerStatus_To_extensions_ReplicaSetStatus(in *v ...@@ -164,9 +164,9 @@ func Convert_v1_ReplicationControllerStatus_To_extensions_ReplicaSetStatus(in *v
return nil return nil
} }
func Convert_extensions_ReplicaSet_To_v1_ReplicationController(in *extensions.ReplicaSet, out *v1.ReplicationController, s conversion.Scope) error { func Convert_apps_ReplicaSet_To_v1_ReplicationController(in *apps.ReplicaSet, out *v1.ReplicationController, s conversion.Scope) error {
out.ObjectMeta = in.ObjectMeta out.ObjectMeta = in.ObjectMeta
if err := Convert_extensions_ReplicaSetSpec_To_v1_ReplicationControllerSpec(&in.Spec, &out.Spec, s); err != nil { if err := Convert_apps_ReplicaSetSpec_To_v1_ReplicationControllerSpec(&in.Spec, &out.Spec, s); err != nil {
fieldErr, ok := err.(*field.Error) fieldErr, ok := err.(*field.Error)
if !ok { if !ok {
return err return err
...@@ -176,13 +176,13 @@ func Convert_extensions_ReplicaSet_To_v1_ReplicationController(in *extensions.Re ...@@ -176,13 +176,13 @@ func Convert_extensions_ReplicaSet_To_v1_ReplicationController(in *extensions.Re
} }
out.Annotations[v1.NonConvertibleAnnotationPrefix+"/"+fieldErr.Field] = reflect.ValueOf(fieldErr.BadValue).String() out.Annotations[v1.NonConvertibleAnnotationPrefix+"/"+fieldErr.Field] = reflect.ValueOf(fieldErr.BadValue).String()
} }
if err := Convert_extensions_ReplicaSetStatus_To_v1_ReplicationControllerStatus(&in.Status, &out.Status, s); err != nil { if err := Convert_apps_ReplicaSetStatus_To_v1_ReplicationControllerStatus(&in.Status, &out.Status, s); err != nil {
return err return err
} }
return nil return nil
} }
func Convert_extensions_ReplicaSetSpec_To_v1_ReplicationControllerSpec(in *extensions.ReplicaSetSpec, out *v1.ReplicationControllerSpec, s conversion.Scope) error { func Convert_apps_ReplicaSetSpec_To_v1_ReplicationControllerSpec(in *apps.ReplicaSetSpec, out *v1.ReplicationControllerSpec, s conversion.Scope) error {
out.Replicas = new(int32) out.Replicas = new(int32)
*out.Replicas = in.Replicas *out.Replicas = in.Replicas
out.MinReadySeconds = in.MinReadySeconds out.MinReadySeconds = in.MinReadySeconds
...@@ -197,7 +197,7 @@ func Convert_extensions_ReplicaSetSpec_To_v1_ReplicationControllerSpec(in *exten ...@@ -197,7 +197,7 @@ func Convert_extensions_ReplicaSetSpec_To_v1_ReplicationControllerSpec(in *exten
return invalidErr return invalidErr
} }
func Convert_extensions_ReplicaSetStatus_To_v1_ReplicationControllerStatus(in *extensions.ReplicaSetStatus, out *v1.ReplicationControllerStatus, s conversion.Scope) error { func Convert_apps_ReplicaSetStatus_To_v1_ReplicationControllerStatus(in *apps.ReplicaSetStatus, out *v1.ReplicationControllerStatus, s conversion.Scope) error {
out.Replicas = in.Replicas out.Replicas = in.Replicas
out.FullyLabeledReplicas = in.FullyLabeledReplicas out.FullyLabeledReplicas = in.FullyLabeledReplicas
out.ReadyReplicas = in.ReadyReplicas out.ReadyReplicas = in.ReadyReplicas
......
...@@ -24,8 +24,8 @@ import ( ...@@ -24,8 +24,8 @@ import (
"testing" "testing"
"time" "time"
appsv1 "k8s.io/api/apps/v1"
"k8s.io/api/core/v1" "k8s.io/api/core/v1"
extensionsv1beta1 "k8s.io/api/extensions/v1beta1"
"k8s.io/apimachinery/pkg/api/apitesting/fuzzer" "k8s.io/apimachinery/pkg/api/apitesting/fuzzer"
apiequality "k8s.io/apimachinery/pkg/api/equality" apiequality "k8s.io/apimachinery/pkg/api/equality"
"k8s.io/apimachinery/pkg/api/resource" "k8s.io/apimachinery/pkg/api/resource"
...@@ -34,10 +34,10 @@ import ( ...@@ -34,10 +34,10 @@ import (
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/diff" "k8s.io/apimachinery/pkg/util/diff"
"k8s.io/kubernetes/pkg/api/legacyscheme" "k8s.io/kubernetes/pkg/api/legacyscheme"
apps "k8s.io/kubernetes/pkg/apis/apps"
"k8s.io/kubernetes/pkg/apis/core" "k8s.io/kubernetes/pkg/apis/core"
corefuzzer "k8s.io/kubernetes/pkg/apis/core/fuzzer" corefuzzer "k8s.io/kubernetes/pkg/apis/core/fuzzer"
corev1 "k8s.io/kubernetes/pkg/apis/core/v1" corev1 "k8s.io/kubernetes/pkg/apis/core/v1"
"k8s.io/kubernetes/pkg/apis/extensions"
utilpointer "k8s.io/utils/pointer" utilpointer "k8s.io/utils/pointer"
// enforce that all types are installed // enforce that all types are installed
...@@ -305,16 +305,16 @@ func TestReplicationControllerConversion(t *testing.T) { ...@@ -305,16 +305,16 @@ func TestReplicationControllerConversion(t *testing.T) {
} }
for _, in := range inputs { for _, in := range inputs {
rs := &extensions.ReplicaSet{} rs := &apps.ReplicaSet{}
// Use in.DeepCopy() to avoid sharing pointers with `in`. // Use in.DeepCopy() to avoid sharing pointers with `in`.
if err := corev1.Convert_v1_ReplicationController_To_extensions_ReplicaSet(in.DeepCopy(), rs, nil); err != nil { if err := corev1.Convert_v1_ReplicationController_To_apps_ReplicaSet(in.DeepCopy(), rs, nil); err != nil {
t.Errorf("can't convert RC to RS: %v", err) t.Errorf("can't convert RC to RS: %v", err)
continue continue
} }
// Round-trip RS before converting back to RC. // Round-trip RS before converting back to RC.
rs = roundTripRS(t, rs) rs = roundTripRS(t, rs)
out := &v1.ReplicationController{} out := &v1.ReplicationController{}
if err := corev1.Convert_extensions_ReplicaSet_To_v1_ReplicationController(rs, out, nil); err != nil { if err := corev1.Convert_apps_ReplicaSet_To_v1_ReplicationController(rs, out, nil); err != nil {
t.Errorf("can't convert RS to RC: %v", err) t.Errorf("can't convert RS to RC: %v", err)
continue continue
} }
...@@ -326,8 +326,8 @@ func TestReplicationControllerConversion(t *testing.T) { ...@@ -326,8 +326,8 @@ func TestReplicationControllerConversion(t *testing.T) {
} }
} }
func roundTripRS(t *testing.T, rs *extensions.ReplicaSet) *extensions.ReplicaSet { func roundTripRS(t *testing.T, rs *apps.ReplicaSet) *apps.ReplicaSet {
codec := legacyscheme.Codecs.LegacyCodec(extensionsv1beta1.SchemeGroupVersion) codec := legacyscheme.Codecs.LegacyCodec(appsv1.SchemeGroupVersion)
data, err := runtime.Encode(codec, rs) data, err := runtime.Encode(codec, rs)
if err != nil { if err != nil {
t.Errorf("%v\n %#v", err, rs) t.Errorf("%v\n %#v", err, rs)
...@@ -338,7 +338,7 @@ func roundTripRS(t *testing.T, rs *extensions.ReplicaSet) *extensions.ReplicaSet ...@@ -338,7 +338,7 @@ func roundTripRS(t *testing.T, rs *extensions.ReplicaSet) *extensions.ReplicaSet
t.Errorf("%v\nData: %s\nSource: %#v", err, string(data), rs) t.Errorf("%v\nData: %s\nSource: %#v", err, string(data), rs)
return nil return nil
} }
obj3 := &extensions.ReplicaSet{} obj3 := &apps.ReplicaSet{}
err = legacyscheme.Scheme.Convert(obj2, obj3, nil) err = legacyscheme.Scheme.Convert(obj2, obj3, nil)
if err != nil { if err != nil {
t.Errorf("%v\nSource: %#v", err, obj2) t.Errorf("%v\nSource: %#v", err, obj2)
......
...@@ -29,8 +29,8 @@ import ( ...@@ -29,8 +29,8 @@ import (
conversion "k8s.io/apimachinery/pkg/conversion" conversion "k8s.io/apimachinery/pkg/conversion"
runtime "k8s.io/apimachinery/pkg/runtime" runtime "k8s.io/apimachinery/pkg/runtime"
types "k8s.io/apimachinery/pkg/types" types "k8s.io/apimachinery/pkg/types"
apps "k8s.io/kubernetes/pkg/apis/apps"
core "k8s.io/kubernetes/pkg/apis/core" core "k8s.io/kubernetes/pkg/apis/core"
extensions "k8s.io/kubernetes/pkg/apis/extensions"
) )
func init() { func init() {
...@@ -1990,6 +1990,21 @@ func RegisterConversions(s *runtime.Scheme) error { ...@@ -1990,6 +1990,21 @@ func RegisterConversions(s *runtime.Scheme) error {
}); err != nil { }); err != nil {
return err return err
} }
if err := s.AddConversionFunc((*apps.ReplicaSetSpec)(nil), (*v1.ReplicationControllerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_apps_ReplicaSetSpec_To_v1_ReplicationControllerSpec(a.(*apps.ReplicaSetSpec), b.(*v1.ReplicationControllerSpec), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*apps.ReplicaSetStatus)(nil), (*v1.ReplicationControllerStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_apps_ReplicaSetStatus_To_v1_ReplicationControllerStatus(a.(*apps.ReplicaSetStatus), b.(*v1.ReplicationControllerStatus), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*apps.ReplicaSet)(nil), (*v1.ReplicationController)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_apps_ReplicaSet_To_v1_ReplicationController(a.(*apps.ReplicaSet), b.(*v1.ReplicationController), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*core.PodSecurityContext)(nil), (*v1.PodSecurityContext)(nil), func(a, b interface{}, scope conversion.Scope) error { if err := s.AddConversionFunc((*core.PodSecurityContext)(nil), (*v1.PodSecurityContext)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_core_PodSecurityContext_To_v1_PodSecurityContext(a.(*core.PodSecurityContext), b.(*v1.PodSecurityContext), scope) return Convert_core_PodSecurityContext_To_v1_PodSecurityContext(a.(*core.PodSecurityContext), b.(*v1.PodSecurityContext), scope)
}); err != nil { }); err != nil {
...@@ -2020,21 +2035,6 @@ func RegisterConversions(s *runtime.Scheme) error { ...@@ -2020,21 +2035,6 @@ func RegisterConversions(s *runtime.Scheme) error {
}); err != nil { }); err != nil {
return err return err
} }
if err := s.AddConversionFunc((*extensions.ReplicaSetSpec)(nil), (*v1.ReplicationControllerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_extensions_ReplicaSetSpec_To_v1_ReplicationControllerSpec(a.(*extensions.ReplicaSetSpec), b.(*v1.ReplicationControllerSpec), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*extensions.ReplicaSetStatus)(nil), (*v1.ReplicationControllerStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_extensions_ReplicaSetStatus_To_v1_ReplicationControllerStatus(a.(*extensions.ReplicaSetStatus), b.(*v1.ReplicationControllerStatus), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*extensions.ReplicaSet)(nil), (*v1.ReplicationController)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_extensions_ReplicaSet_To_v1_ReplicationController(a.(*extensions.ReplicaSet), b.(*v1.ReplicationController), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*v1.PodSecurityContext)(nil), (*core.PodSecurityContext)(nil), func(a, b interface{}, scope conversion.Scope) error { if err := s.AddConversionFunc((*v1.PodSecurityContext)(nil), (*core.PodSecurityContext)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1_PodSecurityContext_To_core_PodSecurityContext(a.(*v1.PodSecurityContext), b.(*core.PodSecurityContext), scope) return Convert_v1_PodSecurityContext_To_core_PodSecurityContext(a.(*v1.PodSecurityContext), b.(*core.PodSecurityContext), scope)
}); err != nil { }); err != nil {
...@@ -2055,23 +2055,23 @@ func RegisterConversions(s *runtime.Scheme) error { ...@@ -2055,23 +2055,23 @@ func RegisterConversions(s *runtime.Scheme) error {
}); err != nil { }); err != nil {
return err return err
} }
if err := s.AddConversionFunc((*v1.ReplicationControllerSpec)(nil), (*core.ReplicationControllerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { if err := s.AddConversionFunc((*v1.ReplicationControllerSpec)(nil), (*apps.ReplicaSetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1_ReplicationControllerSpec_To_core_ReplicationControllerSpec(a.(*v1.ReplicationControllerSpec), b.(*core.ReplicationControllerSpec), scope) return Convert_v1_ReplicationControllerSpec_To_apps_ReplicaSetSpec(a.(*v1.ReplicationControllerSpec), b.(*apps.ReplicaSetSpec), scope)
}); err != nil { }); err != nil {
return err return err
} }
if err := s.AddConversionFunc((*v1.ReplicationControllerSpec)(nil), (*extensions.ReplicaSetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { if err := s.AddConversionFunc((*v1.ReplicationControllerSpec)(nil), (*core.ReplicationControllerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1_ReplicationControllerSpec_To_extensions_ReplicaSetSpec(a.(*v1.ReplicationControllerSpec), b.(*extensions.ReplicaSetSpec), scope) return Convert_v1_ReplicationControllerSpec_To_core_ReplicationControllerSpec(a.(*v1.ReplicationControllerSpec), b.(*core.ReplicationControllerSpec), scope)
}); err != nil { }); err != nil {
return err return err
} }
if err := s.AddConversionFunc((*v1.ReplicationControllerStatus)(nil), (*extensions.ReplicaSetStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { if err := s.AddConversionFunc((*v1.ReplicationControllerStatus)(nil), (*apps.ReplicaSetStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1_ReplicationControllerStatus_To_extensions_ReplicaSetStatus(a.(*v1.ReplicationControllerStatus), b.(*extensions.ReplicaSetStatus), scope) return Convert_v1_ReplicationControllerStatus_To_apps_ReplicaSetStatus(a.(*v1.ReplicationControllerStatus), b.(*apps.ReplicaSetStatus), scope)
}); err != nil { }); err != nil {
return err return err
} }
if err := s.AddConversionFunc((*v1.ReplicationController)(nil), (*extensions.ReplicaSet)(nil), func(a, b interface{}, scope conversion.Scope) error { if err := s.AddConversionFunc((*v1.ReplicationController)(nil), (*apps.ReplicaSet)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1_ReplicationController_To_extensions_ReplicaSet(a.(*v1.ReplicationController), b.(*extensions.ReplicaSet), scope) return Convert_v1_ReplicationController_To_apps_ReplicaSet(a.(*v1.ReplicationController), b.(*apps.ReplicaSet), scope)
}); err != nil { }); err != nil {
return err return err
} }
......
...@@ -15,11 +15,11 @@ go_library( ...@@ -15,11 +15,11 @@ go_library(
], ],
importpath = "k8s.io/kubernetes/pkg/apis/extensions", importpath = "k8s.io/kubernetes/pkg/apis/extensions",
deps = [ deps = [
"//pkg/apis/apps:go_default_library",
"//pkg/apis/autoscaling:go_default_library", "//pkg/apis/autoscaling:go_default_library",
"//pkg/apis/core:go_default_library", "//pkg/apis/core:go_default_library",
"//pkg/apis/networking:go_default_library", "//pkg/apis/networking:go_default_library",
"//pkg/apis/policy:go_default_library", "//pkg/apis/policy:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/resource:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
......
...@@ -9,13 +9,7 @@ go_library( ...@@ -9,13 +9,7 @@ go_library(
name = "go_default_library", name = "go_default_library",
srcs = ["fuzzer.go"], srcs = ["fuzzer.go"],
importpath = "k8s.io/kubernetes/pkg/apis/extensions/fuzzer", importpath = "k8s.io/kubernetes/pkg/apis/extensions/fuzzer",
deps = [ deps = ["//staging/src/k8s.io/apimachinery/pkg/runtime/serializer:go_default_library"],
"//pkg/apis/extensions:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime/serializer:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/intstr:go_default_library",
"//vendor/github.com/google/gofuzz:go_default_library",
],
) )
filegroup( filegroup(
......
...@@ -17,98 +17,10 @@ limitations under the License. ...@@ -17,98 +17,10 @@ limitations under the License.
package fuzzer package fuzzer
import ( import (
"fmt"
fuzz "github.com/google/gofuzz"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer" runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer"
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/kubernetes/pkg/apis/extensions"
) )
// Funcs returns the fuzzer functions for the extensions api group. // Funcs returns the fuzzer functions for the extensions api group.
var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} { var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} {
return []interface{}{ return []interface{}{}
func(j *extensions.Deployment, c fuzz.Continue) {
c.FuzzNoCustom(j)
// match defaulting
if j.Spec.Selector == nil {
j.Spec.Selector = &metav1.LabelSelector{MatchLabels: j.Spec.Template.Labels}
}
if len(j.Labels) == 0 {
j.Labels = j.Spec.Template.Labels
}
},
func(j *extensions.DeploymentSpec, c fuzz.Continue) {
c.FuzzNoCustom(j) // fuzz self without calling this function again
rhl := int32(c.Rand.Int31())
pds := int32(c.Rand.Int31())
j.RevisionHistoryLimit = &rhl
j.ProgressDeadlineSeconds = &pds
},
func(j *extensions.DeploymentStrategy, c fuzz.Continue) {
c.FuzzNoCustom(j) // fuzz self without calling this function again
// Ensure that strategyType is one of valid values.
strategyTypes := []extensions.DeploymentStrategyType{extensions.RecreateDeploymentStrategyType, extensions.RollingUpdateDeploymentStrategyType}
j.Type = strategyTypes[c.Rand.Intn(len(strategyTypes))]
if j.Type != extensions.RollingUpdateDeploymentStrategyType {
j.RollingUpdate = nil
} else {
rollingUpdate := extensions.RollingUpdateDeployment{}
if c.RandBool() {
rollingUpdate.MaxUnavailable = intstr.FromInt(int(c.Rand.Int31()))
rollingUpdate.MaxSurge = intstr.FromInt(int(c.Rand.Int31()))
} else {
rollingUpdate.MaxSurge = intstr.FromString(fmt.Sprintf("%d%%", c.Rand.Int31()))
}
j.RollingUpdate = &rollingUpdate
}
},
func(j *extensions.DaemonSet, c fuzz.Continue) {
c.FuzzNoCustom(j)
// match defaulter
j.Spec.Template.Generation = 0
if len(j.ObjectMeta.Labels) == 0 {
j.ObjectMeta.Labels = j.Spec.Template.ObjectMeta.Labels
}
},
func(j *extensions.DaemonSetSpec, c fuzz.Continue) {
c.FuzzNoCustom(j) // fuzz self without calling this function again
rhl := int32(c.Rand.Int31())
j.RevisionHistoryLimit = &rhl
},
func(j *extensions.DaemonSetUpdateStrategy, c fuzz.Continue) {
c.FuzzNoCustom(j) // fuzz self without calling this function again
// Ensure that strategyType is one of valid values.
strategyTypes := []extensions.DaemonSetUpdateStrategyType{extensions.RollingUpdateDaemonSetStrategyType, extensions.OnDeleteDaemonSetStrategyType}
j.Type = strategyTypes[c.Rand.Intn(len(strategyTypes))]
if j.Type != extensions.RollingUpdateDaemonSetStrategyType {
j.RollingUpdate = nil
} else {
rollingUpdate := extensions.RollingUpdateDaemonSet{}
if c.RandBool() {
if c.RandBool() {
rollingUpdate.MaxUnavailable = intstr.FromInt(1 + int(c.Rand.Int31()))
} else {
rollingUpdate.MaxUnavailable = intstr.FromString(fmt.Sprintf("%d%%", 1+c.Rand.Int31()))
}
}
j.RollingUpdate = &rollingUpdate
}
},
func(j *extensions.ReplicaSet, c fuzz.Continue) {
c.FuzzNoCustom(j)
// match defaulter
if j.Spec.Selector == nil {
j.Spec.Selector = &metav1.LabelSelector{MatchLabels: j.Spec.Template.Labels}
}
if len(j.Labels) == 0 {
j.Labels = j.Spec.Template.Labels
}
},
}
} }
...@@ -19,6 +19,7 @@ package extensions ...@@ -19,6 +19,7 @@ package extensions
import ( import (
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/kubernetes/pkg/apis/apps"
"k8s.io/kubernetes/pkg/apis/autoscaling" "k8s.io/kubernetes/pkg/apis/autoscaling"
"k8s.io/kubernetes/pkg/apis/networking" "k8s.io/kubernetes/pkg/apis/networking"
"k8s.io/kubernetes/pkg/apis/policy" "k8s.io/kubernetes/pkg/apis/policy"
...@@ -49,16 +50,16 @@ var ( ...@@ -49,16 +50,16 @@ var (
func addKnownTypes(scheme *runtime.Scheme) error { func addKnownTypes(scheme *runtime.Scheme) error {
// TODO this gets cleaned up when the types are fixed // TODO this gets cleaned up when the types are fixed
scheme.AddKnownTypes(SchemeGroupVersion, scheme.AddKnownTypes(SchemeGroupVersion,
&Deployment{}, &apps.Deployment{},
&DeploymentList{}, &apps.DeploymentList{},
&DeploymentRollback{}, &apps.DeploymentRollback{},
&ReplicationControllerDummy{}, &ReplicationControllerDummy{},
&DaemonSetList{}, &apps.DaemonSetList{},
&DaemonSet{}, &apps.DaemonSet{},
&Ingress{}, &Ingress{},
&IngressList{}, &IngressList{},
&ReplicaSet{}, &apps.ReplicaSet{},
&ReplicaSetList{}, &apps.ReplicaSetList{},
&policy.PodSecurityPolicy{}, &policy.PodSecurityPolicy{},
&policy.PodSecurityPolicyList{}, &policy.PodSecurityPolicyList{},
&autoscaling.Scale{}, &autoscaling.Scale{},
......
...@@ -18,6 +18,7 @@ go_library( ...@@ -18,6 +18,7 @@ go_library(
], ],
importpath = "k8s.io/kubernetes/pkg/apis/extensions/v1beta1", importpath = "k8s.io/kubernetes/pkg/apis/extensions/v1beta1",
deps = [ deps = [
"//pkg/apis/apps:go_default_library",
"//pkg/apis/autoscaling:go_default_library", "//pkg/apis/autoscaling:go_default_library",
"//pkg/apis/core:go_default_library", "//pkg/apis/core:go_default_library",
"//pkg/apis/core/v1:go_default_library", "//pkg/apis/core/v1:go_default_library",
......
...@@ -27,10 +27,10 @@ import ( ...@@ -27,10 +27,10 @@ import (
"k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/intstr" "k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/kubernetes/pkg/apis/apps"
"k8s.io/kubernetes/pkg/apis/autoscaling" "k8s.io/kubernetes/pkg/apis/autoscaling"
api "k8s.io/kubernetes/pkg/apis/core" api "k8s.io/kubernetes/pkg/apis/core"
k8s_api_v1 "k8s.io/kubernetes/pkg/apis/core/v1" k8s_api_v1 "k8s.io/kubernetes/pkg/apis/core/v1"
"k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/apis/networking" "k8s.io/kubernetes/pkg/apis/networking"
) )
...@@ -39,16 +39,16 @@ func addConversionFuncs(scheme *runtime.Scheme) error { ...@@ -39,16 +39,16 @@ func addConversionFuncs(scheme *runtime.Scheme) error {
err := scheme.AddConversionFuncs( err := scheme.AddConversionFuncs(
Convert_autoscaling_ScaleStatus_To_v1beta1_ScaleStatus, Convert_autoscaling_ScaleStatus_To_v1beta1_ScaleStatus,
Convert_v1beta1_ScaleStatus_To_autoscaling_ScaleStatus, Convert_v1beta1_ScaleStatus_To_autoscaling_ScaleStatus,
Convert_extensions_DeploymentSpec_To_v1beta1_DeploymentSpec, Convert_apps_DeploymentSpec_To_v1beta1_DeploymentSpec,
Convert_v1beta1_DeploymentSpec_To_extensions_DeploymentSpec, Convert_v1beta1_DeploymentSpec_To_apps_DeploymentSpec,
Convert_extensions_DeploymentStrategy_To_v1beta1_DeploymentStrategy, Convert_apps_DeploymentStrategy_To_v1beta1_DeploymentStrategy,
Convert_v1beta1_DeploymentStrategy_To_extensions_DeploymentStrategy, Convert_v1beta1_DeploymentStrategy_To_apps_DeploymentStrategy,
Convert_extensions_RollingUpdateDeployment_To_v1beta1_RollingUpdateDeployment, Convert_apps_RollingUpdateDeployment_To_v1beta1_RollingUpdateDeployment,
Convert_v1beta1_RollingUpdateDeployment_To_extensions_RollingUpdateDeployment, Convert_v1beta1_RollingUpdateDeployment_To_apps_RollingUpdateDeployment,
Convert_extensions_RollingUpdateDaemonSet_To_v1beta1_RollingUpdateDaemonSet, Convert_apps_RollingUpdateDaemonSet_To_v1beta1_RollingUpdateDaemonSet,
Convert_v1beta1_RollingUpdateDaemonSet_To_extensions_RollingUpdateDaemonSet, Convert_v1beta1_RollingUpdateDaemonSet_To_apps_RollingUpdateDaemonSet,
Convert_extensions_ReplicaSetSpec_To_v1beta1_ReplicaSetSpec, Convert_apps_ReplicaSetSpec_To_v1beta1_ReplicaSetSpec,
Convert_v1beta1_ReplicaSetSpec_To_extensions_ReplicaSetSpec, Convert_v1beta1_ReplicaSetSpec_To_apps_ReplicaSetSpec,
Convert_v1beta1_NetworkPolicy_To_networking_NetworkPolicy, Convert_v1beta1_NetworkPolicy_To_networking_NetworkPolicy,
Convert_networking_NetworkPolicy_To_v1beta1_NetworkPolicy, Convert_networking_NetworkPolicy_To_v1beta1_NetworkPolicy,
Convert_v1beta1_NetworkPolicyIngressRule_To_networking_NetworkPolicyIngressRule, Convert_v1beta1_NetworkPolicyIngressRule_To_networking_NetworkPolicyIngressRule,
...@@ -106,13 +106,13 @@ func Convert_v1beta1_ScaleStatus_To_autoscaling_ScaleStatus(in *extensionsv1beta ...@@ -106,13 +106,13 @@ func Convert_v1beta1_ScaleStatus_To_autoscaling_ScaleStatus(in *extensionsv1beta
return nil return nil
} }
func Convert_extensions_DeploymentSpec_To_v1beta1_DeploymentSpec(in *extensions.DeploymentSpec, out *extensionsv1beta1.DeploymentSpec, s conversion.Scope) error { func Convert_apps_DeploymentSpec_To_v1beta1_DeploymentSpec(in *apps.DeploymentSpec, out *extensionsv1beta1.DeploymentSpec, s conversion.Scope) error {
out.Replicas = &in.Replicas out.Replicas = &in.Replicas
out.Selector = in.Selector out.Selector = in.Selector
if err := k8s_api_v1.Convert_core_PodTemplateSpec_To_v1_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { if err := k8s_api_v1.Convert_core_PodTemplateSpec_To_v1_PodTemplateSpec(&in.Template, &out.Template, s); err != nil {
return err return err
} }
if err := Convert_extensions_DeploymentStrategy_To_v1beta1_DeploymentStrategy(&in.Strategy, &out.Strategy, s); err != nil { if err := Convert_apps_DeploymentStrategy_To_v1beta1_DeploymentStrategy(&in.Strategy, &out.Strategy, s); err != nil {
return err return err
} }
if in.RevisionHistoryLimit != nil { if in.RevisionHistoryLimit != nil {
...@@ -134,7 +134,7 @@ func Convert_extensions_DeploymentSpec_To_v1beta1_DeploymentSpec(in *extensions. ...@@ -134,7 +134,7 @@ func Convert_extensions_DeploymentSpec_To_v1beta1_DeploymentSpec(in *extensions.
return nil return nil
} }
func Convert_v1beta1_DeploymentSpec_To_extensions_DeploymentSpec(in *extensionsv1beta1.DeploymentSpec, out *extensions.DeploymentSpec, s conversion.Scope) error { func Convert_v1beta1_DeploymentSpec_To_apps_DeploymentSpec(in *extensionsv1beta1.DeploymentSpec, out *apps.DeploymentSpec, s conversion.Scope) error {
if in.Replicas != nil { if in.Replicas != nil {
out.Replicas = *in.Replicas out.Replicas = *in.Replicas
} }
...@@ -142,14 +142,14 @@ func Convert_v1beta1_DeploymentSpec_To_extensions_DeploymentSpec(in *extensionsv ...@@ -142,14 +142,14 @@ func Convert_v1beta1_DeploymentSpec_To_extensions_DeploymentSpec(in *extensionsv
if err := k8s_api_v1.Convert_v1_PodTemplateSpec_To_core_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { if err := k8s_api_v1.Convert_v1_PodTemplateSpec_To_core_PodTemplateSpec(&in.Template, &out.Template, s); err != nil {
return err return err
} }
if err := Convert_v1beta1_DeploymentStrategy_To_extensions_DeploymentStrategy(&in.Strategy, &out.Strategy, s); err != nil { if err := Convert_v1beta1_DeploymentStrategy_To_apps_DeploymentStrategy(&in.Strategy, &out.Strategy, s); err != nil {
return err return err
} }
out.RevisionHistoryLimit = in.RevisionHistoryLimit out.RevisionHistoryLimit = in.RevisionHistoryLimit
out.MinReadySeconds = in.MinReadySeconds out.MinReadySeconds = in.MinReadySeconds
out.Paused = in.Paused out.Paused = in.Paused
if in.RollbackTo != nil { if in.RollbackTo != nil {
out.RollbackTo = new(extensions.RollbackConfig) out.RollbackTo = new(apps.RollbackConfig)
out.RollbackTo.Revision = in.RollbackTo.Revision out.RollbackTo.Revision = in.RollbackTo.Revision
} else { } else {
out.RollbackTo = nil out.RollbackTo = nil
...@@ -161,11 +161,11 @@ func Convert_v1beta1_DeploymentSpec_To_extensions_DeploymentSpec(in *extensionsv ...@@ -161,11 +161,11 @@ func Convert_v1beta1_DeploymentSpec_To_extensions_DeploymentSpec(in *extensionsv
return nil return nil
} }
func Convert_extensions_DeploymentStrategy_To_v1beta1_DeploymentStrategy(in *extensions.DeploymentStrategy, out *extensionsv1beta1.DeploymentStrategy, s conversion.Scope) error { func Convert_apps_DeploymentStrategy_To_v1beta1_DeploymentStrategy(in *apps.DeploymentStrategy, out *extensionsv1beta1.DeploymentStrategy, s conversion.Scope) error {
out.Type = extensionsv1beta1.DeploymentStrategyType(in.Type) out.Type = extensionsv1beta1.DeploymentStrategyType(in.Type)
if in.RollingUpdate != nil { if in.RollingUpdate != nil {
out.RollingUpdate = new(extensionsv1beta1.RollingUpdateDeployment) out.RollingUpdate = new(extensionsv1beta1.RollingUpdateDeployment)
if err := Convert_extensions_RollingUpdateDeployment_To_v1beta1_RollingUpdateDeployment(in.RollingUpdate, out.RollingUpdate, s); err != nil { if err := Convert_apps_RollingUpdateDeployment_To_v1beta1_RollingUpdateDeployment(in.RollingUpdate, out.RollingUpdate, s); err != nil {
return err return err
} }
} else { } else {
...@@ -174,11 +174,11 @@ func Convert_extensions_DeploymentStrategy_To_v1beta1_DeploymentStrategy(in *ext ...@@ -174,11 +174,11 @@ func Convert_extensions_DeploymentStrategy_To_v1beta1_DeploymentStrategy(in *ext
return nil return nil
} }
func Convert_v1beta1_DeploymentStrategy_To_extensions_DeploymentStrategy(in *extensionsv1beta1.DeploymentStrategy, out *extensions.DeploymentStrategy, s conversion.Scope) error { func Convert_v1beta1_DeploymentStrategy_To_apps_DeploymentStrategy(in *extensionsv1beta1.DeploymentStrategy, out *apps.DeploymentStrategy, s conversion.Scope) error {
out.Type = extensions.DeploymentStrategyType(in.Type) out.Type = apps.DeploymentStrategyType(in.Type)
if in.RollingUpdate != nil { if in.RollingUpdate != nil {
out.RollingUpdate = new(extensions.RollingUpdateDeployment) out.RollingUpdate = new(apps.RollingUpdateDeployment)
if err := Convert_v1beta1_RollingUpdateDeployment_To_extensions_RollingUpdateDeployment(in.RollingUpdate, out.RollingUpdate, s); err != nil { if err := Convert_v1beta1_RollingUpdateDeployment_To_apps_RollingUpdateDeployment(in.RollingUpdate, out.RollingUpdate, s); err != nil {
return err return err
} }
} else { } else {
...@@ -187,7 +187,7 @@ func Convert_v1beta1_DeploymentStrategy_To_extensions_DeploymentStrategy(in *ext ...@@ -187,7 +187,7 @@ func Convert_v1beta1_DeploymentStrategy_To_extensions_DeploymentStrategy(in *ext
return nil return nil
} }
func Convert_extensions_RollingUpdateDeployment_To_v1beta1_RollingUpdateDeployment(in *extensions.RollingUpdateDeployment, out *extensionsv1beta1.RollingUpdateDeployment, s conversion.Scope) error { func Convert_apps_RollingUpdateDeployment_To_v1beta1_RollingUpdateDeployment(in *apps.RollingUpdateDeployment, out *extensionsv1beta1.RollingUpdateDeployment, s conversion.Scope) error {
if out.MaxUnavailable == nil { if out.MaxUnavailable == nil {
out.MaxUnavailable = &intstr.IntOrString{} out.MaxUnavailable = &intstr.IntOrString{}
} }
...@@ -203,7 +203,7 @@ func Convert_extensions_RollingUpdateDeployment_To_v1beta1_RollingUpdateDeployme ...@@ -203,7 +203,7 @@ func Convert_extensions_RollingUpdateDeployment_To_v1beta1_RollingUpdateDeployme
return nil return nil
} }
func Convert_v1beta1_RollingUpdateDeployment_To_extensions_RollingUpdateDeployment(in *extensionsv1beta1.RollingUpdateDeployment, out *extensions.RollingUpdateDeployment, s conversion.Scope) error { func Convert_v1beta1_RollingUpdateDeployment_To_apps_RollingUpdateDeployment(in *extensionsv1beta1.RollingUpdateDeployment, out *apps.RollingUpdateDeployment, s conversion.Scope) error {
if err := s.Convert(in.MaxUnavailable, &out.MaxUnavailable, 0); err != nil { if err := s.Convert(in.MaxUnavailable, &out.MaxUnavailable, 0); err != nil {
return err return err
} }
...@@ -213,7 +213,7 @@ func Convert_v1beta1_RollingUpdateDeployment_To_extensions_RollingUpdateDeployme ...@@ -213,7 +213,7 @@ func Convert_v1beta1_RollingUpdateDeployment_To_extensions_RollingUpdateDeployme
return nil return nil
} }
func Convert_extensions_RollingUpdateDaemonSet_To_v1beta1_RollingUpdateDaemonSet(in *extensions.RollingUpdateDaemonSet, out *extensionsv1beta1.RollingUpdateDaemonSet, s conversion.Scope) error { func Convert_apps_RollingUpdateDaemonSet_To_v1beta1_RollingUpdateDaemonSet(in *apps.RollingUpdateDaemonSet, out *extensionsv1beta1.RollingUpdateDaemonSet, s conversion.Scope) error {
if out.MaxUnavailable == nil { if out.MaxUnavailable == nil {
out.MaxUnavailable = &intstr.IntOrString{} out.MaxUnavailable = &intstr.IntOrString{}
} }
...@@ -223,14 +223,14 @@ func Convert_extensions_RollingUpdateDaemonSet_To_v1beta1_RollingUpdateDaemonSet ...@@ -223,14 +223,14 @@ func Convert_extensions_RollingUpdateDaemonSet_To_v1beta1_RollingUpdateDaemonSet
return nil return nil
} }
func Convert_v1beta1_RollingUpdateDaemonSet_To_extensions_RollingUpdateDaemonSet(in *extensionsv1beta1.RollingUpdateDaemonSet, out *extensions.RollingUpdateDaemonSet, s conversion.Scope) error { func Convert_v1beta1_RollingUpdateDaemonSet_To_apps_RollingUpdateDaemonSet(in *extensionsv1beta1.RollingUpdateDaemonSet, out *apps.RollingUpdateDaemonSet, s conversion.Scope) error {
if err := s.Convert(in.MaxUnavailable, &out.MaxUnavailable, 0); err != nil { if err := s.Convert(in.MaxUnavailable, &out.MaxUnavailable, 0); err != nil {
return err return err
} }
return nil return nil
} }
func Convert_extensions_ReplicaSetSpec_To_v1beta1_ReplicaSetSpec(in *extensions.ReplicaSetSpec, out *extensionsv1beta1.ReplicaSetSpec, s conversion.Scope) error { func Convert_apps_ReplicaSetSpec_To_v1beta1_ReplicaSetSpec(in *apps.ReplicaSetSpec, out *extensionsv1beta1.ReplicaSetSpec, s conversion.Scope) error {
out.Replicas = new(int32) out.Replicas = new(int32)
*out.Replicas = int32(in.Replicas) *out.Replicas = int32(in.Replicas)
out.MinReadySeconds = in.MinReadySeconds out.MinReadySeconds = in.MinReadySeconds
...@@ -241,7 +241,7 @@ func Convert_extensions_ReplicaSetSpec_To_v1beta1_ReplicaSetSpec(in *extensions. ...@@ -241,7 +241,7 @@ func Convert_extensions_ReplicaSetSpec_To_v1beta1_ReplicaSetSpec(in *extensions.
return nil return nil
} }
func Convert_v1beta1_ReplicaSetSpec_To_extensions_ReplicaSetSpec(in *extensionsv1beta1.ReplicaSetSpec, out *extensions.ReplicaSetSpec, s conversion.Scope) error { func Convert_v1beta1_ReplicaSetSpec_To_apps_ReplicaSetSpec(in *extensionsv1beta1.ReplicaSetSpec, out *apps.ReplicaSetSpec, s conversion.Scope) error {
if in.Replicas != nil { if in.Replicas != nil {
out.Replicas = *in.Replicas out.Replicas = *in.Replicas
} }
......
...@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and ...@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/apps
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/policy // +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/policy
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/extensions // +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/extensions
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/autoscaling // +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/autoscaling
......
...@@ -11,15 +11,9 @@ go_library( ...@@ -11,15 +11,9 @@ go_library(
srcs = ["validation.go"], srcs = ["validation.go"],
importpath = "k8s.io/kubernetes/pkg/apis/extensions/validation", importpath = "k8s.io/kubernetes/pkg/apis/extensions/validation",
deps = [ deps = [
"//pkg/apis/core:go_default_library",
"//pkg/apis/core/validation:go_default_library", "//pkg/apis/core/validation:go_default_library",
"//pkg/apis/extensions:go_default_library", "//pkg/apis/extensions:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/equality:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/validation:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/api/validation:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/validation:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/labels:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/intstr:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/validation:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/validation:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/validation/field:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/validation/field:go_default_library",
], ],
...@@ -34,8 +28,6 @@ go_test( ...@@ -34,8 +28,6 @@ go_test(
"//pkg/apis/extensions:go_default_library", "//pkg/apis/extensions:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/intstr:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/intstr:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/validation/field:go_default_library",
"//vendor/github.com/davecgh/go-spew/spew:go_default_library",
], ],
) )
......
...@@ -11,9 +11,9 @@ go_library( ...@@ -11,9 +11,9 @@ go_library(
srcs = ["validation.go"], srcs = ["validation.go"],
importpath = "k8s.io/kubernetes/pkg/apis/policy/validation", importpath = "k8s.io/kubernetes/pkg/apis/policy/validation",
deps = [ deps = [
"//pkg/apis/apps/validation:go_default_library",
"//pkg/apis/core:go_default_library", "//pkg/apis/core:go_default_library",
"//pkg/apis/core/validation:go_default_library", "//pkg/apis/core/validation:go_default_library",
"//pkg/apis/extensions/validation:go_default_library",
"//pkg/apis/policy:go_default_library", "//pkg/apis/policy:go_default_library",
"//pkg/features:go_default_library", "//pkg/features:go_default_library",
"//pkg/security/apparmor:go_default_library", "//pkg/security/apparmor:go_default_library",
......
...@@ -27,9 +27,9 @@ import ( ...@@ -27,9 +27,9 @@ import (
unversionedvalidation "k8s.io/apimachinery/pkg/apis/meta/v1/validation" unversionedvalidation "k8s.io/apimachinery/pkg/apis/meta/v1/validation"
"k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/sets"
"k8s.io/apimachinery/pkg/util/validation/field" "k8s.io/apimachinery/pkg/util/validation/field"
appsvalidation "k8s.io/kubernetes/pkg/apis/apps/validation"
core "k8s.io/kubernetes/pkg/apis/core" core "k8s.io/kubernetes/pkg/apis/core"
apivalidation "k8s.io/kubernetes/pkg/apis/core/validation" apivalidation "k8s.io/kubernetes/pkg/apis/core/validation"
extensionsvalidation "k8s.io/kubernetes/pkg/apis/extensions/validation"
"k8s.io/kubernetes/pkg/apis/policy" "k8s.io/kubernetes/pkg/apis/policy"
"k8s.io/kubernetes/pkg/features" "k8s.io/kubernetes/pkg/features"
"k8s.io/kubernetes/pkg/security/apparmor" "k8s.io/kubernetes/pkg/security/apparmor"
...@@ -68,13 +68,13 @@ func ValidatePodDisruptionBudgetSpec(spec policy.PodDisruptionBudgetSpec, fldPat ...@@ -68,13 +68,13 @@ func ValidatePodDisruptionBudgetSpec(spec policy.PodDisruptionBudgetSpec, fldPat
} }
if spec.MinAvailable != nil { if spec.MinAvailable != nil {
allErrs = append(allErrs, extensionsvalidation.ValidatePositiveIntOrPercent(*spec.MinAvailable, fldPath.Child("minAvailable"))...) allErrs = append(allErrs, appsvalidation.ValidatePositiveIntOrPercent(*spec.MinAvailable, fldPath.Child("minAvailable"))...)
allErrs = append(allErrs, extensionsvalidation.IsNotMoreThan100Percent(*spec.MinAvailable, fldPath.Child("minAvailable"))...) allErrs = append(allErrs, appsvalidation.IsNotMoreThan100Percent(*spec.MinAvailable, fldPath.Child("minAvailable"))...)
} }
if spec.MaxUnavailable != nil { if spec.MaxUnavailable != nil {
allErrs = append(allErrs, extensionsvalidation.ValidatePositiveIntOrPercent(*spec.MaxUnavailable, fldPath.Child("maxUnavailable"))...) allErrs = append(allErrs, appsvalidation.ValidatePositiveIntOrPercent(*spec.MaxUnavailable, fldPath.Child("maxUnavailable"))...)
allErrs = append(allErrs, extensionsvalidation.IsNotMoreThan100Percent(*spec.MaxUnavailable, fldPath.Child("maxUnavailable"))...) allErrs = append(allErrs, appsvalidation.IsNotMoreThan100Percent(*spec.MaxUnavailable, fldPath.Child("maxUnavailable"))...)
} }
allErrs = append(allErrs, unversionedvalidation.ValidateLabelSelector(spec.Selector, fldPath.Child("selector"))...) allErrs = append(allErrs, unversionedvalidation.ValidateLabelSelector(spec.Selector, fldPath.Child("selector"))...)
......
...@@ -10,14 +10,16 @@ go_library( ...@@ -10,14 +10,16 @@ go_library(
srcs = [ srcs = [
"apps_client.go", "apps_client.go",
"controllerrevision.go", "controllerrevision.go",
"daemonset.go",
"deployment.go",
"doc.go", "doc.go",
"generated_expansion.go", "generated_expansion.go",
"replicaset.go",
"statefulset.go", "statefulset.go",
], ],
importpath = "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/apps/internalversion", importpath = "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/apps/internalversion",
deps = [ deps = [
"//pkg/apis/apps:go_default_library", "//pkg/apis/apps:go_default_library",
"//pkg/apis/autoscaling:go_default_library",
"//pkg/client/clientset_generated/internalclientset/scheme:go_default_library", "//pkg/client/clientset_generated/internalclientset/scheme:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/types:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/types:go_default_library",
......
...@@ -26,6 +26,9 @@ import ( ...@@ -26,6 +26,9 @@ import (
type AppsInterface interface { type AppsInterface interface {
RESTClient() rest.Interface RESTClient() rest.Interface
ControllerRevisionsGetter ControllerRevisionsGetter
DaemonSetsGetter
DeploymentsGetter
ReplicaSetsGetter
StatefulSetsGetter StatefulSetsGetter
} }
...@@ -38,6 +41,18 @@ func (c *AppsClient) ControllerRevisions(namespace string) ControllerRevisionInt ...@@ -38,6 +41,18 @@ func (c *AppsClient) ControllerRevisions(namespace string) ControllerRevisionInt
return newControllerRevisions(c, namespace) return newControllerRevisions(c, namespace)
} }
func (c *AppsClient) DaemonSets(namespace string) DaemonSetInterface {
return newDaemonSets(c, namespace)
}
func (c *AppsClient) Deployments(namespace string) DeploymentInterface {
return newDeployments(c, namespace)
}
func (c *AppsClient) ReplicaSets(namespace string) ReplicaSetInterface {
return newReplicaSets(c, namespace)
}
func (c *AppsClient) StatefulSets(namespace string) StatefulSetInterface { func (c *AppsClient) StatefulSets(namespace string) StatefulSetInterface {
return newStatefulSets(c, namespace) return newStatefulSets(c, namespace)
} }
......
...@@ -23,7 +23,7 @@ import ( ...@@ -23,7 +23,7 @@ import (
types "k8s.io/apimachinery/pkg/types" types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch" watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest" rest "k8s.io/client-go/rest"
extensions "k8s.io/kubernetes/pkg/apis/extensions" apps "k8s.io/kubernetes/pkg/apis/apps"
scheme "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/scheme" scheme "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/scheme"
) )
...@@ -35,15 +35,15 @@ type DaemonSetsGetter interface { ...@@ -35,15 +35,15 @@ type DaemonSetsGetter interface {
// DaemonSetInterface has methods to work with DaemonSet resources. // DaemonSetInterface has methods to work with DaemonSet resources.
type DaemonSetInterface interface { type DaemonSetInterface interface {
Create(*extensions.DaemonSet) (*extensions.DaemonSet, error) Create(*apps.DaemonSet) (*apps.DaemonSet, error)
Update(*extensions.DaemonSet) (*extensions.DaemonSet, error) Update(*apps.DaemonSet) (*apps.DaemonSet, error)
UpdateStatus(*extensions.DaemonSet) (*extensions.DaemonSet, error) UpdateStatus(*apps.DaemonSet) (*apps.DaemonSet, error)
Delete(name string, options *v1.DeleteOptions) error Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string, options v1.GetOptions) (*extensions.DaemonSet, error) Get(name string, options v1.GetOptions) (*apps.DaemonSet, error)
List(opts v1.ListOptions) (*extensions.DaemonSetList, error) List(opts v1.ListOptions) (*apps.DaemonSetList, error)
Watch(opts v1.ListOptions) (watch.Interface, error) Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *extensions.DaemonSet, err error) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *apps.DaemonSet, err error)
DaemonSetExpansion DaemonSetExpansion
} }
...@@ -54,7 +54,7 @@ type daemonSets struct { ...@@ -54,7 +54,7 @@ type daemonSets struct {
} }
// newDaemonSets returns a DaemonSets // newDaemonSets returns a DaemonSets
func newDaemonSets(c *ExtensionsClient, namespace string) *daemonSets { func newDaemonSets(c *AppsClient, namespace string) *daemonSets {
return &daemonSets{ return &daemonSets{
client: c.RESTClient(), client: c.RESTClient(),
ns: namespace, ns: namespace,
...@@ -62,8 +62,8 @@ func newDaemonSets(c *ExtensionsClient, namespace string) *daemonSets { ...@@ -62,8 +62,8 @@ func newDaemonSets(c *ExtensionsClient, namespace string) *daemonSets {
} }
// Get takes name of the daemonSet, and returns the corresponding daemonSet object, and an error if there is any. // Get takes name of the daemonSet, and returns the corresponding daemonSet object, and an error if there is any.
func (c *daemonSets) Get(name string, options v1.GetOptions) (result *extensions.DaemonSet, err error) { func (c *daemonSets) Get(name string, options v1.GetOptions) (result *apps.DaemonSet, err error) {
result = &extensions.DaemonSet{} result = &apps.DaemonSet{}
err = c.client.Get(). err = c.client.Get().
Namespace(c.ns). Namespace(c.ns).
Resource("daemonsets"). Resource("daemonsets").
...@@ -75,8 +75,8 @@ func (c *daemonSets) Get(name string, options v1.GetOptions) (result *extensions ...@@ -75,8 +75,8 @@ func (c *daemonSets) Get(name string, options v1.GetOptions) (result *extensions
} }
// List takes label and field selectors, and returns the list of DaemonSets that match those selectors. // List takes label and field selectors, and returns the list of DaemonSets that match those selectors.
func (c *daemonSets) List(opts v1.ListOptions) (result *extensions.DaemonSetList, err error) { func (c *daemonSets) List(opts v1.ListOptions) (result *apps.DaemonSetList, err error) {
result = &extensions.DaemonSetList{} result = &apps.DaemonSetList{}
err = c.client.Get(). err = c.client.Get().
Namespace(c.ns). Namespace(c.ns).
Resource("daemonsets"). Resource("daemonsets").
...@@ -97,8 +97,8 @@ func (c *daemonSets) Watch(opts v1.ListOptions) (watch.Interface, error) { ...@@ -97,8 +97,8 @@ func (c *daemonSets) Watch(opts v1.ListOptions) (watch.Interface, error) {
} }
// Create takes the representation of a daemonSet and creates it. Returns the server's representation of the daemonSet, and an error, if there is any. // Create takes the representation of a daemonSet and creates it. Returns the server's representation of the daemonSet, and an error, if there is any.
func (c *daemonSets) Create(daemonSet *extensions.DaemonSet) (result *extensions.DaemonSet, err error) { func (c *daemonSets) Create(daemonSet *apps.DaemonSet) (result *apps.DaemonSet, err error) {
result = &extensions.DaemonSet{} result = &apps.DaemonSet{}
err = c.client.Post(). err = c.client.Post().
Namespace(c.ns). Namespace(c.ns).
Resource("daemonsets"). Resource("daemonsets").
...@@ -109,8 +109,8 @@ func (c *daemonSets) Create(daemonSet *extensions.DaemonSet) (result *extensions ...@@ -109,8 +109,8 @@ func (c *daemonSets) Create(daemonSet *extensions.DaemonSet) (result *extensions
} }
// Update takes the representation of a daemonSet and updates it. Returns the server's representation of the daemonSet, and an error, if there is any. // Update takes the representation of a daemonSet and updates it. Returns the server's representation of the daemonSet, and an error, if there is any.
func (c *daemonSets) Update(daemonSet *extensions.DaemonSet) (result *extensions.DaemonSet, err error) { func (c *daemonSets) Update(daemonSet *apps.DaemonSet) (result *apps.DaemonSet, err error) {
result = &extensions.DaemonSet{} result = &apps.DaemonSet{}
err = c.client.Put(). err = c.client.Put().
Namespace(c.ns). Namespace(c.ns).
Resource("daemonsets"). Resource("daemonsets").
...@@ -124,8 +124,8 @@ func (c *daemonSets) Update(daemonSet *extensions.DaemonSet) (result *extensions ...@@ -124,8 +124,8 @@ func (c *daemonSets) Update(daemonSet *extensions.DaemonSet) (result *extensions
// UpdateStatus was generated because the type contains a Status member. // UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *daemonSets) UpdateStatus(daemonSet *extensions.DaemonSet) (result *extensions.DaemonSet, err error) { func (c *daemonSets) UpdateStatus(daemonSet *apps.DaemonSet) (result *apps.DaemonSet, err error) {
result = &extensions.DaemonSet{} result = &apps.DaemonSet{}
err = c.client.Put(). err = c.client.Put().
Namespace(c.ns). Namespace(c.ns).
Resource("daemonsets"). Resource("daemonsets").
...@@ -160,8 +160,8 @@ func (c *daemonSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1. ...@@ -160,8 +160,8 @@ func (c *daemonSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.
} }
// Patch applies the patch and returns the patched daemonSet. // Patch applies the patch and returns the patched daemonSet.
func (c *daemonSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *extensions.DaemonSet, err error) { func (c *daemonSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *apps.DaemonSet, err error) {
result = &extensions.DaemonSet{} result = &apps.DaemonSet{}
err = c.client.Patch(pt). err = c.client.Patch(pt).
Namespace(c.ns). Namespace(c.ns).
Resource("daemonsets"). Resource("daemonsets").
......
...@@ -23,8 +23,7 @@ import ( ...@@ -23,8 +23,7 @@ import (
types "k8s.io/apimachinery/pkg/types" types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch" watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest" rest "k8s.io/client-go/rest"
autoscaling "k8s.io/kubernetes/pkg/apis/autoscaling" apps "k8s.io/kubernetes/pkg/apis/apps"
extensions "k8s.io/kubernetes/pkg/apis/extensions"
scheme "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/scheme" scheme "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/scheme"
) )
...@@ -36,18 +35,15 @@ type DeploymentsGetter interface { ...@@ -36,18 +35,15 @@ type DeploymentsGetter interface {
// DeploymentInterface has methods to work with Deployment resources. // DeploymentInterface has methods to work with Deployment resources.
type DeploymentInterface interface { type DeploymentInterface interface {
Create(*extensions.Deployment) (*extensions.Deployment, error) Create(*apps.Deployment) (*apps.Deployment, error)
Update(*extensions.Deployment) (*extensions.Deployment, error) Update(*apps.Deployment) (*apps.Deployment, error)
UpdateStatus(*extensions.Deployment) (*extensions.Deployment, error) UpdateStatus(*apps.Deployment) (*apps.Deployment, error)
Delete(name string, options *v1.DeleteOptions) error Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string, options v1.GetOptions) (*extensions.Deployment, error) Get(name string, options v1.GetOptions) (*apps.Deployment, error)
List(opts v1.ListOptions) (*extensions.DeploymentList, error) List(opts v1.ListOptions) (*apps.DeploymentList, error)
Watch(opts v1.ListOptions) (watch.Interface, error) Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *extensions.Deployment, err error) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *apps.Deployment, err error)
GetScale(deploymentName string, options v1.GetOptions) (*autoscaling.Scale, error)
UpdateScale(deploymentName string, scale *autoscaling.Scale) (*autoscaling.Scale, error)
DeploymentExpansion DeploymentExpansion
} }
...@@ -58,7 +54,7 @@ type deployments struct { ...@@ -58,7 +54,7 @@ type deployments struct {
} }
// newDeployments returns a Deployments // newDeployments returns a Deployments
func newDeployments(c *ExtensionsClient, namespace string) *deployments { func newDeployments(c *AppsClient, namespace string) *deployments {
return &deployments{ return &deployments{
client: c.RESTClient(), client: c.RESTClient(),
ns: namespace, ns: namespace,
...@@ -66,8 +62,8 @@ func newDeployments(c *ExtensionsClient, namespace string) *deployments { ...@@ -66,8 +62,8 @@ func newDeployments(c *ExtensionsClient, namespace string) *deployments {
} }
// 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, options v1.GetOptions) (result *extensions.Deployment, err error) { func (c *deployments) Get(name string, options v1.GetOptions) (result *apps.Deployment, err error) {
result = &extensions.Deployment{} result = &apps.Deployment{}
err = c.client.Get(). err = c.client.Get().
Namespace(c.ns). Namespace(c.ns).
Resource("deployments"). Resource("deployments").
...@@ -79,8 +75,8 @@ func (c *deployments) Get(name string, options v1.GetOptions) (result *extension ...@@ -79,8 +75,8 @@ func (c *deployments) Get(name string, options v1.GetOptions) (result *extension
} }
// 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(opts v1.ListOptions) (result *extensions.DeploymentList, err error) { func (c *deployments) List(opts v1.ListOptions) (result *apps.DeploymentList, err error) {
result = &extensions.DeploymentList{} result = &apps.DeploymentList{}
err = c.client.Get(). err = c.client.Get().
Namespace(c.ns). Namespace(c.ns).
Resource("deployments"). Resource("deployments").
...@@ -101,8 +97,8 @@ func (c *deployments) Watch(opts v1.ListOptions) (watch.Interface, error) { ...@@ -101,8 +97,8 @@ func (c *deployments) Watch(opts v1.ListOptions) (watch.Interface, 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 *extensions.Deployment) (result *extensions.Deployment, err error) { func (c *deployments) Create(deployment *apps.Deployment) (result *apps.Deployment, err error) {
result = &extensions.Deployment{} result = &apps.Deployment{}
err = c.client.Post(). err = c.client.Post().
Namespace(c.ns). Namespace(c.ns).
Resource("deployments"). Resource("deployments").
...@@ -113,8 +109,8 @@ func (c *deployments) Create(deployment *extensions.Deployment) (result *extensi ...@@ -113,8 +109,8 @@ func (c *deployments) Create(deployment *extensions.Deployment) (result *extensi
} }
// 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 *extensions.Deployment) (result *extensions.Deployment, err error) { func (c *deployments) Update(deployment *apps.Deployment) (result *apps.Deployment, err error) {
result = &extensions.Deployment{} result = &apps.Deployment{}
err = c.client.Put(). err = c.client.Put().
Namespace(c.ns). Namespace(c.ns).
Resource("deployments"). Resource("deployments").
...@@ -128,8 +124,8 @@ func (c *deployments) Update(deployment *extensions.Deployment) (result *extensi ...@@ -128,8 +124,8 @@ func (c *deployments) Update(deployment *extensions.Deployment) (result *extensi
// UpdateStatus was generated because the type contains a Status member. // UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *deployments) UpdateStatus(deployment *extensions.Deployment) (result *extensions.Deployment, err error) { func (c *deployments) UpdateStatus(deployment *apps.Deployment) (result *apps.Deployment, err error) {
result = &extensions.Deployment{} result = &apps.Deployment{}
err = c.client.Put(). err = c.client.Put().
Namespace(c.ns). Namespace(c.ns).
Resource("deployments"). Resource("deployments").
...@@ -164,8 +160,8 @@ func (c *deployments) DeleteCollection(options *v1.DeleteOptions, listOptions v1 ...@@ -164,8 +160,8 @@ func (c *deployments) DeleteCollection(options *v1.DeleteOptions, listOptions v1
} }
// Patch applies the patch and returns the patched deployment. // Patch applies the patch and returns the patched deployment.
func (c *deployments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *extensions.Deployment, err error) { func (c *deployments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *apps.Deployment, err error) {
result = &extensions.Deployment{} result = &apps.Deployment{}
err = c.client.Patch(pt). err = c.client.Patch(pt).
Namespace(c.ns). Namespace(c.ns).
Resource("deployments"). Resource("deployments").
...@@ -176,31 +172,3 @@ func (c *deployments) Patch(name string, pt types.PatchType, data []byte, subres ...@@ -176,31 +172,3 @@ func (c *deployments) Patch(name string, pt types.PatchType, data []byte, subres
Into(result) Into(result)
return return
} }
// GetScale takes name of the deployment, and returns the corresponding autoscaling.Scale object, and an error if there is any.
func (c *deployments) GetScale(deploymentName string, options v1.GetOptions) (result *autoscaling.Scale, err error) {
result = &autoscaling.Scale{}
err = c.client.Get().
Namespace(c.ns).
Resource("deployments").
Name(deploymentName).
SubResource("scale").
VersionedParams(&options, scheme.ParameterCodec).
Do().
Into(result)
return
}
// UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.
func (c *deployments) UpdateScale(deploymentName string, scale *autoscaling.Scale) (result *autoscaling.Scale, err error) {
result = &autoscaling.Scale{}
err = c.client.Put().
Namespace(c.ns).
Resource("deployments").
Name(deploymentName).
SubResource("scale").
Body(scale).
Do().
Into(result)
return
}
...@@ -11,12 +11,14 @@ go_library( ...@@ -11,12 +11,14 @@ go_library(
"doc.go", "doc.go",
"fake_apps_client.go", "fake_apps_client.go",
"fake_controllerrevision.go", "fake_controllerrevision.go",
"fake_daemonset.go",
"fake_deployment.go",
"fake_replicaset.go",
"fake_statefulset.go", "fake_statefulset.go",
], ],
importpath = "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/apps/internalversion/fake", importpath = "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/apps/internalversion/fake",
deps = [ deps = [
"//pkg/apis/apps:go_default_library", "//pkg/apis/apps:go_default_library",
"//pkg/apis/autoscaling:go_default_library",
"//pkg/client/clientset_generated/internalclientset/typed/apps/internalversion:go_default_library", "//pkg/client/clientset_generated/internalclientset/typed/apps/internalversion:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/labels:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/labels:go_default_library",
......
...@@ -32,6 +32,18 @@ func (c *FakeApps) ControllerRevisions(namespace string) internalversion.Control ...@@ -32,6 +32,18 @@ func (c *FakeApps) ControllerRevisions(namespace string) internalversion.Control
return &FakeControllerRevisions{c, namespace} return &FakeControllerRevisions{c, namespace}
} }
func (c *FakeApps) DaemonSets(namespace string) internalversion.DaemonSetInterface {
return &FakeDaemonSets{c, namespace}
}
func (c *FakeApps) Deployments(namespace string) internalversion.DeploymentInterface {
return &FakeDeployments{c, namespace}
}
func (c *FakeApps) ReplicaSets(namespace string) internalversion.ReplicaSetInterface {
return &FakeReplicaSets{c, namespace}
}
func (c *FakeApps) StatefulSets(namespace string) internalversion.StatefulSetInterface { func (c *FakeApps) StatefulSets(namespace string) internalversion.StatefulSetInterface {
return &FakeStatefulSets{c, namespace} return &FakeStatefulSets{c, namespace}
} }
......
...@@ -25,34 +25,34 @@ import ( ...@@ -25,34 +25,34 @@ import (
types "k8s.io/apimachinery/pkg/types" types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch" watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing" testing "k8s.io/client-go/testing"
extensions "k8s.io/kubernetes/pkg/apis/extensions" apps "k8s.io/kubernetes/pkg/apis/apps"
) )
// FakeDaemonSets implements DaemonSetInterface // FakeDaemonSets implements DaemonSetInterface
type FakeDaemonSets struct { type FakeDaemonSets struct {
Fake *FakeExtensions Fake *FakeApps
ns string ns string
} }
var daemonsetsResource = schema.GroupVersionResource{Group: "extensions", Version: "", Resource: "daemonsets"} var daemonsetsResource = schema.GroupVersionResource{Group: "apps", Version: "", Resource: "daemonsets"}
var daemonsetsKind = schema.GroupVersionKind{Group: "extensions", Version: "", Kind: "DaemonSet"} var daemonsetsKind = schema.GroupVersionKind{Group: "apps", Version: "", Kind: "DaemonSet"}
// Get takes name of the daemonSet, and returns the corresponding daemonSet object, and an error if there is any. // Get takes name of the daemonSet, and returns the corresponding daemonSet object, and an error if there is any.
func (c *FakeDaemonSets) Get(name string, options v1.GetOptions) (result *extensions.DaemonSet, err error) { func (c *FakeDaemonSets) Get(name string, options v1.GetOptions) (result *apps.DaemonSet, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewGetAction(daemonsetsResource, c.ns, name), &extensions.DaemonSet{}) Invokes(testing.NewGetAction(daemonsetsResource, c.ns, name), &apps.DaemonSet{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*extensions.DaemonSet), err return obj.(*apps.DaemonSet), err
} }
// List takes label and field selectors, and returns the list of DaemonSets that match those selectors. // List takes label and field selectors, and returns the list of DaemonSets that match those selectors.
func (c *FakeDaemonSets) List(opts v1.ListOptions) (result *extensions.DaemonSetList, err error) { func (c *FakeDaemonSets) List(opts v1.ListOptions) (result *apps.DaemonSetList, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewListAction(daemonsetsResource, daemonsetsKind, c.ns, opts), &extensions.DaemonSetList{}) Invokes(testing.NewListAction(daemonsetsResource, daemonsetsKind, c.ns, opts), &apps.DaemonSetList{})
if obj == nil { if obj == nil {
return nil, err return nil, err
...@@ -62,8 +62,8 @@ func (c *FakeDaemonSets) List(opts v1.ListOptions) (result *extensions.DaemonSet ...@@ -62,8 +62,8 @@ func (c *FakeDaemonSets) List(opts v1.ListOptions) (result *extensions.DaemonSet
if label == nil { if label == nil {
label = labels.Everything() label = labels.Everything()
} }
list := &extensions.DaemonSetList{ListMeta: obj.(*extensions.DaemonSetList).ListMeta} list := &apps.DaemonSetList{ListMeta: obj.(*apps.DaemonSetList).ListMeta}
for _, item := range obj.(*extensions.DaemonSetList).Items { for _, item := range obj.(*apps.DaemonSetList).Items {
if label.Matches(labels.Set(item.Labels)) { if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item) list.Items = append(list.Items, item)
} }
...@@ -79,43 +79,43 @@ func (c *FakeDaemonSets) Watch(opts v1.ListOptions) (watch.Interface, error) { ...@@ -79,43 +79,43 @@ func (c *FakeDaemonSets) Watch(opts v1.ListOptions) (watch.Interface, error) {
} }
// Create takes the representation of a daemonSet and creates it. Returns the server's representation of the daemonSet, and an error, if there is any. // Create takes the representation of a daemonSet and creates it. Returns the server's representation of the daemonSet, and an error, if there is any.
func (c *FakeDaemonSets) Create(daemonSet *extensions.DaemonSet) (result *extensions.DaemonSet, err error) { func (c *FakeDaemonSets) Create(daemonSet *apps.DaemonSet) (result *apps.DaemonSet, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewCreateAction(daemonsetsResource, c.ns, daemonSet), &extensions.DaemonSet{}) Invokes(testing.NewCreateAction(daemonsetsResource, c.ns, daemonSet), &apps.DaemonSet{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*extensions.DaemonSet), err return obj.(*apps.DaemonSet), err
} }
// Update takes the representation of a daemonSet and updates it. Returns the server's representation of the daemonSet, and an error, if there is any. // Update takes the representation of a daemonSet and updates it. Returns the server's representation of the daemonSet, and an error, if there is any.
func (c *FakeDaemonSets) Update(daemonSet *extensions.DaemonSet) (result *extensions.DaemonSet, err error) { func (c *FakeDaemonSets) Update(daemonSet *apps.DaemonSet) (result *apps.DaemonSet, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewUpdateAction(daemonsetsResource, c.ns, daemonSet), &extensions.DaemonSet{}) Invokes(testing.NewUpdateAction(daemonsetsResource, c.ns, daemonSet), &apps.DaemonSet{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*extensions.DaemonSet), err return obj.(*apps.DaemonSet), err
} }
// UpdateStatus was generated because the type contains a Status member. // UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeDaemonSets) UpdateStatus(daemonSet *extensions.DaemonSet) (*extensions.DaemonSet, error) { func (c *FakeDaemonSets) UpdateStatus(daemonSet *apps.DaemonSet) (*apps.DaemonSet, error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(daemonsetsResource, "status", c.ns, daemonSet), &extensions.DaemonSet{}) Invokes(testing.NewUpdateSubresourceAction(daemonsetsResource, "status", c.ns, daemonSet), &apps.DaemonSet{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*extensions.DaemonSet), err return obj.(*apps.DaemonSet), err
} }
// Delete takes name of the daemonSet and deletes it. Returns an error if one occurs. // Delete takes name of the daemonSet and deletes it. Returns an error if one occurs.
func (c *FakeDaemonSets) Delete(name string, options *v1.DeleteOptions) error { func (c *FakeDaemonSets) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake. _, err := c.Fake.
Invokes(testing.NewDeleteAction(daemonsetsResource, c.ns, name), &extensions.DaemonSet{}) Invokes(testing.NewDeleteAction(daemonsetsResource, c.ns, name), &apps.DaemonSet{})
return err return err
} }
...@@ -124,17 +124,17 @@ func (c *FakeDaemonSets) Delete(name string, options *v1.DeleteOptions) error { ...@@ -124,17 +124,17 @@ func (c *FakeDaemonSets) Delete(name string, options *v1.DeleteOptions) error {
func (c *FakeDaemonSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { func (c *FakeDaemonSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(daemonsetsResource, c.ns, listOptions) action := testing.NewDeleteCollectionAction(daemonsetsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &extensions.DaemonSetList{}) _, err := c.Fake.Invokes(action, &apps.DaemonSetList{})
return err return err
} }
// Patch applies the patch and returns the patched daemonSet. // Patch applies the patch and returns the patched daemonSet.
func (c *FakeDaemonSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *extensions.DaemonSet, err error) { func (c *FakeDaemonSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *apps.DaemonSet, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, name, pt, data, subresources...), &extensions.DaemonSet{}) Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, name, pt, data, subresources...), &apps.DaemonSet{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*extensions.DaemonSet), err return obj.(*apps.DaemonSet), err
} }
...@@ -25,35 +25,34 @@ import ( ...@@ -25,35 +25,34 @@ import (
types "k8s.io/apimachinery/pkg/types" types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch" watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing" testing "k8s.io/client-go/testing"
autoscaling "k8s.io/kubernetes/pkg/apis/autoscaling" apps "k8s.io/kubernetes/pkg/apis/apps"
extensions "k8s.io/kubernetes/pkg/apis/extensions"
) )
// FakeDeployments implements DeploymentInterface // FakeDeployments implements DeploymentInterface
type FakeDeployments struct { type FakeDeployments struct {
Fake *FakeExtensions Fake *FakeApps
ns string ns string
} }
var deploymentsResource = schema.GroupVersionResource{Group: "extensions", Version: "", Resource: "deployments"} var deploymentsResource = schema.GroupVersionResource{Group: "apps", Version: "", Resource: "deployments"}
var deploymentsKind = schema.GroupVersionKind{Group: "extensions", Version: "", Kind: "Deployment"} var deploymentsKind = schema.GroupVersionKind{Group: "apps", Version: "", Kind: "Deployment"}
// 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 *FakeDeployments) Get(name string, options v1.GetOptions) (result *extensions.Deployment, err error) { func (c *FakeDeployments) Get(name string, options v1.GetOptions) (result *apps.Deployment, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewGetAction(deploymentsResource, c.ns, name), &extensions.Deployment{}) Invokes(testing.NewGetAction(deploymentsResource, c.ns, name), &apps.Deployment{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*extensions.Deployment), err return obj.(*apps.Deployment), err
} }
// 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 *FakeDeployments) List(opts v1.ListOptions) (result *extensions.DeploymentList, err error) { func (c *FakeDeployments) List(opts v1.ListOptions) (result *apps.DeploymentList, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewListAction(deploymentsResource, deploymentsKind, c.ns, opts), &extensions.DeploymentList{}) Invokes(testing.NewListAction(deploymentsResource, deploymentsKind, c.ns, opts), &apps.DeploymentList{})
if obj == nil { if obj == nil {
return nil, err return nil, err
...@@ -63,8 +62,8 @@ func (c *FakeDeployments) List(opts v1.ListOptions) (result *extensions.Deployme ...@@ -63,8 +62,8 @@ func (c *FakeDeployments) List(opts v1.ListOptions) (result *extensions.Deployme
if label == nil { if label == nil {
label = labels.Everything() label = labels.Everything()
} }
list := &extensions.DeploymentList{ListMeta: obj.(*extensions.DeploymentList).ListMeta} list := &apps.DeploymentList{ListMeta: obj.(*apps.DeploymentList).ListMeta}
for _, item := range obj.(*extensions.DeploymentList).Items { for _, item := range obj.(*apps.DeploymentList).Items {
if label.Matches(labels.Set(item.Labels)) { if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item) list.Items = append(list.Items, item)
} }
...@@ -80,43 +79,43 @@ func (c *FakeDeployments) Watch(opts v1.ListOptions) (watch.Interface, error) { ...@@ -80,43 +79,43 @@ func (c *FakeDeployments) Watch(opts v1.ListOptions) (watch.Interface, 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 *FakeDeployments) Create(deployment *extensions.Deployment) (result *extensions.Deployment, err error) { func (c *FakeDeployments) Create(deployment *apps.Deployment) (result *apps.Deployment, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewCreateAction(deploymentsResource, c.ns, deployment), &extensions.Deployment{}) Invokes(testing.NewCreateAction(deploymentsResource, c.ns, deployment), &apps.Deployment{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*extensions.Deployment), err return obj.(*apps.Deployment), err
} }
// 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 *FakeDeployments) Update(deployment *extensions.Deployment) (result *extensions.Deployment, err error) { func (c *FakeDeployments) Update(deployment *apps.Deployment) (result *apps.Deployment, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewUpdateAction(deploymentsResource, c.ns, deployment), &extensions.Deployment{}) Invokes(testing.NewUpdateAction(deploymentsResource, c.ns, deployment), &apps.Deployment{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*extensions.Deployment), err return obj.(*apps.Deployment), err
} }
// UpdateStatus was generated because the type contains a Status member. // UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeDeployments) UpdateStatus(deployment *extensions.Deployment) (*extensions.Deployment, error) { func (c *FakeDeployments) UpdateStatus(deployment *apps.Deployment) (*apps.Deployment, error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(deploymentsResource, "status", c.ns, deployment), &extensions.Deployment{}) Invokes(testing.NewUpdateSubresourceAction(deploymentsResource, "status", c.ns, deployment), &apps.Deployment{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*extensions.Deployment), err return obj.(*apps.Deployment), err
} }
// Delete takes name of the deployment and deletes it. Returns an error if one occurs. // Delete takes name of the deployment and deletes it. Returns an error if one occurs.
func (c *FakeDeployments) Delete(name string, options *v1.DeleteOptions) error { func (c *FakeDeployments) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake. _, err := c.Fake.
Invokes(testing.NewDeleteAction(deploymentsResource, c.ns, name), &extensions.Deployment{}) Invokes(testing.NewDeleteAction(deploymentsResource, c.ns, name), &apps.Deployment{})
return err return err
} }
...@@ -125,39 +124,17 @@ func (c *FakeDeployments) Delete(name string, options *v1.DeleteOptions) error { ...@@ -125,39 +124,17 @@ func (c *FakeDeployments) Delete(name string, options *v1.DeleteOptions) error {
func (c *FakeDeployments) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { func (c *FakeDeployments) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(deploymentsResource, c.ns, listOptions) action := testing.NewDeleteCollectionAction(deploymentsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &extensions.DeploymentList{}) _, err := c.Fake.Invokes(action, &apps.DeploymentList{})
return err return err
} }
// Patch applies the patch and returns the patched deployment. // Patch applies the patch and returns the patched deployment.
func (c *FakeDeployments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *extensions.Deployment, err error) { func (c *FakeDeployments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *apps.Deployment, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, name, pt, data, subresources...), &extensions.Deployment{}) Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, name, pt, data, subresources...), &apps.Deployment{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*extensions.Deployment), err return obj.(*apps.Deployment), err
}
// GetScale takes name of the deployment, and returns the corresponding scale object, and an error if there is any.
func (c *FakeDeployments) GetScale(deploymentName string, options v1.GetOptions) (result *autoscaling.Scale, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetSubresourceAction(deploymentsResource, c.ns, "scale", deploymentName), &autoscaling.Scale{})
if obj == nil {
return nil, err
}
return obj.(*autoscaling.Scale), err
}
// UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.
func (c *FakeDeployments) UpdateScale(deploymentName string, scale *autoscaling.Scale) (result *autoscaling.Scale, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(deploymentsResource, "scale", c.ns, scale), &autoscaling.Scale{})
if obj == nil {
return nil, err
}
return obj.(*autoscaling.Scale), err
} }
...@@ -25,35 +25,34 @@ import ( ...@@ -25,35 +25,34 @@ import (
types "k8s.io/apimachinery/pkg/types" types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch" watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing" testing "k8s.io/client-go/testing"
autoscaling "k8s.io/kubernetes/pkg/apis/autoscaling" apps "k8s.io/kubernetes/pkg/apis/apps"
extensions "k8s.io/kubernetes/pkg/apis/extensions"
) )
// FakeReplicaSets implements ReplicaSetInterface // FakeReplicaSets implements ReplicaSetInterface
type FakeReplicaSets struct { type FakeReplicaSets struct {
Fake *FakeExtensions Fake *FakeApps
ns string ns string
} }
var replicasetsResource = schema.GroupVersionResource{Group: "extensions", Version: "", Resource: "replicasets"} var replicasetsResource = schema.GroupVersionResource{Group: "apps", Version: "", Resource: "replicasets"}
var replicasetsKind = schema.GroupVersionKind{Group: "extensions", Version: "", Kind: "ReplicaSet"} var replicasetsKind = schema.GroupVersionKind{Group: "apps", Version: "", Kind: "ReplicaSet"}
// Get takes name of the replicaSet, and returns the corresponding replicaSet object, and an error if there is any. // Get takes name of the replicaSet, and returns the corresponding replicaSet object, and an error if there is any.
func (c *FakeReplicaSets) Get(name string, options v1.GetOptions) (result *extensions.ReplicaSet, err error) { func (c *FakeReplicaSets) Get(name string, options v1.GetOptions) (result *apps.ReplicaSet, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewGetAction(replicasetsResource, c.ns, name), &extensions.ReplicaSet{}) Invokes(testing.NewGetAction(replicasetsResource, c.ns, name), &apps.ReplicaSet{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*extensions.ReplicaSet), err return obj.(*apps.ReplicaSet), err
} }
// List takes label and field selectors, and returns the list of ReplicaSets that match those selectors. // List takes label and field selectors, and returns the list of ReplicaSets that match those selectors.
func (c *FakeReplicaSets) List(opts v1.ListOptions) (result *extensions.ReplicaSetList, err error) { func (c *FakeReplicaSets) List(opts v1.ListOptions) (result *apps.ReplicaSetList, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewListAction(replicasetsResource, replicasetsKind, c.ns, opts), &extensions.ReplicaSetList{}) Invokes(testing.NewListAction(replicasetsResource, replicasetsKind, c.ns, opts), &apps.ReplicaSetList{})
if obj == nil { if obj == nil {
return nil, err return nil, err
...@@ -63,8 +62,8 @@ func (c *FakeReplicaSets) List(opts v1.ListOptions) (result *extensions.ReplicaS ...@@ -63,8 +62,8 @@ func (c *FakeReplicaSets) List(opts v1.ListOptions) (result *extensions.ReplicaS
if label == nil { if label == nil {
label = labels.Everything() label = labels.Everything()
} }
list := &extensions.ReplicaSetList{ListMeta: obj.(*extensions.ReplicaSetList).ListMeta} list := &apps.ReplicaSetList{ListMeta: obj.(*apps.ReplicaSetList).ListMeta}
for _, item := range obj.(*extensions.ReplicaSetList).Items { for _, item := range obj.(*apps.ReplicaSetList).Items {
if label.Matches(labels.Set(item.Labels)) { if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item) list.Items = append(list.Items, item)
} }
...@@ -80,43 +79,43 @@ func (c *FakeReplicaSets) Watch(opts v1.ListOptions) (watch.Interface, error) { ...@@ -80,43 +79,43 @@ func (c *FakeReplicaSets) Watch(opts v1.ListOptions) (watch.Interface, error) {
} }
// Create takes the representation of a replicaSet and creates it. Returns the server's representation of the replicaSet, and an error, if there is any. // Create takes the representation of a replicaSet and creates it. Returns the server's representation of the replicaSet, and an error, if there is any.
func (c *FakeReplicaSets) Create(replicaSet *extensions.ReplicaSet) (result *extensions.ReplicaSet, err error) { func (c *FakeReplicaSets) Create(replicaSet *apps.ReplicaSet) (result *apps.ReplicaSet, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewCreateAction(replicasetsResource, c.ns, replicaSet), &extensions.ReplicaSet{}) Invokes(testing.NewCreateAction(replicasetsResource, c.ns, replicaSet), &apps.ReplicaSet{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*extensions.ReplicaSet), err return obj.(*apps.ReplicaSet), err
} }
// Update takes the representation of a replicaSet and updates it. Returns the server's representation of the replicaSet, and an error, if there is any. // Update takes the representation of a replicaSet and updates it. Returns the server's representation of the replicaSet, and an error, if there is any.
func (c *FakeReplicaSets) Update(replicaSet *extensions.ReplicaSet) (result *extensions.ReplicaSet, err error) { func (c *FakeReplicaSets) Update(replicaSet *apps.ReplicaSet) (result *apps.ReplicaSet, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewUpdateAction(replicasetsResource, c.ns, replicaSet), &extensions.ReplicaSet{}) Invokes(testing.NewUpdateAction(replicasetsResource, c.ns, replicaSet), &apps.ReplicaSet{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*extensions.ReplicaSet), err return obj.(*apps.ReplicaSet), err
} }
// UpdateStatus was generated because the type contains a Status member. // UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeReplicaSets) UpdateStatus(replicaSet *extensions.ReplicaSet) (*extensions.ReplicaSet, error) { func (c *FakeReplicaSets) UpdateStatus(replicaSet *apps.ReplicaSet) (*apps.ReplicaSet, error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(replicasetsResource, "status", c.ns, replicaSet), &extensions.ReplicaSet{}) Invokes(testing.NewUpdateSubresourceAction(replicasetsResource, "status", c.ns, replicaSet), &apps.ReplicaSet{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*extensions.ReplicaSet), err return obj.(*apps.ReplicaSet), err
} }
// Delete takes name of the replicaSet and deletes it. Returns an error if one occurs. // Delete takes name of the replicaSet and deletes it. Returns an error if one occurs.
func (c *FakeReplicaSets) Delete(name string, options *v1.DeleteOptions) error { func (c *FakeReplicaSets) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake. _, err := c.Fake.
Invokes(testing.NewDeleteAction(replicasetsResource, c.ns, name), &extensions.ReplicaSet{}) Invokes(testing.NewDeleteAction(replicasetsResource, c.ns, name), &apps.ReplicaSet{})
return err return err
} }
...@@ -125,39 +124,17 @@ func (c *FakeReplicaSets) Delete(name string, options *v1.DeleteOptions) error { ...@@ -125,39 +124,17 @@ func (c *FakeReplicaSets) Delete(name string, options *v1.DeleteOptions) error {
func (c *FakeReplicaSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { func (c *FakeReplicaSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(replicasetsResource, c.ns, listOptions) action := testing.NewDeleteCollectionAction(replicasetsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &extensions.ReplicaSetList{}) _, err := c.Fake.Invokes(action, &apps.ReplicaSetList{})
return err return err
} }
// Patch applies the patch and returns the patched replicaSet. // Patch applies the patch and returns the patched replicaSet.
func (c *FakeReplicaSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *extensions.ReplicaSet, err error) { func (c *FakeReplicaSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *apps.ReplicaSet, err error) {
obj, err := c.Fake. obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, name, pt, data, subresources...), &extensions.ReplicaSet{}) Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, name, pt, data, subresources...), &apps.ReplicaSet{})
if obj == nil { if obj == nil {
return nil, err return nil, err
} }
return obj.(*extensions.ReplicaSet), err return obj.(*apps.ReplicaSet), err
}
// GetScale takes name of the replicaSet, and returns the corresponding scale object, and an error if there is any.
func (c *FakeReplicaSets) GetScale(replicaSetName string, options v1.GetOptions) (result *autoscaling.Scale, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetSubresourceAction(replicasetsResource, c.ns, "scale", replicaSetName), &autoscaling.Scale{})
if obj == nil {
return nil, err
}
return obj.(*autoscaling.Scale), err
}
// UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.
func (c *FakeReplicaSets) UpdateScale(replicaSetName string, scale *autoscaling.Scale) (result *autoscaling.Scale, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(replicasetsResource, "scale", c.ns, scale), &autoscaling.Scale{})
if obj == nil {
return nil, err
}
return obj.(*autoscaling.Scale), err
} }
...@@ -26,7 +26,6 @@ import ( ...@@ -26,7 +26,6 @@ import (
watch "k8s.io/apimachinery/pkg/watch" watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing" testing "k8s.io/client-go/testing"
apps "k8s.io/kubernetes/pkg/apis/apps" apps "k8s.io/kubernetes/pkg/apis/apps"
autoscaling "k8s.io/kubernetes/pkg/apis/autoscaling"
) )
// FakeStatefulSets implements StatefulSetInterface // FakeStatefulSets implements StatefulSetInterface
...@@ -139,25 +138,3 @@ func (c *FakeStatefulSets) Patch(name string, pt types.PatchType, data []byte, s ...@@ -139,25 +138,3 @@ func (c *FakeStatefulSets) Patch(name string, pt types.PatchType, data []byte, s
} }
return obj.(*apps.StatefulSet), err return obj.(*apps.StatefulSet), err
} }
// GetScale takes name of the statefulSet, and returns the corresponding scale object, and an error if there is any.
func (c *FakeStatefulSets) GetScale(statefulSetName string, options v1.GetOptions) (result *autoscaling.Scale, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetSubresourceAction(statefulsetsResource, c.ns, "scale", statefulSetName), &autoscaling.Scale{})
if obj == nil {
return nil, err
}
return obj.(*autoscaling.Scale), err
}
// UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.
func (c *FakeStatefulSets) UpdateScale(statefulSetName string, scale *autoscaling.Scale) (result *autoscaling.Scale, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(statefulsetsResource, "scale", c.ns, scale), &autoscaling.Scale{})
if obj == nil {
return nil, err
}
return obj.(*autoscaling.Scale), err
}
...@@ -20,4 +20,10 @@ package internalversion ...@@ -20,4 +20,10 @@ package internalversion
type ControllerRevisionExpansion interface{} type ControllerRevisionExpansion interface{}
type DaemonSetExpansion interface{}
type DeploymentExpansion interface{}
type ReplicaSetExpansion interface{}
type StatefulSetExpansion interface{} type StatefulSetExpansion interface{}
...@@ -23,8 +23,7 @@ import ( ...@@ -23,8 +23,7 @@ import (
types "k8s.io/apimachinery/pkg/types" types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch" watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest" rest "k8s.io/client-go/rest"
autoscaling "k8s.io/kubernetes/pkg/apis/autoscaling" apps "k8s.io/kubernetes/pkg/apis/apps"
extensions "k8s.io/kubernetes/pkg/apis/extensions"
scheme "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/scheme" scheme "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/scheme"
) )
...@@ -36,18 +35,15 @@ type ReplicaSetsGetter interface { ...@@ -36,18 +35,15 @@ type ReplicaSetsGetter interface {
// ReplicaSetInterface has methods to work with ReplicaSet resources. // ReplicaSetInterface has methods to work with ReplicaSet resources.
type ReplicaSetInterface interface { type ReplicaSetInterface interface {
Create(*extensions.ReplicaSet) (*extensions.ReplicaSet, error) Create(*apps.ReplicaSet) (*apps.ReplicaSet, error)
Update(*extensions.ReplicaSet) (*extensions.ReplicaSet, error) Update(*apps.ReplicaSet) (*apps.ReplicaSet, error)
UpdateStatus(*extensions.ReplicaSet) (*extensions.ReplicaSet, error) UpdateStatus(*apps.ReplicaSet) (*apps.ReplicaSet, error)
Delete(name string, options *v1.DeleteOptions) error Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string, options v1.GetOptions) (*extensions.ReplicaSet, error) Get(name string, options v1.GetOptions) (*apps.ReplicaSet, error)
List(opts v1.ListOptions) (*extensions.ReplicaSetList, error) List(opts v1.ListOptions) (*apps.ReplicaSetList, error)
Watch(opts v1.ListOptions) (watch.Interface, error) Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *extensions.ReplicaSet, err error) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *apps.ReplicaSet, err error)
GetScale(replicaSetName string, options v1.GetOptions) (*autoscaling.Scale, error)
UpdateScale(replicaSetName string, scale *autoscaling.Scale) (*autoscaling.Scale, error)
ReplicaSetExpansion ReplicaSetExpansion
} }
...@@ -58,7 +54,7 @@ type replicaSets struct { ...@@ -58,7 +54,7 @@ type replicaSets struct {
} }
// newReplicaSets returns a ReplicaSets // newReplicaSets returns a ReplicaSets
func newReplicaSets(c *ExtensionsClient, namespace string) *replicaSets { func newReplicaSets(c *AppsClient, namespace string) *replicaSets {
return &replicaSets{ return &replicaSets{
client: c.RESTClient(), client: c.RESTClient(),
ns: namespace, ns: namespace,
...@@ -66,8 +62,8 @@ func newReplicaSets(c *ExtensionsClient, namespace string) *replicaSets { ...@@ -66,8 +62,8 @@ func newReplicaSets(c *ExtensionsClient, namespace string) *replicaSets {
} }
// Get takes name of the replicaSet, and returns the corresponding replicaSet object, and an error if there is any. // Get takes name of the replicaSet, and returns the corresponding replicaSet object, and an error if there is any.
func (c *replicaSets) Get(name string, options v1.GetOptions) (result *extensions.ReplicaSet, err error) { func (c *replicaSets) Get(name string, options v1.GetOptions) (result *apps.ReplicaSet, err error) {
result = &extensions.ReplicaSet{} result = &apps.ReplicaSet{}
err = c.client.Get(). err = c.client.Get().
Namespace(c.ns). Namespace(c.ns).
Resource("replicasets"). Resource("replicasets").
...@@ -79,8 +75,8 @@ func (c *replicaSets) Get(name string, options v1.GetOptions) (result *extension ...@@ -79,8 +75,8 @@ func (c *replicaSets) Get(name string, options v1.GetOptions) (result *extension
} }
// List takes label and field selectors, and returns the list of ReplicaSets that match those selectors. // List takes label and field selectors, and returns the list of ReplicaSets that match those selectors.
func (c *replicaSets) List(opts v1.ListOptions) (result *extensions.ReplicaSetList, err error) { func (c *replicaSets) List(opts v1.ListOptions) (result *apps.ReplicaSetList, err error) {
result = &extensions.ReplicaSetList{} result = &apps.ReplicaSetList{}
err = c.client.Get(). err = c.client.Get().
Namespace(c.ns). Namespace(c.ns).
Resource("replicasets"). Resource("replicasets").
...@@ -101,8 +97,8 @@ func (c *replicaSets) Watch(opts v1.ListOptions) (watch.Interface, error) { ...@@ -101,8 +97,8 @@ func (c *replicaSets) Watch(opts v1.ListOptions) (watch.Interface, error) {
} }
// Create takes the representation of a replicaSet and creates it. Returns the server's representation of the replicaSet, and an error, if there is any. // Create takes the representation of a replicaSet and creates it. Returns the server's representation of the replicaSet, and an error, if there is any.
func (c *replicaSets) Create(replicaSet *extensions.ReplicaSet) (result *extensions.ReplicaSet, err error) { func (c *replicaSets) Create(replicaSet *apps.ReplicaSet) (result *apps.ReplicaSet, err error) {
result = &extensions.ReplicaSet{} result = &apps.ReplicaSet{}
err = c.client.Post(). err = c.client.Post().
Namespace(c.ns). Namespace(c.ns).
Resource("replicasets"). Resource("replicasets").
...@@ -113,8 +109,8 @@ func (c *replicaSets) Create(replicaSet *extensions.ReplicaSet) (result *extensi ...@@ -113,8 +109,8 @@ func (c *replicaSets) Create(replicaSet *extensions.ReplicaSet) (result *extensi
} }
// Update takes the representation of a replicaSet and updates it. Returns the server's representation of the replicaSet, and an error, if there is any. // Update takes the representation of a replicaSet and updates it. Returns the server's representation of the replicaSet, and an error, if there is any.
func (c *replicaSets) Update(replicaSet *extensions.ReplicaSet) (result *extensions.ReplicaSet, err error) { func (c *replicaSets) Update(replicaSet *apps.ReplicaSet) (result *apps.ReplicaSet, err error) {
result = &extensions.ReplicaSet{} result = &apps.ReplicaSet{}
err = c.client.Put(). err = c.client.Put().
Namespace(c.ns). Namespace(c.ns).
Resource("replicasets"). Resource("replicasets").
...@@ -128,8 +124,8 @@ func (c *replicaSets) Update(replicaSet *extensions.ReplicaSet) (result *extensi ...@@ -128,8 +124,8 @@ func (c *replicaSets) Update(replicaSet *extensions.ReplicaSet) (result *extensi
// UpdateStatus was generated because the type contains a Status member. // UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *replicaSets) UpdateStatus(replicaSet *extensions.ReplicaSet) (result *extensions.ReplicaSet, err error) { func (c *replicaSets) UpdateStatus(replicaSet *apps.ReplicaSet) (result *apps.ReplicaSet, err error) {
result = &extensions.ReplicaSet{} result = &apps.ReplicaSet{}
err = c.client.Put(). err = c.client.Put().
Namespace(c.ns). Namespace(c.ns).
Resource("replicasets"). Resource("replicasets").
...@@ -164,8 +160,8 @@ func (c *replicaSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1 ...@@ -164,8 +160,8 @@ func (c *replicaSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1
} }
// Patch applies the patch and returns the patched replicaSet. // Patch applies the patch and returns the patched replicaSet.
func (c *replicaSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *extensions.ReplicaSet, err error) { func (c *replicaSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *apps.ReplicaSet, err error) {
result = &extensions.ReplicaSet{} result = &apps.ReplicaSet{}
err = c.client.Patch(pt). err = c.client.Patch(pt).
Namespace(c.ns). Namespace(c.ns).
Resource("replicasets"). Resource("replicasets").
...@@ -176,31 +172,3 @@ func (c *replicaSets) Patch(name string, pt types.PatchType, data []byte, subres ...@@ -176,31 +172,3 @@ func (c *replicaSets) Patch(name string, pt types.PatchType, data []byte, subres
Into(result) Into(result)
return return
} }
// GetScale takes name of the replicaSet, and returns the corresponding autoscaling.Scale object, and an error if there is any.
func (c *replicaSets) GetScale(replicaSetName string, options v1.GetOptions) (result *autoscaling.Scale, err error) {
result = &autoscaling.Scale{}
err = c.client.Get().
Namespace(c.ns).
Resource("replicasets").
Name(replicaSetName).
SubResource("scale").
VersionedParams(&options, scheme.ParameterCodec).
Do().
Into(result)
return
}
// UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.
func (c *replicaSets) UpdateScale(replicaSetName string, scale *autoscaling.Scale) (result *autoscaling.Scale, err error) {
result = &autoscaling.Scale{}
err = c.client.Put().
Namespace(c.ns).
Resource("replicasets").
Name(replicaSetName).
SubResource("scale").
Body(scale).
Do().
Into(result)
return
}
...@@ -24,7 +24,6 @@ import ( ...@@ -24,7 +24,6 @@ import (
watch "k8s.io/apimachinery/pkg/watch" watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest" rest "k8s.io/client-go/rest"
apps "k8s.io/kubernetes/pkg/apis/apps" apps "k8s.io/kubernetes/pkg/apis/apps"
autoscaling "k8s.io/kubernetes/pkg/apis/autoscaling"
scheme "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/scheme" scheme "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/scheme"
) )
...@@ -45,9 +44,6 @@ type StatefulSetInterface interface { ...@@ -45,9 +44,6 @@ type StatefulSetInterface interface {
List(opts v1.ListOptions) (*apps.StatefulSetList, error) List(opts v1.ListOptions) (*apps.StatefulSetList, error)
Watch(opts v1.ListOptions) (watch.Interface, error) Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *apps.StatefulSet, err error) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *apps.StatefulSet, err error)
GetScale(statefulSetName string, options v1.GetOptions) (*autoscaling.Scale, error)
UpdateScale(statefulSetName string, scale *autoscaling.Scale) (*autoscaling.Scale, error)
StatefulSetExpansion StatefulSetExpansion
} }
...@@ -176,31 +172,3 @@ func (c *statefulSets) Patch(name string, pt types.PatchType, data []byte, subre ...@@ -176,31 +172,3 @@ func (c *statefulSets) Patch(name string, pt types.PatchType, data []byte, subre
Into(result) Into(result)
return return
} }
// GetScale takes name of the statefulSet, and returns the corresponding autoscaling.Scale object, and an error if there is any.
func (c *statefulSets) GetScale(statefulSetName string, options v1.GetOptions) (result *autoscaling.Scale, err error) {
result = &autoscaling.Scale{}
err = c.client.Get().
Namespace(c.ns).
Resource("statefulsets").
Name(statefulSetName).
SubResource("scale").
VersionedParams(&options, scheme.ParameterCodec).
Do().
Into(result)
return
}
// UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.
func (c *statefulSets) UpdateScale(statefulSetName string, scale *autoscaling.Scale) (result *autoscaling.Scale, err error) {
result = &autoscaling.Scale{}
err = c.client.Put().
Namespace(c.ns).
Resource("statefulsets").
Name(statefulSetName).
SubResource("scale").
Body(scale).
Do().
Into(result)
return
}
...@@ -8,18 +8,13 @@ load( ...@@ -8,18 +8,13 @@ load(
go_library( go_library(
name = "go_default_library", name = "go_default_library",
srcs = [ srcs = [
"daemonset.go",
"deployment.go",
"deployment_expansion.go",
"doc.go", "doc.go",
"extensions_client.go", "extensions_client.go",
"generated_expansion.go", "generated_expansion.go",
"ingress.go", "ingress.go",
"replicaset.go",
], ],
importpath = "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/internalversion", importpath = "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/internalversion",
deps = [ deps = [
"//pkg/apis/autoscaling:go_default_library",
"//pkg/apis/extensions:go_default_library", "//pkg/apis/extensions:go_default_library",
"//pkg/client/clientset_generated/internalclientset/scheme:go_default_library", "//pkg/client/clientset_generated/internalclientset/scheme:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
......
/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package internalversion
import "k8s.io/kubernetes/pkg/apis/extensions"
// The DeploymentExpansion interface allows manually adding extra methods to the DeploymentInterface.
type DeploymentExpansion interface {
Rollback(*extensions.DeploymentRollback) error
}
// Rollback applied the provided DeploymentRollback to the named deployment in the current namespace.
func (c *deployments) Rollback(deploymentRollback *extensions.DeploymentRollback) error {
return c.client.Post().Namespace(c.ns).Resource("deployments").Name(deploymentRollback.Name).SubResource("rollback").Body(deploymentRollback).Do().Error()
}
...@@ -25,10 +25,7 @@ import ( ...@@ -25,10 +25,7 @@ import (
type ExtensionsInterface interface { type ExtensionsInterface interface {
RESTClient() rest.Interface RESTClient() rest.Interface
DaemonSetsGetter
DeploymentsGetter
IngressesGetter IngressesGetter
ReplicaSetsGetter
} }
// ExtensionsClient is used to interact with features provided by the extensions group. // ExtensionsClient is used to interact with features provided by the extensions group.
...@@ -36,22 +33,10 @@ type ExtensionsClient struct { ...@@ -36,22 +33,10 @@ type ExtensionsClient struct {
restClient rest.Interface restClient rest.Interface
} }
func (c *ExtensionsClient) DaemonSets(namespace string) DaemonSetInterface {
return newDaemonSets(c, namespace)
}
func (c *ExtensionsClient) Deployments(namespace string) DeploymentInterface {
return newDeployments(c, namespace)
}
func (c *ExtensionsClient) Ingresses(namespace string) IngressInterface { func (c *ExtensionsClient) Ingresses(namespace string) IngressInterface {
return newIngresses(c, namespace) return newIngresses(c, namespace)
} }
func (c *ExtensionsClient) ReplicaSets(namespace string) ReplicaSetInterface {
return newReplicaSets(c, namespace)
}
// NewForConfig creates a new ExtensionsClient for the given config. // NewForConfig creates a new ExtensionsClient for the given config.
func NewForConfig(c *rest.Config) (*ExtensionsClient, error) { func NewForConfig(c *rest.Config) (*ExtensionsClient, error) {
config := *c config := *c
......
...@@ -9,16 +9,11 @@ go_library( ...@@ -9,16 +9,11 @@ go_library(
name = "go_default_library", name = "go_default_library",
srcs = [ srcs = [
"doc.go", "doc.go",
"fake_daemonset.go",
"fake_deployment.go",
"fake_deployment_expansion.go",
"fake_extensions_client.go", "fake_extensions_client.go",
"fake_ingress.go", "fake_ingress.go",
"fake_replicaset.go",
], ],
importpath = "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/internalversion/fake", importpath = "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/extensions/internalversion/fake",
deps = [ deps = [
"//pkg/apis/autoscaling:go_default_library",
"//pkg/apis/extensions:go_default_library", "//pkg/apis/extensions:go_default_library",
"//pkg/client/clientset_generated/internalclientset/typed/extensions/internalversion:go_default_library", "//pkg/client/clientset_generated/internalclientset/typed/extensions/internalversion:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
......
/*
Copyright 2014 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package fake
import (
core "k8s.io/client-go/testing"
"k8s.io/kubernetes/pkg/apis/extensions"
)
func (c *FakeDeployments) Rollback(deploymentRollback *extensions.DeploymentRollback) error {
action := core.CreateActionImpl{}
action.Verb = "create"
action.Resource = deploymentsResource
action.Subresource = "rollback"
action.Object = deploymentRollback
_, err := c.Fake.Invokes(action, deploymentRollback)
return err
}
...@@ -28,22 +28,10 @@ type FakeExtensions struct { ...@@ -28,22 +28,10 @@ type FakeExtensions struct {
*testing.Fake *testing.Fake
} }
func (c *FakeExtensions) DaemonSets(namespace string) internalversion.DaemonSetInterface {
return &FakeDaemonSets{c, namespace}
}
func (c *FakeExtensions) Deployments(namespace string) internalversion.DeploymentInterface {
return &FakeDeployments{c, namespace}
}
func (c *FakeExtensions) Ingresses(namespace string) internalversion.IngressInterface { func (c *FakeExtensions) Ingresses(namespace string) internalversion.IngressInterface {
return &FakeIngresses{c, namespace} return &FakeIngresses{c, namespace}
} }
func (c *FakeExtensions) ReplicaSets(namespace string) internalversion.ReplicaSetInterface {
return &FakeReplicaSets{c, namespace}
}
// RESTClient returns a RESTClient that is used to communicate // RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation. // with API server by this client implementation.
func (c *FakeExtensions) RESTClient() rest.Interface { func (c *FakeExtensions) RESTClient() rest.Interface {
......
...@@ -18,8 +18,4 @@ limitations under the License. ...@@ -18,8 +18,4 @@ limitations under the License.
package internalversion package internalversion
type DaemonSetExpansion interface{}
type IngressExpansion interface{} type IngressExpansion interface{}
type ReplicaSetExpansion interface{}
...@@ -9,7 +9,10 @@ go_library( ...@@ -9,7 +9,10 @@ go_library(
name = "go_default_library", name = "go_default_library",
srcs = [ srcs = [
"controllerrevision.go", "controllerrevision.go",
"daemonset.go",
"deployment.go",
"interface.go", "interface.go",
"replicaset.go",
"statefulset.go", "statefulset.go",
], ],
importpath = "k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/apps/internalversion", importpath = "k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/apps/internalversion",
......
...@@ -25,10 +25,10 @@ import ( ...@@ -25,10 +25,10 @@ import (
runtime "k8s.io/apimachinery/pkg/runtime" runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch" watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache" cache "k8s.io/client-go/tools/cache"
extensions "k8s.io/kubernetes/pkg/apis/extensions" apps "k8s.io/kubernetes/pkg/apis/apps"
internalclientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" internalclientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
internalinterfaces "k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/internalinterfaces" internalinterfaces "k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/internalinterfaces"
internalversion "k8s.io/kubernetes/pkg/client/listers/extensions/internalversion" internalversion "k8s.io/kubernetes/pkg/client/listers/apps/internalversion"
) )
// DaemonSetInformer provides access to a shared informer and lister for // DaemonSetInformer provides access to a shared informer and lister for
...@@ -61,16 +61,16 @@ func NewFilteredDaemonSetInformer(client internalclientset.Interface, namespace ...@@ -61,16 +61,16 @@ func NewFilteredDaemonSetInformer(client internalclientset.Interface, namespace
if tweakListOptions != nil { if tweakListOptions != nil {
tweakListOptions(&options) tweakListOptions(&options)
} }
return client.Extensions().DaemonSets(namespace).List(options) return client.Apps().DaemonSets(namespace).List(options)
}, },
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil { if tweakListOptions != nil {
tweakListOptions(&options) tweakListOptions(&options)
} }
return client.Extensions().DaemonSets(namespace).Watch(options) return client.Apps().DaemonSets(namespace).Watch(options)
}, },
}, },
&extensions.DaemonSet{}, &apps.DaemonSet{},
resyncPeriod, resyncPeriod,
indexers, indexers,
) )
...@@ -81,7 +81,7 @@ func (f *daemonSetInformer) defaultInformer(client internalclientset.Interface, ...@@ -81,7 +81,7 @@ func (f *daemonSetInformer) defaultInformer(client internalclientset.Interface,
} }
func (f *daemonSetInformer) Informer() cache.SharedIndexInformer { func (f *daemonSetInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&extensions.DaemonSet{}, f.defaultInformer) return f.factory.InformerFor(&apps.DaemonSet{}, f.defaultInformer)
} }
func (f *daemonSetInformer) Lister() internalversion.DaemonSetLister { func (f *daemonSetInformer) Lister() internalversion.DaemonSetLister {
......
...@@ -25,10 +25,10 @@ import ( ...@@ -25,10 +25,10 @@ import (
runtime "k8s.io/apimachinery/pkg/runtime" runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch" watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache" cache "k8s.io/client-go/tools/cache"
extensions "k8s.io/kubernetes/pkg/apis/extensions" apps "k8s.io/kubernetes/pkg/apis/apps"
internalclientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" internalclientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
internalinterfaces "k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/internalinterfaces" internalinterfaces "k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/internalinterfaces"
internalversion "k8s.io/kubernetes/pkg/client/listers/extensions/internalversion" internalversion "k8s.io/kubernetes/pkg/client/listers/apps/internalversion"
) )
// DeploymentInformer provides access to a shared informer and lister for // DeploymentInformer provides access to a shared informer and lister for
...@@ -61,16 +61,16 @@ func NewFilteredDeploymentInformer(client internalclientset.Interface, namespace ...@@ -61,16 +61,16 @@ func NewFilteredDeploymentInformer(client internalclientset.Interface, namespace
if tweakListOptions != nil { if tweakListOptions != nil {
tweakListOptions(&options) tweakListOptions(&options)
} }
return client.Extensions().Deployments(namespace).List(options) return client.Apps().Deployments(namespace).List(options)
}, },
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil { if tweakListOptions != nil {
tweakListOptions(&options) tweakListOptions(&options)
} }
return client.Extensions().Deployments(namespace).Watch(options) return client.Apps().Deployments(namespace).Watch(options)
}, },
}, },
&extensions.Deployment{}, &apps.Deployment{},
resyncPeriod, resyncPeriod,
indexers, indexers,
) )
...@@ -81,7 +81,7 @@ func (f *deploymentInformer) defaultInformer(client internalclientset.Interface, ...@@ -81,7 +81,7 @@ func (f *deploymentInformer) defaultInformer(client internalclientset.Interface,
} }
func (f *deploymentInformer) Informer() cache.SharedIndexInformer { func (f *deploymentInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&extensions.Deployment{}, f.defaultInformer) return f.factory.InformerFor(&apps.Deployment{}, f.defaultInformer)
} }
func (f *deploymentInformer) Lister() internalversion.DeploymentLister { func (f *deploymentInformer) Lister() internalversion.DeploymentLister {
......
...@@ -26,6 +26,12 @@ import ( ...@@ -26,6 +26,12 @@ import (
type Interface interface { type Interface interface {
// ControllerRevisions returns a ControllerRevisionInformer. // ControllerRevisions returns a ControllerRevisionInformer.
ControllerRevisions() ControllerRevisionInformer ControllerRevisions() ControllerRevisionInformer
// DaemonSets returns a DaemonSetInformer.
DaemonSets() DaemonSetInformer
// Deployments returns a DeploymentInformer.
Deployments() DeploymentInformer
// ReplicaSets returns a ReplicaSetInformer.
ReplicaSets() ReplicaSetInformer
// StatefulSets returns a StatefulSetInformer. // StatefulSets returns a StatefulSetInformer.
StatefulSets() StatefulSetInformer StatefulSets() StatefulSetInformer
} }
...@@ -46,6 +52,21 @@ func (v *version) ControllerRevisions() ControllerRevisionInformer { ...@@ -46,6 +52,21 @@ func (v *version) ControllerRevisions() ControllerRevisionInformer {
return &controllerRevisionInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} return &controllerRevisionInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
} }
// DaemonSets returns a DaemonSetInformer.
func (v *version) DaemonSets() DaemonSetInformer {
return &daemonSetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
}
// Deployments returns a DeploymentInformer.
func (v *version) Deployments() DeploymentInformer {
return &deploymentInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
}
// ReplicaSets returns a ReplicaSetInformer.
func (v *version) ReplicaSets() ReplicaSetInformer {
return &replicaSetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
}
// StatefulSets returns a StatefulSetInformer. // StatefulSets returns a StatefulSetInformer.
func (v *version) StatefulSets() StatefulSetInformer { func (v *version) StatefulSets() StatefulSetInformer {
return &statefulSetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} return &statefulSetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
......
...@@ -25,10 +25,10 @@ import ( ...@@ -25,10 +25,10 @@ import (
runtime "k8s.io/apimachinery/pkg/runtime" runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch" watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache" cache "k8s.io/client-go/tools/cache"
extensions "k8s.io/kubernetes/pkg/apis/extensions" apps "k8s.io/kubernetes/pkg/apis/apps"
internalclientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" internalclientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
internalinterfaces "k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/internalinterfaces" internalinterfaces "k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/internalinterfaces"
internalversion "k8s.io/kubernetes/pkg/client/listers/extensions/internalversion" internalversion "k8s.io/kubernetes/pkg/client/listers/apps/internalversion"
) )
// ReplicaSetInformer provides access to a shared informer and lister for // ReplicaSetInformer provides access to a shared informer and lister for
...@@ -61,16 +61,16 @@ func NewFilteredReplicaSetInformer(client internalclientset.Interface, namespace ...@@ -61,16 +61,16 @@ func NewFilteredReplicaSetInformer(client internalclientset.Interface, namespace
if tweakListOptions != nil { if tweakListOptions != nil {
tweakListOptions(&options) tweakListOptions(&options)
} }
return client.Extensions().ReplicaSets(namespace).List(options) return client.Apps().ReplicaSets(namespace).List(options)
}, },
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil { if tweakListOptions != nil {
tweakListOptions(&options) tweakListOptions(&options)
} }
return client.Extensions().ReplicaSets(namespace).Watch(options) return client.Apps().ReplicaSets(namespace).Watch(options)
}, },
}, },
&extensions.ReplicaSet{}, &apps.ReplicaSet{},
resyncPeriod, resyncPeriod,
indexers, indexers,
) )
...@@ -81,7 +81,7 @@ func (f *replicaSetInformer) defaultInformer(client internalclientset.Interface, ...@@ -81,7 +81,7 @@ func (f *replicaSetInformer) defaultInformer(client internalclientset.Interface,
} }
func (f *replicaSetInformer) Informer() cache.SharedIndexInformer { func (f *replicaSetInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&extensions.ReplicaSet{}, f.defaultInformer) return f.factory.InformerFor(&apps.ReplicaSet{}, f.defaultInformer)
} }
func (f *replicaSetInformer) Lister() internalversion.ReplicaSetLister { func (f *replicaSetInformer) Lister() internalversion.ReplicaSetLister {
......
...@@ -8,11 +8,8 @@ load( ...@@ -8,11 +8,8 @@ load(
go_library( go_library(
name = "go_default_library", name = "go_default_library",
srcs = [ srcs = [
"daemonset.go",
"deployment.go",
"ingress.go", "ingress.go",
"interface.go", "interface.go",
"replicaset.go",
], ],
importpath = "k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/extensions/internalversion", importpath = "k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/extensions/internalversion",
deps = [ deps = [
......
...@@ -24,14 +24,8 @@ import ( ...@@ -24,14 +24,8 @@ import (
// Interface provides access to all the informers in this group version. // Interface provides access to all the informers in this group version.
type Interface interface { type Interface interface {
// DaemonSets returns a DaemonSetInformer.
DaemonSets() DaemonSetInformer
// Deployments returns a DeploymentInformer.
Deployments() DeploymentInformer
// Ingresses returns a IngressInformer. // Ingresses returns a IngressInformer.
Ingresses() IngressInformer Ingresses() IngressInformer
// ReplicaSets returns a ReplicaSetInformer.
ReplicaSets() ReplicaSetInformer
} }
type version struct { type version struct {
...@@ -45,22 +39,7 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList ...@@ -45,22 +39,7 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList
return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
} }
// DaemonSets returns a DaemonSetInformer.
func (v *version) DaemonSets() DaemonSetInformer {
return &daemonSetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
}
// Deployments returns a DeploymentInformer.
func (v *version) Deployments() DeploymentInformer {
return &deploymentInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
}
// Ingresses returns a IngressInformer. // Ingresses returns a IngressInformer.
func (v *version) Ingresses() IngressInformer { func (v *version) Ingresses() IngressInformer {
return &ingressInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} return &ingressInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
} }
// ReplicaSets returns a ReplicaSetInformer.
func (v *version) ReplicaSets() ReplicaSetInformer {
return &replicaSetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
}
...@@ -77,6 +77,12 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource ...@@ -77,6 +77,12 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
// Group=apps, Version=internalVersion // Group=apps, Version=internalVersion
case apps.SchemeGroupVersion.WithResource("controllerrevisions"): case apps.SchemeGroupVersion.WithResource("controllerrevisions"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().InternalVersion().ControllerRevisions().Informer()}, nil return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().InternalVersion().ControllerRevisions().Informer()}, nil
case apps.SchemeGroupVersion.WithResource("daemonsets"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().InternalVersion().DaemonSets().Informer()}, nil
case apps.SchemeGroupVersion.WithResource("deployments"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().InternalVersion().Deployments().Informer()}, nil
case apps.SchemeGroupVersion.WithResource("replicasets"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().InternalVersion().ReplicaSets().Informer()}, nil
case apps.SchemeGroupVersion.WithResource("statefulsets"): case apps.SchemeGroupVersion.WithResource("statefulsets"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().InternalVersion().StatefulSets().Informer()}, nil return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().InternalVersion().StatefulSets().Informer()}, nil
...@@ -137,14 +143,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource ...@@ -137,14 +143,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
return &genericInformer{resource: resource.GroupResource(), informer: f.Core().InternalVersion().ServiceAccounts().Informer()}, nil return &genericInformer{resource: resource.GroupResource(), informer: f.Core().InternalVersion().ServiceAccounts().Informer()}, nil
// Group=extensions, Version=internalVersion // Group=extensions, Version=internalVersion
case extensions.SchemeGroupVersion.WithResource("daemonsets"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Extensions().InternalVersion().DaemonSets().Informer()}, nil
case extensions.SchemeGroupVersion.WithResource("deployments"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Extensions().InternalVersion().Deployments().Informer()}, nil
case extensions.SchemeGroupVersion.WithResource("ingresses"): case extensions.SchemeGroupVersion.WithResource("ingresses"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Extensions().InternalVersion().Ingresses().Informer()}, nil return &genericInformer{resource: resource.GroupResource(), informer: f.Extensions().InternalVersion().Ingresses().Informer()}, nil
case extensions.SchemeGroupVersion.WithResource("replicasets"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Extensions().InternalVersion().ReplicaSets().Informer()}, nil
// Group=networking.k8s.io, Version=internalVersion // Group=networking.k8s.io, Version=internalVersion
case networking.SchemeGroupVersion.WithResource("networkpolicies"): case networking.SchemeGroupVersion.WithResource("networkpolicies"):
......
...@@ -9,7 +9,10 @@ go_library( ...@@ -9,7 +9,10 @@ go_library(
name = "go_default_library", name = "go_default_library",
srcs = [ srcs = [
"controllerrevision.go", "controllerrevision.go",
"daemonset.go",
"deployment.go",
"expansion_generated.go", "expansion_generated.go",
"replicaset.go",
"statefulset.go", "statefulset.go",
"statefulset_expansion.go", "statefulset_expansion.go",
], ],
......
...@@ -22,13 +22,13 @@ import ( ...@@ -22,13 +22,13 @@ import (
"k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache" "k8s.io/client-go/tools/cache"
extensions "k8s.io/kubernetes/pkg/apis/extensions" apps "k8s.io/kubernetes/pkg/apis/apps"
) )
// DaemonSetLister helps list DaemonSets. // DaemonSetLister helps list DaemonSets.
type DaemonSetLister interface { type DaemonSetLister interface {
// List lists all DaemonSets in the indexer. // List lists all DaemonSets in the indexer.
List(selector labels.Selector) (ret []*extensions.DaemonSet, err error) List(selector labels.Selector) (ret []*apps.DaemonSet, err error)
// DaemonSets returns an object that can list and get DaemonSets. // DaemonSets returns an object that can list and get DaemonSets.
DaemonSets(namespace string) DaemonSetNamespaceLister DaemonSets(namespace string) DaemonSetNamespaceLister
DaemonSetListerExpansion DaemonSetListerExpansion
...@@ -45,9 +45,9 @@ func NewDaemonSetLister(indexer cache.Indexer) DaemonSetLister { ...@@ -45,9 +45,9 @@ func NewDaemonSetLister(indexer cache.Indexer) DaemonSetLister {
} }
// List lists all DaemonSets in the indexer. // List lists all DaemonSets in the indexer.
func (s *daemonSetLister) List(selector labels.Selector) (ret []*extensions.DaemonSet, err error) { func (s *daemonSetLister) List(selector labels.Selector) (ret []*apps.DaemonSet, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) { err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*extensions.DaemonSet)) ret = append(ret, m.(*apps.DaemonSet))
}) })
return ret, err return ret, err
} }
...@@ -60,9 +60,9 @@ func (s *daemonSetLister) DaemonSets(namespace string) DaemonSetNamespaceLister ...@@ -60,9 +60,9 @@ func (s *daemonSetLister) DaemonSets(namespace string) DaemonSetNamespaceLister
// DaemonSetNamespaceLister helps list and get DaemonSets. // DaemonSetNamespaceLister helps list and get DaemonSets.
type DaemonSetNamespaceLister interface { type DaemonSetNamespaceLister interface {
// List lists all DaemonSets in the indexer for a given namespace. // List lists all DaemonSets in the indexer for a given namespace.
List(selector labels.Selector) (ret []*extensions.DaemonSet, err error) List(selector labels.Selector) (ret []*apps.DaemonSet, err error)
// Get retrieves the DaemonSet from the indexer for a given namespace and name. // Get retrieves the DaemonSet from the indexer for a given namespace and name.
Get(name string) (*extensions.DaemonSet, error) Get(name string) (*apps.DaemonSet, error)
DaemonSetNamespaceListerExpansion DaemonSetNamespaceListerExpansion
} }
...@@ -74,21 +74,21 @@ type daemonSetNamespaceLister struct { ...@@ -74,21 +74,21 @@ type daemonSetNamespaceLister struct {
} }
// List lists all DaemonSets in the indexer for a given namespace. // List lists all DaemonSets in the indexer for a given namespace.
func (s daemonSetNamespaceLister) List(selector labels.Selector) (ret []*extensions.DaemonSet, err error) { func (s daemonSetNamespaceLister) List(selector labels.Selector) (ret []*apps.DaemonSet, err error) {
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
ret = append(ret, m.(*extensions.DaemonSet)) ret = append(ret, m.(*apps.DaemonSet))
}) })
return ret, err return ret, err
} }
// Get retrieves the DaemonSet from the indexer for a given namespace and name. // Get retrieves the DaemonSet from the indexer for a given namespace and name.
func (s daemonSetNamespaceLister) Get(name string) (*extensions.DaemonSet, error) { func (s daemonSetNamespaceLister) Get(name string) (*apps.DaemonSet, error) {
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
if err != nil { if err != nil {
return nil, err return nil, err
} }
if !exists { if !exists {
return nil, errors.NewNotFound(extensions.Resource("daemonset"), name) return nil, errors.NewNotFound(apps.Resource("daemonset"), name)
} }
return obj.(*extensions.DaemonSet), nil return obj.(*apps.DaemonSet), nil
} }
...@@ -22,13 +22,13 @@ import ( ...@@ -22,13 +22,13 @@ import (
"k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache" "k8s.io/client-go/tools/cache"
extensions "k8s.io/kubernetes/pkg/apis/extensions" apps "k8s.io/kubernetes/pkg/apis/apps"
) )
// DeploymentLister helps list Deployments. // DeploymentLister helps list Deployments.
type DeploymentLister interface { type DeploymentLister interface {
// List lists all Deployments in the indexer. // List lists all Deployments in the indexer.
List(selector labels.Selector) (ret []*extensions.Deployment, err error) List(selector labels.Selector) (ret []*apps.Deployment, err error)
// Deployments returns an object that can list and get Deployments. // Deployments returns an object that can list and get Deployments.
Deployments(namespace string) DeploymentNamespaceLister Deployments(namespace string) DeploymentNamespaceLister
DeploymentListerExpansion DeploymentListerExpansion
...@@ -45,9 +45,9 @@ func NewDeploymentLister(indexer cache.Indexer) DeploymentLister { ...@@ -45,9 +45,9 @@ func NewDeploymentLister(indexer cache.Indexer) DeploymentLister {
} }
// List lists all Deployments in the indexer. // List lists all Deployments in the indexer.
func (s *deploymentLister) List(selector labels.Selector) (ret []*extensions.Deployment, err error) { func (s *deploymentLister) List(selector labels.Selector) (ret []*apps.Deployment, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) { err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*extensions.Deployment)) ret = append(ret, m.(*apps.Deployment))
}) })
return ret, err return ret, err
} }
...@@ -60,9 +60,9 @@ func (s *deploymentLister) Deployments(namespace string) DeploymentNamespaceList ...@@ -60,9 +60,9 @@ func (s *deploymentLister) Deployments(namespace string) DeploymentNamespaceList
// DeploymentNamespaceLister helps list and get Deployments. // DeploymentNamespaceLister helps list and get Deployments.
type DeploymentNamespaceLister interface { type DeploymentNamespaceLister interface {
// List lists all Deployments in the indexer for a given namespace. // List lists all Deployments in the indexer for a given namespace.
List(selector labels.Selector) (ret []*extensions.Deployment, err error) List(selector labels.Selector) (ret []*apps.Deployment, err error)
// Get retrieves the Deployment from the indexer for a given namespace and name. // Get retrieves the Deployment from the indexer for a given namespace and name.
Get(name string) (*extensions.Deployment, error) Get(name string) (*apps.Deployment, error)
DeploymentNamespaceListerExpansion DeploymentNamespaceListerExpansion
} }
...@@ -74,21 +74,21 @@ type deploymentNamespaceLister struct { ...@@ -74,21 +74,21 @@ type deploymentNamespaceLister struct {
} }
// List lists all Deployments in the indexer for a given namespace. // List lists all Deployments in the indexer for a given namespace.
func (s deploymentNamespaceLister) List(selector labels.Selector) (ret []*extensions.Deployment, err error) { func (s deploymentNamespaceLister) List(selector labels.Selector) (ret []*apps.Deployment, err error) {
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
ret = append(ret, m.(*extensions.Deployment)) ret = append(ret, m.(*apps.Deployment))
}) })
return ret, err return ret, err
} }
// Get retrieves the Deployment from the indexer for a given namespace and name. // Get retrieves the Deployment from the indexer for a given namespace and name.
func (s deploymentNamespaceLister) Get(name string) (*extensions.Deployment, error) { func (s deploymentNamespaceLister) Get(name string) (*apps.Deployment, error) {
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
if err != nil { if err != nil {
return nil, err return nil, err
} }
if !exists { if !exists {
return nil, errors.NewNotFound(extensions.Resource("deployment"), name) return nil, errors.NewNotFound(apps.Resource("deployment"), name)
} }
return obj.(*extensions.Deployment), nil return obj.(*apps.Deployment), nil
} }
...@@ -25,3 +25,27 @@ type ControllerRevisionListerExpansion interface{} ...@@ -25,3 +25,27 @@ type ControllerRevisionListerExpansion interface{}
// ControllerRevisionNamespaceListerExpansion allows custom methods to be added to // ControllerRevisionNamespaceListerExpansion allows custom methods to be added to
// ControllerRevisionNamespaceLister. // ControllerRevisionNamespaceLister.
type ControllerRevisionNamespaceListerExpansion interface{} type ControllerRevisionNamespaceListerExpansion interface{}
// DaemonSetListerExpansion allows custom methods to be added to
// DaemonSetLister.
type DaemonSetListerExpansion interface{}
// DaemonSetNamespaceListerExpansion allows custom methods to be added to
// DaemonSetNamespaceLister.
type DaemonSetNamespaceListerExpansion interface{}
// DeploymentListerExpansion allows custom methods to be added to
// DeploymentLister.
type DeploymentListerExpansion interface{}
// DeploymentNamespaceListerExpansion allows custom methods to be added to
// DeploymentNamespaceLister.
type DeploymentNamespaceListerExpansion interface{}
// ReplicaSetListerExpansion allows custom methods to be added to
// ReplicaSetLister.
type ReplicaSetListerExpansion interface{}
// ReplicaSetNamespaceListerExpansion allows custom methods to be added to
// ReplicaSetNamespaceLister.
type ReplicaSetNamespaceListerExpansion interface{}
...@@ -22,13 +22,13 @@ import ( ...@@ -22,13 +22,13 @@ import (
"k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache" "k8s.io/client-go/tools/cache"
extensions "k8s.io/kubernetes/pkg/apis/extensions" apps "k8s.io/kubernetes/pkg/apis/apps"
) )
// ReplicaSetLister helps list ReplicaSets. // ReplicaSetLister helps list ReplicaSets.
type ReplicaSetLister interface { type ReplicaSetLister interface {
// List lists all ReplicaSets in the indexer. // List lists all ReplicaSets in the indexer.
List(selector labels.Selector) (ret []*extensions.ReplicaSet, err error) List(selector labels.Selector) (ret []*apps.ReplicaSet, err error)
// ReplicaSets returns an object that can list and get ReplicaSets. // ReplicaSets returns an object that can list and get ReplicaSets.
ReplicaSets(namespace string) ReplicaSetNamespaceLister ReplicaSets(namespace string) ReplicaSetNamespaceLister
ReplicaSetListerExpansion ReplicaSetListerExpansion
...@@ -45,9 +45,9 @@ func NewReplicaSetLister(indexer cache.Indexer) ReplicaSetLister { ...@@ -45,9 +45,9 @@ func NewReplicaSetLister(indexer cache.Indexer) ReplicaSetLister {
} }
// List lists all ReplicaSets in the indexer. // List lists all ReplicaSets in the indexer.
func (s *replicaSetLister) List(selector labels.Selector) (ret []*extensions.ReplicaSet, err error) { func (s *replicaSetLister) List(selector labels.Selector) (ret []*apps.ReplicaSet, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) { err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*extensions.ReplicaSet)) ret = append(ret, m.(*apps.ReplicaSet))
}) })
return ret, err return ret, err
} }
...@@ -60,9 +60,9 @@ func (s *replicaSetLister) ReplicaSets(namespace string) ReplicaSetNamespaceList ...@@ -60,9 +60,9 @@ func (s *replicaSetLister) ReplicaSets(namespace string) ReplicaSetNamespaceList
// ReplicaSetNamespaceLister helps list and get ReplicaSets. // ReplicaSetNamespaceLister helps list and get ReplicaSets.
type ReplicaSetNamespaceLister interface { type ReplicaSetNamespaceLister interface {
// List lists all ReplicaSets in the indexer for a given namespace. // List lists all ReplicaSets in the indexer for a given namespace.
List(selector labels.Selector) (ret []*extensions.ReplicaSet, err error) List(selector labels.Selector) (ret []*apps.ReplicaSet, err error)
// Get retrieves the ReplicaSet from the indexer for a given namespace and name. // Get retrieves the ReplicaSet from the indexer for a given namespace and name.
Get(name string) (*extensions.ReplicaSet, error) Get(name string) (*apps.ReplicaSet, error)
ReplicaSetNamespaceListerExpansion ReplicaSetNamespaceListerExpansion
} }
...@@ -74,21 +74,21 @@ type replicaSetNamespaceLister struct { ...@@ -74,21 +74,21 @@ type replicaSetNamespaceLister struct {
} }
// List lists all ReplicaSets in the indexer for a given namespace. // List lists all ReplicaSets in the indexer for a given namespace.
func (s replicaSetNamespaceLister) List(selector labels.Selector) (ret []*extensions.ReplicaSet, err error) { func (s replicaSetNamespaceLister) List(selector labels.Selector) (ret []*apps.ReplicaSet, err error) {
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
ret = append(ret, m.(*extensions.ReplicaSet)) ret = append(ret, m.(*apps.ReplicaSet))
}) })
return ret, err return ret, err
} }
// Get retrieves the ReplicaSet from the indexer for a given namespace and name. // Get retrieves the ReplicaSet from the indexer for a given namespace and name.
func (s replicaSetNamespaceLister) Get(name string) (*extensions.ReplicaSet, error) { func (s replicaSetNamespaceLister) Get(name string) (*apps.ReplicaSet, error) {
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
if err != nil { if err != nil {
return nil, err return nil, err
} }
if !exists { if !exists {
return nil, errors.NewNotFound(extensions.Resource("replicaset"), name) return nil, errors.NewNotFound(apps.Resource("replicaset"), name)
} }
return obj.(*extensions.ReplicaSet), nil return obj.(*apps.ReplicaSet), nil
} }
package(default_visibility = ["//visibility:public"]) package(default_visibility = ["//visibility:public"])
load( load("@io_bazel_rules_go//go:def.bzl", "go_library")
"@io_bazel_rules_go//go:def.bzl",
"go_library",
"go_test",
)
go_library( go_library(
name = "go_default_library", name = "go_default_library",
srcs = [ srcs = [
"daemonset.go",
"daemonset_expansion.go",
"deployment.go",
"deployment_expansion.go",
"expansion_generated.go", "expansion_generated.go",
"ingress.go", "ingress.go",
"replicaset.go",
"replicaset_expansion.go",
], ],
importpath = "k8s.io/kubernetes/pkg/client/listers/extensions/internalversion", importpath = "k8s.io/kubernetes/pkg/client/listers/extensions/internalversion",
deps = [ deps = [
"//pkg/apis/core:go_default_library",
"//pkg/apis/extensions:go_default_library", "//pkg/apis/extensions:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/errors:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/api/errors:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/labels:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/labels:go_default_library",
"//staging/src/k8s.io/client-go/tools/cache:go_default_library", "//staging/src/k8s.io/client-go/tools/cache:go_default_library",
], ],
...@@ -41,17 +29,3 @@ filegroup( ...@@ -41,17 +29,3 @@ filegroup(
srcs = [":package-srcs"], srcs = [":package-srcs"],
tags = ["automanaged"], tags = ["automanaged"],
) )
go_test(
name = "go_default_test",
srcs = ["daemonset_expansion_test.go"],
embed = [":go_default_library"],
deps = [
"//pkg/apis/core:go_default_library",
"//pkg/apis/extensions:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/labels:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library",
"//staging/src/k8s.io/client-go/tools/cache:go_default_library",
],
)
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package internalversion
import (
"fmt"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
api "k8s.io/kubernetes/pkg/apis/core"
"k8s.io/kubernetes/pkg/apis/extensions"
)
// DaemonSetListerExpansion allows custom methods to be added to
// DaemonSetLister.
type DaemonSetListerExpansion interface {
GetPodDaemonSets(pod *api.Pod) ([]*extensions.DaemonSet, error)
}
// DaemonSetNamespaceListerExpansion allows custom methods to be added to
// DaemonSetNamespaceLister.
type DaemonSetNamespaceListerExpansion interface{}
// GetPodDaemonSets returns a list of DaemonSets that potentially match a pod.
// Only the one specified in the Pod's ControllerRef will actually manage it.
// Returns an error only if no matching DaemonSets are found.
func (s *daemonSetLister) GetPodDaemonSets(pod *api.Pod) ([]*extensions.DaemonSet, error) {
var selector labels.Selector
var daemonSet *extensions.DaemonSet
if len(pod.Labels) == 0 {
return nil, fmt.Errorf("no daemon sets found for pod %v because it has no labels", pod.Name)
}
list, err := s.DaemonSets(pod.Namespace).List(labels.Everything())
if err != nil {
return nil, err
}
var daemonSets []*extensions.DaemonSet
for i := range list {
daemonSet = list[i]
if daemonSet.Namespace != pod.Namespace {
continue
}
selector, err = metav1.LabelSelectorAsSelector(daemonSet.Spec.Selector)
if err != nil {
// this should not happen if the DaemonSet passed validation
return nil, err
}
// If a daemonSet with a nil or empty selector creeps in, it should match nothing, not everything.
if selector.Empty() || !selector.Matches(labels.Set(pod.Labels)) {
continue
}
daemonSets = append(daemonSets, daemonSet)
}
if len(daemonSets) == 0 {
return nil, fmt.Errorf("could not find daemon set for pod %s in namespace %s with labels: %v", pod.Name, pod.Namespace, pod.Labels)
}
return daemonSets, nil
}
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package internalversion
import (
"testing"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/client-go/tools/cache"
api "k8s.io/kubernetes/pkg/apis/core"
"k8s.io/kubernetes/pkg/apis/extensions"
)
func TestDaemonSetLister(t *testing.T) {
store := cache.NewIndexer(cache.MetaNamespaceKeyFunc, cache.Indexers{"namespace": cache.MetaNamespaceIndexFunc})
lister := NewDaemonSetLister(store)
testCases := []struct {
inDSs []*extensions.DaemonSet
list func() ([]*extensions.DaemonSet, error)
outDaemonSetNames sets.String
expectErr bool
}{
// Basic listing
{
inDSs: []*extensions.DaemonSet{
{ObjectMeta: metav1.ObjectMeta{Name: "basic"}},
},
list: func() ([]*extensions.DaemonSet, error) {
return lister.List(labels.Everything())
},
outDaemonSetNames: sets.NewString("basic"),
},
// Listing multiple daemon sets
{
inDSs: []*extensions.DaemonSet{
{ObjectMeta: metav1.ObjectMeta{Name: "basic"}},
{ObjectMeta: metav1.ObjectMeta{Name: "complex"}},
{ObjectMeta: metav1.ObjectMeta{Name: "complex2"}},
},
list: func() ([]*extensions.DaemonSet, error) {
return lister.List(labels.Everything())
},
outDaemonSetNames: sets.NewString("basic", "complex", "complex2"),
},
// No pod labels
{
inDSs: []*extensions.DaemonSet{
{
ObjectMeta: metav1.ObjectMeta{Name: "basic", Namespace: "ns"},
Spec: extensions.DaemonSetSpec{
Selector: &metav1.LabelSelector{MatchLabels: map[string]string{"foo": "baz"}},
},
},
},
list: func() ([]*extensions.DaemonSet, error) {
pod := &api.Pod{
ObjectMeta: metav1.ObjectMeta{Name: "pod1", Namespace: "ns"},
}
return lister.GetPodDaemonSets(pod)
},
outDaemonSetNames: sets.NewString(),
expectErr: true,
},
// No DS selectors
{
inDSs: []*extensions.DaemonSet{
{
ObjectMeta: metav1.ObjectMeta{Name: "basic", Namespace: "ns"},
},
},
list: func() ([]*extensions.DaemonSet, error) {
pod := &api.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: "pod1",
Namespace: "ns",
Labels: map[string]string{"foo": "bar"},
},
}
return lister.GetPodDaemonSets(pod)
},
outDaemonSetNames: sets.NewString(),
expectErr: true,
},
// Matching labels to selectors and namespace
{
inDSs: []*extensions.DaemonSet{
{
ObjectMeta: metav1.ObjectMeta{Name: "foo"},
Spec: extensions.DaemonSetSpec{
Selector: &metav1.LabelSelector{MatchLabels: map[string]string{"foo": "bar"}},
},
},
{
ObjectMeta: metav1.ObjectMeta{Name: "bar", Namespace: "ns"},
Spec: extensions.DaemonSetSpec{
Selector: &metav1.LabelSelector{MatchLabels: map[string]string{"foo": "bar"}},
},
},
},
list: func() ([]*extensions.DaemonSet, error) {
pod := &api.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: "pod1",
Labels: map[string]string{"foo": "bar"},
Namespace: "ns",
},
}
return lister.GetPodDaemonSets(pod)
},
outDaemonSetNames: sets.NewString("bar"),
},
}
for _, c := range testCases {
for _, r := range c.inDSs {
store.Add(r)
}
daemonSets, err := c.list()
if err != nil && c.expectErr {
continue
} else if c.expectErr {
t.Error("Expected error, got none")
continue
} else if err != nil {
t.Errorf("Unexpected error %#v", err)
continue
}
daemonSetNames := make([]string, len(daemonSets))
for ix := range daemonSets {
daemonSetNames[ix] = daemonSets[ix].Name
}
if !c.outDaemonSetNames.HasAll(daemonSetNames...) || len(daemonSetNames) != len(c.outDaemonSetNames) {
t.Errorf("Unexpected got controllers %+v expected %+v", daemonSetNames, c.outDaemonSetNames)
}
}
}
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package internalversion
import (
"fmt"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/kubernetes/pkg/apis/extensions"
)
// DeploymentListerExpansion allows custom methods to be added to
// DeploymentLister.
type DeploymentListerExpansion interface {
GetDeploymentsForReplicaSet(rs *extensions.ReplicaSet) ([]*extensions.Deployment, error)
}
// DeploymentNamespaceListerExpansion allows custom methods to be added to
// DeploymentNamespaceLister.
type DeploymentNamespaceListerExpansion interface{}
// GetDeploymentsForReplicaSet returns a list of Deployments that potentially
// match a ReplicaSet. Only the one specified in the ReplicaSet's ControllerRef
// will actually manage it.
// Returns an error only if no matching Deployments are found.
func (s *deploymentLister) GetDeploymentsForReplicaSet(rs *extensions.ReplicaSet) ([]*extensions.Deployment, error) {
if len(rs.Labels) == 0 {
return nil, fmt.Errorf("no deployments found for ReplicaSet %v because it has no labels", rs.Name)
}
// TODO: MODIFY THIS METHOD so that it checks for the podTemplateSpecHash label
dList, err := s.Deployments(rs.Namespace).List(labels.Everything())
if err != nil {
return nil, err
}
var deployments []*extensions.Deployment
for _, d := range dList {
selector, err := metav1.LabelSelectorAsSelector(d.Spec.Selector)
if err != nil {
return nil, fmt.Errorf("invalid label selector: %v", err)
}
// If a deployment with a nil or empty selector creeps in, it should match nothing, not everything.
if selector.Empty() || !selector.Matches(labels.Set(rs.Labels)) {
continue
}
deployments = append(deployments, d)
}
if len(deployments) == 0 {
return nil, fmt.Errorf("could not find deployments set for ReplicaSet %s in namespace %s with labels: %v", rs.Name, rs.Namespace, rs.Labels)
}
return deployments, nil
}
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package internalversion
import (
"fmt"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
api "k8s.io/kubernetes/pkg/apis/core"
"k8s.io/kubernetes/pkg/apis/extensions"
)
// ReplicaSetListerExpansion allows custom methods to be added to
// ReplicaSetLister.
type ReplicaSetListerExpansion interface {
GetPodReplicaSets(pod *api.Pod) ([]*extensions.ReplicaSet, error)
}
// ReplicaSetNamespaceListerExpansion allows custom methods to be added to
// ReplicaSetNamespaceLister.
type ReplicaSetNamespaceListerExpansion interface{}
// GetPodReplicaSets returns a list of ReplicaSets that potentially match a pod.
// Only the one specified in the Pod's ControllerRef will actually manage it.
// Returns an error only if no matching ReplicaSets are found.
func (s *replicaSetLister) GetPodReplicaSets(pod *api.Pod) ([]*extensions.ReplicaSet, error) {
if len(pod.Labels) == 0 {
return nil, fmt.Errorf("no ReplicaSets found for pod %v because it has no labels", pod.Name)
}
list, err := s.ReplicaSets(pod.Namespace).List(labels.Everything())
if err != nil {
return nil, err
}
var rss []*extensions.ReplicaSet
for _, rs := range list {
if rs.Namespace != pod.Namespace {
continue
}
selector, err := metav1.LabelSelectorAsSelector(rs.Spec.Selector)
if err != nil {
return nil, fmt.Errorf("invalid selector: %v", err)
}
// If a ReplicaSet with a nil or empty selector creeps in, it should match nothing, not everything.
if selector.Empty() || !selector.Matches(labels.Set(pod.Labels)) {
continue
}
rss = append(rss, rs)
}
if len(rss) == 0 {
return nil, fmt.Errorf("could not find ReplicaSet for pod %s in namespace %s with labels: %v", pod.Name, pod.Namespace, pod.Labels)
}
return rss, nil
}
...@@ -16,9 +16,9 @@ go_library( ...@@ -16,9 +16,9 @@ go_library(
], ],
importpath = "k8s.io/kubernetes/pkg/controller/replication", importpath = "k8s.io/kubernetes/pkg/controller/replication",
deps = [ deps = [
"//pkg/apis/apps:go_default_library",
"//pkg/apis/apps/v1:go_default_library", "//pkg/apis/apps/v1:go_default_library",
"//pkg/apis/core/v1:go_default_library", "//pkg/apis/core/v1:go_default_library",
"//pkg/apis/extensions:go_default_library",
"//pkg/controller:go_default_library", "//pkg/controller:go_default_library",
"//pkg/controller/replicaset:go_default_library", "//pkg/controller/replicaset:go_default_library",
"//staging/src/k8s.io/api/apps/v1:go_default_library", "//staging/src/k8s.io/api/apps/v1:go_default_library",
......
...@@ -41,9 +41,9 @@ import ( ...@@ -41,9 +41,9 @@ import (
appslisters "k8s.io/client-go/listers/apps/v1" appslisters "k8s.io/client-go/listers/apps/v1"
v1listers "k8s.io/client-go/listers/core/v1" v1listers "k8s.io/client-go/listers/core/v1"
"k8s.io/client-go/tools/cache" "k8s.io/client-go/tools/cache"
appsinternal "k8s.io/kubernetes/pkg/apis/apps"
appsconversion "k8s.io/kubernetes/pkg/apis/apps/v1" appsconversion "k8s.io/kubernetes/pkg/apis/apps/v1"
apiv1 "k8s.io/kubernetes/pkg/apis/core/v1" apiv1 "k8s.io/kubernetes/pkg/apis/core/v1"
"k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/controller" "k8s.io/kubernetes/pkg/controller"
) )
...@@ -276,26 +276,26 @@ func convertCall(fn func(*v1.ReplicationController) (*v1.ReplicationController, ...@@ -276,26 +276,26 @@ func convertCall(fn func(*v1.ReplicationController) (*v1.ReplicationController,
} }
func convertRCtoRS(rc *v1.ReplicationController, out *apps.ReplicaSet) (*apps.ReplicaSet, error) { func convertRCtoRS(rc *v1.ReplicationController, out *apps.ReplicaSet) (*apps.ReplicaSet, error) {
var rsInternal extensions.ReplicaSet var rsInternal appsinternal.ReplicaSet
if err := apiv1.Convert_v1_ReplicationController_To_extensions_ReplicaSet(rc, &rsInternal, nil); err != nil { if err := apiv1.Convert_v1_ReplicationController_To_apps_ReplicaSet(rc, &rsInternal, nil); err != nil {
return nil, fmt.Errorf("can't convert ReplicationController %v/%v to ReplicaSet: %v", rc.Namespace, rc.Name, err) return nil, fmt.Errorf("can't convert ReplicationController %v/%v to ReplicaSet: %v", rc.Namespace, rc.Name, err)
} }
if out == nil { if out == nil {
out = new(apps.ReplicaSet) out = new(apps.ReplicaSet)
} }
if err := appsconversion.Convert_extensions_ReplicaSet_To_v1_ReplicaSet(&rsInternal, out, nil); err != nil { if err := appsconversion.Convert_apps_ReplicaSet_To_v1_ReplicaSet(&rsInternal, out, nil); err != nil {
return nil, fmt.Errorf("can't convert ReplicaSet (converted from ReplicationController %v/%v) from internal to extensions/v1beta1: %v", rc.Namespace, rc.Name, err) return nil, fmt.Errorf("can't convert ReplicaSet (converted from ReplicationController %v/%v) from internal to apps/v1: %v", rc.Namespace, rc.Name, err)
} }
return out, nil return out, nil
} }
func convertRStoRC(rs *apps.ReplicaSet) (*v1.ReplicationController, error) { func convertRStoRC(rs *apps.ReplicaSet) (*v1.ReplicationController, error) {
var rsInternal extensions.ReplicaSet var rsInternal appsinternal.ReplicaSet
if err := appsconversion.Convert_v1_ReplicaSet_To_extensions_ReplicaSet(rs, &rsInternal, nil); err != nil { if err := appsconversion.Convert_v1_ReplicaSet_To_apps_ReplicaSet(rs, &rsInternal, nil); err != nil {
return nil, fmt.Errorf("can't convert ReplicaSet (converting to ReplicationController %v/%v) from extensions/v1beta1 to internal: %v", rs.Namespace, rs.Name, err) return nil, fmt.Errorf("can't convert ReplicaSet (converting to ReplicationController %v/%v) from apps/v1 to internal: %v", rs.Namespace, rs.Name, err)
} }
var rc v1.ReplicationController var rc v1.ReplicationController
if err := apiv1.Convert_extensions_ReplicaSet_To_v1_ReplicationController(&rsInternal, &rc, nil); err != nil { if err := apiv1.Convert_apps_ReplicaSet_To_v1_ReplicationController(&rsInternal, &rc, nil); err != nil {
return nil, fmt.Errorf("can't convert ReplicaSet to ReplicationController %v/%v: %v", rs.Namespace, rs.Name, err) return nil, fmt.Errorf("can't convert ReplicaSet to ReplicationController %v/%v: %v", rs.Namespace, rs.Name, err)
} }
return &rc, nil return &rc, nil
......
...@@ -1872,7 +1872,7 @@ type ReplicaSetDescriber struct { ...@@ -1872,7 +1872,7 @@ type ReplicaSetDescriber struct {
} }
func (d *ReplicaSetDescriber) Describe(namespace, name string, describerSettings printers.DescriberSettings) (string, error) { func (d *ReplicaSetDescriber) Describe(namespace, name string, describerSettings printers.DescriberSettings) (string, error) {
rsc := d.Extensions().ReplicaSets(namespace) rsc := d.Apps().ReplicaSets(namespace)
pc := d.Core().Pods(namespace) pc := d.Core().Pods(namespace)
rs, err := rsc.Get(name, metav1.GetOptions{}) rs, err := rsc.Get(name, metav1.GetOptions{})
...@@ -1895,7 +1895,7 @@ func (d *ReplicaSetDescriber) Describe(namespace, name string, describerSettings ...@@ -1895,7 +1895,7 @@ func (d *ReplicaSetDescriber) Describe(namespace, name string, describerSettings
return describeReplicaSet(rs, events, running, waiting, succeeded, failed, getPodErr) return describeReplicaSet(rs, events, running, waiting, succeeded, failed, getPodErr)
} }
func describeReplicaSet(rs *extensions.ReplicaSet, events *api.EventList, running, waiting, succeeded, failed int, getPodErr error) (string, error) { func describeReplicaSet(rs *apps.ReplicaSet, events *api.EventList, running, waiting, succeeded, failed int, getPodErr error) (string, error) {
return tabbedString(func(out io.Writer) error { return tabbedString(func(out io.Writer) error {
w := NewPrefixWriter(out) w := NewPrefixWriter(out)
w.Write(LEVEL_0, "Name:\t%s\n", rs.Name) w.Write(LEVEL_0, "Name:\t%s\n", rs.Name)
...@@ -2085,7 +2085,7 @@ type DaemonSetDescriber struct { ...@@ -2085,7 +2085,7 @@ type DaemonSetDescriber struct {
} }
func (d *DaemonSetDescriber) Describe(namespace, name string, describerSettings printers.DescriberSettings) (string, error) { func (d *DaemonSetDescriber) Describe(namespace, name string, describerSettings printers.DescriberSettings) (string, error) {
dc := d.Extensions().DaemonSets(namespace) dc := d.Apps().DaemonSets(namespace)
pc := d.Core().Pods(namespace) pc := d.Core().Pods(namespace)
daemon, err := dc.Get(name, metav1.GetOptions{}) daemon, err := dc.Get(name, metav1.GetOptions{})
...@@ -2110,7 +2110,7 @@ func (d *DaemonSetDescriber) Describe(namespace, name string, describerSettings ...@@ -2110,7 +2110,7 @@ func (d *DaemonSetDescriber) Describe(namespace, name string, describerSettings
return describeDaemonSet(daemon, events, running, waiting, succeeded, failed) return describeDaemonSet(daemon, events, running, waiting, succeeded, failed)
} }
func describeDaemonSet(daemon *extensions.DaemonSet, events *api.EventList, running, waiting, succeeded, failed int) (string, error) { func describeDaemonSet(daemon *apps.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 {
w := NewPrefixWriter(out) w := NewPrefixWriter(out)
w.Write(LEVEL_0, "Name:\t%s\n", daemon.Name) w.Write(LEVEL_0, "Name:\t%s\n", daemon.Name)
...@@ -3233,8 +3233,8 @@ func (dd *DeploymentDescriber) Describe(namespace, name string, describerSetting ...@@ -3233,8 +3233,8 @@ func (dd *DeploymentDescriber) Describe(namespace, name string, describerSetting
if err != nil { if err != nil {
return "", err return "", err
} }
internalDeployment := &extensions.Deployment{} internalDeployment := &apps.Deployment{}
if err := legacyscheme.Scheme.Convert(d, internalDeployment, extensions.SchemeGroupVersion); err != nil { if err := legacyscheme.Scheme.Convert(d, internalDeployment, apps.SchemeGroupVersion); err != nil {
return "", err return "", err
} }
...@@ -3246,7 +3246,7 @@ func (dd *DeploymentDescriber) Describe(namespace, name string, describerSetting ...@@ -3246,7 +3246,7 @@ func (dd *DeploymentDescriber) Describe(namespace, name string, describerSetting
return describeDeployment(d, selector, internalDeployment, events, dd) return describeDeployment(d, selector, internalDeployment, events, dd)
} }
func describeDeployment(d *appsv1.Deployment, selector labels.Selector, internalDeployment *extensions.Deployment, events *api.EventList, dd *DeploymentDescriber) (string, error) { func describeDeployment(d *appsv1.Deployment, selector labels.Selector, internalDeployment *apps.Deployment, events *api.EventList, dd *DeploymentDescriber) (string, error) {
return tabbedString(func(out io.Writer) error { return tabbedString(func(out io.Writer) error {
w := NewPrefixWriter(out) w := NewPrefixWriter(out)
w.Write(LEVEL_0, "Name:\t%s\n", d.ObjectMeta.Name) w.Write(LEVEL_0, "Name:\t%s\n", d.ObjectMeta.Name)
......
...@@ -36,7 +36,6 @@ import ( ...@@ -36,7 +36,6 @@ import (
"k8s.io/kubernetes/pkg/apis/apps" "k8s.io/kubernetes/pkg/apis/apps"
"k8s.io/kubernetes/pkg/apis/autoscaling" "k8s.io/kubernetes/pkg/apis/autoscaling"
api "k8s.io/kubernetes/pkg/apis/core" api "k8s.io/kubernetes/pkg/apis/core"
"k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/apis/networking" "k8s.io/kubernetes/pkg/apis/networking"
"k8s.io/kubernetes/pkg/apis/policy" "k8s.io/kubernetes/pkg/apis/policy"
"k8s.io/kubernetes/pkg/apis/storage" "k8s.io/kubernetes/pkg/apis/storage"
...@@ -2188,7 +2187,7 @@ func TestDescribeEvents(t *testing.T) { ...@@ -2188,7 +2187,7 @@ func TestDescribeEvents(t *testing.T) {
m := map[string]printers.Describer{ m := map[string]printers.Describer{
"DaemonSetDescriber": &DaemonSetDescriber{ "DaemonSetDescriber": &DaemonSetDescriber{
fake.NewSimpleClientset(&extensions.DaemonSet{ fake.NewSimpleClientset(&apps.DaemonSet{
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
Name: "bar", Name: "bar",
Namespace: "foo", Namespace: "foo",
...@@ -2245,7 +2244,7 @@ func TestDescribeEvents(t *testing.T) { ...@@ -2245,7 +2244,7 @@ func TestDescribeEvents(t *testing.T) {
}, events), }, events),
}, },
"ReplicaSetDescriber": &ReplicaSetDescriber{ "ReplicaSetDescriber": &ReplicaSetDescriber{
fake.NewSimpleClientset(&extensions.ReplicaSet{ fake.NewSimpleClientset(&apps.ReplicaSet{
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
Name: "bar", Name: "bar",
Namespace: "foo", Namespace: "foo",
......
...@@ -769,7 +769,7 @@ func printReplicationControllerList(list *api.ReplicationControllerList, options ...@@ -769,7 +769,7 @@ func printReplicationControllerList(list *api.ReplicationControllerList, options
return rows, nil return rows, nil
} }
func printReplicaSet(obj *extensions.ReplicaSet, options printers.PrintOptions) ([]metav1beta1.TableRow, error) { func printReplicaSet(obj *apps.ReplicaSet, options printers.PrintOptions) ([]metav1beta1.TableRow, error) {
row := metav1beta1.TableRow{ row := metav1beta1.TableRow{
Object: runtime.RawExtension{Object: obj}, Object: runtime.RawExtension{Object: obj},
} }
...@@ -786,7 +786,7 @@ func printReplicaSet(obj *extensions.ReplicaSet, options printers.PrintOptions) ...@@ -786,7 +786,7 @@ func printReplicaSet(obj *extensions.ReplicaSet, options printers.PrintOptions)
return []metav1beta1.TableRow{row}, nil return []metav1beta1.TableRow{row}, nil
} }
func printReplicaSetList(list *extensions.ReplicaSetList, options printers.PrintOptions) ([]metav1beta1.TableRow, error) { func printReplicaSetList(list *apps.ReplicaSetList, options printers.PrintOptions) ([]metav1beta1.TableRow, error) {
rows := make([]metav1beta1.TableRow, 0, len(list.Items)) rows := make([]metav1beta1.TableRow, 0, len(list.Items))
for i := range list.Items { for i := range list.Items {
r, err := printReplicaSet(&list.Items[i], options) r, err := printReplicaSet(&list.Items[i], options)
...@@ -1063,7 +1063,7 @@ func printStatefulSetList(list *apps.StatefulSetList, options printers.PrintOpti ...@@ -1063,7 +1063,7 @@ func printStatefulSetList(list *apps.StatefulSetList, options printers.PrintOpti
return rows, nil return rows, nil
} }
func printDaemonSet(obj *extensions.DaemonSet, options printers.PrintOptions) ([]metav1beta1.TableRow, error) { func printDaemonSet(obj *apps.DaemonSet, options printers.PrintOptions) ([]metav1beta1.TableRow, error) {
row := metav1beta1.TableRow{ row := metav1beta1.TableRow{
Object: runtime.RawExtension{Object: obj}, Object: runtime.RawExtension{Object: obj},
} }
...@@ -1082,7 +1082,7 @@ func printDaemonSet(obj *extensions.DaemonSet, options printers.PrintOptions) ([ ...@@ -1082,7 +1082,7 @@ func printDaemonSet(obj *extensions.DaemonSet, options printers.PrintOptions) ([
return []metav1beta1.TableRow{row}, nil return []metav1beta1.TableRow{row}, nil
} }
func printDaemonSetList(list *extensions.DaemonSetList, options printers.PrintOptions) ([]metav1beta1.TableRow, error) { func printDaemonSetList(list *apps.DaemonSetList, options printers.PrintOptions) ([]metav1beta1.TableRow, error) {
rows := make([]metav1beta1.TableRow, 0, len(list.Items)) rows := make([]metav1beta1.TableRow, 0, len(list.Items))
for i := range list.Items { for i := range list.Items {
r, err := printDaemonSet(&list.Items[i], options) r, err := printDaemonSet(&list.Items[i], options)
...@@ -1555,7 +1555,7 @@ func truncate(str string, maxLen int) string { ...@@ -1555,7 +1555,7 @@ func truncate(str string, maxLen int) string {
return str return str
} }
func printDeployment(obj *extensions.Deployment, options printers.PrintOptions) ([]metav1beta1.TableRow, error) { func printDeployment(obj *apps.Deployment, options printers.PrintOptions) ([]metav1beta1.TableRow, error) {
row := metav1beta1.TableRow{ row := metav1beta1.TableRow{
Object: runtime.RawExtension{Object: obj}, Object: runtime.RawExtension{Object: obj},
} }
...@@ -1578,7 +1578,7 @@ func printDeployment(obj *extensions.Deployment, options printers.PrintOptions) ...@@ -1578,7 +1578,7 @@ func printDeployment(obj *extensions.Deployment, options printers.PrintOptions)
return []metav1beta1.TableRow{row}, nil return []metav1beta1.TableRow{row}, nil
} }
func printDeploymentList(list *extensions.DeploymentList, options printers.PrintOptions) ([]metav1beta1.TableRow, error) { func printDeploymentList(list *apps.DeploymentList, options printers.PrintOptions) ([]metav1beta1.TableRow, error) {
rows := make([]metav1beta1.TableRow, 0, len(list.Items)) rows := make([]metav1beta1.TableRow, 0, len(list.Items))
for i := range list.Items { for i := range list.Items {
r, err := printDeployment(&list.Items[i], options) r, err := printDeployment(&list.Items[i], options)
......
...@@ -1971,17 +1971,17 @@ func TestTranslateTimestampUntil(t *testing.T) { ...@@ -1971,17 +1971,17 @@ func TestTranslateTimestampUntil(t *testing.T) {
func TestPrintDeployment(t *testing.T) { func TestPrintDeployment(t *testing.T) {
tests := []struct { tests := []struct {
deployment extensions.Deployment deployment apps.Deployment
expect string expect string
wideExpect string wideExpect string
}{ }{
{ {
extensions.Deployment{ apps.Deployment{
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
Name: "test1", Name: "test1",
CreationTimestamp: metav1.Time{Time: time.Now().Add(1.9e9)}, CreationTimestamp: metav1.Time{Time: time.Now().Add(1.9e9)},
}, },
Spec: extensions.DeploymentSpec{ Spec: apps.DeploymentSpec{
Replicas: 5, Replicas: 5,
Template: api.PodTemplateSpec{ Template: api.PodTemplateSpec{
Spec: api.PodSpec{ Spec: api.PodSpec{
...@@ -1999,7 +1999,7 @@ func TestPrintDeployment(t *testing.T) { ...@@ -1999,7 +1999,7 @@ func TestPrintDeployment(t *testing.T) {
}, },
Selector: &metav1.LabelSelector{MatchLabels: map[string]string{"foo": "bar"}}, Selector: &metav1.LabelSelector{MatchLabels: map[string]string{"foo": "bar"}},
}, },
Status: extensions.DeploymentStatus{ Status: apps.DeploymentStatus{
Replicas: 10, Replicas: 10,
UpdatedReplicas: 2, UpdatedReplicas: 2,
AvailableReplicas: 1, AvailableReplicas: 1,
...@@ -2040,21 +2040,21 @@ func TestPrintDeployment(t *testing.T) { ...@@ -2040,21 +2040,21 @@ func TestPrintDeployment(t *testing.T) {
func TestPrintDaemonSet(t *testing.T) { func TestPrintDaemonSet(t *testing.T) {
tests := []struct { tests := []struct {
ds extensions.DaemonSet ds apps.DaemonSet
startsWith string startsWith string
}{ }{
{ {
extensions.DaemonSet{ apps.DaemonSet{
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
Name: "test1", Name: "test1",
CreationTimestamp: metav1.Time{Time: time.Now().Add(1.9e9)}, CreationTimestamp: metav1.Time{Time: time.Now().Add(1.9e9)},
}, },
Spec: extensions.DaemonSetSpec{ Spec: apps.DaemonSetSpec{
Template: api.PodTemplateSpec{ Template: api.PodTemplateSpec{
Spec: api.PodSpec{Containers: make([]api.Container, 2)}, Spec: api.PodSpec{Containers: make([]api.Container, 2)},
}, },
}, },
Status: extensions.DaemonSetStatus{ Status: apps.DaemonSetStatus{
CurrentNumberScheduled: 2, CurrentNumberScheduled: 2,
DesiredNumberScheduled: 3, DesiredNumberScheduled: 3,
NumberReady: 1, NumberReady: 1,
...@@ -3154,17 +3154,17 @@ func boolP(b bool) *bool { ...@@ -3154,17 +3154,17 @@ func boolP(b bool) *bool {
func TestPrintReplicaSet(t *testing.T) { func TestPrintReplicaSet(t *testing.T) {
tests := []struct { tests := []struct {
replicaSet extensions.ReplicaSet replicaSet apps.ReplicaSet
expect string expect string
wideExpect string wideExpect string
}{ }{
{ {
extensions.ReplicaSet{ apps.ReplicaSet{
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
Name: "test1", Name: "test1",
CreationTimestamp: metav1.Time{Time: time.Now().Add(1.9e9)}, CreationTimestamp: metav1.Time{Time: time.Now().Add(1.9e9)},
}, },
Spec: extensions.ReplicaSetSpec{ Spec: apps.ReplicaSetSpec{
Replicas: 5, Replicas: 5,
Template: api.PodTemplateSpec{ Template: api.PodTemplateSpec{
Spec: api.PodSpec{ Spec: api.PodSpec{
...@@ -3182,7 +3182,7 @@ func TestPrintReplicaSet(t *testing.T) { ...@@ -3182,7 +3182,7 @@ func TestPrintReplicaSet(t *testing.T) {
}, },
Selector: &metav1.LabelSelector{MatchLabels: map[string]string{"foo": "bar"}}, Selector: &metav1.LabelSelector{MatchLabels: map[string]string{"foo": "bar"}},
}, },
Status: extensions.ReplicaSetStatus{ Status: apps.ReplicaSetStatus{
Replicas: 5, Replicas: 5,
ReadyReplicas: 2, ReadyReplicas: 2,
}, },
......
...@@ -16,8 +16,8 @@ go_library( ...@@ -16,8 +16,8 @@ go_library(
deps = [ deps = [
"//pkg/api/legacyscheme:go_default_library", "//pkg/api/legacyscheme:go_default_library",
"//pkg/api/pod:go_default_library", "//pkg/api/pod:go_default_library",
"//pkg/apis/extensions:go_default_library", "//pkg/apis/apps:go_default_library",
"//pkg/apis/extensions/validation:go_default_library", "//pkg/apis/apps/validation:go_default_library",
"//staging/src/k8s.io/api/apps/v1beta2:go_default_library", "//staging/src/k8s.io/api/apps/v1beta2:go_default_library",
"//staging/src/k8s.io/api/extensions/v1beta1:go_default_library", "//staging/src/k8s.io/api/extensions/v1beta1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/equality:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/api/equality:go_default_library",
...@@ -36,8 +36,8 @@ go_test( ...@@ -36,8 +36,8 @@ go_test(
srcs = ["strategy_test.go"], srcs = ["strategy_test.go"],
embed = [":go_default_library"], embed = [":go_default_library"],
deps = [ deps = [
"//pkg/apis/apps:go_default_library",
"//pkg/apis/core:go_default_library", "//pkg/apis/core:go_default_library",
"//pkg/apis/extensions:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/validation/field:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/validation/field:go_default_library",
"//staging/src/k8s.io/apiserver/pkg/endpoints/request:go_default_library", "//staging/src/k8s.io/apiserver/pkg/endpoints/request:go_default_library",
......
...@@ -11,8 +11,8 @@ go_test( ...@@ -11,8 +11,8 @@ go_test(
srcs = ["storage_test.go"], srcs = ["storage_test.go"],
embed = [":go_default_library"], embed = [":go_default_library"],
deps = [ deps = [
"//pkg/apis/apps:go_default_library",
"//pkg/apis/core:go_default_library", "//pkg/apis/core:go_default_library",
"//pkg/apis/extensions:go_default_library",
"//pkg/registry/registrytest:go_default_library", "//pkg/registry/registrytest:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/fields:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/fields:go_default_library",
...@@ -29,7 +29,7 @@ go_library( ...@@ -29,7 +29,7 @@ go_library(
srcs = ["storage.go"], srcs = ["storage.go"],
importpath = "k8s.io/kubernetes/pkg/registry/apps/daemonset/storage", importpath = "k8s.io/kubernetes/pkg/registry/apps/daemonset/storage",
deps = [ deps = [
"//pkg/apis/extensions:go_default_library", "//pkg/apis/apps:go_default_library",
"//pkg/printers:go_default_library", "//pkg/printers:go_default_library",
"//pkg/printers/internalversion:go_default_library", "//pkg/printers/internalversion:go_default_library",
"//pkg/printers/storage:go_default_library", "//pkg/printers/storage:go_default_library",
......
...@@ -24,7 +24,7 @@ import ( ...@@ -24,7 +24,7 @@ import (
"k8s.io/apiserver/pkg/registry/generic" "k8s.io/apiserver/pkg/registry/generic"
genericregistry "k8s.io/apiserver/pkg/registry/generic/registry" genericregistry "k8s.io/apiserver/pkg/registry/generic/registry"
"k8s.io/apiserver/pkg/registry/rest" "k8s.io/apiserver/pkg/registry/rest"
"k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/apis/apps"
"k8s.io/kubernetes/pkg/printers" "k8s.io/kubernetes/pkg/printers"
printersinternal "k8s.io/kubernetes/pkg/printers/internalversion" printersinternal "k8s.io/kubernetes/pkg/printers/internalversion"
printerstorage "k8s.io/kubernetes/pkg/printers/storage" printerstorage "k8s.io/kubernetes/pkg/printers/storage"
...@@ -40,9 +40,9 @@ type REST struct { ...@@ -40,9 +40,9 @@ type REST struct {
// NewREST returns a RESTStorage object that will work against DaemonSets. // NewREST returns a RESTStorage object that will work against DaemonSets.
func NewREST(optsGetter generic.RESTOptionsGetter) (*REST, *StatusREST) { func NewREST(optsGetter generic.RESTOptionsGetter) (*REST, *StatusREST) {
store := &genericregistry.Store{ store := &genericregistry.Store{
NewFunc: func() runtime.Object { return &extensions.DaemonSet{} }, NewFunc: func() runtime.Object { return &apps.DaemonSet{} },
NewListFunc: func() runtime.Object { return &extensions.DaemonSetList{} }, NewListFunc: func() runtime.Object { return &apps.DaemonSetList{} },
DefaultQualifiedResource: extensions.Resource("daemonsets"), DefaultQualifiedResource: apps.Resource("daemonsets"),
CreateStrategy: daemonset.Strategy, CreateStrategy: daemonset.Strategy,
UpdateStrategy: daemonset.Strategy, UpdateStrategy: daemonset.Strategy,
...@@ -87,7 +87,7 @@ type StatusREST struct { ...@@ -87,7 +87,7 @@ type StatusREST struct {
} }
func (r *StatusREST) New() runtime.Object { func (r *StatusREST) New() runtime.Object {
return &extensions.DaemonSet{} return &apps.DaemonSet{}
} }
// Get retrieves the object from the storage. It is required to support Patch. // Get retrieves the object from the storage. It is required to support Patch.
......
...@@ -26,13 +26,13 @@ import ( ...@@ -26,13 +26,13 @@ import (
"k8s.io/apiserver/pkg/registry/generic" "k8s.io/apiserver/pkg/registry/generic"
genericregistrytest "k8s.io/apiserver/pkg/registry/generic/testing" genericregistrytest "k8s.io/apiserver/pkg/registry/generic/testing"
etcdtesting "k8s.io/apiserver/pkg/storage/etcd/testing" etcdtesting "k8s.io/apiserver/pkg/storage/etcd/testing"
"k8s.io/kubernetes/pkg/apis/apps"
api "k8s.io/kubernetes/pkg/apis/core" api "k8s.io/kubernetes/pkg/apis/core"
"k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/registry/registrytest" "k8s.io/kubernetes/pkg/registry/registrytest"
) )
func newStorage(t *testing.T) (*REST, *StatusREST, *etcdtesting.EtcdTestServer) { func newStorage(t *testing.T) (*REST, *StatusREST, *etcdtesting.EtcdTestServer) {
etcdStorage, server := registrytest.NewEtcdStorage(t, extensions.GroupName) etcdStorage, server := registrytest.NewEtcdStorage(t, apps.GroupName)
restOptions := generic.RESTOptions{ restOptions := generic.RESTOptions{
StorageConfig: etcdStorage, StorageConfig: etcdStorage,
Decorator: generic.UndecoratedStorage, Decorator: generic.UndecoratedStorage,
...@@ -43,15 +43,16 @@ func newStorage(t *testing.T) (*REST, *StatusREST, *etcdtesting.EtcdTestServer) ...@@ -43,15 +43,16 @@ func newStorage(t *testing.T) (*REST, *StatusREST, *etcdtesting.EtcdTestServer)
return daemonSetStorage, statusStorage, server return daemonSetStorage, statusStorage, server
} }
func newValidDaemonSet() *extensions.DaemonSet { func newValidDaemonSet() *apps.DaemonSet {
return &extensions.DaemonSet{ return &apps.DaemonSet{
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
Name: "foo", Name: "foo",
Namespace: metav1.NamespaceDefault, Namespace: metav1.NamespaceDefault,
Labels: map[string]string{"a": "b"},
}, },
Spec: extensions.DaemonSetSpec{ Spec: apps.DaemonSetSpec{
UpdateStrategy: extensions.DaemonSetUpdateStrategy{ UpdateStrategy: apps.DaemonSetUpdateStrategy{
Type: extensions.OnDeleteDaemonSetStrategyType, Type: apps.OnDeleteDaemonSetStrategyType,
}, },
Selector: &metav1.LabelSelector{MatchLabels: map[string]string{"a": "b"}}, Selector: &metav1.LabelSelector{MatchLabels: map[string]string{"a": "b"}},
Template: api.PodTemplateSpec{ Template: api.PodTemplateSpec{
...@@ -88,15 +89,15 @@ func TestCreate(t *testing.T) { ...@@ -88,15 +89,15 @@ func TestCreate(t *testing.T) {
// valid // valid
ds, ds,
// invalid (invalid selector) // invalid (invalid selector)
&extensions.DaemonSet{ &apps.DaemonSet{
Spec: extensions.DaemonSetSpec{ Spec: apps.DaemonSetSpec{
Selector: &metav1.LabelSelector{MatchLabels: map[string]string{}}, Selector: &metav1.LabelSelector{MatchLabels: map[string]string{}},
Template: validDaemonSet.Spec.Template, Template: validDaemonSet.Spec.Template,
}, },
}, },
// invalid update strategy // invalid update strategy
&extensions.DaemonSet{ &apps.DaemonSet{
Spec: extensions.DaemonSetSpec{ Spec: apps.DaemonSetSpec{
Selector: validDaemonSet.Spec.Selector, Selector: validDaemonSet.Spec.Selector,
Template: validDaemonSet.Spec.Template, Template: validDaemonSet.Spec.Template,
}, },
...@@ -114,19 +115,19 @@ func TestUpdate(t *testing.T) { ...@@ -114,19 +115,19 @@ func TestUpdate(t *testing.T) {
newValidDaemonSet(), newValidDaemonSet(),
// updateFunc // updateFunc
func(obj runtime.Object) runtime.Object { func(obj runtime.Object) runtime.Object {
object := obj.(*extensions.DaemonSet) object := obj.(*apps.DaemonSet)
object.Spec.Template.Spec.NodeSelector = map[string]string{"c": "d"} object.Spec.Template.Spec.NodeSelector = map[string]string{"c": "d"}
object.Spec.Template.Spec.DNSPolicy = api.DNSDefault object.Spec.Template.Spec.DNSPolicy = api.DNSDefault
return object return object
}, },
// invalid updateFunc // invalid updateFunc
func(obj runtime.Object) runtime.Object { func(obj runtime.Object) runtime.Object {
object := obj.(*extensions.DaemonSet) object := obj.(*apps.DaemonSet)
object.Name = "" object.Name = ""
return object return object
}, },
func(obj runtime.Object) runtime.Object { func(obj runtime.Object) runtime.Object {
object := obj.(*extensions.DaemonSet) object := obj.(*apps.DaemonSet)
object.Spec.Template.Spec.RestartPolicy = api.RestartPolicyOnFailure object.Spec.Template.Spec.RestartPolicy = api.RestartPolicyOnFailure
return object return object
}, },
......
...@@ -31,8 +31,8 @@ import ( ...@@ -31,8 +31,8 @@ import (
"k8s.io/apiserver/pkg/storage/names" "k8s.io/apiserver/pkg/storage/names"
"k8s.io/kubernetes/pkg/api/legacyscheme" "k8s.io/kubernetes/pkg/api/legacyscheme"
"k8s.io/kubernetes/pkg/api/pod" "k8s.io/kubernetes/pkg/api/pod"
"k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/apis/apps"
"k8s.io/kubernetes/pkg/apis/extensions/validation" "k8s.io/kubernetes/pkg/apis/apps/validation"
) )
// daemonSetStrategy implements verification logic for daemon sets. // daemonSetStrategy implements verification logic for daemon sets.
...@@ -66,8 +66,8 @@ func (daemonSetStrategy) NamespaceScoped() bool { ...@@ -66,8 +66,8 @@ 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(ctx context.Context, obj runtime.Object) { func (daemonSetStrategy) PrepareForCreate(ctx context.Context, obj runtime.Object) {
daemonSet := obj.(*extensions.DaemonSet) daemonSet := obj.(*apps.DaemonSet)
daemonSet.Status = extensions.DaemonSetStatus{} daemonSet.Status = apps.DaemonSetStatus{}
daemonSet.Generation = 1 daemonSet.Generation = 1
if daemonSet.Spec.TemplateGeneration < 1 { if daemonSet.Spec.TemplateGeneration < 1 {
...@@ -79,8 +79,8 @@ func (daemonSetStrategy) PrepareForCreate(ctx context.Context, obj runtime.Objec ...@@ -79,8 +79,8 @@ func (daemonSetStrategy) PrepareForCreate(ctx context.Context, obj runtime.Objec
// 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(ctx context.Context, obj, old runtime.Object) { func (daemonSetStrategy) PrepareForUpdate(ctx context.Context, obj, old runtime.Object) {
newDaemonSet := obj.(*extensions.DaemonSet) newDaemonSet := obj.(*apps.DaemonSet)
oldDaemonSet := old.(*extensions.DaemonSet) oldDaemonSet := old.(*apps.DaemonSet)
pod.DropDisabledAlphaFields(&newDaemonSet.Spec.Template.Spec) pod.DropDisabledAlphaFields(&newDaemonSet.Spec.Template.Spec)
pod.DropDisabledAlphaFields(&oldDaemonSet.Spec.Template.Spec) pod.DropDisabledAlphaFields(&oldDaemonSet.Spec.Template.Spec)
...@@ -114,7 +114,7 @@ func (daemonSetStrategy) PrepareForUpdate(ctx context.Context, obj, old runtime. ...@@ -114,7 +114,7 @@ func (daemonSetStrategy) PrepareForUpdate(ctx context.Context, obj, old runtime.
// Validate validates a new daemon set. // Validate validates a new daemon set.
func (daemonSetStrategy) Validate(ctx context.Context, obj runtime.Object) field.ErrorList { func (daemonSetStrategy) Validate(ctx context.Context, obj runtime.Object) field.ErrorList {
daemonSet := obj.(*extensions.DaemonSet) daemonSet := obj.(*apps.DaemonSet)
return validation.ValidateDaemonSet(daemonSet) return validation.ValidateDaemonSet(daemonSet)
} }
...@@ -130,9 +130,9 @@ func (daemonSetStrategy) AllowCreateOnUpdate() bool { ...@@ -130,9 +130,9 @@ 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 context.Context, obj, old runtime.Object) field.ErrorList { func (daemonSetStrategy) ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList {
newDaemonSet := obj.(*extensions.DaemonSet) newDaemonSet := obj.(*apps.DaemonSet)
oldDaemonSet := old.(*extensions.DaemonSet) oldDaemonSet := old.(*apps.DaemonSet)
allErrs := validation.ValidateDaemonSet(obj.(*extensions.DaemonSet)) allErrs := validation.ValidateDaemonSet(obj.(*apps.DaemonSet))
allErrs = append(allErrs, validation.ValidateDaemonSetUpdate(newDaemonSet, oldDaemonSet)...) allErrs = append(allErrs, validation.ValidateDaemonSetUpdate(newDaemonSet, oldDaemonSet)...)
// Update is not allowed to set Spec.Selector for apps/v1 and apps/v1beta2 (allowed for extensions/v1beta1). // Update is not allowed to set Spec.Selector for apps/v1 and apps/v1beta2 (allowed for extensions/v1beta1).
...@@ -165,11 +165,11 @@ type daemonSetStatusStrategy struct { ...@@ -165,11 +165,11 @@ type daemonSetStatusStrategy struct {
var StatusStrategy = daemonSetStatusStrategy{Strategy} var StatusStrategy = daemonSetStatusStrategy{Strategy}
func (daemonSetStatusStrategy) PrepareForUpdate(ctx context.Context, obj, old runtime.Object) { func (daemonSetStatusStrategy) PrepareForUpdate(ctx context.Context, obj, old runtime.Object) {
newDaemonSet := obj.(*extensions.DaemonSet) newDaemonSet := obj.(*apps.DaemonSet)
oldDaemonSet := old.(*extensions.DaemonSet) oldDaemonSet := old.(*apps.DaemonSet)
newDaemonSet.Spec = oldDaemonSet.Spec newDaemonSet.Spec = oldDaemonSet.Spec
} }
func (daemonSetStatusStrategy) ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList { func (daemonSetStatusStrategy) ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList {
return validation.ValidateDaemonSetStatusUpdate(obj.(*extensions.DaemonSet), old.(*extensions.DaemonSet)) return validation.ValidateDaemonSetStatusUpdate(obj.(*apps.DaemonSet), old.(*apps.DaemonSet))
} }
...@@ -24,8 +24,8 @@ import ( ...@@ -24,8 +24,8 @@ import (
"k8s.io/apimachinery/pkg/util/validation/field" "k8s.io/apimachinery/pkg/util/validation/field"
genericapirequest "k8s.io/apiserver/pkg/endpoints/request" genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
"k8s.io/apiserver/pkg/registry/rest" "k8s.io/apiserver/pkg/registry/rest"
"k8s.io/kubernetes/pkg/apis/apps"
api "k8s.io/kubernetes/pkg/apis/core" api "k8s.io/kubernetes/pkg/apis/core"
"k8s.io/kubernetes/pkg/apis/extensions"
) )
const ( const (
...@@ -160,20 +160,20 @@ func TestSelectorImmutability(t *testing.T) { ...@@ -160,20 +160,20 @@ func TestSelectorImmutability(t *testing.T) {
} }
} }
func newDaemonSetWithSelectorLabels(selectorLabels map[string]string, templateGeneration int64) *extensions.DaemonSet { func newDaemonSetWithSelectorLabels(selectorLabels map[string]string, templateGeneration int64) *apps.DaemonSet {
return &extensions.DaemonSet{ return &apps.DaemonSet{
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
Name: daemonsetName, Name: daemonsetName,
Namespace: namespace, Namespace: namespace,
ResourceVersion: "1", ResourceVersion: "1",
}, },
Spec: extensions.DaemonSetSpec{ Spec: apps.DaemonSetSpec{
Selector: &metav1.LabelSelector{ Selector: &metav1.LabelSelector{
MatchLabels: selectorLabels, MatchLabels: selectorLabels,
MatchExpressions: []metav1.LabelSelectorRequirement{}, MatchExpressions: []metav1.LabelSelectorRequirement{},
}, },
UpdateStrategy: extensions.DaemonSetUpdateStrategy{ UpdateStrategy: apps.DaemonSetUpdateStrategy{
Type: extensions.OnDeleteDaemonSetStrategyType, Type: apps.OnDeleteDaemonSetStrategyType,
}, },
TemplateGeneration: templateGeneration, TemplateGeneration: templateGeneration,
Template: api.PodTemplateSpec{ Template: api.PodTemplateSpec{
......
...@@ -16,8 +16,8 @@ go_library( ...@@ -16,8 +16,8 @@ go_library(
deps = [ deps = [
"//pkg/api/legacyscheme:go_default_library", "//pkg/api/legacyscheme:go_default_library",
"//pkg/api/pod:go_default_library", "//pkg/api/pod:go_default_library",
"//pkg/apis/extensions:go_default_library", "//pkg/apis/apps:go_default_library",
"//pkg/apis/extensions/validation:go_default_library", "//pkg/apis/apps/validation:go_default_library",
"//staging/src/k8s.io/api/apps/v1beta1:go_default_library", "//staging/src/k8s.io/api/apps/v1beta1:go_default_library",
"//staging/src/k8s.io/api/apps/v1beta2:go_default_library", "//staging/src/k8s.io/api/apps/v1beta2:go_default_library",
"//staging/src/k8s.io/api/extensions/v1beta1:go_default_library", "//staging/src/k8s.io/api/extensions/v1beta1:go_default_library",
...@@ -37,8 +37,8 @@ go_test( ...@@ -37,8 +37,8 @@ go_test(
srcs = ["strategy_test.go"], srcs = ["strategy_test.go"],
embed = [":go_default_library"], embed = [":go_default_library"],
deps = [ deps = [
"//pkg/apis/apps:go_default_library",
"//pkg/apis/core:go_default_library", "//pkg/apis/core:go_default_library",
"//pkg/apis/extensions:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/intstr:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/intstr:go_default_library",
......
...@@ -11,9 +11,9 @@ go_test( ...@@ -11,9 +11,9 @@ go_test(
srcs = ["storage_test.go"], srcs = ["storage_test.go"],
embed = [":go_default_library"], embed = [":go_default_library"],
deps = [ deps = [
"//pkg/apis/apps:go_default_library",
"//pkg/apis/autoscaling:go_default_library", "//pkg/apis/autoscaling:go_default_library",
"//pkg/apis/core:go_default_library", "//pkg/apis/core:go_default_library",
"//pkg/apis/extensions:go_default_library",
"//pkg/registry/registrytest:go_default_library", "//pkg/registry/registrytest:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/equality:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/api/equality:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/errors:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/api/errors:go_default_library",
...@@ -37,14 +37,14 @@ go_library( ...@@ -37,14 +37,14 @@ go_library(
srcs = ["storage.go"], srcs = ["storage.go"],
importpath = "k8s.io/kubernetes/pkg/registry/apps/deployment/storage", importpath = "k8s.io/kubernetes/pkg/registry/apps/deployment/storage",
deps = [ deps = [
"//pkg/apis/apps:go_default_library",
"//pkg/apis/apps/v1beta1:go_default_library", "//pkg/apis/apps/v1beta1:go_default_library",
"//pkg/apis/apps/v1beta2:go_default_library", "//pkg/apis/apps/v1beta2:go_default_library",
"//pkg/apis/apps/validation:go_default_library",
"//pkg/apis/autoscaling:go_default_library", "//pkg/apis/autoscaling:go_default_library",
"//pkg/apis/autoscaling/v1:go_default_library", "//pkg/apis/autoscaling/v1:go_default_library",
"//pkg/apis/autoscaling/validation:go_default_library", "//pkg/apis/autoscaling/validation:go_default_library",
"//pkg/apis/extensions:go_default_library",
"//pkg/apis/extensions/v1beta1:go_default_library", "//pkg/apis/extensions/v1beta1:go_default_library",
"//pkg/apis/extensions/validation:go_default_library",
"//pkg/printers:go_default_library", "//pkg/printers:go_default_library",
"//pkg/printers/internalversion:go_default_library", "//pkg/printers/internalversion:go_default_library",
"//pkg/printers/storage:go_default_library", "//pkg/printers/storage:go_default_library",
......
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