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
07e05429
Commit
07e05429
authored
Mar 16, 2016
by
Michelle Noorali
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(repos): add routes for chart repo management
parent
75cbba95
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
2 deletions
+34
-2
chartrepos.go
cmd/manager/chartrepos.go
+31
-0
deployments.go
cmd/manager/deployments.go
+1
-1
main.go
cmd/manager/main.go
+2
-1
No files found.
cmd/manager/chartrepos.go
0 → 100644
View file @
07e05429
package
main
import
(
"github.com/kubernetes/helm/cmd/manager/router"
"github.com/kubernetes/helm/pkg/util"
"net/http"
)
func
registerChartRepoRoutes
(
c
*
router
.
Context
,
h
*
router
.
Handler
)
{
h
.
Add
(
"GET /chart_repositories"
,
listChartRepositoriesHandlerFunc
)
h
.
Add
(
"POST /chart_repositories"
,
addChartRepoHandlerFunc
)
h
.
Add
(
"DELETE /chart_repositories"
,
removeChartRepoHandlerFunc
)
}
func
listChartRepositoriesHandlerFunc
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
,
c
*
router
.
Context
)
error
{
handler
:=
"manager: list chart repositories"
util
.
LogHandlerExitWithJSON
(
handler
,
w
,
"a repo here"
,
http
.
StatusOK
)
return
nil
}
func
addChartRepoHandlerFunc
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
,
c
*
router
.
Context
)
error
{
handler
:=
"manager: add chart repository"
util
.
LogHandlerExitWithJSON
(
handler
,
w
,
"add a repo"
,
http
.
StatusOK
)
return
nil
}
func
removeChartRepoHandlerFunc
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
,
c
*
router
.
Context
)
error
{
handler
:=
"manager: remove chart repository"
util
.
LogHandlerExitWithJSON
(
handler
,
w
,
"remove a repo"
,
http
.
StatusOK
)
return
nil
}
cmd/manager/deployments.go
View file @
07e05429
...
...
@@ -78,7 +78,7 @@ type Route struct {
Type
string
}
func
registerRoutes
(
c
*
router
.
Context
,
h
*
router
.
Handler
)
{
func
register
Deployment
Routes
(
c
*
router
.
Context
,
h
*
router
.
Handler
)
{
re
:=
regexp
.
MustCompile
(
"{[a-z]+}"
)
h
.
Add
(
"GET /healthz"
,
healthz
)
...
...
cmd/manager/main.go
View file @
07e05429
...
...
@@ -54,7 +54,8 @@ func main() {
// Set up routes
handler
:=
router
.
NewHandler
(
c
)
registerRoutes
(
c
,
handler
)
registerDeploymentRoutes
(
c
,
handler
)
registerChartRepoRoutes
(
c
,
handler
)
// Now create a server.
log
.
Printf
(
"Starting Manager %s on %s"
,
version
.
Version
,
c
.
Config
.
Address
)
...
...
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