Skip to content

Commit dee97a4

Browse files
author
draveness
committed
refactor: cleanup e2e replicaset utils
1 parent e3c3f75 commit dee97a4

File tree

16 files changed

+198
-105
lines changed

16 files changed

+198
-105
lines changed

test/e2e/apps/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ go_library(
6161
"//staging/src/k8s.io/client-go/tools/watch:go_default_library",
6262
"//test/e2e/common:go_default_library",
6363
"//test/e2e/framework:go_default_library",
64+
"//test/e2e/framework/replicaset:go_default_library",
6465
"//test/utils:go_default_library",
6566
"//test/utils/image:go_default_library",
6667
"//vendor/github.com/davecgh/go-spew/spew:go_default_library",

test/e2e/apps/deployment.go

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import (
3939
appsinternal "k8s.io/kubernetes/pkg/apis/apps"
4040
deploymentutil "k8s.io/kubernetes/pkg/controller/deployment/util"
4141
"k8s.io/kubernetes/test/e2e/framework"
42+
"k8s.io/kubernetes/test/e2e/framework/replicaset"
4243
testutil "k8s.io/kubernetes/test/utils"
4344
utilpointer "k8s.io/utils/pointer"
4445
)
@@ -421,7 +422,7 @@ func testRolloverDeployment(f *framework.Framework) {
421422

422423
// Wait for replica set to become ready before adopting it.
423424
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())
425426

426427
// Create a deployment to delete nginx pods and instead bring up redis-slave pods.
427428
// We use a nonexistent image here, so that we make sure it won't finish
@@ -527,7 +528,7 @@ func testRollbackDeployment(f *framework.Framework) {
527528
Expect(err).NotTo(HaveOccurred())
528529

529530
// Current newRS annotation should be "create"
530-
err = framework.CheckNewRSAnnotations(c, ns, deploymentName, createAnnotation)
531+
err = replicaset.CheckNewRSAnnotations(c, ns, deploymentName, createAnnotation)
531532
Expect(err).NotTo(HaveOccurred())
532533

533534
// 2. Update the deployment to create redis pods.
@@ -553,7 +554,7 @@ func testRollbackDeployment(f *framework.Framework) {
553554
Expect(err).NotTo(HaveOccurred())
554555

555556
// Current newRS annotation should be "update"
556-
err = framework.CheckNewRSAnnotations(c, ns, deploymentName, updateAnnotation)
557+
err = replicaset.CheckNewRSAnnotations(c, ns, deploymentName, updateAnnotation)
557558
Expect(err).NotTo(HaveOccurred())
558559

559560
// 3. Update the deploymentRollback to rollback to revision 1
@@ -576,7 +577,7 @@ func testRollbackDeployment(f *framework.Framework) {
576577
Expect(err).NotTo(HaveOccurred())
577578

578579
// 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)
580581
Expect(err).NotTo(HaveOccurred())
581582

582583
// 4. Update the deploymentRollback to rollback to last revision
@@ -597,7 +598,7 @@ func testRollbackDeployment(f *framework.Framework) {
597598
Expect(err).NotTo(HaveOccurred())
598599

599600
// 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)
601602
Expect(err).NotTo(HaveOccurred())
602603

603604
// 5. Update the deploymentRollback to rollback to revision 10
@@ -875,17 +876,17 @@ func testProportionalScalingDeployment(f *framework.Framework) {
875876
// First rollout's replicaset should have Deployment's (replicas - maxUnavailable) = 10 - 2 = 8 available replicas.
876877
minAvailableReplicas := replicas - int32(maxUnavailable)
877878
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())
879880

880881
// First rollout's replicaset should have .spec.replicas = 8 too.
881882
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())
883884

884885
// The desired replicas wait makes sure that the RS controller has created expected number of pods.
885886
framework.Logf("Waiting for the first rollout's replicaset of deployment %q to have desired number of replicas", deploymentName)
886887
firstRS, err = c.AppsV1().ReplicaSets(ns).Get(firstRS.Name, metav1.GetOptions{})
887888
Expect(err).NotTo(HaveOccurred())
888-
err = framework.WaitForReplicaSetDesiredReplicas(c.AppsV1(), firstRS)
889+
err = replicaset.WaitForReplicaSetDesiredReplicas(c.AppsV1(), firstRS)
889890
Expect(err).NotTo(HaveOccurred())
890891

891892
// Checking state of second rollout's replicaset.
@@ -902,13 +903,13 @@ func testProportionalScalingDeployment(f *framework.Framework) {
902903
// Second rollout's replicaset should have Deployment's (replicas + maxSurge - first RS's replicas) = 10 + 3 - 8 = 5 for .spec.replicas.
903904
newReplicas := replicas + int32(maxSurge) - minAvailableReplicas
904905
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())
906907

907908
// The desired replicas wait makes sure that the RS controller has created expected number of pods.
908909
framework.Logf("Waiting for the second rollout's replicaset of deployment %q to have desired number of replicas", deploymentName)
909910
secondRS, err = c.AppsV1().ReplicaSets(ns).Get(secondRS.Name, metav1.GetOptions{})
910911
Expect(err).NotTo(HaveOccurred())
911-
err = framework.WaitForReplicaSetDesiredReplicas(c.AppsV1(), secondRS)
912+
err = replicaset.WaitForReplicaSetDesiredReplicas(c.AppsV1(), secondRS)
912913
Expect(err).NotTo(HaveOccurred())
913914

914915
// Check the deployment's minimum availability.
@@ -934,12 +935,12 @@ func testProportionalScalingDeployment(f *framework.Framework) {
934935
// First rollout's replicaset should have .spec.replicas = 8 + (30-10)*(8/13) = 8 + 12 = 20 replicas.
935936
// Note that 12 comes from rounding (30-10)*(8/13) to nearest integer.
936937
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())
938939

939940
// Second rollout's replicaset should have .spec.replicas = 5 + (30-10)*(5/13) = 5 + 8 = 13 replicas.
940941
// Note that 8 comes from rounding (30-10)*(5/13) to nearest integer.
941942
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())
943944
}
944945

945946
func checkDeploymentReplicaSetsControllerRef(c clientset.Interface, ns string, uid types.UID, label map[string]string) error {

test/e2e/apps/replica_set.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import (
3030
"k8s.io/apimachinery/pkg/util/wait"
3131
"k8s.io/kubernetes/pkg/controller/replicaset"
3232
"k8s.io/kubernetes/test/e2e/framework"
33+
replicasetutil "k8s.io/kubernetes/test/e2e/framework/replicaset"
3334

3435
. "github.com/onsi/ginkgo"
3536
. "github.com/onsi/gomega"
@@ -228,7 +229,7 @@ func testReplicaSetConditionCheck(f *framework.Framework) {
228229
Expect(err).NotTo(HaveOccurred())
229230

230231
By(fmt.Sprintf("Scaling down replica set %q to satisfy pod quota", name))
231-
rs, err = framework.UpdateReplicaSetWithRetries(c, namespace, name, func(update *apps.ReplicaSet) {
232+
rs, err = replicasetutil.UpdateReplicaSetWithRetries(c, namespace, name, func(update *apps.ReplicaSet) {
232233
x := int32(2)
233234
update.Spec.Replicas = &x
234235
})

test/e2e/common/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ go_library(
7777
"//staging/src/k8s.io/client-go/tools/cache:go_default_library",
7878
"//staging/src/k8s.io/client-go/tools/watch:go_default_library",
7979
"//test/e2e/framework:go_default_library",
80+
"//test/e2e/framework/replicaset:go_default_library",
8081
"//test/utils:go_default_library",
8182
"//test/utils/image:go_default_library",
8283
"//vendor/github.com/onsi/ginkgo:go_default_library",

test/e2e/common/autoscaling_utils.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import (
3232
clientset "k8s.io/client-go/kubernetes"
3333
api "k8s.io/kubernetes/pkg/apis/core"
3434
"k8s.io/kubernetes/test/e2e/framework"
35+
"k8s.io/kubernetes/test/e2e/framework/replicaset"
3536
testutils "k8s.io/kubernetes/test/utils"
3637

3738
. "github.com/onsi/ginkgo"
@@ -482,7 +483,7 @@ func runServiceAndWorkloadForResourceConsumer(c clientset.Interface, ns, name st
482483
RCConfig: rcConfig,
483484
}
484485
By(fmt.Sprintf("creating replicaset %s in namespace %s", rsConfig.Name, rsConfig.Namespace))
485-
framework.ExpectNoError(framework.RunReplicaSet(rsConfig))
486+
framework.ExpectNoError(replicaset.RunReplicaSet(rsConfig))
486487
break
487488
default:
488489
framework.Failf(invalidKind)

test/e2e/framework/BUILD

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ go_library(
2929
"pv_util.go",
3030
"rc_util.go",
3131
"resource_usage_gatherer.go",
32-
"rs_util.go",
3332
"service_util.go",
3433
"size.go",
3534
"ssh.go",
@@ -107,7 +106,6 @@ go_library(
107106
"//staging/src/k8s.io/client-go/dynamic:go_default_library",
108107
"//staging/src/k8s.io/client-go/kubernetes:go_default_library",
109108
"//staging/src/k8s.io/client-go/kubernetes/scheme:go_default_library",
110-
"//staging/src/k8s.io/client-go/kubernetes/typed/apps/v1:go_default_library",
111109
"//staging/src/k8s.io/client-go/kubernetes/typed/authorization/v1beta1:go_default_library",
112110
"//staging/src/k8s.io/client-go/kubernetes/typed/core/v1:go_default_library",
113111
"//staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1beta1:go_default_library",
@@ -165,6 +163,7 @@ filegroup(
165163
"//test/e2e/framework/providers/kubemark:all-srcs",
166164
"//test/e2e/framework/providers/openstack:all-srcs",
167165
"//test/e2e/framework/providers/vsphere:all-srcs",
166+
"//test/e2e/framework/replicaset:all-srcs",
168167
"//test/e2e/framework/testfiles:all-srcs",
169168
"//test/e2e/framework/timer:all-srcs",
170169
"//test/e2e/framework/viperconfig:all-srcs",

test/e2e/framework/deployment_util.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import (
3838

3939
// UpdateDeploymentWithRetries updates the specified deployment with retries.
4040
func UpdateDeploymentWithRetries(c clientset.Interface, namespace, name string, applyUpdate testutils.UpdateDeploymentFunc) (*apps.Deployment, error) {
41-
return testutils.UpdateDeploymentWithRetries(c, namespace, name, applyUpdate, Logf, Poll, pollShortTimeout)
41+
return testutils.UpdateDeploymentWithRetries(c, namespace, name, applyUpdate, Logf, Poll, PollShortTimeout)
4242
}
4343

4444
// WaitForDeploymentOldRSsNum waits for the deployment to clean up old rcs.
@@ -77,14 +77,14 @@ func WaitForObservedDeployment(c clientset.Interface, ns, deploymentName string,
7777

7878
// WaitForDeploymentWithCondition waits for the specified deployment condition.
7979
func WaitForDeploymentWithCondition(c clientset.Interface, ns, deploymentName, reason string, condType apps.DeploymentConditionType) error {
80-
return testutils.WaitForDeploymentWithCondition(c, ns, deploymentName, reason, condType, Logf, Poll, pollLongTimeout)
80+
return testutils.WaitForDeploymentWithCondition(c, ns, deploymentName, reason, condType, Logf, Poll, PollLongTimeout)
8181
}
8282

8383
// WaitForDeploymentRevisionAndImage waits for the deployment's and its new RS's revision and container image to match the given revision and image.
8484
// Note that deployment revision and its new RS revision should be updated shortly most of the time, but an overwhelmed RS controller
8585
// may result in taking longer to relabel a RS.
8686
func WaitForDeploymentRevisionAndImage(c clientset.Interface, ns, deploymentName string, revision, image string) error {
87-
return testutils.WaitForDeploymentRevisionAndImage(c, ns, deploymentName, revision, image, Logf, Poll, pollLongTimeout)
87+
return testutils.WaitForDeploymentRevisionAndImage(c, ns, deploymentName, revision, image, Logf, Poll, PollLongTimeout)
8888
}
8989

9090
// NewDeployment returns a deployment spec with the specified argument.
@@ -123,24 +123,24 @@ func NewDeployment(deploymentName string, replicas int32, podLabels map[string]s
123123
// Rolling update strategy is used only during a rolling update, and can be violated in other situations,
124124
// such as shortly after a scaling event or the deployment is just created.
125125
func WaitForDeploymentComplete(c clientset.Interface, d *apps.Deployment) error {
126-
return testutils.WaitForDeploymentComplete(c, d, Logf, Poll, pollLongTimeout)
126+
return testutils.WaitForDeploymentComplete(c, d, Logf, Poll, PollLongTimeout)
127127
}
128128

129129
// WaitForDeploymentCompleteAndCheckRolling waits for the deployment to complete, and check rolling update strategy isn't broken at any times.
130130
// Rolling update strategy should not be broken during a rolling update.
131131
func WaitForDeploymentCompleteAndCheckRolling(c clientset.Interface, d *apps.Deployment) error {
132-
return testutils.WaitForDeploymentCompleteAndCheckRolling(c, d, Logf, Poll, pollLongTimeout)
132+
return testutils.WaitForDeploymentCompleteAndCheckRolling(c, d, Logf, Poll, PollLongTimeout)
133133
}
134134

135135
// WaitForDeploymentUpdatedReplicasGTE waits for given deployment to be observed by the controller and has at least a number of updatedReplicas
136136
func WaitForDeploymentUpdatedReplicasGTE(c clientset.Interface, ns, deploymentName string, minUpdatedReplicas int32, desiredGeneration int64) error {
137-
return testutils.WaitForDeploymentUpdatedReplicasGTE(c, ns, deploymentName, minUpdatedReplicas, desiredGeneration, Poll, pollLongTimeout)
137+
return testutils.WaitForDeploymentUpdatedReplicasGTE(c, ns, deploymentName, minUpdatedReplicas, desiredGeneration, Poll, PollLongTimeout)
138138
}
139139

140140
// WaitForDeploymentRollbackCleared waits for given deployment either started rolling back or doesn't need to rollback.
141141
// Note that rollback should be cleared shortly, so we only wait for 1 minute here to fail early.
142142
func WaitForDeploymentRollbackCleared(c clientset.Interface, ns, deploymentName string) error {
143-
return testutils.WaitForDeploymentRollbackCleared(c, ns, deploymentName, Poll, pollShortTimeout)
143+
return testutils.WaitForDeploymentRollbackCleared(c, ns, deploymentName, Poll, PollShortTimeout)
144144
}
145145

146146
// WatchRecreateDeployment watches Recreate deployments and ensures no new pods will run at the same time with
@@ -200,7 +200,7 @@ func logPodsOfDeployment(c clientset.Interface, deployment *apps.Deployment, rsL
200200

201201
// WaitForDeploymentRevision waits for becoming the target revision of a delopyment.
202202
func WaitForDeploymentRevision(c clientset.Interface, d *apps.Deployment, targetRevision string) error {
203-
err := wait.PollImmediate(Poll, pollLongTimeout, func() (bool, error) {
203+
err := wait.PollImmediate(Poll, PollLongTimeout, func() (bool, error) {
204204
deployment, err := c.AppsV1().Deployments(d.Namespace).Get(d.Name, metav1.GetOptions{})
205205
if err != nil {
206206
return false, err
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
load("@io_bazel_rules_go//go:def.bzl", "go_library")
2+
3+
go_library(
4+
name = "go_default_library",
5+
srcs = [
6+
"fixtures.go",
7+
"rest.go",
8+
"wait.go",
9+
],
10+
importpath = "k8s.io/kubernetes/test/e2e/framework/replicaset",
11+
visibility = ["//visibility:public"],
12+
deps = [
13+
"//pkg/controller/deployment/util:go_default_library",
14+
"//staging/src/k8s.io/api/apps/v1:go_default_library",
15+
"//staging/src/k8s.io/api/core/v1:go_default_library",
16+
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
17+
"//staging/src/k8s.io/apimachinery/pkg/util/wait:go_default_library",
18+
"//staging/src/k8s.io/client-go/kubernetes:go_default_library",
19+
"//staging/src/k8s.io/client-go/kubernetes/typed/apps/v1:go_default_library",
20+
"//test/e2e/framework:go_default_library",
21+
"//test/utils:go_default_library",
22+
"//vendor/github.com/onsi/ginkgo:go_default_library",
23+
],
24+
)
25+
26+
filegroup(
27+
name = "package-srcs",
28+
srcs = glob(["**"]),
29+
tags = ["automanaged"],
30+
visibility = ["//visibility:private"],
31+
)
32+
33+
filegroup(
34+
name = "all-srcs",
35+
srcs = [":package-srcs"],
36+
tags = ["automanaged"],
37+
visibility = ["//visibility:public"],
38+
)
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*
2+
Copyright 2019 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package replicaset
18+
19+
import (
20+
apps "k8s.io/api/apps/v1"
21+
"k8s.io/api/core/v1"
22+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
23+
)
24+
25+
// NewReplicaSet returns a new ReplicaSet.
26+
func NewReplicaSet(name, namespace string, replicas int32, podLabels map[string]string, imageName, image string) *apps.ReplicaSet {
27+
return &apps.ReplicaSet{
28+
TypeMeta: metav1.TypeMeta{
29+
Kind: "ReplicaSet",
30+
APIVersion: "apps/v1",
31+
},
32+
ObjectMeta: metav1.ObjectMeta{
33+
Namespace: namespace,
34+
Name: name,
35+
},
36+
Spec: apps.ReplicaSetSpec{
37+
Selector: &metav1.LabelSelector{
38+
MatchLabels: podLabels,
39+
},
40+
Replicas: &replicas,
41+
Template: v1.PodTemplateSpec{
42+
ObjectMeta: metav1.ObjectMeta{
43+
Labels: podLabels,
44+
},
45+
Spec: v1.PodSpec{
46+
Containers: []v1.Container{
47+
{
48+
Name: imageName,
49+
Image: image,
50+
},
51+
},
52+
},
53+
},
54+
},
55+
}
56+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*
2+
Copyright 2019 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package replicaset
18+
19+
import (
20+
"fmt"
21+
22+
apps "k8s.io/api/apps/v1"
23+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
24+
clientset "k8s.io/client-go/kubernetes"
25+
deploymentutil "k8s.io/kubernetes/pkg/controller/deployment/util"
26+
"k8s.io/kubernetes/test/e2e/framework"
27+
testutils "k8s.io/kubernetes/test/utils"
28+
)
29+
30+
// UpdateReplicaSetWithRetries updates replicaset template with retries.
31+
func UpdateReplicaSetWithRetries(c clientset.Interface, namespace, name string, applyUpdate testutils.UpdateReplicaSetFunc) (*apps.ReplicaSet, error) {
32+
return testutils.UpdateReplicaSetWithRetries(c, namespace, name, applyUpdate, framework.Logf, framework.Poll, framework.PollShortTimeout)
33+
}
34+
35+
// CheckNewRSAnnotations check if the new RS's annotation is as expected
36+
func CheckNewRSAnnotations(c clientset.Interface, ns, deploymentName string, expectedAnnotations map[string]string) error {
37+
deployment, err := c.AppsV1().Deployments(ns).Get(deploymentName, metav1.GetOptions{})
38+
if err != nil {
39+
return err
40+
}
41+
newRS, err := deploymentutil.GetNewReplicaSet(deployment, c.AppsV1())
42+
if err != nil {
43+
return err
44+
}
45+
for k, v := range expectedAnnotations {
46+
// Skip checking revision annotations
47+
if k != deploymentutil.RevisionAnnotation && v != newRS.Annotations[k] {
48+
return fmt.Errorf("Expected new RS annotations = %+v, got %+v", expectedAnnotations, newRS.Annotations)
49+
}
50+
}
51+
return nil
52+
}

0 commit comments

Comments
 (0)