claudio4j commented on code in PR #17419: URL: https://github.com/apache/camel/pull/17419#discussion_r2009849009
########## dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/KubernetesDelete.java: ########## @@ -25,41 +25,36 @@ import io.fabric8.kubernetes.api.model.StatusDetails; import io.fabric8.openshift.client.OpenShiftClient; import org.apache.camel.dsl.jbang.core.commands.CamelJBangMain; -import org.apache.camel.dsl.jbang.core.commands.kubernetes.traits.BaseTrait; import org.apache.camel.util.StringHelper; import org.codehaus.plexus.util.ExceptionUtils; import picocli.CommandLine; import static org.apache.camel.dsl.jbang.core.commands.kubernetes.KubernetesHelper.getKubernetesClient; +import static org.apache.camel.dsl.jbang.core.commands.kubernetes.traits.BaseTrait.KUBERNETES_LABEL_NAME; @CommandLine.Command(name = "delete", - description = "Delete Camel application from Kubernetes. This operation will delete all resources associated to this app, such as: Deployment, Routes, Services, etc. filtering by labels \"app.kubernetes.io/managed-by=camel-jbang\" and \"app=<app name>\".", + description = "Delete Camel application from Kubernetes. This operation will delete all resources associated to this app, such as: Deployment, Routes, Services, etc. filtering by label \"app.kubernetes.io/name=<name>\".", sortOptions = false) public class KubernetesDelete extends KubernetesBaseCommand { - @CommandLine.Parameters(description = "The deployed application name", arity = "1", paramLabel = "<app name>") - String appName; - public KubernetesDelete(CamelJBangMain main) { super(main); } public Integer doCall() throws Exception { - printer().printf("Deleting all resources from app: %s%n", appName); + printer().printf("Deleting all resources from app: %s%n", name); Map<String, String> labels = new HashMap<>(); // this label is set in KubernetesRun command - labels.put(BaseTrait.KUBERNETES_LABEL_MANAGED_BY, "camel-jbang"); - labels.put("app", appName); + labels.put(KUBERNETES_LABEL_NAME, name); Review Comment: I added the managed-by=camel-jbang since camel-jbang deploys it only for the `run` command. As for the export command, the user may want to use different tools to deploy and manage, so the managed-by label was not changed. The `managed-by` label was added as additional filter for `delete` command to be on the safe side, to delete only the resources run by camel-jbang. -- 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