(t *testing.T)
| 374 | } |
| 375 | |
| 376 | func TestIsManifestUnknownError(t *testing.T) { |
| 377 | // Mostly a smoke test; we can add more registries here if they need special handling. |
| 378 | |
| 379 | for _, c := range []struct{ name, response string }{ |
| 380 | { |
| 381 | name: "docker.io when a tag in an _existing repo_ is not found", |
| 382 | response: "HTTP/1.1 404 Not Found\r\n" + |
| 383 | "Connection: close\r\n" + |
| 384 | "Content-Length: 109\r\n" + |
| 385 | "Content-Type: application/json\r\n" + |
| 386 | "Date: Thu, 12 Aug 2021 20:51:32 GMT\r\n" + |
| 387 | "Docker-Distribution-Api-Version: registry/2.0\r\n" + |
| 388 | "Ratelimit-Limit: 100;w=21600\r\n" + |
| 389 | "Ratelimit-Remaining: 100;w=21600\r\n" + |
| 390 | "Strict-Transport-Security: max-age=31536000\r\n" + |
| 391 | "\r\n" + |
| 392 | "{\"errors\":[{\"code\":\"MANIFEST_UNKNOWN\",\"message\":\"manifest unknown\",\"detail\":{\"Tag\":\"this-does-not-exist\"}}]}\n", |
| 393 | }, |
| 394 | { |
| 395 | name: "registry.redhat.io/v2/this-does-not-exist/manifests/latest", |
| 396 | response: "HTTP/1.1 404 Not Found\r\n" + |
| 397 | "Connection: close\r\n" + |
| 398 | "Content-Length: 53\r\n" + |
| 399 | "Cache-Control: max-age=0, no-cache, no-store\r\n" + |
| 400 | "Content-Type: application/json\r\n" + |
| 401 | "Date: Thu, 13 Oct 2022 18:15:15 GMT\r\n" + |
| 402 | "Expires: Thu, 13 Oct 2022 18:15:15 GMT\r\n" + |
| 403 | "Pragma: no-cache\r\n" + |
| 404 | "Server: Apache\r\n" + |
| 405 | "Strict-Transport-Security: max-age=63072000; includeSubdomains; preload\r\n" + |
| 406 | "X-Hostname: crane-tbr06.cran-001.prod.iad2.dc.redhat.com\r\n" + |
| 407 | "\r\n" + |
| 408 | "{\"errors\": [{\"code\": \"404\", \"message\": \"Not Found\"}]}\r\n", |
| 409 | }, |
| 410 | { |
| 411 | name: "registry.redhat.io/v2/rhosp15-rhel8/openstack-cron/manifests/sha256-8df5e60c42668706ac108b59c559b9187fa2de7e4e262e2967e3e9da35d5a8d7.sig", |
| 412 | response: "HTTP/1.1 404 Not Found\r\n" + |
| 413 | "Connection: close\r\n" + |
| 414 | "Content-Length: 10\r\n" + |
| 415 | "Accept-Ranges: bytes\r\n" + |
| 416 | "Date: Thu, 13 Oct 2022 18:13:53 GMT\r\n" + |
| 417 | "Server: AkamaiNetStorage\r\n" + |
| 418 | "X-Docker-Size: -1\r\n" + |
| 419 | "\r\n" + |
| 420 | "Not found\r\n", |
| 421 | }, |
| 422 | { |
| 423 | name: "Harbor v2.10.2", |
| 424 | response: "HTTP/1.1 404 Not Found\r\n" + |
| 425 | "Content-Length: 153\r\n" + |
| 426 | "Connection: keep-alive\r\n" + |
| 427 | "Content-Type: application/json; charset=utf-8\r\n" + |
| 428 | "Date: Wed, 08 May 2024 08:14:59 GMT\r\n" + |
| 429 | "Server: nginx\r\n" + |
| 430 | "Set-Cookie: sid=f617c257877837614ada2561513d6827; Path=/; HttpOnly\r\n" + |
| 431 | "X-Request-Id: 1b151fb1-c943-4190-a9ce-5156ed5e3200\r\n" + |
| 432 | "\r\n" + |
| 433 | "{\"errors\":[{\"code\":\"NOT_FOUND\",\"message\":\"artifact test/alpine:sha256-443205b0cfcc78444321d56a2fe273f06e27b2c72b5058f8d7e975997d45b015.sig not found\"}]}\n", |
nothing calls this directly
no test coverage detected
searching dependent graphs…