MCPcopy
hub / github.com/helm/helm / initFakeRegistryTestServer

Function initFakeRegistryTestServer

pkg/registry/registry_test.go:215–380  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

213}
214
215func initFakeRegistryTestServer() string {
216 s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
217 switch r.URL.Path {
218 case "/v2/testrepo/image-index/manifests/0.1.0":
219 w.Header().Set("Content-Type", ocispec.MediaTypeImageIndex)
220 w.Write([]byte(`{
221 "schemaVersion": 2,
222 "mediaType": "application/vnd.oci.image.index.v1+json",
223 "manifests": [
224 {
225 "mediaType": "application/vnd.oci.image.manifest.v1+json",
226 "digest": "sha256:2771e37a12b7bcb2902456ecf3f29bf9ee11ec348e66e8eb322d9780ad7fc2df",
227 "size": 1035,
228 "platform": {
229 "architecture": "amd64",
230 "os": "linux"
231 },
232 "annotations": {
233 "com.docker.official-images.bashbrew.arch": "amd64",
234 "org.opencontainers.image.base.name": "scratch",
235 "org.opencontainers.image.created": "2025-08-13T22:16:57Z",
236 "org.opencontainers.image.revision": "6930d60e10e81283a57be3ee3a2b5ca328a40304",
237 "org.opencontainers.image.source": "https://github.com/docker-library/hello-world.git#6930d60e10e81283a57be3ee3a2b5ca328a40304:amd64/hello-world",
238 "org.opencontainers.image.url": "https://hub.docker.com/_/hello-world",
239 "org.opencontainers.image.version": "linux"
240 }
241 },
242 {
243 "mediaType": "application/vnd.oci.image.manifest.v1+json",
244 "digest": "sha256:6b75187531c5e9b6a85c8946d5d82e4ef3801e051fbff338f382f3edfa60e3d2",
245 "size": 566,
246 "platform": {
247 "architecture": "unknown",
248 "os": "unknown"
249 },
250 "annotations": {
251 "com.docker.official-images.bashbrew.arch": "amd64",
252 "vnd.docker.reference.digest": "sha256:2771e37a12b7bcb2902456ecf3f29bf9ee11ec348e66e8eb322d9780ad7fc2df",
253 "vnd.docker.reference.type": "attestation-manifest"
254 }
255 },
256 {
257 "mediaType": "application/vnd.oci.image.manifest.v1+json",
258 "digest": "sha256:7fbdc47de56b45d092f8f419e8b6183adf0159d00e05574c01787231b54fe28f",
259 "size": 815
260 }
261 ]
262}`))
263
264 case "/v2/testrepo/image-index/manifests/sha256:2771e37a12b7bcb2902456ecf3f29bf9ee11ec348e66e8eb322d9780ad7fc2df":
265 w.Header().Set("Content-Type", ocispec.MediaTypeImageManifest)
266 w.Write([]byte(`{
267 "schemaVersion": 2,
268 "mediaType": "application/vnd.oci.image.manifest.v1+json",
269 "config": {
270 "mediaType": "application/vnd.oci.image.config.v1+json",
271 "digest": "sha256:1b44b5a3e06a9aae883e7bf25e45c100be0bb81a0e01b32de604f3ac44711634",
272 "size": 547

Callers 1

setupFunction · 0.85

Calls 3

SetMethod · 0.45
WriteMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…