PITR targetInclusive is silently ignored (env var typo + misspelled Patroni recovery key)
Summary
When restoring a cluster with point-in-time recovery, .spec.initialData.restore.fromBackup.pointInTimeRecovery.targetInclusive has no effect. The recovery target is always treated as inclusive regardless of the configured value.
Root cause
Two defects in the Patroni start path:
PatroniEnvironmentVariablesexports the value as env varRECOVERY_TARGET_INCLUSIVE, buttemplates/start-patroni.shreads and expands the misspelled$RECOVERY_TARGET_INCUSIVE(missing theL). The variable is therefore always empty and the setting never reaches Patroni.- Even if the names matched, the script emits the recovery key as
recovery_target_incusive— also misspelled — which is not a valid PostgreSQL recovery setting.
Impact
Silent wrong recovery point: a restore requesting an exclusive target still includes the target transaction. Data-correctness issue with no error surfaced. Severity: critical.
Files
stackgres-k8s/src/operator/src/main/resources/templates/start-patroni.sh(~lines 229-231, 380-382)stackgres-k8s/src/operator/src/main/java/io/stackgres/operator/conciliation/factory/cluster/patroni/PatroniEnvironmentVariables.java(~lines 118-123)
Test gap
PatroniEnvVarFactoryTest asserts only the Java-side env var name; nothing exercises the shell template that consumes it.