File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4646 if : matrix.rust == 'stable' && matrix.os == 'ubuntu-latest'
4747 run : cargo fmt -- --check
4848
49+ - name : Check for executor.execute_command antipattern
50+ if : matrix.rust == 'stable' && matrix.os == 'ubuntu-latest'
51+ run : |
52+ # Commands should use self.execute_command(args) not self.executor.execute_command("docker", args)
53+ # The latter causes "docker docker <cmd>" double-command bug
54+ if grep -r 'executor\.execute_command("docker"' src/command/; then
55+ echo "ERROR: Found executor.execute_command(\"docker\", ...) antipattern!"
56+ echo "Use self.execute_command(args) instead to avoid 'docker docker' bug."
57+ exit 1
58+ fi
59+
4960 - name : Run Clippy
5061 if : matrix.rust == 'stable'
5162 run : cargo clippy --all-targets --all-features -- -D warnings
Original file line number Diff line number Diff line change @@ -1034,7 +1034,7 @@ impl BuildCommand {
10341034 & self . executor
10351035 }
10361036
1037- /// Get a mutable reference to the command executor
1037+ /// Get a mutable reference to the command executor
10381038 #[ must_use]
10391039 pub fn get_executor_mut ( & mut self ) -> & mut CommandExecutor {
10401040 & mut self . executor
@@ -1322,7 +1322,7 @@ impl DockerCommand for BuildCommand {
13221322
13231323 async fn execute ( & self ) -> Result < Self :: Output > {
13241324 let args = self . build_command_args ( ) ;
1325- let output = self . executor . execute_command ( "docker" , args) . await ?;
1325+ let output = self . execute_command ( args) . await ?;
13261326
13271327 // Extract image ID from output
13281328 let image_id = if self . quiet {
Original file line number Diff line number Diff line change @@ -165,7 +165,7 @@ impl DockerCommand for BuilderBuildCommand {
165165 async fn execute ( & self ) -> Result < Self :: Output > {
166166 // The builder build command has the same output as regular build
167167 let args = self . build_command_args ( ) ;
168- let output = self . inner . executor . execute_command ( "docker" , args) . await ?;
168+ let output = self . execute_command ( args) . await ?;
169169
170170 // Extract image ID from output
171171 let image_id = extract_image_id ( & output. stdout ) ;
Original file line number Diff line number Diff line change @@ -191,7 +191,7 @@ impl DockerCommand for BuilderPruneCommand {
191191
192192 async fn execute ( & self ) -> Result < Self :: Output > {
193193 let args = self . build_command_args ( ) ;
194- let output = self . executor . execute_command ( "docker" , args) . await ?;
194+ let output = self . execute_command ( args) . await ?;
195195
196196 let ( deleted_cache_ids, space_reclaimed, space_reclaimed_str) =
197197 Self :: parse_output ( & output. stdout ) ;
Original file line number Diff line number Diff line change @@ -820,7 +820,7 @@ impl DockerCommand for ImagesCommand {
820820
821821 async fn execute ( & self ) -> Result < Self :: Output > {
822822 let args = self . build_command_args ( ) ;
823- let output = self . executor . execute_command ( "docker" , args) . await ?;
823+ let output = self . execute_command ( args) . await ?;
824824
825825 let images = self . parse_output ( & output) ;
826826
Original file line number Diff line number Diff line change @@ -234,7 +234,7 @@ impl DockerCommand for LoginCommand {
234234
235235 async fn execute ( & self ) -> Result < Self :: Output > {
236236 let args = self . build_command_args ( ) ;
237- let output = self . executor . execute_command ( "docker" , args) . await ?;
237+ let output = self . execute_command ( args) . await ?;
238238
239239 Ok ( LoginOutput { output } )
240240 }
Original file line number Diff line number Diff line change @@ -186,7 +186,7 @@ impl DockerCommand for LogoutCommand {
186186
187187 async fn execute ( & self ) -> Result < Self :: Output > {
188188 let args = self . build_command_args ( ) ;
189- let output = self . executor . execute_command ( "docker" , args) . await ?;
189+ let output = self . execute_command ( args) . await ?;
190190
191191 Ok ( LogoutOutput { output } )
192192 }
Original file line number Diff line number Diff line change @@ -349,7 +349,7 @@ impl DockerCommand for PullCommand {
349349
350350 async fn execute ( & self ) -> Result < Self :: Output > {
351351 let args = self . build_command_args ( ) ;
352- self . executor . execute_command ( "docker" , args) . await
352+ self . execute_command ( args) . await
353353 }
354354}
355355
Original file line number Diff line number Diff line change @@ -357,7 +357,7 @@ impl DockerCommand for PushCommand {
357357
358358 async fn execute ( & self ) -> Result < Self :: Output > {
359359 let args = self . build_command_args ( ) ;
360- self . executor . execute_command ( "docker" , args) . await
360+ self . execute_command ( args) . await
361361 }
362362}
363363
Original file line number Diff line number Diff line change @@ -488,7 +488,7 @@ impl DockerCommand for SearchCommand {
488488
489489 async fn execute ( & self ) -> Result < Self :: Output > {
490490 let args = self . build_command_args ( ) ;
491- let output = self . executor . execute_command ( "docker" , args) . await ?;
491+ let output = self . execute_command ( args) . await ?;
492492
493493 let repositories = self . parse_output ( & output) ?;
494494
You can’t perform that action at this time.
0 commit comments