MCPcopy Create free account
hub / github.com/conforma/cli / setupRegistry

Function setupRegistry

acceptance/cli/cli.go:326–348  ·  view source on GitHub ↗
(ctx context.Context, vars map[string]string, environment []string)

Source from the content-addressed store, hash-verified

324}
325
326func setupRegistry(ctx context.Context, vars map[string]string, environment []string) ([]string, map[string]string, error) {
327 if !registry.IsRunning(ctx) {
328 return environment, vars, nil
329 }
330
331 registryURL, err := registry.StubRegistry(ctx)
332 if err != nil {
333 return environment, vars, err
334 }
335
336 vars["REGISTRY"] = registryURL
337
338 digests, err := registry.AllDigests(ctx)
339 if err != nil {
340 return environment, vars, err
341 }
342
343 for repositoryAndTag, digest := range digests {
344 vars[fmt.Sprintf("REGISTRY_%s_DIGEST", repositoryAndTag)] = digest
345 }
346
347 return environment, vars, nil
348}
349
350func setupKubernetes(ctx context.Context, vars map[string]string, environment []string) ([]string, map[string]string, error) {
351 if !testenv.HasState[kubernetes.ClusterState](ctx) {

Callers 1

variablesFunction · 0.85

Calls 3

IsRunningFunction · 0.92
StubRegistryFunction · 0.92
AllDigestsFunction · 0.92

Tested by

no test coverage detected