Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
fcb1cd30
Commit
fcb1cd30
authored
Jan 28, 2015
by
Brian Grant
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3891 from nikhiljindal/Operation
Deleting OperationHandler for handling /operation endpoint on server
parents
9bfdfa05
521728e9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
43 deletions
+1
-43
apiserver.go
pkg/apiserver/apiserver.go
+1
-4
operation.go
pkg/apiserver/operation.go
+0
-35
auth_test.go
test/integration/auth_test.go
+0
-4
No files found.
pkg/apiserver/apiserver.go
View file @
fcb1cd30
...
...
@@ -195,7 +195,7 @@ func addParamIf(b *restful.RouteBuilder, parameter *restful.Parameter, shouldAdd
return
b
.
Param
(
parameter
)
}
// InstallREST registers the REST handlers (storage, watch,
and operations
) into a restful Container.
// InstallREST registers the REST handlers (storage, watch,
proxy and redirect
) into a restful Container.
// It is expected that the provided path root prefix will serve all operations. Root MUST NOT end
// in a slash. A restful WebService is created for the group and version.
func
(
g
*
APIGroupVersion
)
InstallREST
(
container
*
restful
.
Container
,
mux
Mux
,
root
string
,
version
string
)
error
{
...
...
@@ -210,7 +210,6 @@ func (g *APIGroupVersion) InstallREST(container *restful.Container, mux Mux, roo
}
proxyHandler
:=
&
ProxyHandler
{
prefix
+
"/proxy/"
,
g
.
handler
.
storage
,
g
.
handler
.
codec
}
redirectHandler
:=
&
RedirectHandler
{
g
.
handler
.
storage
,
g
.
handler
.
codec
}
opHandler
:=
&
OperationHandler
{
g
.
handler
.
ops
,
g
.
handler
.
codec
}
// Create a new WebService for this APIGroupVersion at the specified path prefix
// TODO: Pass in more descriptive documentation
...
...
@@ -269,8 +268,6 @@ func (g *APIGroupVersion) InstallREST(container *restful.Container, mux Mux, roo
mux
.
Handle
(
prefix
+
"/watch/"
,
http
.
StripPrefix
(
prefix
+
"/watch/"
,
watchHandler
))
mux
.
Handle
(
prefix
+
"/proxy/"
,
http
.
StripPrefix
(
prefix
+
"/proxy/"
,
proxyHandler
))
mux
.
Handle
(
prefix
+
"/redirect/"
,
http
.
StripPrefix
(
prefix
+
"/redirect/"
,
redirectHandler
))
mux
.
Handle
(
prefix
+
"/operations"
,
http
.
StripPrefix
(
prefix
+
"/operations"
,
opHandler
))
mux
.
Handle
(
prefix
+
"/operations/"
,
http
.
StripPrefix
(
prefix
+
"/operations/"
,
opHandler
))
container
.
Add
(
ws
)
...
...
pkg/apiserver/operation.go
View file @
fcb1cd30
...
...
@@ -17,7 +17,6 @@ limitations under the License.
package
apiserver
import
(
"net/http"
"sort"
"strconv"
"sync"
...
...
@@ -25,43 +24,9 @@ import (
"time"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/runtime"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
)
type
OperationHandler
struct
{
ops
*
Operations
codec
runtime
.
Codec
}
func
(
h
*
OperationHandler
)
ServeHTTP
(
w
http
.
ResponseWriter
,
req
*
http
.
Request
)
{
parts
:=
splitPath
(
req
.
URL
.
Path
)
if
len
(
parts
)
>
1
||
req
.
Method
!=
"GET"
{
notFound
(
w
,
req
)
return
}
if
len
(
parts
)
==
0
{
// List outstanding operations.
list
:=
h
.
ops
.
List
()
writeJSON
(
http
.
StatusOK
,
h
.
codec
,
list
,
w
)
return
}
op
:=
h
.
ops
.
Get
(
parts
[
0
])
if
op
==
nil
{
notFound
(
w
,
req
)
return
}
result
,
complete
:=
op
.
StatusOrResult
()
obj
:=
result
.
Object
if
complete
{
writeJSON
(
http
.
StatusOK
,
h
.
codec
,
obj
,
w
)
}
else
{
writeJSON
(
http
.
StatusAccepted
,
h
.
codec
,
obj
,
w
)
}
}
// Operation represents an ongoing action which the server is performing.
type
Operation
struct
{
ID
string
...
...
test/integration/auth_test.go
View file @
fcb1cd30
...
...
@@ -257,10 +257,6 @@ func getTestRequests() []struct {
{
"GET"
,
"/api/v1beta1/foo/a"
,
""
,
code404
},
{
"DELETE"
,
"/api/v1beta1/foo"
+
timeoutFlag
,
""
,
code404
},
// Operations
{
"GET"
,
"/api/v1beta1/operations"
,
""
,
code200
},
{
"GET"
,
"/api/v1beta1/operations/1234567890"
,
""
,
code404
},
// Special verbs on nodes
// TODO: Will become 405 once these are converted to go-restful
{
"GET"
,
"/api/v1beta1/proxy/minions/a"
,
""
,
code404
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment