-
-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix WatchParams
bookmarks for watch_metadata
#1193
Conversation
Intended to factor out `populate_qp` from `ListParams` and do the same in `WatchParams`, but accidentally found a place where the duplication caused a split. This brings the query param serialization in line for all variants of list, and does the same for all variants of watch (where the inconsistency was wound). Signed-off-by: clux <sszynrae@gmail.com>
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1193 +/- ##
==========================================
+ Coverage 73.42% 73.51% +0.08%
==========================================
Files 68 68
Lines 5370 5357 -13
==========================================
- Hits 3943 3938 -5
+ Misses 1427 1419 -8
|
@mateiidavid just checking in to make sure was if there was real reason to exclude watch bookmarks from the metadata watches. |
In all honesty, it might have just been me being short-sighted. There isn't afaik a real reason to exclude them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be missing some context here, tried to get up to speed with the params split change. I'd urge another reviewer to check this out 😬
As far as metadata watches go, they should be ok with bookmarks, went back to my PR and I seemed to have manually validated that it works using curl
:; curl -H "Accept: application/json;as=PartialObjectMetadata;g=meta.k8s.io;v=v1" "http://localhost:8001/api/v1/namespaces/kube-system/pods?&w
atch=true&resourceVersion=0&timeoutSeconds=290&allowWatchBookmarks=true"
{"type":"ADDED","object":{"kind":"PartialObjectMetadata","apiVersion":"meta.k8s.io/v1","metadata":{"name":"local-path-provisioner-7b7dc8d6f5-ckv7f","generateName":"local-path-provisioner-7b7dc8d6f5-","namespace":"kube-system","uid":"aee9cd50-1d63-42ae-92c7-de43ca7ba3a1","resourceVersion":"473","creationTimestamp":"2023-04-05T11:23:40Z","labels":{"app":"local-path-provisioner","pod-template-hash":"7b7dc8d6f5"},"ownerReferences":[{"apiVersion":"apps/v1","kind":"ReplicaSet","name":"local-path-provisioner-7b7dc8d6f5","uid":"5fbe213e-302a-4c97-b33a-0f29d2645bea","controller":true,"blockOwnerDeletion":true}],"managedFields":[{"manager":"k3s","operation":"Update","apiVersion":"v1","time":"2023-04-05T11:23:40Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:generateName":{},"f:labels":{".":{},"f:app":{},"f:pod-template-hash":{}},"f:ownerReferences":{".":{},"k:{\"uid\":\"5fbe213e-302a-4c97-b33a-0f29d2645bea\"}":{}}},"f:spec":{"f:containers":{"k:{\"name\":\"local-path-provisioner\"}":{".":{},"f:command":{},"f:env":{".":{},"k:{\"name\":\"POD_NAMESPACE\"}":{".":{},"f:name":{},"f:valueFrom":{".":{},"f:fieldRef":{}}}},"f:image":{},"f:imagePullPolicy":{},"f:name":{},"f:resources":{},"f:terminationMessagePath":{},"f:terminationMessagePolicy":{},"f:volumeMounts":{".":{},"k:{\"mountPath\":\"/etc/config/\"}":{".":{},"f:mountPath":{},"f:name":{}}}}},"f:dnsPolicy":{},"f:enableServiceLinks":{},"f:priorityClassName":{},"f:restartPolicy":{},"f:schedulerName":{},"f:securityContext":{},"f:serviceAccount":{},"f:serviceAccountName":{},"f:terminationGracePeriodSeconds":{},"f:tolerations":{},"f:volumes":{".":{},"k:{\"name\":\"config-volume\"}":{".":{},"f:configMap":{".":{},"f:defaultMode":{},"f:name":{}},"f:name":{}}}}}},{"manager":"k3s","operation":"Update","apiVersion":"v1","time":"2023-04-05T11:23:46Z","fieldsType":"FieldsV1","fieldsV1":{"f:status":{"f:conditions":{"k:{\"type\":\"ContainersReady\"}":{".":{},"f:lastProbeTime":{},"f:lastTransitionTime":{},"f:status":{},"f:type":{}},"k:{\"type\":\"Initialized\"}":{".":{},"f:lastProbeTime":{},"f:lastTransitionTime":{},"f:status":{},"f:type":{}},"k:{\"type\":\"Ready\"}":{".":{},"f:lastProbeTime":{},"f:lastTransitionTime":{},"f:status":{},"f:type":{}}},"f:containerStatuses":{},"f:hostIP":{},"f:phase":{},"f:podIP":{},"f:podIPs":{".":{},"k:{\"ip\":\"10.42.0.5\"}":{".":{},"f:ip":{}}},"f:startTime":{}}},"subresource":"status"}]}}}
Left a tiny nit since I started going through the code. Think the refactor looks great.
Signed-off-by: clux <sszynrae@gmail.com>
Thanks for checking! |
Intended to factor out
populate_qp
fromListParams
and do the same inWatchParams
, but accidentally found a place where the duplication caused a split.This brings the query param serialization in line for all variants of list, and does the same for all variants of watch (where the inconsistency was wound).