Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Bruce Flynn
chart-server
Commits
909508cb
Commit
909508cb
authored
Oct 19, 2018
by
Bruce Flynn
Browse files
fix bad pat
parent
19ea4701
Changes
2
Hide whitespace changes
Inline
Side-by-side
Dockerfile
View file @
909508cb
...
...
@@ -7,6 +7,7 @@ COPY . .
RUN
dep ensure
&&
./build.sh
FROM
debian:buster-slim
COPY
--from=build /go/bin/chart-server .
ENTRYPOINT
["./chart-server"]
...
...
main.go
View file @
909508cb
...
...
@@ -38,7 +38,7 @@ func handleUpload(w http.ResponseWriter, r *http.Request) {
http
.
Error
(
w
,
"InternalServerError"
,
http
.
StatusInternalServerError
)
return
}
// got a stat result, file must exist
// got a stat result, file must exist
already and we should not overwrite
if
st
!=
nil
{
http
.
Error
(
w
,
"File exists"
,
http
.
StatusForbidden
)
return
...
...
@@ -173,7 +173,7 @@ Options can also be specified as environment variables $CHART_SVR_<name>
r
.
HandleFunc
(
"/status"
,
handleStatus
)
.
Methods
(
"GET"
)
// Limit to only index.yaml and chart (.tgz) files
r
.
HandleFunc
(
`/{filename:(?:index.yaml|.*-.*.tgz)}`
,
handleGetFile
)
.
Methods
(
"GET"
)
r
.
HandleFunc
(
`/{chart:.*-.*
\
.tgz}`
,
handleUpload
)
.
Methods
(
"PUT"
)
r
.
HandleFunc
(
`/{chart:.*-.*.tgz}`
,
handleUpload
)
.
Methods
(
"PUT"
)
r
.
HandleFunc
(
"/"
,
handleGetHome
)
h
:=
handlers
.
CombinedLoggingHandler
(
os
.
Stdout
,
handlers
.
CORS
()(
r
))
...
...
Write
Preview
Supports
Markdown
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