mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-09 05:01:46 +00:00
Add the ability to watch fields of an rc
This commit is contained in:
@@ -32,6 +32,15 @@ import (
|
||||
"github.com/golang/glog"
|
||||
)
|
||||
|
||||
// Etcd watch event actions
|
||||
const (
|
||||
EtcdCreate = "create"
|
||||
EtcdGet = "get"
|
||||
EtcdSet = "set"
|
||||
EtcdCAS = "compareAndSwap"
|
||||
EtcdDelete = "delete"
|
||||
)
|
||||
|
||||
// FilterFunc is a predicate which takes an API object and returns true
|
||||
// iff the object should remain in the set.
|
||||
type FilterFunc func(obj runtime.Object) bool
|
||||
@@ -377,11 +386,11 @@ func (w *etcdWatcher) sendDelete(res *etcd.Response) {
|
||||
|
||||
func (w *etcdWatcher) sendResult(res *etcd.Response) {
|
||||
switch res.Action {
|
||||
case "create", "get":
|
||||
case EtcdCreate, EtcdGet:
|
||||
w.sendAdd(res)
|
||||
case "set", "compareAndSwap":
|
||||
case EtcdSet, EtcdCAS:
|
||||
w.sendModify(res)
|
||||
case "delete":
|
||||
case EtcdDelete:
|
||||
w.sendDelete(res)
|
||||
default:
|
||||
glog.Errorf("unknown action: %v", res.Action)
|
||||
|
Reference in New Issue
Block a user