Commit 3bacb04a authored by Cong Ding's avatar Cong Ding

cleanup: remove deadcode

parent eb5a26f8
...@@ -855,13 +855,6 @@ func appendIf(actions []action, a action, shouldAppend bool) []action { ...@@ -855,13 +855,6 @@ func appendIf(actions []action, a action, shouldAppend bool) []action {
return actions return actions
} }
// Wraps a http.Handler function inside a restful.RouteFunction
func routeFunction(handler http.Handler) restful.RouteFunction {
return func(restReq *restful.Request, restResp *restful.Response) {
handler.ServeHTTP(restResp.ResponseWriter, restReq.Request)
}
}
func addParams(route *restful.RouteBuilder, params []*restful.Parameter) { func addParams(route *restful.RouteBuilder, params []*restful.Parameter) {
for _, param := range params { for _, param := range params {
route.Param(param) route.Param(param)
......
...@@ -22,7 +22,6 @@ import ( ...@@ -22,7 +22,6 @@ import (
"net/http" "net/http"
"reflect" "reflect"
"sync" "sync"
"time"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
...@@ -100,9 +99,6 @@ type etcdWatcher struct { ...@@ -100,9 +99,6 @@ type etcdWatcher struct {
cache etcdCache cache etcdCache
} }
// watchWaitDuration is the amount of time to wait for an error from watch.
const watchWaitDuration = 100 * time.Millisecond
// newEtcdWatcher returns a new etcdWatcher; if list is true, watch sub-nodes. // newEtcdWatcher returns a new etcdWatcher; if list is true, watch sub-nodes.
// The versioner must be able to handle the objects that transform creates. // The versioner must be able to handle the objects that transform creates.
func newEtcdWatcher(list bool, quorum bool, include includeFunc, pred storage.SelectionPredicate, func newEtcdWatcher(list bool, quorum bool, include includeFunc, pred storage.SelectionPredicate,
......
...@@ -73,11 +73,6 @@ type store struct { ...@@ -73,11 +73,6 @@ type store struct {
leaseManager *leaseManager leaseManager *leaseManager
} }
type elemForDecode struct {
data []byte
rev uint64
}
type objState struct { type objState struct {
obj runtime.Object obj runtime.Object
meta *storage.ResponseMeta meta *storage.ResponseMeta
......
...@@ -94,7 +94,7 @@ func (p *Parser) consumeText() string { ...@@ -94,7 +94,7 @@ func (p *Parser) consumeText() string {
// next returns the next rune in the input. // next returns the next rune in the input.
func (p *Parser) next() rune { func (p *Parser) next() rune {
if int(p.pos) >= len(p.input) { if p.pos >= len(p.input) {
p.width = 0 p.width = 0
return eof return eof
} }
...@@ -266,7 +266,7 @@ Loop: ...@@ -266,7 +266,7 @@ Loop:
} }
} }
text := p.consumeText() text := p.consumeText()
text = string(text[1 : len(text)-1]) text = text[1 : len(text)-1]
if text == "*" { if text == "*" {
text = ":" text = ":"
} }
...@@ -373,7 +373,7 @@ Loop: ...@@ -373,7 +373,7 @@ Loop:
} }
reg := regexp.MustCompile(`^([^!<>=]+)([!<>=]+)(.+?)$`) reg := regexp.MustCompile(`^([^!<>=]+)([!<>=]+)(.+?)$`)
text := p.consumeText() text := p.consumeText()
text = string(text[:len(text)-2]) text = text[:len(text)-2]
value := reg.FindStringSubmatch(text) value := reg.FindStringSubmatch(text)
if value == nil { if value == nil {
parser, err := parseAction("text", text) parser, err := parseAction("text", text)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment