Making the monocular client search path a const

Signed-off-by: Matt Farina <matt@mattfarina.com>
pull/6187/head
Matt Farina 5 years ago
parent 2d4ced9090
commit a6762a38a8
No known key found for this signature in database
GPG Key ID: 9436E80BFBA46909

@ -28,6 +28,9 @@ import (
"helm.sh/helm/pkg/chart"
)
// SearchPath is the url path to the search API in monocular.
const SearchPath = "api/chartsvc/v1/charts/search"
// The structs below represent the structure of the response from the monocular
// search API. The structs were not imported from monocular because monocular
// imports from Helm v2 (avoiding circular version dependency) and the mappings
@ -100,7 +103,7 @@ func (c *Client) Search(term string) ([]SearchResult, error) {
}
// Set the path to the monocular API endpoint for search
p.Path = path.Join(p.Path, "api/chartsvc/v1/charts/search")
p.Path = path.Join(p.Path, SearchPath)
p.RawQuery = "q=" + url.QueryEscape(term)

Loading…
Cancel
Save