feat(service): apply custom marks to the computed diff

This commit is contained in:
2026-08-19 18:02:55 +07:00
parent 618d5c5bb6
commit 208e73980d
3 changed files with 79 additions and 10 deletions
+6
View File
@@ -41,6 +41,11 @@ type DomainRef struct {
Provider string
SecretEnc string
Template dto.TemplateDoc
// CustomKeys are RecordDiff keys the operator marked as deliberately
// outside the template for this domain. Applied in resolve() right after
// the diff is computed — the single marking point, like tmpl.Materialize
// is the single materialisation point.
CustomKeys []string
}
// ZoneRef is the provider-access subset of a domain, without a template —
@@ -102,6 +107,7 @@ func (s *DomainService) resolve(ctx context.Context, projectID, domainID uuid.UU
return nil, provider.Credentials{}, ref, diff.Changeset{}, fmt.Errorf("%w: %v", ErrProviderUnavailable, err)
}
cs := diff.Diff(tmpl.Materialize(ref.Template, ref.ZoneName), actual)
cs.MarkCustom(ref.CustomKeys)
return p, creds, ref, cs, nil
}