Skip to content

Commit

Permalink
revert reporting on all conditions with events (#16)
Browse files Browse the repository at this point in the history
* always push ready event #14

* push ready event unless cluster was not ready #14
  • Loading branch information
akyriako authored Dec 12, 2024
1 parent b2ced05 commit 70c7d6b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ OPERATOR_SDK_VERSION ?= v1.38.0
# Image URL to use all building/pushing image targets
DOCKER_HUB_NAME ?= $(shell docker info | sed '/Username:/!d;s/.* //')
IMG_NAME ?= typesense-operator
IMG_TAG ?= 0.2.4
IMG_TAG ?= 0.2.5
IMG ?= $(DOCKER_HUB_NAME)/$(IMG_NAME):$(IMG_TAG)

# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
Expand Down
4 changes: 2 additions & 2 deletions charts/typesense-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.2.4
version: 0.2.5
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.2.4"
appVersion: "0.2.5"
2 changes: 1 addition & 1 deletion charts/typesense-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ controllerManager:
- ALL
image:
repository: akyriako78/typesense-operator
tag: 0.2.4
tag: 0.2.5
resources:
limits:
cpu: 500m
Expand Down
7 changes: 5 additions & 2 deletions internal/controller/typesensecluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"github.com/pkg/errors"
"golang.org/x/text/cases"
"golang.org/x/text/language"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/tools/record"
ctrl "sigs.k8s.io/controller-runtime"
Expand Down Expand Up @@ -203,14 +204,16 @@ func (r *TypesenseClusterReconciler) Reconcile(ctx context.Context, req ctrl.Req
delayPerReplicaPeriodSeconds = int64(size)
}
} else {
//c := ts.Status.Conditions[0]
report := ts.Status.Conditions[0].Status != metav1.ConditionTrue

cerr := r.setConditionReady(ctx, &ts, string(condition))
if cerr != nil {
return ctrl.Result{}, cerr
}

r.Recorder.Eventf(&ts, "Normal", string(condition), toTitle("quorum is ready"))
if report {
r.Recorder.Eventf(&ts, "Normal", string(condition), toTitle("quorum is ready"))
}

delayPerReplicaPeriodSeconds = int64(1)
}
Expand Down

0 comments on commit 70c7d6b

Please sign in to comment.