File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -638,6 +638,45 @@ func TestApplyContainerEdits(t *testing.T) {
638638 },
639639 },
640640 },
641+ {
642+ name : "mount added by edit comes after existing ones of same number of path parts" ,
643+ spec : & oci.Spec {
644+ Mounts : []oci.Mount {
645+ {
646+ Source : "/some/host/path1" ,
647+ Destination : "/dest/path/c" ,
648+ },
649+ {
650+ Source : "/some/host/path2" ,
651+ Destination : "/dest/path/b" ,
652+ },
653+ },
654+ },
655+ edits : & cdi.ContainerEdits {
656+ Mounts : []* cdi.Mount {
657+ {
658+ HostPath : "/some/host/path3" ,
659+ ContainerPath : "/dest/path/a" ,
660+ },
661+ },
662+ },
663+ result : & oci.Spec {
664+ Mounts : []oci.Mount {
665+ {
666+ Source : "/some/host/path1" ,
667+ Destination : "/dest/path/c" ,
668+ },
669+ {
670+ Source : "/some/host/path2" ,
671+ Destination : "/dest/path/b" ,
672+ },
673+ {
674+ Source : "/some/host/path3" ,
675+ Destination : "/dest/path/a" ,
676+ },
677+ },
678+ },
679+ },
641680 } {
642681 t .Run (tc .name , func (t * testing.T ) {
643682 edits := ContainerEdits {tc .edits }
You can’t perform that action at this time.
0 commit comments