Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
helm3
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
helm3
Commits
b93cb085
Commit
b93cb085
authored
Mar 31, 2016
by
Adam Reese
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #531 from adamreese/fix/deadcode
fix(manager): remove deadcode
parents
f63e6bc1
adfe3946
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
63 deletions
+0
-63
deployments.go
cmd/manager/deployments.go
+0
-63
No files found.
cmd/manager/deployments.go
View file @
b93cb085
...
@@ -19,17 +19,12 @@ package main
...
@@ -19,17 +19,12 @@ package main
import
(
import
(
"errors"
"errors"
"fmt"
"fmt"
"io"
"io/ioutil"
"log"
"log"
"net"
"net"
"net/http"
"net/http"
"net/url"
"os"
"os"
"strings"
"strings"
"github.com/ghodss/yaml"
"github.com/gorilla/mux"
"github.com/kubernetes/helm/cmd/manager/manager"
"github.com/kubernetes/helm/cmd/manager/manager"
"github.com/kubernetes/helm/cmd/manager/repository"
"github.com/kubernetes/helm/cmd/manager/repository"
"github.com/kubernetes/helm/cmd/manager/repository/persistent"
"github.com/kubernetes/helm/cmd/manager/repository/persistent"
...
@@ -41,20 +36,6 @@ import (
...
@@ -41,20 +36,6 @@ import (
"github.com/kubernetes/helm/pkg/util"
"github.com/kubernetes/helm/pkg/util"
)
)
// Deprecated. Use Context.Manager instead.
var
backend
manager
.
Manager
// Route defines a routing table entry to be registered with gorilla/mux.
//
// Route is deprecated. Use router.Routes instead.
type
Route
struct
{
Name
string
Path
string
Methods
string
HandlerFunc
http
.
HandlerFunc
Type
string
}
func
registerDeploymentRoutes
(
c
*
router
.
Context
,
h
*
router
.
Handler
)
{
func
registerDeploymentRoutes
(
c
*
router
.
Context
,
h
*
router
.
Handler
)
{
h
.
Add
(
"GET /healthz"
,
healthz
)
h
.
Add
(
"GET /healthz"
,
healthz
)
h
.
Add
(
"GET /deployments"
,
listDeploymentsHandlerFunc
)
h
.
Add
(
"GET /deployments"
,
listDeploymentsHandlerFunc
)
...
@@ -272,25 +253,6 @@ func pos(w http.ResponseWriter, r *http.Request, i int) (string, error) {
...
@@ -272,25 +253,6 @@ func pos(w http.ResponseWriter, r *http.Request, i int) (string, error) {
return
parts
[
i
],
nil
return
parts
[
i
],
nil
}
}
func
getPathVariable
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
,
variable
,
handler
string
)
(
string
,
error
)
{
vars
:=
mux
.
Vars
(
r
)
escaped
,
ok
:=
vars
[
variable
]
if
!
ok
{
e
:=
fmt
.
Errorf
(
"%s name not found in URL"
,
variable
)
util
.
LogAndReturnError
(
handler
,
http
.
StatusBadRequest
,
e
,
w
)
return
""
,
e
}
unescaped
,
err
:=
url
.
QueryUnescape
(
escaped
)
if
err
!=
nil
{
e
:=
fmt
.
Errorf
(
"cannot decode name (%v)"
,
variable
)
util
.
LogAndReturnError
(
handler
,
http
.
StatusBadRequest
,
e
,
w
)
return
""
,
e
}
return
unescaped
,
nil
}
func
getDeploymentRequest
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
,
handler
string
)
*
common
.
DeploymentRequest
{
func
getDeploymentRequest
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
,
handler
string
)
*
common
.
DeploymentRequest
{
util
.
LogHandlerEntry
(
handler
,
r
)
util
.
LogHandlerEntry
(
handler
,
r
)
depReq
:=
&
common
.
DeploymentRequest
{}
depReq
:=
&
common
.
DeploymentRequest
{}
...
@@ -501,28 +463,3 @@ func getCredentialHandlerFunc(w http.ResponseWriter, r *http.Request, c *router.
...
@@ -501,28 +463,3 @@ func getCredentialHandlerFunc(w http.ResponseWriter, r *http.Request, c *router.
util
.
LogHandlerExitWithJSON
(
handler
,
w
,
cr
,
http
.
StatusOK
)
util
.
LogHandlerExitWithJSON
(
handler
,
w
,
cr
,
http
.
StatusOK
)
return
nil
return
nil
}
}
func
getJSONFromRequest
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
,
handler
string
)
([]
byte
,
error
)
{
util
.
LogHandlerEntry
(
handler
,
r
)
b
:=
io
.
LimitReader
(
r
.
Body
,
*
maxLength
*
1024
)
y
,
err
:=
ioutil
.
ReadAll
(
b
)
if
err
!=
nil
{
util
.
LogAndReturnError
(
handler
,
http
.
StatusBadRequest
,
err
,
w
)
return
[]
byte
{},
err
}
// Reject the input if it exceeded the length limit,
// since we may not have read all of it into the buffer.
if
_
,
err
=
b
.
Read
(
make
([]
byte
,
0
,
1
));
err
!=
io
.
EOF
{
e
:=
fmt
.
Errorf
(
"template exceeds maximum length of %d KB"
,
*
maxLength
)
util
.
LogAndReturnError
(
handler
,
http
.
StatusBadRequest
,
e
,
w
)
return
[]
byte
{},
err
}
if
err
:=
r
.
Body
.
Close
();
err
!=
nil
{
util
.
LogAndReturnError
(
handler
,
http
.
StatusInternalServerError
,
err
,
w
)
return
[]
byte
{},
err
}
return
yaml
.
YAMLToJSON
(
y
)
}
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