Skip to content

Commit b2198c0

Browse files
authored
fix: handle the case when master resource snapshot is not found (#350)
Signed-off-by: Zhiying Lin <[email protected]>
1 parent b70a24e commit b2198c0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/controllers/rollout/controller.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,11 @@ func (r *Reconciler) Reconcile(ctx context.Context, req runtime.Request) (runtim
151151
"placement", placementObjRef)
152152
return runtime.Result{}, err
153153
}
154+
if masterResourceSnapshot == nil {
155+
klog.V(2).InfoS("No masterResourceSnapshot found for the placement, stop rolling", "placement", placementObjRef)
156+
// New masterResourceSnapshot creation should trigger the rollout controller.
157+
return runtime.Result{}, nil
158+
}
154159
klog.V(2).InfoS("Found the masterResourceSnapshot for the placement", "placement", placementObjRef, "masterResourceSnapshot", klog.KObj(masterResourceSnapshot))
155160

156161
// Note: there is a corner case that an override is in-between snapshots (the old one is marked as not the latest while the new one is not created yet)

0 commit comments

Comments
 (0)