-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CAMEL-21855: camel-jbang - k8s delete may not work any more #17419
base: main
Are you sure you want to change the base?
Conversation
...etes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/KubernetesDelete.java
Outdated
Show resolved
Hide resolved
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The KUBERNETES_LABEL_MANAGED_BY
is there, as the run
command sets this label.
Also, the manage-by=camel-jbang
label is to make sure these custom resources are set by camel-jbang and not to delete any other deployment by a deployment that sets the same name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
run
is an extension of export + package + deploy
, for which manage-by is not camel-jbang, but jkube. There is a hack in the code that silently overrides manage-by=jkube with manage-by=camel-jbang, but only for the run case.
We could filter by manage-by, but only it works for all cases. Accidentally deleting (other) resources with the given name in the same namespace is a non-issue IMHO - we delete deployment + service (and some openshift specific stuff).
Do you have an actual use case where not filtering by manage-by would be a problem?
https://issues.apache.org/jira/browse/CAMEL-21855