cleanup: remove deadcode

This commit is contained in:
Cong Ding
2018-06-22 16:39:13 -07:00
parent eb5a26f801
commit 3bacb04a5f
4 changed files with 3 additions and 19 deletions

View File

@@ -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)

View File

@@ -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 {
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,

View File

@@ -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

View File

@@ -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:
} }
} }
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:
} }
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)