Skip to content

Commit

Permalink
fix: 修复deployment创建顺序
Browse files Browse the repository at this point in the history
Signed-off-by: joshua <[email protected]>
  • Loading branch information
sujoshua committed Aug 24, 2024
1 parent de73b8a commit a31d69f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions internal/controller/job_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,6 @@ func (r *JobReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.R
}

if app != nil {
err = r.Patch(ctx, app, client.Apply, applyOpts...)
if err != nil {
return ctrl.Result{}, err
}

err = r.Patch(ctx, svc, client.Apply, applyOpts...)
if err != nil {
return ctrl.Result{}, err
Expand All @@ -135,6 +130,10 @@ func (r *JobReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.R
}
}
}
err = r.Patch(ctx, app, client.Apply, applyOpts...)
if err != nil {
return ctrl.Result{}, err
}
} else {
deploy := new(appsv1.Deployment)
err := r.Get(ctx, client.ObjectKey{Name: job.Name, Namespace: job.Namespace}, deploy)
Expand Down

0 comments on commit a31d69f

Please sign in to comment.