oc-mirror

module
v0.1.1-alpha.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2021 License: Apache-2.0

README

oc-mirror

This repo is under active development. CLI and APIs are unstable

oc-mirror is an OpenShift Client (oc) plugin that manages OpenShift release, operator catalog, helm charts, and associated container images.

Usage

asciicast

The mirror registry reg.mirror.com is used in this example. Replace this value with a real registry host, or create a docker.io/library/registry:2 container locally.

Environment Prep
  1. Download pull secret and place at ~/.docker/config.json1.
    • Your mirror registry secret must have both push and pull scopes.
  2. Build:
    make build
    
Content Discovery
Updates
  • List updates since the last oc-mirror run
    ./bin/oc-mirror list updates --config imageset-config.yaml --dir test-create
    
Releases
  1. List all available release payloads for a version of OpenShift (defaults to stable)
    ./bin/oc-mirror list releases --version=4.9
    
  2. List all available channels to query for a version of OpenShift
    ./bin/oc-mirror list releases --channels --version=4.8
    
  3. List all available release payloads for a version of OpenShift in a specified channel
    ./bin/oc-mirror list releases --channel=fast-4.9
    
Operators
  1. List all available catalogs for a version of OpenShift
    ./bin/oc-mirror list operators --catalogs --version=4.9
    
  2. List all available packages in a catalog
    ./bin/oc-mirror list operators --catalog=catalog-name
    
  3. List all available channels in a package
    ./bin/oc-mirror list operators --catalog=catalog-name --package=package-name
    
  4. List all available versions in a channel
    ./bin/oc-mirror list operators --catalog=catalog-name --package=package-name --channel=channel-name
    
Mirroring
Fully Disconnected
  • Create then publish to your mirror registry:
    ./bin/oc-mirror --config imageset-config.yaml --dir test-create file://archives
    ./bin/oc-mirror --from /path/to/archives --dir test-publish docker://reg.mirror.com
    
Partially Disconnected
  • Publish mirror to mirror
    ./bin/oc-mirror --config imageset-config.yaml --dir test docker://localhost:5000
    

Additional Features

  • Get information on your imageset using describe
    ./bin/oc-mirror describe /path/to/archives
    
  • List updates since last run for releases and operators
    ./bin/oc-mirror list updates --config imageset-config.yaml --dir test-create
    

For configuration and options, see the expanded overview and usage docs.

1 For this example, the create and publish steps are run on the same machine. Therefore your ~/.docker/config.json should contain auth config for both release/catalog source images and your mirror registry.

oc-mirror Spec

See the config spec for an in-depth description of fields.

Note: The imageset-config.yaml is only used during bundle creation.

Development

Requirements
  • All top-level requirements
  • go version 1.16+
Build
make
./bin/oc-mirror -h
Test

Unit:

make test-unit

E2E:

make test-e2e

Directories

Path Synopsis
cmd
pkg
archive
Package archive contains tools are archiving and extracting imagesets.\.
Package archive contains tools are archiving and extracting imagesets.\.
bundle
Package bundle contains tools for preparing imagesets for archiving.
Package bundle contains tools for preparing imagesets for archiving.
cli
cli/mirror
Package mirror contains tools for managing container images for internet-disconnected systems.\.
Package mirror contains tools for managing container images for internet-disconnected systems.\.
config/v1alpha1
Package v1alpha1 provides the ImageSetConfiguration and Metadata used for configuring oc imageset.
Package v1alpha1 provides the ImageSetConfiguration and Metadata used for configuring oc imageset.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL