Skip to content

Commit

Permalink
Merge pull request #3 from sujoshua/master
Browse files Browse the repository at this point in the history
fix: 修复deployment创建顺序
  • Loading branch information
sujoshua authored Aug 24, 2024
2 parents fd004a3 + a31d69f commit e747be1
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 e747be1

Please sign in to comment.