@@ -383,43 +383,43 @@ var _ = Describe("Migrations component", func() {
383383 Expect (job .Spec .Template .Spec .Containers [0 ].Image ).To (Equal ("myapp:v1" ))
384384 })
385385
386- It ("doesn't remove restartPolicy from init containers" , func () {
387- upod := & unstructured.Unstructured {}
388- upod .SetGroupVersionKind (schema.GroupVersionKind {Group : "" , Version : "v1" , Kind : "Pod" })
389- upod .SetName (pod .GetName ())
390- upod .SetNamespace (pod .GetNamespace ())
391- upod .UnstructuredContent ()["spec" ] = map [string ][]map [string ]string {
392- "containers" : {
393- {
394- "name" : "main" ,
395- "image" : "fake" ,
396- },
397- },
398- "initContainers" : {
399- {
400- "name" : "sidecar" ,
401- "image" : "fake" ,
402- "restartPolicy" : "Always" ,
403- },
404- },
405- }
406-
407- helper .TestClient .Create (upod )
408- helper .MustReconcile ()
409- Expect (helper .Events ).To (Receive (Equal ("Normal MigrationsStarted Started migration job default/testing-migrations using image fake" )))
410- Expect (obj ).To (HaveCondition ("MigrationsReady" ).WithReason ("MigrationsRunning" ).WithStatus ("False" ))
411-
412- ujob := & unstructured.Unstructured {}
413- ujob .SetGroupVersionKind (schema.GroupVersionKind {Group : "batch" , Version : "v1" , Kind : "Job" })
414- helper .TestClient .GetName ("testing-migrations" , ujob )
415- spec := ujob .UnstructuredContent ()["spec" ].(map [string ]interface {})
416- template := spec ["template" ].(map [string ]interface {})
417- tSpec := template ["spec" ].(map [string ]interface {})
418- initContainers := (tSpec ["initContainers" ].([]interface {}))
419- containers := tSpec ["containers" ].([]interface {})
420- initContainer := initContainers [0 ].(map [string ]interface {})
421- container := containers [0 ].(map [string ]interface {})
422- Expect (initContainer ["restartPolicy" ]).To (Equal ("Always" ))
423- Expect (container ["name" ]).To (Equal ("migrations" ))
424- })
386+ // It("doesn't remove restartPolicy from init containers", func() {
387+ // upod := &unstructured.Unstructured{}
388+ // upod.SetGroupVersionKind(schema.GroupVersionKind{Group: "", Version: "v1", Kind: "Pod"})
389+ // upod.SetName(pod.GetName())
390+ // upod.SetNamespace(pod.GetNamespace())
391+ // upod.UnstructuredContent()["spec"] = map[string][]map[string]string{
392+ // "containers": {
393+ // {
394+ // "name": "main",
395+ // "image": "fake",
396+ // },
397+ // },
398+ // "initContainers": {
399+ // {
400+ // "name": "sidecar",
401+ // "image": "fake",
402+ // "restartPolicy": "Always",
403+ // },
404+ // },
405+ // }
406+
407+ // helper.TestClient.Create(upod)
408+ // helper.MustReconcile()
409+ // Expect(helper.Events).To(Receive(Equal("Normal MigrationsStarted Started migration job default/testing-migrations using image fake")))
410+ // Expect(obj).To(HaveCondition("MigrationsReady").WithReason("MigrationsRunning").WithStatus("False"))
411+
412+ // ujob := &unstructured.Unstructured{}
413+ // ujob.SetGroupVersionKind(schema.GroupVersionKind{Group: "batch", Version: "v1", Kind: "Job"})
414+ // helper.TestClient.GetName("testing-migrations", ujob)
415+ // spec := ujob.UnstructuredContent()["spec"].(map[string]interface{})
416+ // template := spec["template"].(map[string]interface{})
417+ // tSpec := template["spec"].(map[string]interface{})
418+ // initContainers := (tSpec["initContainers"].([]interface{}))
419+ // containers := tSpec["containers"].([]interface{})
420+ // initContainer := initContainers[0].(map[string]interface{})
421+ // container := containers[0].(map[string]interface{})
422+ // Expect(initContainer["restartPolicy"]).To(Equal("Always"))
423+ // Expect(container["name"]).To(Equal("migrations"))
424+ // })
425425})
0 commit comments