Skip to content

Cache secret hashes in nodeset sync checks to avoid redundant API calls#701

Open
lmiccini wants to merge 1 commit into
openstack-k8s-operators:mainfrom
lmiccini:optimize-nodeset-hash-checks
Open

Cache secret hashes in nodeset sync checks to avoid redundant API calls#701
lmiccini wants to merge 1 commit into
openstack-k8s-operators:mainfrom
lmiccini:optimize-nodeset-hash-checks

Conversation

@lmiccini

@lmiccini lmiccini commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

AreSecretHashesInSync and IsSecretHashInSync previously fetched and hashed each secret once per NodeSet that referenced it. In environments with N NodeSets sharing the same secrets, this caused N redundant Get and Hash calls per secret per reconcile cycle.

Add a hash cache (map for AreSecretHashesInSync, single variable for IsSecretHashInSync) so each secret is fetched and hashed at most once per function invocation. No signature or behavioral change for callers.

AreSecretHashesInSync and IsSecretHashInSync previously fetched and
hashed each secret once per NodeSet that referenced it. In environments
with N NodeSets sharing the same secrets, this caused N redundant Get
and Hash calls per secret per reconcile cycle.

Add a hash cache (map for AreSecretHashesInSync, single variable for
IsSecretHashInSync) so each secret is fetched and hashed at most once
per function invocation. No signature or behavioral change for callers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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