tdiesler commented on code in PR #17419:
URL: https://github.com/apache/camel/pull/17419#discussion_r2009903666


##########
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:
   If we must have a 
[app.kubernetes.io/managed-by](http://app.kubernetes.io/managed-by) filter, it 
would be 'jkube' which is present for the export & run case. imho, it is 
however quite unlikely that a user deploys a resource 'foo' to a given 
namespace only to have it mistakenly deleted by camel k8s because that also 
generates + deploys resource 'foo' of the same type in the same ns. Hence, I'd 
say [managed-by](http://app.kubernetes.io/managed-by) filter is not necessary.



-- 
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