Skip to content

feat(clusters): add fence and unfence actions for instances - #103

Open
MatheuslFavaretto wants to merge 1 commit into
cloudnative-pg:mainfrom
MatheuslFavaretto:dev/100
Open

MatheuslFavaretto wants to merge 1 commit into
cloudnative-pg:mainfrom
MatheuslFavaretto:dev/100

Conversation

@MatheuslFavaretto

@MatheuslFavaretto MatheuslFavaretto commented Oct 14, 2026 •

Copy link
Copy Markdown

Adds Fence / Unfence actions to each instance in the cluster's Instances table,
mirroring kubectl cnpg fencing on|off via the cnpg.io/fencedInstances
annotation.

  • Same pattern as the hibernation action: confirm dialog, and disabled with
    a tooltip for users without patch permission
  • Extra warning when fencing the primary, since no failover happens
  • Unfencing a single instance is disabled when the whole cluster is fenced
    (["*"]), as the operator refuses it too
  • New unit tests in src/resources/fencing.test.ts

Tested on kind (CNPG 1.30.1, 2 instances): fencing a replica sets the
annotation and the pod becomes NotReady after ~30s; unfencing removes it and
the pod is Ready again. lint, tsc, test and build pass.

Closes #100

Mirror kubectl cnpg fencing on|off through the cnpg.io/fencedInstances annotation, with an extra warning when fencing the primary.

Closes cloudnative-pg#100

Signed-off-by: Matheus Favaretto <matheusfavaretto.ef@gmail.com>
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.

Add fence and unfence actions for Cluster instances

1 participant