glasskube: Detect version mismatch between the client and `PackageOperator`

Is your feature request related to a problem? Please describe. After an update of the glasskube client the PackageOperator doesn’t get updated automatically. A user must execute glasskube bootstrap to update the PackageOperator.

Describe the solution you’d like Similar to #196 glasskube should not only detect if it wasn’t already bootstrapped, but also if the PackageOperator matches the client version. If there is a version mismatch a message should be printed in the after executing any cli command like:

Glasskube PackageOperator needs to be updated. Please run glasskube bootstrap again to Glasskube from 0.0.1 (PackageOperator version) to 0.0.2 (client version)

Describe alternatives you’ve considered The server component of Glasskube itself could be a glasskube package and managed via glasskube, so updating Glasskube would look like: glasskube upgrade glasskube

Additional context This ticket can use the version util of: #254

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16 (16 by maintainers)

Most upvoted comments

@Baalekshan based on your question in discord about your changes in https://github.com/Baalekshan/glasskube/tree/test : You get the nil pointer dereference because the context is not yet initialized with the rest config. We have a common way to do this in all our cli commands: SetupClientContext in internal/cliutils/setupclientcontext.go. As you can see, this function is used in all commands except the serve command because it has special requirements.

SetupClientContext contains an optional bootstrap-check (RequireBootstrapped), and I think inside of it, you should check whether the right version of the operator is installed – instead of inside the root command. If you do it in the root command, first of all the context is not initialized yet (which is why you get the nil pointer error), and it would also check the mismatch for commands in which it is ok to have mismatch (version, serve).

We will also need a ticket for showing the version mismatch on the UI – I will create it.

Hi @Baalekshan sorry for the late response yes your proposed changes sounds good to split these functionalities into two different files.

yes exactly