@@ -61,7 +61,7 @@ var _ = Describe("Migrations component", func() {
61
61
}
62
62
job = & batchv1.Job {
63
63
ObjectMeta : metav1.ObjectMeta {
64
- Name : "testing" ,
64
+ Name : "testing-migrations " ,
65
65
Namespace : "default" ,
66
66
},
67
67
Spec : batchv1.JobSpec {
@@ -110,9 +110,9 @@ var _ = Describe("Migrations component", func() {
110
110
It ("starts a migration" , func () {
111
111
helper .TestClient .Create (pod )
112
112
helper .MustReconcile ()
113
- Expect (helper .Events ).To (Receive (Equal ("Normal MigrationsStarted Started migration job default/testing using image myapp:latest" )))
113
+ Expect (helper .Events ).To (Receive (Equal ("Normal MigrationsStarted Started migration job default/testing-migrations using image myapp:latest" )))
114
114
Expect (obj ).To (HaveCondition ("MigrationsReady" ).WithReason ("MigrationsRunning" ).WithStatus ("False" ))
115
- helper .TestClient .GetName ("testing" , job )
115
+ helper .TestClient .GetName ("testing-migrations " , job )
116
116
Expect (job .Spec .Template .Spec .Containers [0 ].Name ).To (Equal ("migrations" ))
117
117
Expect (job .Spec .Template .Spec .Containers [0 ].Image ).To (Equal ("myapp:latest" ))
118
118
})
@@ -123,7 +123,7 @@ var _ = Describe("Migrations component", func() {
123
123
helper .MustReconcile ()
124
124
Expect (obj ).To (HaveCondition ("MigrationsReady" ).WithReason ("MigrationsRunning" ).WithStatus ("False" ))
125
125
job2 := & batchv1.Job {}
126
- helper .TestClient .GetName ("testing" , job2 )
126
+ helper .TestClient .GetName ("testing-migrations " , job2 )
127
127
Expect (job .Spec ).To (Equal (job2 .Spec ))
128
128
})
129
129
@@ -133,7 +133,7 @@ var _ = Describe("Migrations component", func() {
133
133
helper .TestClient .Create (job )
134
134
helper .MustReconcile ()
135
135
Expect (obj ).To (HaveCondition ("MigrationsReady" ).WithReason ("StaleJob" ).WithStatus ("False" ))
136
- err := helper .Client .Get (context .Background (), types.NamespacedName {Name : "testing" , Namespace : "default" }, job )
136
+ err := helper .Client .Get (context .Background (), types.NamespacedName {Name : "testing-migrations " , Namespace : "default" }, job )
137
137
Expect (kerrors .IsNotFound (err )).To (BeTrue ())
138
138
})
139
139
@@ -143,7 +143,7 @@ var _ = Describe("Migrations component", func() {
143
143
helper .TestClient .Create (job )
144
144
helper .MustReconcile ()
145
145
Expect (obj ).To (HaveCondition ("MigrationsReady" ).WithStatus ("True" ))
146
- err := helper .Client .Get (context .Background (), types.NamespacedName {Name : "testing" , Namespace : "default" }, job )
146
+ err := helper .Client .Get (context .Background (), types.NamespacedName {Name : "testing-migrations " , Namespace : "default" }, job )
147
147
Expect (kerrors .IsNotFound (err )).To (BeTrue ())
148
148
})
149
149
@@ -154,7 +154,7 @@ var _ = Describe("Migrations component", func() {
154
154
helper .MustReconcile ()
155
155
Expect (obj ).To (HaveCondition ("MigrationsReady" ).WithStatus ("False" ).WithReason ("MigrationsFailed" ))
156
156
job2 := & batchv1.Job {}
157
- helper .TestClient .GetName ("testing" , job2 )
157
+ helper .TestClient .GetName ("testing-migrations " , job2 )
158
158
Expect (job .Spec ).To (Equal (job2 .Spec ))
159
159
})
160
160
@@ -173,15 +173,15 @@ var _ = Describe("Migrations component", func() {
173
173
pod2 .Spec .Containers [0 ].Image = "two:latest"
174
174
helper .TestClient .Create (pod2 )
175
175
helper .MustReconcile ()
176
- helper .TestClient .GetName ("testing" , job )
176
+ helper .TestClient .GetName ("testing-migrations " , job )
177
177
Expect (job .Spec .Template .Spec .Containers [0 ].Image ).To (Equal ("two:latest" ))
178
178
})
179
179
180
180
It ("applies image override" , func () {
181
181
obj .Spec .Image = "other:1"
182
182
helper .TestClient .Create (pod )
183
183
helper .MustReconcile ()
184
- helper .TestClient .GetName ("testing" , job )
184
+ helper .TestClient .GetName ("testing-migrations " , job )
185
185
Expect (job .Spec .Template .Spec .Containers [0 ].Image ).To (Equal ("other:1" ))
186
186
})
187
187
@@ -190,7 +190,7 @@ var _ = Describe("Migrations component", func() {
190
190
obj .Spec .Command = & command
191
191
helper .TestClient .Create (pod )
192
192
helper .MustReconcile ()
193
- helper .TestClient .GetName ("testing" , job )
193
+ helper .TestClient .GetName ("testing-migrations " , job )
194
194
Expect (job .Spec .Template .Spec .Containers [0 ].Command ).To (Equal ([]string {"run" , "migrations" }))
195
195
})
196
196
@@ -199,7 +199,7 @@ var _ = Describe("Migrations component", func() {
199
199
obj .Spec .Args = & args
200
200
helper .TestClient .Create (pod )
201
201
helper .MustReconcile ()
202
- helper .TestClient .GetName ("testing" , job )
202
+ helper .TestClient .GetName ("testing-migrations " , job )
203
203
Expect (job .Spec .Template .Spec .Containers [0 ].Args ).To (Equal ([]string {"run" , "migrations" }))
204
204
})
205
205
@@ -246,7 +246,7 @@ var _ = Describe("Migrations component", func() {
246
246
helper .TestClient .Create (pod )
247
247
248
248
helper .MustReconcile ()
249
- helper .TestClient .GetName ("testing" , job )
249
+ helper .TestClient .GetName ("testing-migrations " , job )
250
250
Expect (job .Spec .Template .Spec .Containers [0 ].Image ).To (Equal ("myapp:v1" ))
251
251
})
252
252
})
0 commit comments