kapp-controller icon indicating copy to clipboard operation
kapp-controller copied to clipboard

Right method to know the version of a package install

Open aelango-vmw opened this issue 3 years ago • 1 comments

Say there are 2 different versions (v1, v2) of a specific package. I've installed version v2 version of the package. Say I try to downgrade for some reason to v1. And the package install reconciliation fails. In this case, the v2 of the app is still running.

A package Install's Status has both version and lastAttemptedVersion

  • version seems to be the currently resolved version, which is v1
  • lastAttemptedVersion seems to be the attempted version, successful or unsuccessful
    • There is a possibility that this can denote a failed reconciliation as well.

In this case what is the best way to know which version is currently running in the cluster from the status field?

aelango-vmw avatar Jun 16 '22 21:06 aelango-vmw

version seems to be the currently resolved version, which is v1

correct.

lastAttemptedVersion seems to be the attempted version, successful or unsuccessful

correct. it gets set as soon as we try to apply any change regardless how far we get through that change (even if no change applied at all).

In this case what is the best way to know which version is currently running in the cluster from the status field?

there is not really a concept for that since deploy might have failed mid way and so your environment actually contains combination of 2 versions (e.g. Deployment from one version but Service from another -- since k8s doesnt provide transaction across multiple resources, your "inseparable unit" is each resource.).

we could probably introduce additional field last lastSuccessfullyAppliedVersion though that does not gurantee that there werent failures between that and "current state". what are your thoughts?

cppforlife avatar Jun 17 '22 11:06 cppforlife

Hi @cppforlife, I want to rollback the package install to previous successful applied version if any upgrade fails. It could help that if there's lastSuccessfullyAppliedVersion field.

killwing avatar Dec 09 '22 07:12 killwing

@cppforlife leave this one open for future prioritization of the feature you suggested?

neil-hickey avatar Feb 22 '23 19:02 neil-hickey