mirror of https://github.com/knative/func.git
Add limit to number of manifests (#2055)
Signed-off-by: AdamKorcz <adam@adalogics.com>
This commit is contained in:
parent
7fa331b544
commit
1d94c1afb7
|
@ -60,6 +60,10 @@ func GetPlatformImage(ref, platform string) (string, error) {
|
||||||
return "", fmt.Errorf("cannot get index manifest: %w", err)
|
return "", fmt.Errorf("cannot get index manifest: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(idxMft.Manifests) > 1000 {
|
||||||
|
return "", fmt.Errorf("platform image has too many manifests")
|
||||||
|
}
|
||||||
|
|
||||||
for _, manifest := range idxMft.Manifests {
|
for _, manifest := range idxMft.Manifests {
|
||||||
if plat.OS == manifest.Platform.OS &&
|
if plat.OS == manifest.Platform.OS &&
|
||||||
plat.Architecture == manifest.Platform.Architecture {
|
plat.Architecture == manifest.Platform.Architecture {
|
||||||
|
|
Loading…
Reference in New Issue