release

package
Version: v4.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 1, 2019 License: Apache-2.0 Imports: 61 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComponentReferencesForImageStream

func ComponentReferencesForImageStream(is *imageapi.ImageStream) (func(string) imagereference.DockerImageReference, error)

func NewCmd

func NewCmd(f kcmdutil.Factory, parentName string, streams genericclioptions.IOStreams) *cobra.Command

func NewExtract

func NewExtract(f kcmdutil.Factory, parentName string, streams genericclioptions.IOStreams) *cobra.Command

func NewInfo

func NewInfo(f kcmdutil.Factory, parentName string, streams genericclioptions.IOStreams) *cobra.Command

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 NewRelease(f kcmdutil.Factory, parentName string, streams genericclioptions.IOStreams) *cobra.Command

func NopManifestMapper

func NopManifestMapper(data []byte) ([]byte, error)

func ReplacementsForImageStream

func ReplacementsForImageStream(is *imageapi.ImageStream, allowTags bool, fn func(component string) imagereference.DockerImageReference) (map[string]string, error)

Types

type BugInfo

type BugInfo struct {
	ID       int    `json:"id"`
	Status   string `json:"status"`
	Priority string `json:"priority"`
	Summary  string `json:"summary"`
}

type BugList

type BugList struct {
	Bugs []BugInfo `json:"bugs"`
}

type CincinnatiMetadata

type CincinnatiMetadata struct {
	Kind string `json:"kind"`

	Version  string   `json:"version"`
	Previous []string `json:"previous"`

	Metadata map[string]interface{} `json:"metadata,omitempty"`
}

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

type ComponentVersions map[string]string

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 *docker10.DockerImageConfig)
}

func NewExtractOptions

func NewExtractOptions(streams genericclioptions.IOStreams) *ExtractOptions

func (*ExtractOptions) Complete

func (o *ExtractOptions) Complete(f kcmdutil.Factory, cmd *cobra.Command, args []string) error

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        *docker10.DockerImageConfig         `json:"config"`

	Manifest distribution.Manifest `json:"-"`
}

type ImageChange

type ImageChange struct {
	Name     string
	From, To imagereference.DockerImageReference
}

type ImageReference

type ImageReference struct {
	SourceRepository string
	TargetPullSpec   string
}

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) Complete

func (o *InfoOptions) Complete(f kcmdutil.Factory, cmd *cobra.Command, args []string) error

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

type ManifestMapper func(data []byte) ([]byte, error)

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 Mapping

type Mapping struct {
	Source      string
	Destination string
}

type MergeCommit

type MergeCommit struct {
	CommitDate time.Time

	Commit        string
	ParentCommits []string

	PullRequest int
	Bug         int

	Subject string
}

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) Complete

func (o *MirrorOptions) Complete(cmd *cobra.Command, f kcmdutil.Factory, args []string) error

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) Complete

func (o *NewOptions) Complete(f kcmdutil.Factory, cmd *cobra.Command, args []string) error

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 NewPayload(path string) *Payload

func (*Payload) Path

func (p *Payload) Path() string

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 PayloadVerifier func(filename string, data []byte) error

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     *docker10.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

type ReleaseManifestDiff

type ReleaseManifestDiff struct {
	Filename string `json:"filename"`

	From []byte `json:"from"`
	To   []byte `json:"to"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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