Component versions annotations doesn't reflect accurately what is installed in a SGCluster.
Suppose that we have the follwing SGCluster
apiVersion: stackgres.io/v1
kind: SGCluster
metadata:
name: test
spec:
instances: 3
postgres:
version: '12.7'
pods:
persistentVolume:
size: '10Gi'
sgInstanceProfile: 'size-xs'
If we look at cluster pods annotations, would reflect the following:
kubectl get pods -o json | jq '.items[].metadata.annotations'
{
"kubernetes.io/psp": "eks.privileged",
"stackgres.io/cluster-controller-version": "development-jvm",
"stackgres.io/envoy-version": "1.17.1",
"stackgres.io/operatorVersion": "1.0.0-beta3-SNAPSHOT",
"stackgres.io/patroni-version": "2.1.0",
"stackgres.io/pgbouncer-version": "1.15.0",
"stackgres.io/postgresql-version": "12.7",
"stackgres.io/prometheus-postgres-exporter-version": "0.9.0",
"status": "{\"conn_url\":\"postgres://192.168.73.165:7433/postgres\",\"api_url\":\"http://192.168.73.165:8008/patroni\",\"state\":\"running\",\"role\":\"master\",\"version\":\"2.1.0\",\"xlog_location\":83886176,\"timeline\":1}"
}
{
"kubernetes.io/psp": "eks.privileged",
"stackgres.io/cluster-controller-version": "development-jvm",
"stackgres.io/envoy-version": "1.17.1",
"stackgres.io/operatorVersion": "1.0.0-beta3-SNAPSHOT",
"stackgres.io/patroni-version": "2.1.0",
"stackgres.io/pgbouncer-version": "1.15.0",
"stackgres.io/postgresql-version": "12.7",
"stackgres.io/prometheus-postgres-exporter-version": "0.9.0",
"status": "{\"conn_url\":\"postgres://192.168.92.161:7433/postgres\",\"api_url\":\"http://192.168.92.161:8008/patroni\",\"state\":\"running\",\"role\":\"replica\",\"version\":\"2.1.0\",\"xlog_location\":83886176,\"timeline\":1}"
}
{
"kubernetes.io/psp": "eks.privileged",
"stackgres.io/cluster-controller-version": "development-jvm",
"stackgres.io/envoy-version": "1.17.1",
"stackgres.io/operatorVersion": "1.0.0-beta3-SNAPSHOT",
"stackgres.io/patroni-version": "2.1.0",
"stackgres.io/pgbouncer-version": "1.15.0",
"stackgres.io/postgresql-version": "12.7",
"stackgres.io/prometheus-postgres-exporter-version": "0.9.0",
"status": "{\"conn_url\":\"postgres://192.168.7.98:7433/postgres\",\"api_url\":\"http://192.168.7.98:8008/patroni\",\"state\":\"running\",\"role\":\"replica\",\"version\":\"2.1.0\",\"xlog_location\":83886176,\"timeline\":1}"
}
If we change the SGCluster postgres version to 12.8 without making a minor version upgrade, the annotations would look like this:
{
"kubernetes.io/psp": "eks.privileged",
"stackgres.io/cluster-controller-version": "development-jvm",
"stackgres.io/envoy-version": "1.17.1",
"stackgres.io/operatorVersion": "1.0.0-beta3-SNAPSHOT",
"stackgres.io/patroni-version": "2.1.0",
"stackgres.io/pgbouncer-version": "1.15.0",
"stackgres.io/postgresql-version": "12.8",
"stackgres.io/prometheus-postgres-exporter-version": "0.9.0",
"status": "{\"conn_url\":\"postgres://192.168.73.165:7433/postgres\",\"api_url\":\"http://192.168.73.165:8008/patroni\",\"state\":\"running\",\"role\":\"master\",\"version\":\"2.1.0\",\"xlog_location\":83886176,\"timeline\":1}"
}
{
"kubernetes.io/psp": "eks.privileged",
"stackgres.io/cluster-controller-version": "development-jvm",
"stackgres.io/envoy-version": "1.17.1",
"stackgres.io/operatorVersion": "1.0.0-beta3-SNAPSHOT",
"stackgres.io/patroni-version": "2.1.0",
"stackgres.io/pgbouncer-version": "1.15.0",
"stackgres.io/postgresql-version": "12.8",
"stackgres.io/prometheus-postgres-exporter-version": "0.9.0",
"status": "{\"conn_url\":\"postgres://192.168.92.161:7433/postgres\",\"api_url\":\"http://192.168.92.161:8008/patroni\",\"state\":\"running\",\"role\":\"replica\",\"version\":\"2.1.0\",\"xlog_location\":83886176,\"timeline\":1}"
}
{
"kubernetes.io/psp": "eks.privileged",
"stackgres.io/cluster-controller-version": "development-jvm",
"stackgres.io/envoy-version": "1.17.1",
"stackgres.io/operatorVersion": "1.0.0-beta3-SNAPSHOT",
"stackgres.io/patroni-version": "2.1.0",
"stackgres.io/pgbouncer-version": "1.15.0",
"stackgres.io/postgresql-version": "12.8",
"stackgres.io/prometheus-postgres-exporter-version": "0.9.0",
"status": "{\"conn_url\":\"postgres://192.168.7.98:7433/postgres\",\"api_url\":\"http://192.168.7.98:8008/patroni\",\"state\":\"running\",\"role\":\"replica\",\"version\":\"2.1.0\",\"xlog_location\":83886176,\"timeline\":1}"
}
If we look closely, the "postgresql-version" annotation have changed to 12.8, when in fact the pod is running on postgres 12.7.
This could be misleading, since by just looking that the annotations someone might suppose that the pod is running in a different version that what is actually running.