Skip to content

Commit

Permalink
update tortoise status after initialization phase (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
sanposhiho authored Apr 8, 2023
1 parent 7487da3 commit d9f8048
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ kind: Kustomization
images:
- name: controller
newName: ghcr.io/mercari/tortoise
newTag: v0.0.7
newTag: v0.0.9
6 changes: 6 additions & 0 deletions controllers/tortoise_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ func (r *TortoiseReconciler) Reconcile(ctx context.Context, req ctrl.Request) (c
return ctrl.Result{}, fmt.Errorf("initialize VPAs and HPA: %w", err)
}

_, err = r.TortoiseService.UpdateTortoiseStatus(ctx, tortoise, now)
if err != nil {
logger.Error(err, "update Tortoise status", "tortoise", req.NamespacedName)
return ctrl.Result{}, err
}

// VPA and HPA are just created, and they won't start working soon.
// So, return here and wait a few min for them to start to work.
return ctrl.Result{RequeueAfter: 2 * time.Minute}, nil
Expand Down

0 comments on commit d9f8048

Please sign in to comment.