mirror of
https://github.com/kubernetes/client-go.git
synced 2025-06-24 22:23:02 +00:00
Merge pull request #123937 from p0lyn0mial/upstream-use-initial-events-annotation-key-const
use metav1.InitialEventsAnnotationKey const Kubernetes-commit: c016b0b9a8ca63dbec1fade0910c2a06017cc4ab
This commit is contained in:
commit
a82df61b84
2
tools/cache/reflector.go
vendored
2
tools/cache/reflector.go
vendored
@ -780,7 +780,7 @@ loop:
|
||||
}
|
||||
case watch.Bookmark:
|
||||
// A `Bookmark` means watch has synced here, just update the resourceVersion
|
||||
if meta.GetAnnotations()["k8s.io/initial-events-end"] == "true" {
|
||||
if meta.GetAnnotations()[metav1.InitialEventsAnnotationKey] == "true" {
|
||||
if exitOnInitialEventsEndBookmark != nil {
|
||||
*exitOnInitialEventsEndBookmark = true
|
||||
}
|
||||
|
14
tools/cache/reflector_watchlist_test.go
vendored
14
tools/cache/reflector_watchlist_test.go
vendored
@ -174,7 +174,7 @@ func TestWatchList(t *testing.T) {
|
||||
{Type: watch.Bookmark, Object: &v1.Pod{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
ResourceVersion: "2",
|
||||
Annotations: map[string]string{"k8s.io/initial-events-end": "true"},
|
||||
Annotations: map[string]string{metav1.InitialEventsAnnotationKey: "true"},
|
||||
},
|
||||
}},
|
||||
},
|
||||
@ -203,7 +203,7 @@ func TestWatchList(t *testing.T) {
|
||||
{Type: watch.Bookmark, Object: &v1.Pod{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
ResourceVersion: "5",
|
||||
Annotations: map[string]string{"k8s.io/initial-events-end": "true"},
|
||||
Annotations: map[string]string{metav1.InitialEventsAnnotationKey: "true"},
|
||||
},
|
||||
}},
|
||||
},
|
||||
@ -241,7 +241,7 @@ func TestWatchList(t *testing.T) {
|
||||
{Type: watch.Bookmark, Object: &v1.Pod{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
ResourceVersion: "2",
|
||||
Annotations: map[string]string{"k8s.io/initial-events-end": "true"},
|
||||
Annotations: map[string]string{metav1.InitialEventsAnnotationKey: "true"},
|
||||
},
|
||||
}},
|
||||
},
|
||||
@ -279,7 +279,7 @@ func TestWatchList(t *testing.T) {
|
||||
{Type: watch.Bookmark, Object: &v1.Pod{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
ResourceVersion: "1",
|
||||
Annotations: map[string]string{"k8s.io/initial-events-end": "true"},
|
||||
Annotations: map[string]string{metav1.InitialEventsAnnotationKey: "true"},
|
||||
},
|
||||
}},
|
||||
},
|
||||
@ -310,7 +310,7 @@ func TestWatchList(t *testing.T) {
|
||||
{Type: watch.Bookmark, Object: &v1.Pod{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
ResourceVersion: "2",
|
||||
Annotations: map[string]string{"k8s.io/initial-events-end": "true"},
|
||||
Annotations: map[string]string{metav1.InitialEventsAnnotationKey: "true"},
|
||||
},
|
||||
}},
|
||||
{Type: watch.Added, Object: makePod("p3", "3")},
|
||||
@ -351,7 +351,7 @@ func TestWatchList(t *testing.T) {
|
||||
{Type: watch.Bookmark, Object: &v1.Pod{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
ResourceVersion: "2",
|
||||
Annotations: map[string]string{"k8s.io/initial-events-end": "true"},
|
||||
Annotations: map[string]string{metav1.InitialEventsAnnotationKey: "true"},
|
||||
},
|
||||
}},
|
||||
{Type: watch.Added, Object: makePod("p3", "3")},
|
||||
@ -382,7 +382,7 @@ func TestWatchList(t *testing.T) {
|
||||
{Type: watch.Bookmark, Object: &v1.Pod{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
ResourceVersion: "2",
|
||||
Annotations: map[string]string{"k8s.io/initial-events-end": "false"},
|
||||
Annotations: map[string]string{metav1.InitialEventsAnnotationKey: "false"},
|
||||
},
|
||||
}},
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user