camel-k
camel-k copied to clipboard
`kamel uninstall` should also delete leases
I've uninstalled everything but I can still see leases around that won't let me install again an operator due to installation not allowed because operator with id 'camel-k-missing-deps' already exists, use the --force option to skip this check
fyi @christophd
I could not reproduce but I faced an issue with the platform Kamelets that should be fixed by https://github.com/apache/camel-k/pull/3553
I confirm that leases (along with integrations, integration kits, builds, camel catalogs, Kamelet bindings...) are not deleted by the uninstall command however they don't prevent the install command to work as expected since the install command only checks whether an integration platform with the same name already exists in the namespace and the integration platform is properly removed by the uninstall command.
The lease exists in the namespace...
$ kubectl get lease -n foo
NAME HOLDER AGE
camel-k-lock camel-k-operator-848fd8785b-7knql_626532a4-c05f-4edb-8cd9-7f6294d6cc57 13m
but it doesn't prevent the install command to work as expected
kamel install -n foo
OLM is not available in the cluster. Fallback to regular installation.
Warning: the operator won't be able to detect a local image registry via KEP-1755
Camel K installed in namespace foo
Knowing that, shall we still remove the lease on uninstall?
NB: Once the new operator is installed in the namespace, a new lead is then elected such that the lease is automatically updated without the need to delete it first
What version have you used for testing this? The failure happens in version >= 1.10 (also nightly) only.
I tested it with 1.9.2, I can indeed reproduce it with 1.10, thx for the clarifications 🙏
I've checked with @gansheer the expected behavior and we realized this is not a bug. Basically the lease is created by the operator Pod and it's correctly release when the Pod is terminating. It does not make sense to alter this behavior by the installation procedure.