Skip to content

Registry deduplication: duplicate Docker Hub entries in image destination picker #93

@mmurrs

Description

@mmurrs

Description

When running ecloud compute app deploy and selecting an image destination, Docker Hub registries appear multiple times if ~/.docker/config.json contains multiple URL variants for the same registry (e.g., docker.io, index.docker.io, https://index.docker.io/v1/).

Example output:

Detected authenticated registries:
  dockerhub: mattmurrs/dev-test:latest
  dockerhub: mattmurrs/dev-test:latest
  dockerhub: mattmurrs/dev-test:latest

? Select image destination:
❯ mattmurrs/dev-test:latest
  mattmurrs/dev-test:latest
  mattmurrs/dev-test:latest
  Enter custom image reference

Root Cause

In packages/cli/src/utils/prompts.ts, getAvailableRegistries() deduplicates GCR entries using a Map (keyed by username), but Docker Hub and GHCR entries are pushed directly to the array without deduplication. Each auths entry in the Docker config that resolves to Docker Hub produces a separate registry entry.

Expected Behavior

Only one entry per unique registry type + username combination should appear in the picker.

Suggested Fix

Apply the same Map-based deduplication used for GCR to Docker Hub and GHCR entries (e.g., key by registryType:username).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions