Skip to content

Conversation

@gianlucam76
Copy link
Member

When Sveltos deploys a YAML/JSON (via PolicyRefs or KustomizationRefs) the information on referenced resources were added as labels. This had a downside: the name of the referenced resource cannot exceed 63 characters (that is the maximum length of a label value).

This PR move those data to annotations, removing that limitation.

This PR also introduces a tier concept for PolicyRefs/KustomizationRefs. The Tier field on a Sveltos PolicyRef/KustomizationRef introduces a secondary, intra-profile priority system. It is designed specifically to resolve resource conflicts that occur when multiple policy references within the same parent ClusterProfile or Profile attempt to deploy the identical Kubernetes resource.

This system works in two distinct steps:

  1. Primary Conflict Resolution (ClusterProfile Tier)

This is the first and highest-level check.

Scenario: Two different ClusterProfile objects (Profile A and Profile B), both matching the same destination cluster, try to deploy the same resource (e.g., a ConfigMap named my-app-config).

Rule: The ClusterProfile with the lowest numerical Tier value wins. (Lower number = higher priority).

Example: If Profile A has Tier: 10 and Profile B has Tier: 50, Profile A wins and is the only one authorized to manage my-app-config.

When Sveltos deploys a YAML/JSON (via PolicyRefs or KustomizationRefs)
the information on referenced resources were added as labels.
This had a downside: the name of the referenced resource cannot exceed
63 characters (that is the maximum length of a label value).

This PR move those data to annotations, removing that limitation.

This PR also introduces a __tier__ concept for PolicyRefs/KustomizationRefs.
The Tier field on a Sveltos PolicyRef/KustomizationRef introduces a secondary,
intra-profile priority system. It is designed specifically to resolve resource
conflicts that occur when multiple policy references within the same parent
ClusterProfile or Profile attempt to deploy the identical Kubernetes resource.

This system works in two distinct steps:

1. Primary Conflict Resolution (ClusterProfile Tier)

This is the first and highest-level check.

Scenario: Two different ClusterProfile objects (Profile A and Profile B), both matching
the same destination cluster, try to deploy the same resource (e.g., a ConfigMap named my-app-config).

Rule: The ClusterProfile with the lowest numerical Tier value wins. (Lower number = higher priority).

Example: If Profile A has Tier: 10 and Profile B has Tier: 50, Profile A wins and is the only one
authorized to manage my-app-config.
@gianlucam76 gianlucam76 merged commit 235fcc4 into projectsveltos:release-1.1 Oct 10, 2025
8 checks passed
@gianlucam76 gianlucam76 deleted the release-1.1 branch October 10, 2025 19:42
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