Skip to content

Conversation

@gianlucam76
Copy link
Member

This pull request (PR) changes how the event manager names ClusterProfile instances. Previously, the names were random, which made it impossible to predict what a new ClusterProfile would be named. This unpredictability became an issue in situations where we needed to know the name beforehand to set other ClusterProfile instances as dependent on it.

This PR introduces an optional field in the EventTrigger spec called InstantiatedProfileNameFormat. This field allows to define a naming template for the generated ClusterProfile.

For example, using the template

{{ .Cluster.metadata.name }}-{{ .Resource.metadata.name }}-test

Sveltos will automatically generate a name for the ClusterProfile instance based on the cluster and event data when an event occurs.

This provides a predictable naming convention that can used for dependency management.

This PR contains code changes, unit test and functional test

Fixes #377

This pull request (PR) changes how the event manager names ClusterProfile instances.
Previously, the names were random, which made it impossible to predict what a new
ClusterProfile would be named. This unpredictability became an issue in situations
where we needed to know the name beforehand to set other ClusterProfile instances
as dependent on it.

This PR introduces an optional field in the EventTrigger spec called **InstantiatedProfileNameFormat**.
This field allows to define a naming template for the generated ClusterProfile.

For example, using the template

`{{ .Cluster.metadata.name }}-{{ .Resource.metadata.name }}-test`

Sveltos will automatically generate a name for the ClusterProfile instance based on the
cluster and event data when an event occurs.

This provides a predictable naming convention that can used for dependency management.

This PR contains code changes, unit test and functional test
@gianlucam76 gianlucam76 merged commit af60918 into projectsveltos:main Aug 30, 2025
6 checks passed
@gianlucam76 gianlucam76 deleted the profile-name branch August 30, 2025 16:38
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.

Ability to Retrieve ClusterProfile Name Generated by the EventManager

1 participant