File tree Expand file tree Collapse file tree
infrastructure/controllers/kyverno/policies Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -117,6 +117,7 @@ spec:
117117 property : kopia_password
118118
119119 # Rule 2: Generate ReplicationSource (backup schedule)
120+ # IMPORTANT: Only create backup AFTER PVC is Bound to avoid conflicts with restore
120121 - name : generate-replication-source
121122 skipBackgroundRequests : false
122123 match :
@@ -136,6 +137,13 @@ spec:
136137 - kube-system
137138 - volsync-system
138139 - kyverno
140+ preconditions :
141+ all :
142+ # Only create backup ReplicationSource after PVC is Bound
143+ # This prevents backup from running during restore (when PVC is Pending)
144+ - key : " {{ request.object.status.phase || 'Pending' }}"
145+ operator : Equals
146+ value : " Bound"
139147 generate :
140148 synchronize : true
141149 apiVersion : volsync.backube/v1alpha1
You can’t perform that action at this time.
0 commit comments