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

貢獻者指南