Skip to content

Commit 4758a9c

Browse files
committed
do not try to reconcile objects in deletion
On-behalf-of: @SAP [email protected]
1 parent a7417d6 commit 4758a9c

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

internal/controller/frontproxy/controller.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ func (r *FrontProxyReconciler) Reconcile(ctx context.Context, req ctrl.Request)
114114
func (r *FrontProxyReconciler) reconcile(ctx context.Context, frontProxy *operatorv1alpha1.FrontProxy) ([]metav1.Condition, error) {
115115
var conditions []metav1.Condition
116116

117+
if frontProxy.DeletionTimestamp != nil {
118+
return conditions, nil
119+
}
120+
117121
cond, rootShard := util.FetchRootShard(ctx, r.Client, frontProxy.Namespace, frontProxy.Spec.RootShard.Reference)
118122
conditions = append(conditions, cond)
119123

internal/controller/kubeconfig/controller.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ func (r *KubeconfigReconciler) Reconcile(ctx context.Context, req ctrl.Request)
7777
return ctrl.Result{}, err
7878
}
7979

80+
if kc.DeletionTimestamp != nil {
81+
return ctrl.Result{}, nil
82+
}
83+
8084
rootShard := &operatorv1alpha1.RootShard{}
8185
shard := &operatorv1alpha1.Shard{}
8286

internal/controller/rootshard/controller.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ func (r *RootShardReconciler) reconcile(ctx context.Context, rootShard *operator
128128
conditions []metav1.Condition
129129
)
130130

131+
if rootShard.DeletionTimestamp != nil {
132+
return conditions, nil
133+
}
134+
131135
ownerRefWrapper := k8creconciling.OwnerRefWrapper(*metav1.NewControllerRef(rootShard, operatorv1alpha1.SchemeGroupVersion.WithKind("RootShard")))
132136

133137
issuerReconcilers := []reconciling.NamedIssuerReconcilerFactory{

internal/controller/shard/controller.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ func (r *ShardReconciler) reconcile(ctx context.Context, s *operatorv1alpha1.Sha
117117
conditions []metav1.Condition
118118
)
119119

120+
if s.DeletionTimestamp != nil {
121+
return conditions, nil
122+
}
123+
120124
cond, rootShard := util.FetchRootShard(ctx, r.Client, s.Namespace, s.Spec.RootShard.Reference)
121125
conditions = append(conditions, cond)
122126

0 commit comments

Comments
 (0)