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
db692001
Commit
db692001
authored
Aug 06, 2018
by
Tomas Restrepo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Propagate query string arguments in repository URL to absolute chart URL
parent
71629f04
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
chartrepo.go
pkg/repo/chartrepo.go
+4
-1
chartrepo_test.go
pkg/repo/chartrepo_test.go
+8
-0
No files found.
pkg/repo/chartrepo.go
View file @
db692001
...
@@ -270,5 +270,8 @@ func ResolveReferenceURL(baseURL, refURL string) (string, error) {
...
@@ -270,5 +270,8 @@ func ResolveReferenceURL(baseURL, refURL string) (string, error) {
return
""
,
fmt
.
Errorf
(
"failed to parse %s as URL: %v"
,
refURL
,
err
)
return
""
,
fmt
.
Errorf
(
"failed to parse %s as URL: %v"
,
refURL
,
err
)
}
}
return
parsedBaseURL
.
ResolveReference
(
parsedRefURL
)
.
String
(),
nil
resolvedURL
:=
parsedBaseURL
.
ResolveReference
(
parsedRefURL
)
resolvedURL
.
RawQuery
=
parsedBaseURL
.
RawQuery
return
resolvedURL
.
String
(),
nil
}
}
pkg/repo/chartrepo_test.go
View file @
db692001
...
@@ -287,6 +287,14 @@ func TestResolveReferenceURL(t *testing.T) {
...
@@ -287,6 +287,14 @@ func TestResolveReferenceURL(t *testing.T) {
t
.
Errorf
(
"%s"
,
chartURL
)
t
.
Errorf
(
"%s"
,
chartURL
)
}
}
chartURL
,
err
=
ResolveReferenceURL
(
"http://localhost:8123/charts/?st=2018-08-06T22%3A59%3A04Z&se=2018-08-07T22%3A59%3A04Z&sp=rl&sv=2018-03-28&sr=c&sig=cyqM4%2F5G7HNk%2F3faaHSDMaWxFxefCglvZlYSnmQBwiY%3D"
,
"nginx-0.2.0.tgz"
)
if
err
!=
nil
{
t
.
Errorf
(
"%s"
,
err
)
}
if
chartURL
!=
"http://localhost:8123/charts/nginx-0.2.0.tgz?st=2018-08-06T22%3A59%3A04Z&se=2018-08-07T22%3A59%3A04Z&sp=rl&sv=2018-03-28&sr=c&sig=cyqM4%2F5G7HNk%2F3faaHSDMaWxFxefCglvZlYSnmQBwiY%3D"
{
t
.
Errorf
(
"%s does not contain the query string of the base URL"
,
chartURL
)
}
chartURL
,
err
=
ResolveReferenceURL
(
"http://localhost:8123"
,
"https://kubernetes-charts.storage.googleapis.com/nginx-0.2.0.tgz"
)
chartURL
,
err
=
ResolveReferenceURL
(
"http://localhost:8123"
,
"https://kubernetes-charts.storage.googleapis.com/nginx-0.2.0.tgz"
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Errorf
(
"%s"
,
err
)
t
.
Errorf
(
"%s"
,
err
)
...
...
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