squakez commented on code in PR #3309:
URL: https://github.com/apache/camel-k/pull/3309#discussion_r885444988


##########
pkg/controller/build/build_pod.go:
##########
@@ -238,18 +238,34 @@ func addBuildTaskToPod(build *v1.Build, taskName string, 
pod *corev1.Pod) {
 }
 
 func addBuildahTaskToPod(ctx context.Context, c ctrl.Reader, build *v1.Build, 
task *v1.BuildahTask, pod *corev1.Pod) error {
-       bud := []string{
-               "buildah",
-               "bud",
-               "--storage-driver=vfs",
-               "--platform",
-               task.Platform,
-               "--pull-always",
-               "-f",
-               "Dockerfile",
-               "-t",
-               task.Image,
-               ".",
+       bud := []string{}
+
+       if task.Platform != "" {

Review Comment:
   I think we can do something better for readability. Pseudo code follows:
   ```
        bud = []string{
                        "buildah",
                        "bud",
                        "--storage-driver=vfs",
                        "--pull-always",
                        "-f",
                        "Dockerfile",
                        "-t",
                        task.Image,
                        ".",
   }
   if platform != "" {
       bud = append(bud, []string{
                        task.Platform,
                        "--pull-always",
                        "-f",
       }
   }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to