Documentation ¶
Index ¶
- Constants
- Variables
- type Association
- type Chart
- type Helm
- type Image
- type ImageSetConfiguration
- type ImageSetConfigurationSpec
- type ImageType
- type IncludeBundle
- type IncludeChannel
- type IncludeConfig
- type IncludePackage
- type InlinedIndex
- type LocalConfig
- type Metadata
- type MetadataSpec
- type Mirror
- type Operator
- type OperatorMetadata
- type PastMirror
- type Platform
- type PlatformMetadata
- type PlatformType
- type RegistryConfig
- type ReleaseChannel
- type Repository
- type SampleImages
- type StorageConfig
Constants ¶
const DefaultPlatformArchitecture = "amd64"
DefaultPlatformArchitecture defines the default architecture used by mirroring platform release payloads.
const ImageSetConfigurationKind = "ImageSetConfiguration"
ImageSetConfiguration object kind.
const MetadataKind = "Metadata"
MetadataKind object kind.
Variables ¶
var (
GroupVersion = schema.GroupVersion{Group: group, Version: version}
)
Functions ¶
This section is empty.
Types ¶
type Association ¶
type Association struct { // Name of the image. Name string `json:"name"` // Path to image in new location (archive or registry) Path string `json:"path"` // ID of the image. Joining this value with "manifests" and Path // will produce a path to the image's manifest. ID string `json:"id"` // TagSymlink of the blob specified by ID. // This value must be a filename on disk in the "blobs" dir TagSymlink string `json:"tagSymlink"` // Type of the image in the context of this tool. // See the ImageType enum for options. Type ImageType `json:"type"` // ManifestDigests of images if the image is a docker manifest list or OCI index. // These manifests refer to image manifests by content SHA256 digest. // LayerDigests and Manifests are mutually exclusive. ManifestDigests []string `json:"manifestDigests,omitempty"` // LayerDigests of a single manifest if the image is not a docker manifest list // or OCI index. These digests refer to image layer blobs by content SHA256 digest. // LayerDigests and Manifests are mutually exclusive. LayerDigests []string `json:"layerDigests,omitempty"` }
Association between an image and its children, either image layers or child manifests.
func (Association) Validate ¶
func (a Association) Validate() error
Validate checks that the Association fields are set as expected
type Chart ¶
type Chart struct { // Chart is the chart name as define // in the Chart.yaml or in the Helm repo. Name string `json:"name"` // Version is the chart version as define in the // Chart.yaml or in the Helm repo. Version string `json:"version,omitempty"` // Path defines the path on disk where the // chart is stored. // This is applicable for a local chart. Path string `json:"path,omitempty"` // ImagePaths are custom JSON paths for images location // in the helm manifest or templates ImagePaths []string `json:"imagePaths,omitempty"` }
Chart is the information an individual Helm chart
type Helm ¶
type Helm struct { // Repositories are the Helm repositories containing the charts Repositories []Repository `json:"repositories,omitempty"` // Local is the configuration for locally stored helm charts Local []Chart `json:"local,omitempty"` }
Helm defines the configuration for Helm chart download and image mirroring
type Image ¶
type Image struct { // Name of the image. This should be an exact image pin (registry/namespace/name@sha256:<hash>) // but is not required to be. Name string `json:"name"` }
Image contains image pull information.
type ImageSetConfiguration ¶
type ImageSetConfiguration struct { metav1.TypeMeta `json:",inline"` // ImageSetConfigurationSpec defines the global configuration for an imageset. ImageSetConfigurationSpec `json:",inline"` }
ImageSetConfiguration configures image set creation.
type ImageSetConfigurationSpec ¶
type ImageSetConfigurationSpec struct { // Mirror defines the configuration for content types within the imageset. Mirror Mirror `json:"mirror"` // ArchiveSize is the size of the segmented archive in GB ArchiveSize int64 `json:"archiveSize,omitempty"` // StorageConfig for reading/writing metadata and files. StorageConfig StorageConfig `json:"storageConfig"` }
ImageSetConfigurationSpec defines the global configuration for an imageset.
type ImageType ¶
type ImageType int
ImageType defines the content type for mirrored images
func (ImageType) MarshalJSON ¶
MarshalJSON marshals the ImageType as a quoted json string
func (*ImageType) UnmarshalJSON ¶
UnmarshalJSON unmarshals a quoted json string to the ImageType
type IncludeBundle ¶
type IncludeBundle struct { // MinVersion to include, plus all versions in the upgrade graph to the MaxVersion. MinVersion string `json:"minVersion,omitempty" yaml:"minVersion,omitempty"` // MaxVersion to include as the channel head version. MaxVersion string `json:"maxVersion,omitempty" yaml:"maxVersion,omitempty"` // MinBundle to include, plus all bundles in the upgrade graph to the channel head. // Set this field only if the named bundle has no semantic version metadata. MinBundle string `json:"minBundle,omitempty" yaml:"minBundle,omitempty"` }
IncludeBundle contains a name (required) and versions (optional) to include in the diff. The full package or channel is only included if no versions are specified.
type IncludeChannel ¶
type IncludeChannel struct { // Name of channel. Name string `json:"name" yaml:"name"` IncludeBundle `json:",inline"` }
IncludeChannel contains a name (required) and versions (optional) to include in the diff. The full channel is only included if no versions are specified.
type IncludeConfig ¶
type IncludeConfig struct { // Packages to include. Packages []IncludePackage `json:"packages" yaml:"packages"` }
IncludeConfig defines a list of packages for operator version selection.
type IncludePackage ¶
type IncludePackage struct { // Name of package. Name string `json:"name" yaml:"name"` // Channels to include. Channels []IncludeChannel `json:"channels,omitempty" yaml:"channels,omitempty"` // All channels containing these bundles are parsed for an upgrade graph. IncludeBundle `json:",inline"` }
IncludePackage contains a name (required) and channels and/or versions (optional) to include in the diff. The full package is only included if no channels or versions are specified.
type InlinedIndex ¶
type InlinedIndex json.RawMessage
func (InlinedIndex) MarshalJSON ¶
func (index InlinedIndex) MarshalJSON() ([]byte, error)
type LocalConfig ¶
type LocalConfig struct {
Path string `json:"path"`
}
LocalConfig configure a local directory storage
type Metadata ¶
type Metadata struct { metav1.TypeMeta `json:",inline"` // MetadataSpec defines the global specified for Metadata types. MetadataSpec `json:",inline"` }
Metadata configures image set creation.
func NewMetadata ¶
func NewMetadata() Metadata
NewMetadata returns an empty instance of Metadata with the type metadata defined.
func (*Metadata) MarshalJSON ¶
type MetadataSpec ¶
type MetadataSpec struct { // Uid uniquely identifies this metadata object. Uid uuid.UUID `json:"uid"` // SingleUse will ignore the past runs if set to true SingleUse bool `json:"singleUse"` // PastMirror contains the previous mirrored content PastMirror PastMirror `json:"pastMirror"` // PastAssociations define the history about the set of mirrored images including // child manifest and layer digest information PastAssociations []Association `json:"pastAssociations,omitempty"` }
MetadataSpec defines the global configuration specified for Metadata types.
type Mirror ¶
type Mirror struct { // Platform defines the configuration for OpenShift and OKD platform types. Platform Platform `json:"platform,omitempty"` // Operators defines the configuration for Operator content types. Operators []Operator `json:"operators,omitempty"` // AdditionalImages defines the configuration for a list // of individual image content types. AdditionalImages []Image `json:"additionalImages,omitempty"` // Helm define the configuration for Helm content types. Helm Helm `json:"helm,omitempty"` // BlockedImages define a list of images that will be blocked // from the mirroring process if they exist in other content // types in the configuration. BlockedImages []Image `json:"blockedImages,omitempty"` // Samples defines the configuration for Sample content types. // This is currently not implemented. Samples []SampleImages `json:"samples,omitempty"` }
Mirror defines the configuration for content types within the imageset.
type Operator ¶
type Operator struct { // Mirror specific operator packages, channels, and versions, and their dependencies. // If HeadsOnly is true, these objects are mirrored on top of heads of all channels. // Otherwise, only these specific objects are mirrored. IncludeConfig `json:",inline"` // Catalog image to mirror. This image must be pullable and available for subsequent // pulls on later mirrors. // This image should be an exact image pin (registry/namespace/name@sha256:<hash>) // but is not required to be. Catalog string `json:"catalog"` // TargetName is the target image name the catalog will be built with. If unset, // the catalog will be published with the provided name in the Catalog // field. TargetName string `json:"targetName,omitempty"` // TargetTag is the tag the catalog image will be built with. If unset, // the catalog will be publish with the provided tag in the Catalog // field or a tag calculated from the partial digest. TargetTag string `json:"targetTag,omitempty"` // Full defines whether all packages within the catalog // or specified IncludeConfig will be mirrored or just channel heads. Full bool `json:"full,omitempty"` // SkipDependencies will not include dependencies // of bundles included in the diff if true. SkipDependencies bool `json:"skipDependencies,omitempty"` // OriginalRef is used when the Catalog is an OCI FBC (File Based Catalog) location. // It contains the reference to the original repo on a remote registry // Deprecated in oc-mirror 4.13, and will no longer be used. OriginalRef string `json:"originalRef,omitempty"` }
Operator defines the configuration for operator catalog mirroring.
func (Operator) GetUniqueName ¶
GetUniqueName determines the catalog name that will be tracked in the metadata and built. This depends on what fields are set between Catalog, TargetName, and TargetTag.
func (Operator) IsHeadsOnly ¶
IsHeadsOnly determine if the mode set mirrors only channel heads of all packages in the catalog. Channels specified in DiffIncludeConfig will override this setting; heads will still be included, but prior versions may also be included.
type OperatorMetadata ¶
type OperatorMetadata struct { // Catalog references a catalog name from the mirror spec. Catalog string `json:"catalog"` // ImagePin is the resolved sha256 image name of Catalog. // This image will be pulled using the pull secret // in the metadata's Mirror config for this catalog. ImagePin string `json:"imagePin"` // IncludeConfig in OperatorMetadata holds the starting // versions of all heads-only mirrored catalogs. It will // be validated against the current catalog during each run // and updated. IncludeConfig `json:",inline"` }
OperatorMetadata holds an Operator's post-mirror metadata.
type PastMirror ¶
type PastMirror struct { // TimeStamp defines when the mirrored was processed. Timestamp int `json:"timestamp"` // Sequence defines the serial number // assigned to the processed mirror. Sequence int `json:"sequence"` // Mirror defines the mirror defined // in the ImageSetConfigurationSpec provided // during the mirror processing. Mirror Mirror `json:"mirror"` // Operators are metadata about the set of mirrored operators in a mirror operation. Operators []OperatorMetadata `json:"operators,omitempty"` // Platforms are metadata about the set of mirrored platform release channels in a mirror operation. Platforms []PlatformMetadata `json:"platforms,omitempty"` // Associations are metadata about the set of mirrored images including // child manifest and layer digest information Associations []Association `json:"associations,omitempty"` }
PastMirror defines the specification for previously mirrored content.
type Platform ¶
type Platform struct { // Graph defines whether Cincinnati graph data will // downloaded and publish Graph bool `json:"graph,omitempty"` // Channels defines the configuration for individual // OCP and OKD channels Channels []ReleaseChannel `json:"channels,omitempty"` // Architectures defines one or more architectures // to mirror for the release image. This is defined at the // platform level to enable cross-channel upgrades. Architectures []string `json:"architectures,omitempty"` // This new field will allow the diskToMirror functionality // to copy from a release location on disk Release string `json:"release,omitempty"` }
Platform defines the configuration for OpenShift and OKD platform types.
type PlatformMetadata ¶
type PlatformMetadata struct { // ReleaseChannel references a channel name from the mirror spec. ReleaseChannel string `json:"channel"` // MinVersion in PlatformMetadata holds the starting // versions of all newly mirrored channels. This will // be populated the first time a channel is mirrored // and copied the remaining runs. MinVersion string `json:"minVersion"` }
PlatformMetadata holds a Platform's post-mirror metadata.
type PlatformType ¶
type PlatformType int
PlatformType defines the content type for platforms
const ( TypeOCP PlatformType = iota TypeOKD )
TypeOCP is default
func (PlatformType) MarshalJSON ¶
func (pt PlatformType) MarshalJSON() ([]byte, error)
MarshalJSON marshals the PlatformType as a quoted json string
func (PlatformType) String ¶
func (pt PlatformType) String() string
String returns the string representation of an PlatformType
func (*PlatformType) UnmarshalJSON ¶
func (pt *PlatformType) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals a quoted json string to the PlatformType
type RegistryConfig ¶
type RegistryConfig struct { // ImageURL at which the image can be pulled. ImageURL string `json:"imageURL"` // SkipTLS defines whether to use TLS validation // when interacting the the defined registry. SkipTLS bool `json:"skipTLS"` }
RegistryConfig configures a registry-based storage.
type ReleaseChannel ¶
type ReleaseChannel struct { Name string `json:"name"` // Type of the platform in the context of this tool. // See the PlatformType enum for options. OCP is the default. Type PlatformType `json:"type"` // MinVersion is minimum version in the // release channel to mirror MinVersion string `json:"minVersion,omitempty"` // MaxVersion is maximum version in the // release channel to mirror MaxVersion string `json:"maxVersion,omitempty"` // ShortestPath mode calculates the shortest path // between the min and mav version ShortestPath bool `json:"shortestPath,omitempty"` // Full mode set the MinVersion to the // first release in the channel and the MaxVersion // to the last release in the channel. Full bool `json:"full,omitempty"` }
ReleaseChannel defines the configuration for individual OCP and OKD channels
func (ReleaseChannel) IsHeadsOnly ¶
func (r ReleaseChannel) IsHeadsOnly() bool
IsHeadsOnly determine if the mode set mirrors only channel head. Setting MaxVersion will override this setting.
type Repository ¶
type Repository struct { // URL is the url of the Helm repository URL string `json:"url"` // Name is the name of the Helm repository Name string `json:"name"` // Charts is a list of charts to pull from the repo Charts []Chart `json:"charts"` }
Repository defines the configuration for a Helm repository.
type SampleImages ¶
type SampleImages struct {
Image `json:",inline"`
}
SampleImages define the configuration for Sameple content types. Not implemented.
type StorageConfig ¶
type StorageConfig struct { // Registry defines the configuration for registry // storage types. Registry *RegistryConfig `json:"registry,omitempty"` // Local defines the configuration for local // storage types. Local *LocalConfig `json:"local,omitempty"` }
StorageConfig configures how metadata is stored.
func (StorageConfig) IsSet ¶
func (s StorageConfig) IsSet() bool
IsSet will determine whether StorageConfig is empty or has backends set