@@ -1699,6 +1699,44 @@ USER test1`
1699
1699
Expect (pod .Annotations ).To (HaveKeyWithValue (define .InspectAnnotationVolumesFrom + "/" + ctr2 , ctr1 ))
1700
1700
})
1701
1701
1702
+ It ("pod volumes-from annotation with semicolon as field separator" , func () {
1703
+ // Assert that volumes-from annotation for multiple source
1704
+ // containers along with their mount options are getting
1705
+ // generated with semicolon as the field separator.
1706
+
1707
+ srcctr1 , srcctr2 , tgtctr := "srcctr1" , "srcctr2" , "tgtctr"
1708
+ frmopt1 , frmopt2 := srcctr1 + ":ro" , srcctr2 + ":ro"
1709
+ vol1 := filepath .Join (podmanTest .TempDir , "vol-test1" )
1710
+ vol2 := filepath .Join (podmanTest .TempDir , "vol-test2" )
1711
+
1712
+ err1 := os .MkdirAll (vol1 , 0755 )
1713
+ Expect (err1 ).ToNot (HaveOccurred ())
1714
+
1715
+ err2 := os .MkdirAll (vol2 , 0755 )
1716
+ Expect (err2 ).ToNot (HaveOccurred ())
1717
+
1718
+ session := podmanTest .Podman ([]string {"create" , "--name" , srcctr1 , "-v" , vol1 , CITEST_IMAGE })
1719
+ session .WaitWithDefaultTimeout ()
1720
+ Expect (session ).Should (ExitCleanly ())
1721
+
1722
+ session = podmanTest .Podman ([]string {"create" , "--name" , srcctr2 , "-v" , vol2 , CITEST_IMAGE })
1723
+ session .WaitWithDefaultTimeout ()
1724
+ Expect (session ).Should (ExitCleanly ())
1725
+
1726
+ session = podmanTest .Podman ([]string {"create" , "--volumes-from" , frmopt1 , "--volumes-from" , frmopt2 , "--name" , tgtctr , CITEST_IMAGE })
1727
+ session .WaitWithDefaultTimeout ()
1728
+ Expect (session ).Should (ExitCleanly ())
1729
+
1730
+ kube := podmanTest .Podman ([]string {"kube" , "generate" , "--podman-only" , tgtctr })
1731
+ kube .WaitWithDefaultTimeout ()
1732
+ Expect (kube ).Should (ExitCleanly ())
1733
+
1734
+ pod := new (v1.Pod )
1735
+ err3 := yaml .Unmarshal (kube .Out .Contents (), pod )
1736
+ Expect (err3 ).ToNot (HaveOccurred ())
1737
+ Expect (pod .Annotations ).To (HaveKeyWithValue (define .InspectAnnotationVolumesFrom + "/" + tgtctr , frmopt1 + ";" + frmopt2 ))
1738
+ })
1739
+
1702
1740
It ("--podman-only on container with --rm" , func () {
1703
1741
ctr := "ctr"
1704
1742
0 commit comments