Open invidian opened 4 years ago
This was a deliberate decision: https://github.com/kinvolk/lokomotive/pull/268#discussion_r410159354.
Thanks for digging it out @surajssd. This creates an edge case to handle in my refactoring work, as currently for installing component we require configuration to be in place, but when uninstalling, we ignore it :/
That also has some side effects, for example, if component has been installed in user-defined namespace, then uninstalling will fail (or will actually be silent), as it will try to uninstall it from a different namespace.
As we currently do not track which components has been installed, it seems more natural to me to first uninstall the component from the cluster, then de-configure it, to keep reversed order of the install operation (1st you configure, then you install, not the other way around). This would also prevents components from getting untracked (removed from configuration, but someone forgot to uninstall them).
Currently, when one tries to uninstall component, which is not configured,
lokoctl
will happily proceed with it. It seems to me, that we should return an error in such case, as this is similar to what Terraform-target
do and package managers. If you try uninstalling non-existent package or try destroying non-existent target, error is returned.