You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.
The Kubernetes API explicitly disallows parsing the metadata.resourceVersion field on an object as an integer. This project, however, does so as of this commit: cb0486e
During a review of code that would be affected by non-numerical resourceVersions, I came upon this code. I'm hoping to better understand what this codebase is using the parsing logic for and if there are other means to that end without using non-supported API behavior. I can see that uses of the parsing seem to all be in precondition functions passed to Upsert* methods on a store. This looks analogous to the resource version precondition provided by the Kubernetes API server, but the only implementation of the store I found was an in-memory one here - so I'm not entirely sure how the Kubernetes client and server get involved here.
The text was updated successfully, but these errors were encountered:
Personally, I wasn't aware of that note RE: metadata.resourceVersion. We're just parsing as an integer today to guard against incorrectly updating to an older version; however, it looks like the watcher probably handles that for us. If that's the case, we can just do an equality check as mentioned by the docs that you linked.
Gotcha - if you could help me understand the in-memory storage you have and when/if/how it gets synced to a running k8s API server, I could help fix it!
Overview of the Issue
The Kubernetes API explicitly disallows parsing the
metadata.resourceVersion
field on an object as an integer. This project, however, does so as of this commit: cb0486eDuring a review of code that would be affected by non-numerical resourceVersions, I came upon this code. I'm hoping to better understand what this codebase is using the parsing logic for and if there are other means to that end without using non-supported API behavior. I can see that uses of the parsing seem to all be in precondition functions passed to
Upsert*
methods on a store. This looks analogous to the resource version precondition provided by the Kubernetes API server, but the only implementation of the store I found was an in-memory one here - so I'm not entirely sure how the Kubernetes client and server get involved here.The text was updated successfully, but these errors were encountered: