@@ -98,7 +98,7 @@ func CompileKonfluxCli() error {
9898 compileArgs = append (compileArgs , "-gcflags" , "all=-N -l" )
9999 }
100100 compileArgs = append (compileArgs , "-o" , cliBinPath , mainGoPath )
101- stdout , stderr , _ , err := executor .Execute ("go" , compileArgs ... )
101+ stdout , stderr , _ , err := executor .Execute (cliWrappers . Command ( "go" , compileArgs ... ) )
102102 if err != nil {
103103 fmt .Printf ("failed to build CLI: %s\n [stdout]:\n %s\n [stderr]:\n %s\n " , err .Error (), stdout , stderr )
104104 }
@@ -208,7 +208,7 @@ func CreateTestImage(config TestImageConfig) error {
208208 for filePathInContainer , filePathOnHost := range config .Files {
209209 fileNameInContextDir := filepath .Base (filePathOnHost )
210210 dockerfileContent = append (dockerfileContent , fmt .Sprintf ("COPY %s %s" , fileNameInContextDir , filePathInContainer ))
211- stdout , stderr , _ , err := executor .Execute ("cp" , filePathOnHost , path .Join (testImageDir , fileNameInContextDir ))
211+ stdout , stderr , _ , err := executor .Execute (cliWrappers . Command ( "cp" , filePathOnHost , path .Join (testImageDir , fileNameInContextDir ) ))
212212 if err != nil {
213213 fmt .Printf ("failed to copy test file: %s\n [stdout]:\n %s\n [stderr]:\n %s\n " , err .Error (), stdout , stderr )
214214 return err
@@ -232,7 +232,7 @@ func CreateTestImage(config TestImageConfig) error {
232232 buildArgs = append (buildArgs , "--platform" , config .Platform )
233233 }
234234 buildArgs = append (buildArgs , "." )
235- stdout , stderr , _ , err := executor .ExecuteInDir ( testImageDir , containerTool , buildArgs ... )
235+ stdout , stderr , _ , err := executor .Execute (cliWrappers. Cmd { Name : containerTool , Args : buildArgs , Dir : testImageDir } )
236236 if err != nil {
237237 fmt .Printf ("failed to build test image: %s\n [stdout]:\n %s\n [stderr]:\n %s\n " , err .Error (), stdout , stderr )
238238 return err
@@ -262,14 +262,14 @@ func CreateAndPushImageIndex(indexRef string, images []string) (string, error) {
262262 createManifestArgs = append (createManifestArgs , "--amend" )
263263 createManifestArgs = append (createManifestArgs , indexRef )
264264 createManifestArgs = append (createManifestArgs , images ... )
265- if stdout , stderr , _ , err := executor .Execute (containerTool , createManifestArgs ... ); err != nil {
265+ if stdout , stderr , _ , err := executor .Execute (cliWrappers . Command ( containerTool , createManifestArgs ... ) ); err != nil {
266266 fmt .Printf ("failed to create image index: %s\n [stdout]:\n %s\n [stderr]:\n %s\n " , err .Error (), stdout , stderr )
267267 return "" , err
268268 }
269269
270270 // Clean up local image index
271271 defer func () {
272- if stdout , stderr , _ , err := executor .Execute (containerTool , "manifest" , "rm" , indexRef ); err != nil {
272+ if stdout , stderr , _ , err := executor .Execute (cliWrappers . Command ( containerTool , "manifest" , "rm" , indexRef ) ); err != nil {
273273 fmt .Printf ("failed to clean up local image index: %s\n [stdout]:\n %s\n [stderr]:\n %s\n " , err .Error (), stdout , stderr )
274274 }
275275 }()
@@ -279,7 +279,7 @@ func CreateAndPushImageIndex(indexRef string, images []string) (string, error) {
279279
280280 switch containerTool {
281281 case "docker" :
282- stdout , stderr , _ , err := executor .Execute (containerTool , "manifest" , "push" , indexRef )
282+ stdout , stderr , _ , err := executor .Execute (cliWrappers . Command ( containerTool , "manifest" , "push" , indexRef ) )
283283 if err != nil {
284284 fmt .Printf ("failed to push image index: %s\n [stdout]:\n %s\n [stderr]:\n %s\n " , err .Error (), stdout , stderr )
285285 return "" , err
@@ -288,7 +288,7 @@ func CreateAndPushImageIndex(indexRef string, images []string) (string, error) {
288288
289289 case "podman" :
290290 const digestfilePath = "/tmp/index-digestfile"
291- stdout , stderr , _ , err := executor .Execute ("podman" , "push" , "--digestfile" , digestfilePath , indexRef )
291+ stdout , stderr , _ , err := executor .Execute (cliWrappers . Command ( "podman" , "push" , "--digestfile" , digestfilePath , indexRef ) )
292292 if err != nil {
293293 fmt .Printf ("failed to push image index: %s\n [stdout]:\n %s\n [stderr]:\n %s\n " , err .Error (), stdout , stderr )
294294 return "" , err
@@ -307,7 +307,7 @@ func CreateAndPushImageIndex(indexRef string, images []string) (string, error) {
307307
308308func DeleteLocalImage (imageRef string ) error {
309309 executor := cliWrappers .NewCliExecutor ()
310- stdout , stderr , _ , err := executor .Execute (containerTool , "rmi" , imageRef )
310+ stdout , stderr , _ , err := executor .Execute (cliWrappers . Command ( containerTool , "rmi" , imageRef ) )
311311 if err != nil {
312312 fmt .Printf ("failed to remove test image: %s\n [stdout]:\n %s\n [stderr]:\n %s\n " , err .Error (), stdout , stderr )
313313 }
@@ -322,7 +322,7 @@ func PushImage(imageRef string) (string, error) {
322322
323323 switch containerTool {
324324 case "docker" :
325- stdout , stderr , _ , err := executor .Execute ("docker" , "push" , imageRef )
325+ stdout , stderr , _ , err := executor .Execute (cliWrappers . Command ( "docker" , "push" , imageRef ) )
326326 if err != nil {
327327 fmt .Printf ("failed to push test image: %s\n [stdout]:\n %s\n [stderr]:\n %s\n " , err .Error (), stdout , stderr )
328328 return "" , err
@@ -331,7 +331,7 @@ func PushImage(imageRef string) (string, error) {
331331
332332 case "podman" :
333333 const digestfilePath = "/tmp/digestfile"
334- stdout , stderr , _ , err := executor .Execute ("podman" , "push" , "--digestfile" , digestfilePath , imageRef )
334+ stdout , stderr , _ , err := executor .Execute (cliWrappers . Command ( "podman" , "push" , "--digestfile" , digestfilePath , imageRef ) )
335335 if err != nil {
336336 fmt .Printf ("failed to push test image: %s\n [stdout]:\n %s\n [stderr]:\n %s\n " , err .Error (), stdout , stderr )
337337 return "" , err
0 commit comments