Skip to content

Commit

Permalink
Merge branch 'main' into flagbug
Browse files Browse the repository at this point in the history
  • Loading branch information
sanposhiho authored Oct 4, 2023
2 parents 3e9d7a4 + f88ebae commit f69fc5b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

# Image URL to use all building/pushing image targets
IMG ?= ghcr.io/mercari/tortoise:v0.0.31
IMG ?= ghcr.io/mercari/tortoise:v0.0.32
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.27.1

Expand Down
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.31
newTag: v0.0.32
11 changes: 5 additions & 6 deletions controllers/tortoise_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,6 @@ type TortoiseReconciler struct {
//+kubebuilder:rbac:groups=autoscaling,resources=horizontalpodautoscalers,verbs=get;list;watch;create;update;patch;delete

func (r *TortoiseReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Result, reterr error) {
defer func() {
if reterr != nil {
r.EventRecorder.Event(&autoscalingv1beta1.Tortoise{}, "Warning", "ReconcileError", reterr.Error())
}
}()

logger := log.FromContext(ctx)
now := time.Now()

Expand All @@ -89,6 +83,11 @@ func (r *TortoiseReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_
logger.Error(err, "failed to get tortoise", "tortoise", req.NamespacedName)
return ctrl.Result{}, err
}
defer func() {
if reterr != nil {
r.EventRecorder.Event(tortoise, "Warning", "ReconcileError", reterr.Error())
}
}()

if !tortoise.ObjectMeta.DeletionTimestamp.IsZero() {
// Tortoise is deleted by user and waiting for finalizer.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ spec:
- --leader-elect
command:
- /manager
image: ghcr.io/mercari/tortoise:v0.0.31
image: ghcr.io/mercari/tortoise:v0.0.32
livenessProbe:
httpGet:
path: /healthz
Expand Down

0 comments on commit f69fc5b

Please sign in to comment.