Skip to content

Commit

Permalink
bugfix (CollaSet): pod creation error is not thrown out (#37)
Browse files Browse the repository at this point in the history
* bugfix (CollaSet): pod creation error is not thrown out
  • Loading branch information
wu8685 committed Aug 21, 2023
1 parent f3de7b0 commit f9cb738
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions pkg/controllers/collaset/synccontrol/sync_control.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,12 @@ func (sc *RealSyncControl) Scale(set *appsv1alpha1.CollaSet, podWrappers []*coll
newPod.Labels[appsv1alpha1.PodInstanceIDLabelKey] = fmt.Sprintf("%d", availableIDContext.ID)

klog.V(1).Info("try to create Pod with revision %s from CollaSet %s/%s", revision.Name, set.Namespace, set.Name)
if pod, err := sc.podControl.CreatePod(newPod); err == nil {
// add an expectation for this pod creation, before next reconciling
if err := collasetutils.ActiveExpectations.ExpectCreate(set, expectations.Pod, pod.Name); err != nil {
return err
}
if pod, err = sc.podControl.CreatePod(newPod); err != nil {
return err
}
return err

// add an expectation for this pod creation, before next reconciling
return collasetutils.ActiveExpectations.ExpectCreate(set, expectations.Pod, pod.Name)
})

sc.recorder.Eventf(set, corev1.EventTypeNormal, "ScaleOut", "scale out %d Pod(s)", succCount)
Expand Down

0 comments on commit f9cb738

Please sign in to comment.