-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Labels
area/testingIssues or PRs related to testingIssues or PRs related to testinghelp wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/documentationCategorizes issue or PR as related to documentation.Categorizes issue or PR as related to documentation.kind/featureCategorizes issue or PR as related to a new feature.Categorizes issue or PR as related to a new feature.
Description
Problem
Examples and e2e tests currently use hardcoded container registries (like gcr.io/christiewilson-catfactory), which causes:
- 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
- Slow test execution due to remote registry pulls
- 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:
- Helper script - Create
./hack/run-example.shthat applies registry substitution before running examples - Documentation - Add clear instructions to
examples/README.mdfor usingsedor similar tools - Extract utility - Make the existing
substituteEnvfunction 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
Metadata
Metadata
Assignees
Labels
area/testingIssues or PRs related to testingIssues or PRs related to testinghelp wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/documentationCategorizes issue or PR as related to documentation.Categorizes issue or PR as related to documentation.kind/featureCategorizes issue or PR as related to a new feature.Categorizes issue or PR as related to a new feature.
Type
Projects
Status
Todo