Skip to content

feat: record events when a feature fails and use the shared event reasons - #2032

Merged
gianlucam76 merged 1 commit into
projectsveltos:mainfrom
gianlucam76:events
Oct 12, 2026
Merged

gianlucam76 merged 1 commit into
projectsveltos:mainfrom
gianlucam76:events

Conversation

@gianlucam76

Copy link
Copy Markdown
Member

A feature which failed to be deployed, and was retried, only recorded the failure in the ClusterSummary status. An event was recorded only when the failure was not retriable (after the maximum number of consecutive failures, or for a non retriable or template error), so for the first failures a user saw nothing in kubectl describe clustersummary or in the events of the namespace.

This change records an event when a feature fails and the operation is retried, and moves the events addon-controller already recorded to the reasons defined in libsveltos lib/eventreasons.

Reason When
FeatureFailed A feature failed to be deployed or removed and the operation is retried.

FeatureFailed is recorded when the failure message persisted in the ClusterSummary changes, so:

  • the first failure is recorded, an identical retry is not (a retry goes Failed, Provisioning, Failed, and the failure message is kept during the Provisioning step);
  • a different error is recorded;
  • a failure after the feature succeeded (the message is cleared) is recorded again.

It is not recorded for a failure which already has its own event: a non retriable error, a template error (FeatureFailedNonRetriable) and a conflict (ProfileConflict).

The action of a feature event is a verb followed by the feature (DeployingHelm, RemovingResources). The events recorder merges events with the same reason, action and regarding object and keeps only the first note, so two features of the same ClusterSummary failing together would otherwise be a single event.

No event is recorded for expected states: a paused cluster, a closed active window, the MaxUpdate throttle, a profile waiting on its dependencies, a cluster which is not ready or whose agent is not healthy (sveltoscluster-manager records that one), and a successful removal.

The events which already existed use the shared vocabulary. Anyone alerting or filtering on the old reasons needs to update them:

Previous reason New reason
Sveltos (Normal, a feature was deployed) FeatureDeployed

The action of these events was the kind ClusterSummary; it is now a verb followed by the feature, for example DeployingHelm. The notes are unchanged.

…sons

A feature which failed to be deployed, and was retried, only recorded the failure in the ClusterSummary
status. An event was recorded only when the failure was not retriable (after the maximum number of
consecutive failures, or for a non retriable or template error), so for the first failures a user saw nothing
in `kubectl describe clustersummary` or in the events of the namespace.

This change records an event when a feature fails and the operation is retried, and moves the events
addon-controller already recorded to the reasons defined in libsveltos `lib/eventreasons`.

| Reason | When |
|---|---|
| `FeatureFailed` | A feature failed to be deployed or removed and the operation is retried. |
| `LicenseInvalid` | A ClusterSummary targets a SveltosCluster in pull mode which is not covered by a license. One event, instead of one per feature. |

`FeatureFailed` is recorded when the failure message persisted in the ClusterSummary changes, so:
- the first failure is recorded, an identical retry is not (a retry goes Failed, Provisioning, Failed, and the
  failure message is kept during the Provisioning step);
- a different error is recorded;
- a failure after the feature succeeded (the message is cleared) is recorded again.

It is not recorded for a failure which already has its own event: a non retriable error, a template error
(`FeatureFailedNonRetriable`) and a conflict (`ProfileConflict`).

The action of a feature event is a verb followed by the feature (`DeployingHelm`, `RemovingResources`). The
events recorder merges events with the same reason, action and regarding object and keeps only the first
note, so two features of the same ClusterSummary failing together would otherwise be a single event.

No event is recorded for expected states: a paused cluster, a closed active window, the MaxUpdate throttle, a
profile waiting on its dependencies, a cluster which is not ready or whose agent is not healthy
(sveltoscluster-manager records that one), and a successful removal.

The events which already existed use the shared vocabulary. Anyone alerting or filtering on the old reasons
needs to update them:

| Previous reason | New reason |
|---|---|
| `Sveltos` (Normal, a feature was deployed) | `FeatureDeployed` |
| `FailedNonRetriable` | `FeatureFailedNonRetriable` |
| `Conflict` | `ProfileConflict` |

The `action` of these events was the kind `ClusterSummary`; it is now a verb followed by the feature, for
example `DeployingHelm`. The notes are unchanged.
@gianlucam76
gianlucam76 merged commit 5a12993 into projectsveltos:main Oct 12, 2026
12 checks passed
@gianlucam76
gianlucam76 deleted the events branch October 12, 2026 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant