Skip to content

(feat) Add WatchFields to TemplateResourceRef for fine-grained hash control#1767

Merged
gianlucam76 merged 1 commit into
projectsveltos:mainfrom
gianlucam76:templateresourcerefs-hash
May 6, 2026
Merged

(feat) Add WatchFields to TemplateResourceRef for fine-grained hash control#1767
gianlucam76 merged 1 commit into
projectsveltos:mainfrom
gianlucam76:templateresourcerefs-hash

Conversation

@gianlucam76

Copy link
Copy Markdown
Member

IgnoreStatusChanges is an all-or-nothing toggle, it excludes the entire status from hash evaluation. Sometimes it is needed to react to a specific field (e.g. status.readyReplicas) without being sensitive to every other change on the object.

This PR adds a WatchFields field to TemplateResourceRef. When set, only the listed dot-separated field paths (e.g. "status.readyReplicas", "metadata.labels") contribute to the hash. All other fields are ignored. WatchFields takes precedence over IgnoreStatusChanges when both are set.

The feature applies to any field on the resource, not just status.

  templateResourceRefs:
    - resource:
        apiVersion: apps/v1
        kind: Deployment
        name: my-app
        namespace: default
      identifier: MyDeployment
      watchFields:
        - status.readyReplicas
        - status.updatedReplicas

…ontrol

IgnoreStatusChanges is an all-or-nothing toggle, it excludes the entire status from hash evaluation.
Sometimes it is needed to react to a specific field (e.g. status.readyReplicas) without being sensitive
to every other change on the object.

This PR adds a `WatchFields` field to TemplateResourceRef. When set, only the listed dot-separated field
paths (e.g. "status.readyReplicas", "metadata.labels") contribute to the hash. All other fields are ignored.
WatchFields takes precedence over IgnoreStatusChanges when both are set.

The feature applies to any field on the resource, not just status.

```yaml
  templateResourceRefs:
    - resource:
        apiVersion: apps/v1
        kind: Deployment
        name: my-app
        namespace: default
      identifier: MyDeployment
      watchFields:
        - status.readyReplicas
        - status.updatedReplicas
```
@gianlucam76 gianlucam76 merged commit b6237da into projectsveltos:main May 6, 2026
8 checks passed
@gianlucam76 gianlucam76 deleted the templateresourcerefs-hash branch May 6, 2026 17:50
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