Skip to content

fix(k8s-ui): label CNPG Backup spec.target as "Backup Target", not "Recovery Target" - #1569

Open
hisco wants to merge 1 commit into
mainfrom
eyal/rad-403-cnpg-backup-target-label
Open

fix(k8s-ui): label CNPG Backup spec.target as "Backup Target", not "Recovery Target"#1569
hisco wants to merge 1 commit into
mainfrom
eyal/rad-403-cnpg-backup-target-label

Conversation

@hisco

@hisco hisco commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Problem

CloudNativePG Backup.spec.target (enum primary | prefer-standby) is the policy deciding which instance runs the backup — it is not a restore destination. Radar's Backup detail renderer labeled it "Recovery Target", which names a different, real CNPG concept (point-in-time recovery target, which lives on Cluster.spec.bootstrap.recovery.recoveryTarget). An operator reading "Recovery Target" on a Backup would reasonably conclude it controlled restore behavior; it does not.

Fix

  • Relabel the field to "Backup Target" in CNPGBackupRenderer, mirroring the upstream BackupTarget type name so a CNPG operator recognizes it. ("Target Instance" was rejected — prefer-standby is a policy, not a specific pod, and it would collide with the renderer's existing "Instance" property.)
  • Fix the same term in docs/integrations.md.

No logic, accessor, data-key, or section changes.

Tests

Added a renderer test (none existed) asserting the corrected label renders, the misleading "Recovery Target" is gone, and the section is omitted when spec.target is unset — the label assertions fail against the pre-fix code. Full k8s-ui suite passes with no regressions.

Ticket: RAD-403 (Velero/CNPG/Kyverno review).

https://claude.ai/code/session_01KxZ3xt2G4KpexrKSoXQ91S


Note

Low Risk
Label and documentation-only change with regression tests; no backup or restore behavior is modified.

Overview
Fixes misleading UI/docs for CloudNativePG Backup spec.target (primary / prefer-standby): that field is the instance selection policy for where the backup runs, not a point-in-time recovery destination (which lives on Cluster bootstrap/recovery config).

CNPGBackupRenderer now shows Backup Target instead of Recovery Target, with an inline comment clarifying the semantics. docs/integrations.md uses the same wording in the Backup detail bullet list. No accessors, keys, or rendering logic changed.

Adds CNPGBackupRenderer tests that assert the new label, forbid Recovery Target, and hide the target section when spec.target is unset.

Reviewed by Cursor Bugbot for commit 5e31cbb. Bugbot is set up for automated code reviews on this repo. Configure here.

…very Target

CloudNativePG Backup.spec.target (primary | prefer-standby) is the policy
for which instance runs the backup, not a restore destination. The detail
renderer labeled it Recovery Target, which names CNPG's actual recovery
target concept - that lives on Cluster.spec.bootstrap.recovery. Relabel to
Backup Target, mirroring the upstream BackupTarget type, and fix the same
term in the integrations doc.

Ticket: RAD-403.

Claude-Session: https://claude.ai/code/session_01KxZ3xt2G4KpexrKSoXQ91S
@hisco
hisco requested a review from nadaverell as a code owner August 31, 2026 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant