Skip to content

Commit

Permalink
Merge pull request kubernetes#71256 from bclau/fixes-hardcoded-image-…
Browse files Browse the repository at this point in the history
…names

tests: Fixes wrong Pod Container Image usage in test/e2e/apps
  • Loading branch information
k8s-ci-robot authored Nov 29, 2018
2 parents 81eb9ce + 626cbe9 commit bf7efc6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions test/e2e/apps/rc.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,15 +264,15 @@ func testRCAdoptMatchingOrphans(f *framework.Framework) {
Containers: []v1.Container{
{
Name: name,
Image: NginxImageName,
Image: NginxImage,
},
},
},
})

By("When a replication controller with a matching selector is created")
replicas := int32(1)
rcSt := newRC(name, replicas, map[string]string{"name": name}, name, NginxImageName)
rcSt := newRC(name, replicas, map[string]string{"name": name}, name, NginxImage)
rcSt.Spec.Selector = map[string]string{"name": name}
rc, err := f.ClientSet.CoreV1().ReplicationControllers(f.Namespace.Name).Create(rcSt)
Expect(err).NotTo(HaveOccurred())
Expand Down Expand Up @@ -301,7 +301,7 @@ func testRCReleaseControlledNotMatching(f *framework.Framework) {
name := "pod-release"
By("Given a ReplicationController is created")
replicas := int32(1)
rcSt := newRC(name, replicas, map[string]string{"name": name}, name, NginxImageName)
rcSt := newRC(name, replicas, map[string]string{"name": name}, name, NginxImage)
rcSt.Spec.Selector = map[string]string{"name": name}
rc, err := f.ClientSet.CoreV1().ReplicationControllers(f.Namespace.Name).Create(rcSt)
Expect(err).NotTo(HaveOccurred())
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/apps/replica_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,15 +271,15 @@ func testRSAdoptMatchingAndReleaseNotMatching(f *framework.Framework) {
Containers: []v1.Container{
{
Name: name,
Image: NginxImageName,
Image: NginxImage,
},
},
},
})

By("When a replicaset with a matching selector is created")
replicas := int32(1)
rsSt := newRS(name, replicas, map[string]string{"name": name}, name, NginxImageName)
rsSt := newRS(name, replicas, map[string]string{"name": name}, name, NginxImage)
rsSt.Spec.Selector = &metav1.LabelSelector{MatchLabels: map[string]string{"name": name}}
rs, err := f.ClientSet.AppsV1().ReplicaSets(f.Namespace.Name).Create(rsSt)
Expect(err).NotTo(HaveOccurred())
Expand Down
1 change: 1 addition & 0 deletions test/e2e/apps/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
imageutils "k8s.io/kubernetes/test/utils/image"
)

// NOTE(claudiub): These constants should NOT be used as Pod Container Images.
const (
NginxImageName = "nginx"
RedisImageName = "redis"
Expand Down

0 comments on commit bf7efc6

Please sign in to comment.