Skip to content

fix: swapping from quay to in memory test registry - #2228

Open
tommyd450 wants to merge 10 commits into
mainfrom
tdalton/InMemoryTestImage
Open

fix: swapping from quay to in memory test registry#2228
tommyd450 wants to merge 10 commits into
mainfrom
tdalton/InMemoryTestImage

Conversation

@tommyd450

Copy link
Copy Markdown
Contributor

No description provided.

@codecov-commenter

codecov-commenter commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.78%. Comparing base (af84492) to head (dcd238e).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2228      +/-   ##
==========================================
+ Coverage   59.56%   59.78%   +0.22%     
==========================================
  Files         291      292       +1     
  Lines       16384    16447      +63     
==========================================
+ Hits         9759     9833      +74     
+ Misses       5638     5619      -19     
- Partials      987      995       +8     
Flag Coverage Δ
e2e 73.68% <ø> (-0.32%) ⬇️
unit 37.73% <ø> (+0.13%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread test/e2e/support/registry.go Outdated
)

const (
registryImage = "docker.io/library/registry:2"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have we got configured mirror for not pulling directly from docker.io? If not than our job will be unstable due rate limiting from docker registry.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are using mirror.gcr.io in other automations

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, will look into it, was hoping to move this along on friday to remove secret config for running e2e tests on cluster.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can cahnge it to mirror.gcr.io/library/registry:2

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

tommyd450 and others added 9 commits August 19, 2026 09:10
The in-memory test registry serves plain HTTP (no TLS). The
--allow-insecure-registry flag only skips TLS certificate verification
but still uses HTTPS, causing "http: server gave HTTP response to HTTPS
client" errors when cosign runs inside the cluster. Adding
--allow-http-registry tells cosign to use plain HTTP connections.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace in-cluster Kubernetes registry deployment with pure in-memory
implementation using go-containerregistry's built-in registry handler.
Eliminates Deployment/Service/port-forwarding overhead, enabling faster
test startup while maintaining full OCI compatibility.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Instead of running an in-memory registry on the test host, deploy the registry
as a pod within the Kubernetes cluster. This approach:

- Works consistently across all Kubernetes environments (Kind, OpenShift, etc)
- Uses standard Kubernetes Service DNS for pod-to-pod communication
- No need for host.docker.internal or environment-specific configuration
- Uses official 'registry:2.8' container image for production-like behavior

The registry is deployed in the test namespace with:
- A Deployment running the registry container
- A Service exposing the registry on port 5000
- ClusterIP service DNS: test-registry.<namespace>.svc:5000

Images are pushed locally via port-forwarding during test setup, then cosign
and other pods access the registry via the service DNS name from within the cluster.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
The test registry now runs as a pod in the cluster, but tests still need
to push images from the host machine. Add port-forwarding coordination
to make this work smoothly.

This maintains support for both:
- Pushing images from the test host (via localhost:5000)
- Accessing the registry from cluster pods (via service DNS)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Implements automatic detection and optimal strategy selection:

**Outside Cluster (GitHub Actions + Kind):**
- Runs in-memory registry on the host (localhost:5000)
- Discovers Docker gateway IP for pod access (172.17.0.1, host.docker.internal, etc)
- Tests push images locally, pods access via gateway IP
- No port-forwarding or extra setup needed

**Inside Cluster (OpenShift/Kubernetes):**
- Detects presence via KUBERNETES_SERVICE_HOST env var
- Deploys registry as a Kubernetes pod with Service
- Pods access via service DNS (test-registry.namespace.svc:5000)
- Works across all Kubernetes environments

The registry automatically chooses the best approach for each environment,
with zero configuration needed. Handles both GitHub Actions (Kind) and
production Kubernetes/OpenShift scenarios seamlessly.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
When running in OpenShift/Kubernetes (inside a pod), tests get a controller-runtime
client.Client, not a kubernetes.Interface. Support both client types so registry
deployment works in both GitHub Actions (Kind) and OpenShift pipelines scenarios.

This ensures the in-cluster registry deployment actually creates resources when
running in the pipelines repo's OpenShift environment.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@osmman osmman added this to the 1.6.0 milestone Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants