mirror of https://github.com/helm/helm
When an index is in a JSON format, the `sigs.k8s.io/yaml` package uses an inefficient approach to unmarshaling the data, as it does an unnecessary roundtrip on the data to transform the YAML to valid JSON. To prevent this from happening, detect if the bytes which we attempt to load contain valid JSON, and unmarshal them directly using `json.Unmarshal` instead. Signed-off-by: Hidde Beydals <hidde@hhh.computer>pull/12245/head
parent
a50206fed2
commit
e21c9cf7e2
@ -0,0 +1,53 @@
|
||||
{
|
||||
"apiVersion": "v1",
|
||||
"entries": {
|
||||
"nginx": [
|
||||
{
|
||||
"urls": ["https://charts.helm.sh/stable/nginx-0.2.0.tgz"],
|
||||
"name": "nginx",
|
||||
"description": "string",
|
||||
"version": "0.2.0",
|
||||
"home": "https://github.com/something/else",
|
||||
"digest": "sha256:1234567890abcdef",
|
||||
"keywords": ["popular", "web server", "proxy"],
|
||||
"apiVersion": "v2"
|
||||
},
|
||||
{
|
||||
"urls": ["https://charts.helm.sh/stable/nginx-0.1.0.tgz"],
|
||||
"name": "nginx",
|
||||
"description": "string",
|
||||
"version": "0.1.0",
|
||||
"home": "https://github.com/something",
|
||||
"digest": "sha256:1234567890abcdef",
|
||||
"keywords": ["popular", "web server", "proxy"],
|
||||
"apiVersion": "v2"
|
||||
}
|
||||
],
|
||||
"alpine": [
|
||||
{
|
||||
"urls": [
|
||||
"https://charts.helm.sh/stable/alpine-1.0.0.tgz",
|
||||
"http://storage2.googleapis.com/kubernetes-charts/alpine-1.0.0.tgz"
|
||||
],
|
||||
"name": "alpine",
|
||||
"description": "string",
|
||||
"version": "1.0.0",
|
||||
"home": "https://github.com/something",
|
||||
"keywords": ["linux", "alpine", "small", "sumtin"],
|
||||
"digest": "sha256:1234567890abcdef",
|
||||
"apiVersion": "v2"
|
||||
}
|
||||
],
|
||||
"chartWithNoURL": [
|
||||
{
|
||||
"name": "chartWithNoURL",
|
||||
"description": "string",
|
||||
"version": "1.0.0",
|
||||
"home": "https://github.com/something",
|
||||
"keywords": ["small", "sumtin"],
|
||||
"digest": "sha256:1234567890abcdef",
|
||||
"apiVersion": "v2"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
Loading…
Reference in new issue