Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tdiesler
Copy link
Contributor

@tdiesler tdiesler changed the title CAMEL-21855: camel-jbang - camel k8s delete may not work any more CAMEL-21855: camel-jbang - k8s delete may not work any more Mar 11, 2025
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);
Copy link
Contributor

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.

Copy link
Contributor Author

@tdiesler tdiesler Mar 13, 2025

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants