@@ -39,6 +39,7 @@ import (
39
39
appsinternal "k8s.io/kubernetes/pkg/apis/apps"
40
40
deploymentutil "k8s.io/kubernetes/pkg/controller/deployment/util"
41
41
"k8s.io/kubernetes/test/e2e/framework"
42
+ "k8s.io/kubernetes/test/e2e/framework/replicaset"
42
43
testutil "k8s.io/kubernetes/test/utils"
43
44
utilpointer "k8s.io/utils/pointer"
44
45
)
@@ -421,7 +422,7 @@ func testRolloverDeployment(f *framework.Framework) {
421
422
422
423
// Wait for replica set to become ready before adopting it.
423
424
framework .Logf ("Waiting for pods owned by replica set %q to become ready" , rsName )
424
- Expect (framework .WaitForReadyReplicaSet (c , ns , rsName )).NotTo (HaveOccurred ())
425
+ Expect (replicaset .WaitForReadyReplicaSet (c , ns , rsName )).NotTo (HaveOccurred ())
425
426
426
427
// Create a deployment to delete nginx pods and instead bring up redis-slave pods.
427
428
// We use a nonexistent image here, so that we make sure it won't finish
@@ -527,7 +528,7 @@ func testRollbackDeployment(f *framework.Framework) {
527
528
Expect (err ).NotTo (HaveOccurred ())
528
529
529
530
// Current newRS annotation should be "create"
530
- err = framework .CheckNewRSAnnotations (c , ns , deploymentName , createAnnotation )
531
+ err = replicaset .CheckNewRSAnnotations (c , ns , deploymentName , createAnnotation )
531
532
Expect (err ).NotTo (HaveOccurred ())
532
533
533
534
// 2. Update the deployment to create redis pods.
@@ -553,7 +554,7 @@ func testRollbackDeployment(f *framework.Framework) {
553
554
Expect (err ).NotTo (HaveOccurred ())
554
555
555
556
// Current newRS annotation should be "update"
556
- err = framework .CheckNewRSAnnotations (c , ns , deploymentName , updateAnnotation )
557
+ err = replicaset .CheckNewRSAnnotations (c , ns , deploymentName , updateAnnotation )
557
558
Expect (err ).NotTo (HaveOccurred ())
558
559
559
560
// 3. Update the deploymentRollback to rollback to revision 1
@@ -576,7 +577,7 @@ func testRollbackDeployment(f *framework.Framework) {
576
577
Expect (err ).NotTo (HaveOccurred ())
577
578
578
579
// Current newRS annotation should be "create", after the rollback
579
- err = framework .CheckNewRSAnnotations (c , ns , deploymentName , createAnnotation )
580
+ err = replicaset .CheckNewRSAnnotations (c , ns , deploymentName , createAnnotation )
580
581
Expect (err ).NotTo (HaveOccurred ())
581
582
582
583
// 4. Update the deploymentRollback to rollback to last revision
@@ -597,7 +598,7 @@ func testRollbackDeployment(f *framework.Framework) {
597
598
Expect (err ).NotTo (HaveOccurred ())
598
599
599
600
// Current newRS annotation should be "update", after the rollback
600
- err = framework .CheckNewRSAnnotations (c , ns , deploymentName , updateAnnotation )
601
+ err = replicaset .CheckNewRSAnnotations (c , ns , deploymentName , updateAnnotation )
601
602
Expect (err ).NotTo (HaveOccurred ())
602
603
603
604
// 5. Update the deploymentRollback to rollback to revision 10
@@ -875,17 +876,17 @@ func testProportionalScalingDeployment(f *framework.Framework) {
875
876
// First rollout's replicaset should have Deployment's (replicas - maxUnavailable) = 10 - 2 = 8 available replicas.
876
877
minAvailableReplicas := replicas - int32 (maxUnavailable )
877
878
framework .Logf ("Waiting for the first rollout's replicaset to have .status.availableReplicas = %d" , minAvailableReplicas )
878
- Expect (framework .WaitForReplicaSetTargetAvailableReplicas (c , firstRS , minAvailableReplicas )).NotTo (HaveOccurred ())
879
+ Expect (replicaset .WaitForReplicaSetTargetAvailableReplicas (c , firstRS , minAvailableReplicas )).NotTo (HaveOccurred ())
879
880
880
881
// First rollout's replicaset should have .spec.replicas = 8 too.
881
882
framework .Logf ("Waiting for the first rollout's replicaset to have .spec.replicas = %d" , minAvailableReplicas )
882
- Expect (framework .WaitForReplicaSetTargetSpecReplicas (c , firstRS , minAvailableReplicas )).NotTo (HaveOccurred ())
883
+ Expect (replicaset .WaitForReplicaSetTargetSpecReplicas (c , firstRS , minAvailableReplicas )).NotTo (HaveOccurred ())
883
884
884
885
// The desired replicas wait makes sure that the RS controller has created expected number of pods.
885
886
framework .Logf ("Waiting for the first rollout's replicaset of deployment %q to have desired number of replicas" , deploymentName )
886
887
firstRS , err = c .AppsV1 ().ReplicaSets (ns ).Get (firstRS .Name , metav1.GetOptions {})
887
888
Expect (err ).NotTo (HaveOccurred ())
888
- err = framework .WaitForReplicaSetDesiredReplicas (c .AppsV1 (), firstRS )
889
+ err = replicaset .WaitForReplicaSetDesiredReplicas (c .AppsV1 (), firstRS )
889
890
Expect (err ).NotTo (HaveOccurred ())
890
891
891
892
// Checking state of second rollout's replicaset.
@@ -902,13 +903,13 @@ func testProportionalScalingDeployment(f *framework.Framework) {
902
903
// Second rollout's replicaset should have Deployment's (replicas + maxSurge - first RS's replicas) = 10 + 3 - 8 = 5 for .spec.replicas.
903
904
newReplicas := replicas + int32 (maxSurge ) - minAvailableReplicas
904
905
framework .Logf ("Waiting for the second rollout's replicaset to have .spec.replicas = %d" , newReplicas )
905
- Expect (framework .WaitForReplicaSetTargetSpecReplicas (c , secondRS , newReplicas )).NotTo (HaveOccurred ())
906
+ Expect (replicaset .WaitForReplicaSetTargetSpecReplicas (c , secondRS , newReplicas )).NotTo (HaveOccurred ())
906
907
907
908
// The desired replicas wait makes sure that the RS controller has created expected number of pods.
908
909
framework .Logf ("Waiting for the second rollout's replicaset of deployment %q to have desired number of replicas" , deploymentName )
909
910
secondRS , err = c .AppsV1 ().ReplicaSets (ns ).Get (secondRS .Name , metav1.GetOptions {})
910
911
Expect (err ).NotTo (HaveOccurred ())
911
- err = framework .WaitForReplicaSetDesiredReplicas (c .AppsV1 (), secondRS )
912
+ err = replicaset .WaitForReplicaSetDesiredReplicas (c .AppsV1 (), secondRS )
912
913
Expect (err ).NotTo (HaveOccurred ())
913
914
914
915
// Check the deployment's minimum availability.
@@ -934,12 +935,12 @@ func testProportionalScalingDeployment(f *framework.Framework) {
934
935
// First rollout's replicaset should have .spec.replicas = 8 + (30-10)*(8/13) = 8 + 12 = 20 replicas.
935
936
// Note that 12 comes from rounding (30-10)*(8/13) to nearest integer.
936
937
framework .Logf ("Verifying that first rollout's replicaset has .spec.replicas = 20" )
937
- Expect (framework .WaitForReplicaSetTargetSpecReplicas (c , firstRS , 20 )).NotTo (HaveOccurred ())
938
+ Expect (replicaset .WaitForReplicaSetTargetSpecReplicas (c , firstRS , 20 )).NotTo (HaveOccurred ())
938
939
939
940
// Second rollout's replicaset should have .spec.replicas = 5 + (30-10)*(5/13) = 5 + 8 = 13 replicas.
940
941
// Note that 8 comes from rounding (30-10)*(5/13) to nearest integer.
941
942
framework .Logf ("Verifying that second rollout's replicaset has .spec.replicas = 13" )
942
- Expect (framework .WaitForReplicaSetTargetSpecReplicas (c , secondRS , 13 )).NotTo (HaveOccurred ())
943
+ Expect (replicaset .WaitForReplicaSetTargetSpecReplicas (c , secondRS , 13 )).NotTo (HaveOccurred ())
943
944
}
944
945
945
946
func checkDeploymentReplicaSetsControllerRef (c clientset.Interface , ns string , uid types.UID , label map [string ]string ) error {
0 commit comments