tektoncd/pipeline

Make container registry configurable for examples and e2e tests

开放

#9,191 创建于 2025年12月1日

 (2 条评论) (0 个反应) (1 位负责人)Go (1,943 个派生)auto 404
area/testinghelp wantedkind/documentationkind/feature

仓库指标

星标
 (9,013 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

Problem

Examples and e2e tests currently use hardcoded container registries (like gcr.io/christiewilson-catfactory), which causes:

  1. Registry rate limiting when running tests repeatedly - especially with Docker Hub (docker.io) which limits anonymous users to 100 pulls per 6 hours and authenticated users to 200 pulls per 6 hours
  2. Slow test execution due to remote registry pulls
  3. Friction for local development - developers can't easily use local registries

While the test framework has a substituteEnv function that replaces registries with KO_DOCKER_REPO during test execution, this only works for automated tests, not for manually running examples.

Proposed Solution

Make it easy to configure which registry to use for examples and tests. This would allow developers to:

  • Use local registries (like kind.local, registry.local:5000) to avoid rate limits
  • Speed up test/example execution by using cached local images
  • Test in air-gapped or restricted environments

Possible approaches:

  1. Helper script - Create ./hack/run-example.sh that applies registry substitution before running examples
  2. Documentation - Add clear instructions to examples/README.md for using sed or similar tools
  3. Extract utility - Make the existing substituteEnv function available as a standalone tool

Current Workaround

The test/examples_test.go file has a substituteEnv function (lines 79-96) that replaces gcr.io/christiewilson-catfactory with KO_DOCKER_REPO, but it's only accessible during test execution. Users must manually edit YAML files to change registries.

Benefits

  • Avoid registry rate limiting during development/testing
  • Faster test execution with local registries
  • Better developer experience for running examples locally
  • Support for air-gapped/restricted environments

贡献者指南