Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pkg/controllers/rollout/rollout_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ func (r *RolloutReconciler) syncRun(
}
// apply one time strategy
if features.DefaultFeatureGate.Enabled(features.OneTimeStrategy) {
err := r.applyOneTimeStrategy(obj, curRun, workloads, newStatus)
err := r.applyOneTimeStrategy(ctx, obj, curRun, workloads, newStatus)
if err != nil {
return err
}
Expand All @@ -440,7 +440,7 @@ func (r *RolloutReconciler) syncRun(
// that the creation event comes so fast that we don't have time to set it
r.expectation.ExpectCreations(key, 1) // nolint

if err := r.Client.Create(clusterinfo.ContextFed, curRun); err != nil {
if err := r.Client.Create(clusterinfo.WithCluster(ctx, clusterinfo.Fed), curRun); err != nil {
r.expectation.DeleteExpectations(key)
// do not change status phase here if rolloutRun is not created
r.recordCondition(obj, newStatus, rolloutv1alpha1.RolloutConditionTrigger, metav1.ConditionFalse, "FailedCreate", fmt.Sprintf("failed to create a new rolloutRun %s: %v", curRun.Name, err))
Expand Down Expand Up @@ -647,7 +647,7 @@ func (r *RolloutReconciler) cleanupAnnotation(ctx context.Context, obj *rolloutv
return nil
}

func (r *RolloutReconciler) applyOneTimeStrategy(obj *rolloutv1alpha1.Rollout, run *rolloutv1alpha1.RolloutRun, workloads []*workload.Info, newStatus *rolloutv1alpha1.RolloutStatus) error {
func (r *RolloutReconciler) applyOneTimeStrategy(ctx context.Context, obj *rolloutv1alpha1.Rollout, run *rolloutv1alpha1.RolloutRun, workloads []*workload.Info, newStatus *rolloutv1alpha1.RolloutStatus) error {
if run == nil || run.IsCompleted() {
return nil
}
Expand Down Expand Up @@ -681,7 +681,7 @@ func (r *RolloutReconciler) applyOneTimeStrategy(obj *rolloutv1alpha1.Rollout, r
}

// update rolloutRun
_, err = utils.UpdateOnConflict(clusterinfo.ContextFed, r.Client, r.Client, run, func() error {
_, err = utils.UpdateOnConflict(clusterinfo.WithCluster(ctx, clusterinfo.Fed), r.Client, r.Client, run, func() error {
if run.Annotations == nil {
run.Annotations = make(map[string]string)
}
Expand Down