-
Notifications
You must be signed in to change notification settings - Fork 32
K8SPS-601: set Normal event type for non-error events
#1155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -105,7 +105,7 @@ func (r *PerconaServerMySQLReconciler) reconcileCRStatus(ctx context.Context, cr | |||||||||||||
| mysqlStatus.State = apiv1.StateInitializing | ||||||||||||||
|
|
||||||||||||||
| log.Info(fmt.Sprintf("Async replication not ready: %s", msg)) | ||||||||||||||
| r.Recorder.Event(cr, corev1.EventTypeWarning, "AsyncReplicationNotReady", msg) | ||||||||||||||
| r.Recorder.Event(cr, corev1.EventTypeNormal, "AsyncReplicationNotReady", msg) | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
|
|
@@ -228,7 +228,7 @@ func (r *PerconaServerMySQLReconciler) reconcileCRStatus(ctx context.Context, cr | |||||||||||||
|
|
||||||||||||||
| if status.State != initialState { | ||||||||||||||
| log.Info("Cluster state changed", "previous", initialState, "current", status.State) | ||||||||||||||
| r.Recorder.Event(cr, corev1.EventTypeWarning, "ClusterStateChanged", fmt.Sprintf("%s -> %s", initialState, status.State)) | ||||||||||||||
| r.Recorder.Event(cr, corev1.EventTypeNormal, "ClusterStateChanged", fmt.Sprintf("%s -> %s", initialState, status.State)) | ||||||||||||||
|
||||||||||||||
| r.Recorder.Event(cr, corev1.EventTypeNormal, "ClusterStateChanged", fmt.Sprintf("%s -> %s", initialState, status.State)) | |
| eventType := corev1.EventTypeNormal | |
| if status.State == apiv1.StateError || status.State == apiv1.StateInitializing { | |
| eventType = corev1.EventTypeWarning | |
| } | |
| r.Recorder.Event(cr, eventType, "ClusterStateChanged", fmt.Sprintf("%s -> %s", initialState, status.State)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing this event from Warning to Normal may be inappropriate. This event is triggered when async replication is not ready, causing the state to be set to
StateInitializing(line 105). While the code continues with normal flow, this represents a condition where the system is not yet operational. In Kubernetes, Warning events typically indicate issues or non-ready states that administrators should be aware of. Consider whether this transient failure condition should remain as EventTypeWarning to maintain visibility into operational issues.