Right method to know the version of a package install
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
versionseems to be the currently resolved version, which isv1lastAttemptedVersionseems 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?
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?
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.
@cppforlife leave this one open for future prioritization of the feature you suggested?