mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-11 22:20:18 +00:00
Cleanup watch encoding (remove dupe Encoding)
Move standard watch encode / decode streams to use runtime.RawExtension and embed API decoding based on a provided codec.
This commit is contained in:
@@ -28,11 +28,11 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
|
||||
cwatch "github.com/GoogleCloudPlatform/kubernetes/pkg/client/watch"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/runtime"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/watch"
|
||||
watchjson "github.com/GoogleCloudPlatform/kubernetes/pkg/watch/json"
|
||||
"github.com/golang/glog"
|
||||
)
|
||||
|
||||
@@ -269,7 +269,7 @@ func (r *Request) Watch() (watch.Interface, error) {
|
||||
if response.StatusCode != http.StatusOK {
|
||||
return nil, fmt.Errorf("Got status: %v", response.StatusCode)
|
||||
}
|
||||
return watch.NewStreamWatcher(cwatch.NewAPIEventDecoder(response.Body)), nil
|
||||
return watch.NewStreamWatcher(watchjson.NewDecoder(response.Body, r.c.Codec)), nil
|
||||
}
|
||||
|
||||
// Do formats and executes the request. Returns the API object received, or an error.
|
||||
|
Reference in New Issue
Block a user