public Integer doCall() throws Exception {
        File resolvedWorkingDir;
        if (workingDir != null) {
            resolvedWorkingDir = new File(workingDir);
        } else {
            String projectName;
            if (name != null) {
                projectName = KubernetesHelper.sanitize(name);
            } else if (filePath != null) {
                projectName = KubernetesHelper.sanitize(FileUtil.onlyName(SourceScheme.onlyName(filePath)));
            } else {
                printer().println("Name or source file must be set");
                return 1;
            }

            resolvedWorkingDir = new File(RUN_PLATFORM_DIR + "/" + projectName);
        }

        if (!resolvedWorkingDir.exists()) {
            printer().printf("Failed to resolve exported project from path '%s'%n", resolvedWorkingDir);
            return 1;
        }

        File manifest = KubernetesHelper.resolveKubernetesManifest(new File(resolvedWorkingDir, "target/kubernetes"));
        try (FileInputStream fis = new FileInputStream(manifest)) {
            List<StatusDetails> status;
            if (namespace != null) {
                status = client().load(fis).inNamespace(namespace).delete();
            } else {
                status = client().load(fis).delete();
            }

            status.forEach(s -> printer().printf("Deleted: %s '%s'%n", StringHelper.capitalize(s.getKind()), s.getName()));
        }

        return 0;
    }
@Test
    public void shouldDeleteKubernetesResources() throws Exception {
        kubernetesClient.apps().deployments().resource(new DeploymentBuilder()
                .withNewMetadata()
                .withName("route")
                .addToLabels(BaseTrait.INTEGRATION_LABEL, "route")
                .endMetadata()
                .withNewSpec()
                .withNewTemplate()
                .withNewSpec()
                .addToContainers(new ContainerBuilder()
                        .withName("route")
                        .withImage("quay.io/camel-test/route:1.0-SNAPSHOT")
                        .build())
                .endSpec()
                .endTemplate()
                .endSpec()
                .build()).create();

        kubernetesClient.services().resource(new ServiceBuilder()
                .withNewMetadata()
                .withName("route")
                .endMetadata()
                .withNewSpec()
                .withPorts(new ServicePortBuilder()
                        .withPort(80)
                        .withProtocol("TCP")
                        .withName("http")
                        .withTargetPort(new IntOrString(8080))
                        .build())
                .endSpec()
                .build()).create();

        KubernetesRun run = new KubernetesRun(new CamelJBangMain().withPrinter(printer));
        run.withClient(kubernetesClient);
        run.imageGroup = "camel-test";
        run.imageBuild = false;
        run.imagePush = false;
        run.filePaths = new String[] { "classpath:route.yaml" };
        run.output = "yaml";
        int exit = run.doCall();
        Assertions.assertEquals(0, exit);

        KubernetesDelete command = new KubernetesDelete(new CamelJBangMain().withPrinter(printer));
        command.withClient(kubernetesClient);
        command.name = "route";
        exit = command.doCall();

        Assertions.assertEquals(0, exit);
        Assertions.assertNull(kubernetesClient.apps().deployments().withName("route").get());
        Assertions.assertNull(kubernetesClient.services().withName("route").get());
    }