File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ def load_cri_image(path, fullname=None):
2626 Path of the Docker image archive to load
2727 """
2828 log .info ('Importing image from "%s" into CRI cache' , path )
29- cmd = f'ctr --debug -n k8s.io image import "{ path } "'
29+ cmd = f'ctr --debug -n k8s.io image import --platform "linux/amd64" "{ path } "'
3030 if fullname :
3131 cmd += f' --index-name "{ fullname } "'
3232 return __salt__ ["cmd.run_all" ](cmd )
Original file line number Diff line number Diff line change @@ -37,7 +37,9 @@ def test_load_cri_image(self, path):
3737 with patch .dict (containerd .__salt__ , {"cmd.run_all" : mock_cmd }):
3838 self .assertEqual (containerd .load_cri_image (path ), cmd )
3939 mock_cmd .assert_called_once_with (
40- 'ctr --debug -n k8s.io image import "{}"' .format (path )
40+ 'ctr --debug -n k8s.io image import --platform "linux/amd64" "{}"' .format (
41+ path
42+ )
4143 )
4244
4345 def test_load_cri_image_with_fullname (self ):
@@ -61,5 +63,5 @@ def test_load_cri_image_with_fullname(self):
6163 cmd ,
6264 )
6365 mock_cmd .assert_called_once_with (
64- 'ctr --debug -n k8s.io image import "/tmp/toto.tar" --index-name "abc.def/my-image:3.5"'
66+ 'ctr --debug -n k8s.io image import --platform "linux/amd64" "/tmp/toto.tar" --index-name "abc.def/my-image:3.5"'
6567 )
You can’t perform that action at this time.
0 commit comments