Skip to content

Remove deprecated planned_sql from PostgresPolicy status #73

@hardbyte

Description

@hardbyte

Context

In v0.5.0 (#72), the PostgresPolicyPlan CRD is introduced to hold plan artifacts (SQL, change summary) separately from the PostgresPolicy status. During v0.5.x, the deprecated fields are still populated for backward compatibility.

Changes for v0.6.0

Remove deprecated status fields

Remove from PostgresPolicyStatus:

  • planned_sql: Option<String>
  • planned_sql_truncated: bool
  • last_reconcile_time: Option<String> (deprecated alias of last_successful_reconcile_time)

The operator should stop populating these fields. Any tooling reading them should have migrated to using PostgresPolicyPlan CRs and their associated ConfigMaps.

Default approval mode

  • New deployments default to approval: manual (plans require explicit approval)
  • Existing deployments that upgraded from v0.5.x with implicit approval: auto continue working — the field is preserved in their spec
  • Document the behavior change in release notes

CRD schema update

  • Remove the deprecated fields from the CRD OpenAPI schema
  • Regenerate chart CRD and k8s/crd.yaml
  • Bump chart version

Migration guide

  • Release notes should clearly state:
    • planned_sql is removed — use kubectl get pgplan or read the plan's ConfigMap
    • last_reconcile_time is removed — use last_successful_reconcile_time
    • New deployments default to manual approval — add approval: auto to spec if you want the v0.5.x behavior

Testing

  • Verify policy status no longer contains planned_sql
  • Verify existing approval: auto policies continue auto-approving
  • Verify new policies without explicit approval field default to manual
  • E2E tests for the full plan lifecycle without deprecated fields

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions