Documentation ¶
Index ¶
- func ComponentReferencesForImageStream(is *imageapi.ImageStream) (func(string) imagereference.DockerImageReference, error)
- func NewCmd(f kcmdutil.Factory, parentName string, streams genericclioptions.IOStreams) *cobra.Command
- func NewExtract(f kcmdutil.Factory, parentName string, streams genericclioptions.IOStreams) *cobra.Command
- func NewInfo(f kcmdutil.Factory, parentName string, streams genericclioptions.IOStreams) *cobra.Command
- func NewMirror(f kcmdutil.Factory, parentName string, streams genericclioptions.IOStreams) *cobra.Command
- func NewRelease(f kcmdutil.Factory, parentName string, streams genericclioptions.IOStreams) *cobra.Command
- func NopManifestMapper(data []byte) ([]byte, error)
- func ReplacementsForImageStream(is *imageapi.ImageStream, allowTags bool, ...) (map[string]string, error)
- type BugInfo
- type BugList
- type CincinnatiMetadata
- type CodeChange
- type ComponentVersions
- type ExtractOptions
- type Image
- type ImageChange
- type ImageReference
- type ImageReferenceDiff
- type InfoOptions
- type ManifestMapper
- func NewComponentVersionsMapper(releaseName string, versions map[string]string, tagsByName map[string][]string) ManifestMapper
- func NewExactMapper(mappings map[string]string) (ManifestMapper, error)
- func NewImageMapper(images map[string]ImageReference) (ManifestMapper, error)
- func NewTransformFromImageStreamFile(path string, input *imageapi.ImageStream, allowMissingImages bool) (ManifestMapper, error)
- type Mapping
- type MergeCommit
- type MirrorOptions
- type NewOptions
- type Payload
- type PayloadVerifier
- type ReleaseDiff
- type ReleaseInfo
- type ReleaseManifestDiff
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComponentReferencesForImageStream ¶
func ComponentReferencesForImageStream(is *imageapi.ImageStream) (func(string) imagereference.DockerImageReference, error)
func NewExtract ¶
func NewMirror ¶
func NewMirror(f kcmdutil.Factory, parentName string, streams genericclioptions.IOStreams) *cobra.Command
NewMirror creates a command to mirror an existing release.
Example command to mirror a release to a local repository to work offline ¶
$ oc adm release mirror \ --from=registry.svc.ci.openshift.org/openshift/v4.0 \ --to=mycompany.com/myrepository/repo
func NewRelease ¶
func NopManifestMapper ¶
func ReplacementsForImageStream ¶
func ReplacementsForImageStream(is *imageapi.ImageStream, allowTags bool, fn func(component string) imagereference.DockerImageReference) (map[string]string, error)
Types ¶
type CincinnatiMetadata ¶
type CodeChange ¶
type CodeChange struct { Repo string From, To string AlternateRepos []string ImagesAffected []string }
func (CodeChange) FromShort ¶
func (c CodeChange) FromShort() string
func (CodeChange) ToShort ¶
func (c CodeChange) ToShort() string
type ComponentVersions ¶
ComponentVersions is a map of component names to semantic versions. Names are lowercase alphanumeric and dashes. Semantic versions will have all build labels removed, but prerelease segments are preserved.
func (ComponentVersions) String ¶
func (v ComponentVersions) String() string
type ExtractOptions ¶
type ExtractOptions struct { genericclioptions.IOStreams SecurityOptions imagemanifest.SecurityOptions ParallelOptions imagemanifest.ParallelOptions From string Tools bool Command string CommandOperatingSystem string SigningKey string // GitExtractDir is the path of a root directory to extract the source of a release to. GitExtractDir string Directory string File string ImageMetadataCallback func(m *extract.Mapping, dgst, contentDigest digest.Digest, config *dockerv1client.DockerImageConfig) }
func NewExtractOptions ¶
func NewExtractOptions(streams genericclioptions.IOStreams) *ExtractOptions
func (*ExtractOptions) Run ¶
func (o *ExtractOptions) Run() error
type Image ¶
type Image struct { Name string `json:"name"` Ref imagereference.DockerImageReference `json:"-"` Digest digest.Digest `json:"digest"` ContentDigest digest.Digest `json:"contentDigest"` ListDigest digest.Digest `json:"listDigest"` MediaType string `json:"mediaType"` Layers []distribution.Descriptor `json:"layers"` Config *dockerv1client.DockerImageConfig `json:"config"` Manifest distribution.Manifest `json:"-"` }
type ImageChange ¶
type ImageChange struct { Name string From, To imagereference.DockerImageReference }
type ImageReference ¶
type ImageReferenceDiff ¶
type ImageReferenceDiff struct { Name string `json:"name"` From *imageapi.TagReference `json:"from"` To *imageapi.TagReference `json:"to"` }
type InfoOptions ¶
type InfoOptions struct { genericclioptions.IOStreams Images []string From string Output string ImageFor string IncludeImages bool ShowContents bool ShowCommit bool ShowPullSpec bool ShowSize bool Verify bool ChangelogDir string BugsDir string ParallelOptions imagemanifest.ParallelOptions SecurityOptions imagemanifest.SecurityOptions }
func NewInfoOptions ¶
func NewInfoOptions(streams genericclioptions.IOStreams) *InfoOptions
func (*InfoOptions) LoadReleaseInfo ¶
func (o *InfoOptions) LoadReleaseInfo(image string, retrieveImages bool) (*ReleaseInfo, error)
func (*InfoOptions) Run ¶
func (o *InfoOptions) Run() error
func (*InfoOptions) Validate ¶
func (o *InfoOptions) Validate() error
type ManifestMapper ¶
func NewComponentVersionsMapper ¶
func NewComponentVersionsMapper(releaseName string, versions map[string]string, tagsByName map[string][]string) ManifestMapper
NewComponentVersionsMapper substitutes strings of the form 0.0.1-snapshot with releaseName and strings of the form 0.0.1-snapshot-[component] with the version value located in versions, or returns an error. tagsByName allows the caller to return an error if references are ambiguous (two tags declare different version values) - if that replacement is detected and tagsByName[component] has more than one entry, then an error is returned by the ManifestMapper. If the input release name is not a semver, a request for `0.0.1-snapshot` will be left unmodified.
func NewExactMapper ¶
func NewExactMapper(mappings map[string]string) (ManifestMapper, error)
func NewImageMapper ¶
func NewImageMapper(images map[string]ImageReference) (ManifestMapper, error)
func NewTransformFromImageStreamFile ¶
func NewTransformFromImageStreamFile(path string, input *imageapi.ImageStream, allowMissingImages bool) (ManifestMapper, error)
type MergeCommit ¶
type MirrorOptions ¶
type MirrorOptions struct { genericclioptions.IOStreams SecurityOptions imagemanifest.SecurityOptions ParallelOptions imagemanifest.ParallelOptions From string To string ToImageStream string ToRelease string SkipRelease bool DryRun bool ClientFn func() (imageclient.Interface, string, error) ImageStream *imagev1.ImageStream TargetFn func(component string) imagereference.DockerImageReference }
func NewMirrorOptions ¶
func NewMirrorOptions(streams genericclioptions.IOStreams) *MirrorOptions
NewMirrorOptions creates the options for mirroring a release.
func (*MirrorOptions) Run ¶
func (o *MirrorOptions) Run() error
type NewOptions ¶
type NewOptions struct { genericclioptions.IOStreams SecurityOptions imagemanifest.SecurityOptions ParallelOptions imagemanifest.ParallelOptions FromDirectory string Directory string MappingFilenames []string Output string Name string FromReleaseImage string FromImageStream string FromImageStreamFile string Namespace string ReferenceMode string ExtraComponentVersions string AllowedComponents []string Exclude []string AlwaysInclude []string ForceManifest bool ReleaseMetadata string PreviousVersions []string DryRun bool ToFile string ToDir string ToImage string ToImageBase string ToImageBaseTag string ToSignature string Mirror string AllowMissingImages bool SkipManifestCheck bool Mappings []Mapping ImageClient imageclient.Interface VerifyOutputFn func(dgst digest.Digest) error // contains filtered or unexported fields }
func NewNewOptions ¶
func NewNewOptions(streams genericclioptions.IOStreams) *NewOptions
func (*NewOptions) Run ¶
func (o *NewOptions) Run() error
func (*NewOptions) Validate ¶
func (o *NewOptions) Validate() error
type Payload ¶
type Payload struct {
// contains filtered or unexported fields
}
func NewPayload ¶
func (*Payload) References ¶
func (p *Payload) References() (*imageapi.ImageStream, error)
func (*Payload) Rewrite ¶
func (p *Payload) Rewrite(allowTags bool, fn func(component string) imagereference.DockerImageReference) error
Rewrite updates the image stream to point to the locations described by the provided function. If a new ID appears in the returned reference, it will be used instead of the existing digest. All references in manifest files will be updated and then the image stream will be written to the correct location with any updated metadata.
type PayloadVerifier ¶
type ReleaseDiff ¶
type ReleaseDiff struct { From *ReleaseInfo `json:"from"` To *ReleaseInfo `json:"to"` ChangedImages map[string]*ImageReferenceDiff `json:"changedImages"` ChangedManifests map[string]*ReleaseManifestDiff `json:"changedManifests"` }
type ReleaseInfo ¶
type ReleaseInfo struct { Image string `json:"image"` ImageRef imagereference.DockerImageReference `json:"-"` Digest digest.Digest `json:"digest"` ContentDigest digest.Digest `json:"contentDigest"` // TODO: return the list digest in the future // ListDigest digest.Digest `json:"listDigest"` Config *dockerv1client.DockerImageConfig `json:"config"` Metadata *CincinnatiMetadata `json:"metadata"` References *imageapi.ImageStream `json:"references"` ComponentVersions map[string]string `json:"versions"` Images map[string]*Image `json:"images"` RawMetadata map[string][]byte `json:"-"` ManifestFiles map[string][]byte `json:"-"` UnknownFiles []string `json:"-"` Warnings []string `json:"warnings"` }
func (*ReleaseInfo) Platform ¶
func (i *ReleaseInfo) Platform() string
func (*ReleaseInfo) PreferredName ¶
func (i *ReleaseInfo) PreferredName() string