Skip to content

Adds container image listing for channel releases #561

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

crdant
Copy link
Member

@crdant crdant commented Jul 22, 2025

TL;DR

Implements a new CLI command that lists all container images used in a
channel's release, making it easier to prepare air-gapped environments
or audit container dependencies.

Details

Air-gapped installations require knowing which container images are
needed for an application. Previously, there was no simple way to list
all images used by a specific channel or release, forcing users to
manually inspect manifests or guess which images were needed.

This change adds a new replicated channel image ls command that shows
all container images included in a channel's current release or a
specific version. The command handles both current releases and
historical versions via an optional --version flag, and works with
channels specified by name, slug, or ID.

The implementation cleans image names to remove common registry
prefixes, providing a more readable output that can be directly used for
mirroring or documentation purposes. Users can now quickly generate
lists of required images when preparing for air-gapped installations or
when auditing container dependencies.

Key features:

  • Lists all images in a channel's current release
  • Supports retrieving images from a specific version with --version flag
  • Presents image names in a clean, sorted format
  • Handles various registry prefixes and proxy patterns automatically
  • Includes comprehensive help text and examples for easy discovery

AI-gapped environments and container image management are critical for
enterprise customers, and this command makes preparation significantly
easier by providing clear visibility into image requirements.

TL;DR
-----

Implements a new CLI command that lists all container images used in a
channel's release, making it easier to prepare air-gapped environments
or audit container dependencies.

Details
--------

Air-gapped installations require knowing which container images are
needed for an application. Previously, there was no simple way to list
all images used by a specific channel or release, forcing users to
manually inspect manifests or guess which images were needed.

This change adds a new `replicated channel image ls` command that shows
all container images included in a channel's current release or a
specific version. The command handles both current releases and
historical versions via an optional `--version` flag, and works with
channels specified by name, slug, or ID.

The implementation cleans image names to remove common registry
prefixes, providing a more readable output that can be directly used for
mirroring or documentation purposes. Users can now quickly generate
lists of required images when preparing for air-gapped installations or
when auditing container dependencies.

Key features:
- Lists all images in a channel's current release
- Supports retrieving images from a specific version with `--version` flag
- Presents image names in a clean, sorted format
- Handles various registry prefixes and proxy patterns automatically
- Includes comprehensive help text and examples for easy discovery

AI-gapped environments and container image management are critical for
enterprise customers, and this command makes preparation significantly
easier by providing clear visibility into image requirements.
TL;DR
-----

Enhances the channel image listing command with a new `--keep-proxy`
flag that preserves proxy registry domains in image names instead of
automatically stripping them.

Details
--------

Users often need to see the exact image names including their proxy
registry domains. Previously, the CLI would automatically strip proxy
registry domains from image names, which made it difficult to debug
registry-related issues or verify the exact images being pulled.

This change introduces a more intelligent proxy domain detection and
handling system:

1. The CLI now attempts to determine the proxy domain from multiple
   sources:
   - The release's ProxyRegistryDomain field
   - The channel's custom hostname overrides

2. Users can now choose to preserve proxy domains with the new
   `--keep-proxy` flag

The image name cleaning logic was also improved to handle various
registry prefixes consistently, with comprehensive test coverage to
ensure correct behavior across different registry patterns.

This functionality is particularly valuable for customers managing
air-gapped installations where understanding the exact registry paths is
critical for proper configuration and troubleshooting.
@crdant crdant requested a review from pandemicsyn July 23, 2025 01:00
crdant and others added 3 commits July 25, 2025 10:18
…lution

- Add GetCustomHostnames method for focused hostname override access
- Add GetCurrentChannelRelease method that tries to avoid ListChannelReleases API call
- Optimize current release retrieval by using channel data when available
- Consolidate proxy domain resolution logic with proper fallback hierarchy
- Maintain backward compatibility for version-specific queries

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add TestKeepProxyFlagIntegration that actually tests flag logic
- Simulates the conditional logic from channelImageLS function
- Tests both true and false flag states with realistic scenarios
- Complements existing cleanImageName unit tests

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
The test was just duplicating the same conditional logic rather than
actually testing end-to-end flag behavior, making it a tautology that
provided no real value.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@crdant crdant requested a review from pandemicsyn July 25, 2025 14:44
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.

2 participants