Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.

Commit bedc9bf

Browse files
authored
Merge pull request #120 from gianarb/feature/support-paused
Support for paused annotation
2 parents f333fec + 9f50101 commit bedc9bf

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

controllers/packetcluster_controller.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ func (r *PacketClusterReconciler) Reconcile(req ctrl.Request) (_ ctrl.Result, re
8080
}, nil
8181
}
8282

83+
if util.IsPaused(cluster, packetcluster) {
84+
logger.Info("PacketCluster or linked Cluster is marked as paused. Won't reconcile")
85+
return ctrl.Result{}, nil
86+
}
87+
8388
// Create the cluster scope
8489
clusterScope, err := scope.NewClusterScope(scope.ClusterScopeParams{
8590
Logger: logger,

controllers/packetmachine_controller.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ func (r *PacketMachineReconciler) Reconcile(req ctrl.Request) (_ ctrl.Result, re
9999

100100
logger = logger.WithValues("cluster", cluster.Name)
101101

102+
if util.IsPaused(cluster, machine) {
103+
logger.Info("PacketMachine or linked Cluster is marked as paused. Won't reconcile")
104+
return ctrl.Result{}, nil
105+
}
106+
102107
packetcluster := &infrastructurev1alpha3.PacketCluster{}
103108
packetclusterNamespacedName := client.ObjectKey{
104109
Namespace: packetmachine.Namespace,

0 commit comments

Comments
 (0)