public Integer doCall() throws Exception {
        String projectName = getProjectName();

        String workingDir = RUN_PLATFORM_DIR + "/" + projectName;

        printer().println("Exporting application ...");

        // Cache export output in String for later usage in case of error
        Printer runPrinter = printer();
        StringPrinter exportPrinter = new StringPrinter();
        getMain().withPrinter(exportPrinter);

        KubernetesExport export = new KubernetesExport(
                getMain(), new KubernetesExport.ExportConfigurer(
                        runtime,
                        quarkusVersion,
                        true,
                        true,
                        false,
                        workingDir,
                        List.of(filePaths),
                        gav,
                        openApi,
                        true,
                        true,
                        false,
                        false,
                        "off"));

        export.image = image;
        export.imageRegistry = imageRegistry;
        export.imageGroup = imageGroup;
        export.imageBuilder = imageBuilder;
        export.clusterType = clusterType;
        export.traitProfile = traitProfile;
        export.serviceAccount = serviceAccount;
        export.properties = properties;
        export.configs = configs;
        export.resources = resources;
        export.envVars = envVars;
        export.volumes = volumes;
        export.connects = connects;
        export.annotations = annotations;
        export.labels = labels;
        export.traits = traits;

        int exit = export.export();

        // Revert printer to this run command's printer
        getMain().withPrinter(runPrinter);
        if (exit != 0) {
            // print export command output with error details
            printer().println(exportPrinter.getOutput());
            return exit;
        }

        if (output != null) {
            if (RuntimeType.quarkus == runtime) {
                exit = buildQuarkus(workingDir);
            } else if (RuntimeType.springBoot == runtime) {
                exit = buildSpringBoot(workingDir);
            }

            if (exit != 0) {
                printer().println("Project build failed!");
                return exit;
            }

            File manifest;
            switch (output) {
                case "yaml" -> manifest = KubernetesHelper.resolveKubernetesManifest(workingDir + "/target/kubernetes");
                case "json" ->
                    manifest = KubernetesHelper.resolveKubernetesManifest(workingDir + "/target/kubernetes", "json");
                default -> {
                    printer().printf("Unsupported output format '%s' (supported: yaml, json)%n", output);
                    return 1;
                }
            }

            try (FileInputStream fis = new FileInputStream(manifest)) {
                printer().println(IOHelper.loadText(fis));
            }

            return 0;
        }

        if (RuntimeType.quarkus == runtime) {
            exit = deployQuarkus(workingDir);
        } else if (RuntimeType.springBoot == runtime) {
            exit = deploySpringBoot(workingDir);
        }

        if (exit != 0) {
            printer().println("Deployment to %s failed!".formatted(Optional.ofNullable(clusterType)
                    .map(StringHelper::capitalize).orElse("Kubernetes")));
            return exit;
        }

        if (dev) {
            DefaultCamelContext reloadContext = new DefaultCamelContext(false);
            configureFileWatch(reloadContext, export, workingDir);
            reloadContext.start();

            if (cleanup) {
                installShutdownInterceptor(projectName, workingDir);
            }
        }

        if (dev || wait || logs) {
            client(Pod.class).withLabel(BaseTrait.INTEGRATION_LABEL, projectName)
                    .waitUntilCondition(it -> "Running".equals(it.getStatus().getPhase()), 10, TimeUnit.MINUTES);
        }

        if (dev || logs) {
            PodLogs logsCommand = new PodLogs(getMain());
            logsCommand.withClient(client());
            logsCommand.label = "%s=%s".formatted(BaseTrait.INTEGRATION_LABEL, projectName);
            logsCommand.doCall();
        }

        return 0;
    }
@Test
    public void shouldGenerateKubernetesManifest() throws Exception {
        KubernetesRun command = createCommand();
        command.filePaths = new String[] { "classpath:route.yaml" };
        int exit = command.doCall();

        Assertions.assertEquals(0, exit);

        List<HasMetadata> resources = kubernetesClient.load(getKubernetesManifestAsStream(printer.getOutput())).items();
        Assertions.assertEquals(3, resources.size());

        Deployment deployment = resources.stream()
                .filter(it -> Deployment.class.isAssignableFrom(it.getClass()))
                .map(Deployment.class::cast)
                .findFirst()
                .orElseThrow(() -> new RuntimeCamelException("Missing deployment in Kubernetes manifest"));

        Assertions.assertEquals("route", deployment.getMetadata().getName());
        Assertions.assertEquals(1, deployment.getSpec().getTemplate().getSpec().getContainers().size());
        Assertions.assertEquals("route", deployment.getMetadata().getLabels().get(BaseTrait.INTEGRATION_LABEL));
        Assertions.assertEquals("route", deployment.getSpec().getTemplate().getSpec().getContainers().get(0).getName());
        Assertions.assertEquals(3, deployment.getSpec().getSelector().getMatchLabels().size());
        Assertions.assertEquals("route", deployment.getSpec().getSelector().getMatchLabels().get(BaseTrait.INTEGRATION_LABEL));
        Assertions.assertEquals("docker.io/camel-test/route:1.0-SNAPSHOT",
                deployment.getSpec().getTemplate().getSpec().getContainers().get(0).getImage());
        Assertions.assertEquals("Always",
                deployment.getSpec().getTemplate().getSpec().getContainers().get(0).getImagePullPolicy());
    }