mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-15 22:20:51 +00:00
Make ResourceVersion a string internally instead of uint64
Allows us to define different watch versioning regimes in the future as well as to encode information with the resource version. This changes /watch/resources?resourceVersion=3 to start the watch at 4 instead of 3, which means clients can read a resource version and then send it back to the server. Clients should no longer do math on resource versions.
This commit is contained in:
@@ -20,7 +20,6 @@ import (
|
||||
"net/http"
|
||||
"net/url"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"code.google.com/p/go.net/websocket"
|
||||
@@ -37,7 +36,7 @@ type WatchHandler struct {
|
||||
codec runtime.Codec
|
||||
}
|
||||
|
||||
func getWatchParams(query url.Values) (label, field labels.Selector, resourceVersion uint64) {
|
||||
func getWatchParams(query url.Values) (label, field labels.Selector, resourceVersion string) {
|
||||
if s, err := labels.ParseSelector(query.Get("labels")); err != nil {
|
||||
label = labels.Everything()
|
||||
} else {
|
||||
@@ -48,10 +47,8 @@ func getWatchParams(query url.Values) (label, field labels.Selector, resourceVer
|
||||
} else {
|
||||
field = s
|
||||
}
|
||||
if rv, err := strconv.ParseUint(query.Get("resourceVersion"), 10, 64); err == nil {
|
||||
resourceVersion = rv
|
||||
}
|
||||
return label, field, resourceVersion
|
||||
resourceVersion = query.Get("resourceVersion")
|
||||
return
|
||||
}
|
||||
|
||||
var connectionUpgradeRegex = regexp.MustCompile("(^|.*,\\s*)upgrade($|\\s*,)")
|
||||
|
Reference in New Issue
Block a user