| 1 |
package v1 |
| 2 |
|
| 3 |
import ( |
| 4 |
corev1 "k8s.io/api/core/v1" |
| 5 |
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" |
| 6 |
"k8s.io/apimachinery/pkg/runtime" |
| 7 |
) |
| 8 |
|
| 9 |
const ( |
| 10 |
// ResourceImageStreams represents a number of image streams in a project. |
| 11 |
ResourceImageStreams corev1.ResourceName = "openshift.io/imagestreams" |
| 12 |
|
| 13 |
// ResourceImageStreamImages represents a number of unique references to images in all image stream |
| 14 |
// statuses of a project. |
| 15 |
ResourceImageStreamImages corev1.ResourceName = "openshift.io/images" |
| 16 |
|
| 17 |
// ResourceImageStreamTags represents a number of unique references to images in all image stream specs |
| 18 |
// of a project. |
| 19 |
ResourceImageStreamTags corev1.ResourceName = "openshift.io/image-tags" |
| 20 |
|
| 21 |
// Limit that applies to images. Used with a max["storage"] LimitRangeItem to set |
| 22 |
// the maximum size of an image. |
| 23 |
LimitTypeImage corev1.LimitType = "openshift.io/Image" |
| 24 |
|
| 25 |
// Limit that applies to image streams. Used with a max[resource] LimitRangeItem to set the maximum number |
| 26 |
// of resource. Where the resource is one of "openshift.io/images" and "openshift.io/image-tags". |
| 27 |
LimitTypeImageStream corev1.LimitType = "openshift.io/ImageStream" |
| 28 |
) |
| 29 |
|
| 30 |
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 31 |
|
| 32 |
// ImageList is a list of Image objects. |
| 33 |
type ImageList struct { |
| 34 |
metav1.TypeMeta `json:",inline"` |
| 35 |
// Standard object's metadata. |
| 36 |
metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` |
| 37 |
|
| 38 |
// Items is a list of images |
| 39 |
Items []Image `json:"items" protobuf:"bytes,2,rep,name=items"` |
| 40 |
} |
| 41 |
|
| 42 |
// +genclient |
| 43 |
// +genclient:nonNamespaced |
| 44 |
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 45 |
|
| 46 |
// Image is an immutable representation of a container image and metadata at a point in time. |
| 47 |
type Image struct { |
| 48 |
metav1.TypeMeta `json:",inline"` |
| 49 |
// Standard object's metadata. |
| 50 |
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` |
| 51 |
|
| 52 |
// DockerImageReference is the string that can be used to pull this image. |
| 53 |
DockerImageReference string `json:"dockerImageReference,omitempty" protobuf:"bytes,2,opt,name=dockerImageReference"` |
| 54 |
// DockerImageMetadata contains metadata about this image |
| 55 |
// +patchStrategy=replace |
| 56 |
DockerImageMetadata runtime.RawExtension `json:"dockerImageMetadata,omitempty" patchStrategy:"replace" protobuf:"bytes,3,opt,name=dockerImageMetadata"` |
| 57 |
// DockerImageMetadataVersion conveys the version of the object, which if empty defaults to "1.0" |
| 58 |
DockerImageMetadataVersion string `json:"dockerImageMetadataVersion,omitempty" protobuf:"bytes,4,opt,name=dockerImageMetadataVersion"` |
| 59 |
// DockerImageManifest is the raw JSON of the manifest |
| 60 |
DockerImageManifest string `json:"dockerImageManifest,omitempty" protobuf:"bytes,5,opt,name=dockerImageManifest"` |
| 61 |
// DockerImageLayers represents the layers in the image. May not be set if the image does not define that data. |
| 62 |
DockerImageLayers []ImageLayer `json:"dockerImageLayers" protobuf:"bytes,6,rep,name=dockerImageLayers"` |
| 63 |
// Signatures holds all signatures of the image. |
| 64 |
// +patchMergeKey=name |
| 65 |
// +patchStrategy=merge |
| 66 |
Signatures []ImageSignature `json:"signatures,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,7,rep,name=signatures"` |
| 67 |
// DockerImageSignatures provides the signatures as opaque blobs. This is a part of manifest schema v1. |
| 68 |
DockerImageSignatures [][]byte `json:"dockerImageSignatures,omitempty" protobuf:"bytes,8,rep,name=dockerImageSignatures"` |
| 69 |
// DockerImageManifestMediaType specifies the mediaType of manifest. This is a part of manifest schema v2. |
| 70 |
DockerImageManifestMediaType string `json:"dockerImageManifestMediaType,omitempty" protobuf:"bytes,9,opt,name=dockerImageManifestMediaType"` |
| 71 |
// DockerImageConfig is a JSON blob that the runtime uses to set up the container. This is a part of manifest schema v2. |
| 72 |
DockerImageConfig string `json:"dockerImageConfig,omitempty" protobuf:"bytes,10,opt,name=dockerImageConfig"` |
| 73 |
} |
| 74 |
|
| 75 |
// ImageLayer represents a single layer of the image. Some images may have multiple layers. Some may have none. |
| 76 |
type ImageLayer struct { |
| 77 |
// Name of the layer as defined by the underlying store. |
| 78 |
Name string `json:"name" protobuf:"bytes,1,opt,name=name"` |
| 79 |
// Size of the layer in bytes as defined by the underlying store. |
| 80 |
LayerSize int64 `json:"size" protobuf:"varint,2,opt,name=size"` |
| 81 |
// MediaType of the referenced object. |
| 82 |
MediaType string `json:"mediaType" protobuf:"bytes,3,opt,name=mediaType"` |
| 83 |
} |
| 84 |
|
| 85 |
// +genclient |
| 86 |
// +genclient:onlyVerbs=create,delete |
| 87 |
// +genclient:nonNamespaced |
| 88 |
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 89 |
|
| 90 |
// ImageSignature holds a signature of an image. It allows to verify image identity and possibly other claims |
| 91 |
// as long as the signature is trusted. Based on this information it is possible to restrict runnable images |
| 92 |
// to those matching cluster-wide policy. |
| 93 |
// Mandatory fields should be parsed by clients doing image verification. The others are parsed from |
| 94 |
// signature's content by the server. They serve just an informative purpose. |
| 95 |
type ImageSignature struct { |
| 96 |
metav1.TypeMeta `json:",inline"` |
| 97 |
// Standard object's metadata. |
| 98 |
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` |
| 99 |
|
| 100 |
// Required: Describes a type of stored blob. |
| 101 |
Type string `json:"type" protobuf:"bytes,2,opt,name=type"` |
| 102 |
// Required: An opaque binary string which is an image's signature. |
| 103 |
Content []byte `json:"content" protobuf:"bytes,3,opt,name=content"` |
| 104 |
// Conditions represent the latest available observations of a signature's current state. |
| 105 |
// +patchMergeKey=type |
| 106 |
// +patchStrategy=merge |
| 107 |
Conditions []SignatureCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,4,rep,name=conditions"` |
| 108 |
|
| 109 |
// Following metadata fields will be set by server if the signature content is successfully parsed and |
| 110 |
// the information available. |
| 111 |
|
| 112 |
// A human readable string representing image's identity. It could be a product name and version, or an |
| 113 |
// image pull spec (e.g. "registry.access.redhat.com/rhel7/rhel:7.2"). |
| 114 |
ImageIdentity string `json:"imageIdentity,omitempty" protobuf:"bytes,5,opt,name=imageIdentity"` |
| 115 |
// Contains claims from the signature. |
| 116 |
SignedClaims map[string]string `json:"signedClaims,omitempty" protobuf:"bytes,6,rep,name=signedClaims"` |
| 117 |
// If specified, it is the time of signature's creation. |
| 118 |
Created *metav1.Time `json:"created,omitempty" protobuf:"bytes,7,opt,name=created"` |
| 119 |
// If specified, it holds information about an issuer of signing certificate or key (a person or entity |
| 120 |
// who signed the signing certificate or key). |
| 121 |
IssuedBy *SignatureIssuer `json:"issuedBy,omitempty" protobuf:"bytes,8,opt,name=issuedBy"` |
| 122 |
// If specified, it holds information about a subject of signing certificate or key (a person or entity |
| 123 |
// who signed the image). |
| 124 |
IssuedTo *SignatureSubject `json:"issuedTo,omitempty" protobuf:"bytes,9,opt,name=issuedTo"` |
| 125 |
} |
| 126 |
|
| 127 |
/// SignatureConditionType is a type of image signature condition. |
| 128 |
type SignatureConditionType string |
| 129 |
|
| 130 |
// SignatureCondition describes an image signature condition of particular kind at particular probe time. |
| 131 |
type SignatureCondition struct { |
| 132 |
// Type of signature condition, Complete or Failed. |
| 133 |
Type SignatureConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=SignatureConditionType"` |
| 134 |
// Status of the condition, one of True, False, Unknown. |
| 135 |
Status corev1.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/api/core/v1.ConditionStatus"` |
| 136 |
// Last time the condition was checked. |
| 137 |
LastProbeTime metav1.Time `json:"lastProbeTime,omitempty" protobuf:"bytes,3,opt,name=lastProbeTime"` |
| 138 |
// Last time the condition transit from one status to another. |
| 139 |
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,4,opt,name=lastTransitionTime"` |
| 140 |
// (brief) reason for the condition's last transition. |
| 141 |
Reason string `json:"reason,omitempty" protobuf:"bytes,5,opt,name=reason"` |
| 142 |
// Human readable message indicating details about last transition. |
| 143 |
Message string `json:"message,omitempty" protobuf:"bytes,6,opt,name=message"` |
| 144 |
} |
| 145 |
|
| 146 |
// SignatureGenericEntity holds a generic information about a person or entity who is an issuer or a subject |
| 147 |
// of signing certificate or key. |
| 148 |
type SignatureGenericEntity struct { |
| 149 |
// Organization name. |
| 150 |
Organization string `json:"organization,omitempty" protobuf:"bytes,1,opt,name=organization"` |
| 151 |
// Common name (e.g. openshift-signing-service). |
| 152 |
CommonName string `json:"commonName,omitempty" protobuf:"bytes,2,opt,name=commonName"` |
| 153 |
} |
| 154 |
|
| 155 |
// SignatureIssuer holds information about an issuer of signing certificate or key. |
| 156 |
type SignatureIssuer struct { |
| 157 |
SignatureGenericEntity `json:",inline" protobuf:"bytes,1,opt,name=signatureGenericEntity"` |
| 158 |
} |
| 159 |
|
| 160 |
// SignatureSubject holds information about a person or entity who created the signature. |
| 161 |
type SignatureSubject struct { |
| 162 |
SignatureGenericEntity `json:",inline" protobuf:"bytes,1,opt,name=signatureGenericEntity"` |
| 163 |
// If present, it is a human readable key id of public key belonging to the subject used to verify image |
| 164 |
// signature. It should contain at least 64 lowest bits of public key's fingerprint (e.g. |
| 165 |
// 0x685ebe62bf278440). |
| 166 |
PublicKeyID string `json:"publicKeyID" protobuf:"bytes,2,opt,name=publicKeyID"` |
| 167 |
} |
| 168 |
|
| 169 |
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 170 |
|
| 171 |
// ImageStreamList is a list of ImageStream objects. |
| 172 |
type ImageStreamList struct { |
| 173 |
metav1.TypeMeta `json:",inline"` |
| 174 |
// Standard object's metadata. |
| 175 |
metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` |
| 176 |
|
| 177 |
// Items is a list of imageStreams |
| 178 |
Items []ImageStream `json:"items" protobuf:"bytes,2,rep,name=items"` |
| 179 |
} |
| 180 |
|
| 181 |
// +genclient |
| 182 |
// +genclient:method=Secrets,verb=get,subresource=secrets,result=k8s.io/api/core/v1.SecretList |
| 183 |
// +genclient:method=Layers,verb=get,subresource=layers,result=github.com/openshift/api/image/v1.ImageStreamLayers |
| 184 |
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 185 |
|
| 186 |
// ImageStream stores a mapping of tags to images, metadata overrides that are applied |
| 187 |
// when images are tagged in a stream, and an optional reference to a container image |
| 188 |
// repository on a registry. |
| 189 |
type ImageStream struct { |
| 190 |
metav1.TypeMeta `json:",inline"` |
| 191 |
// Standard object's metadata. |
| 192 |
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` |
| 193 |
|
| 194 |
// Spec describes the desired state of this stream |
| 195 |
Spec ImageStreamSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` |
| 196 |
// Status describes the current state of this stream |
| 197 |
Status ImageStreamStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` |
| 198 |
} |
| 199 |
|
| 200 |
// ImageStreamSpec represents options for ImageStreams. |
| 201 |
type ImageStreamSpec struct { |
| 202 |
// lookupPolicy controls how other resources reference images within this namespace. |
| 203 |
LookupPolicy ImageLookupPolicy `json:"lookupPolicy,omitempty" protobuf:"bytes,3,opt,name=lookupPolicy"` |
| 204 |
// dockerImageRepository is optional, if specified this stream is backed by a container repository on this server |
| 205 |
// Deprecated: This field is deprecated as of v3.7 and will be removed in a future release. |
| 206 |
// Specify the source for the tags to be imported in each tag via the spec.tags.from reference instead. |
| 207 |
DockerImageRepository string `json:"dockerImageRepository,omitempty" protobuf:"bytes,1,opt,name=dockerImageRepository"` |
| 208 |
// tags map arbitrary string values to specific image locators |
| 209 |
// +patchMergeKey=name |
| 210 |
// +patchStrategy=merge |
| 211 |
Tags []TagReference `json:"tags,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,2,rep,name=tags"` |
| 212 |
} |
| 213 |
|
| 214 |
// ImageLookupPolicy describes how an image stream can be used to override the image references |
| 215 |
// used by pods, builds, and other resources in a namespace. |
| 216 |
type ImageLookupPolicy struct { |
| 217 |
// local will change the docker short image references (like "mysql" or |
| 218 |
// "php:latest") on objects in this namespace to the image ID whenever they match |
| 219 |
// this image stream, instead of reaching out to a remote registry. The name will |
| 220 |
// be fully qualified to an image ID if found. The tag's referencePolicy is taken |
| 221 |
// into account on the replaced value. Only works within the current namespace. |
| 222 |
Local bool `json:"local" protobuf:"varint,3,opt,name=local"` |
| 223 |
} |
| 224 |
|
| 225 |
// TagReference specifies optional annotations for images using this tag and an optional reference to an ImageStreamTag, ImageStreamImage, or DockerImage this tag should track. |
| 226 |
type TagReference struct { |
| 227 |
// Name of the tag |
| 228 |
Name string `json:"name" protobuf:"bytes,1,opt,name=name"` |
| 229 |
// Optional; if specified, annotations that are applied to images retrieved via ImageStreamTags. |
| 230 |
// +optional |
| 231 |
Annotations map[string]string `json:"annotations" protobuf:"bytes,2,rep,name=annotations"` |
| 232 |
// Optional; if specified, a reference to another image that this tag should point to. Valid values |
| 233 |
// are ImageStreamTag, ImageStreamImage, and DockerImage. ImageStreamTag references |
| 234 |
// can only reference a tag within this same ImageStream. |
| 235 |
From *corev1.ObjectReference `json:"from,omitempty" protobuf:"bytes,3,opt,name=from"` |
| 236 |
// Reference states if the tag will be imported. Default value is false, which means the tag will |
| 237 |
// be imported. |
| 238 |
Reference bool `json:"reference,omitempty" protobuf:"varint,4,opt,name=reference"` |
| 239 |
// Generation is a counter that tracks mutations to the spec tag (user intent). When a tag reference |
| 240 |
// is changed the generation is set to match the current stream generation (which is incremented every |
| 241 |
// time spec is changed). Other processes in the system like the image importer observe that the |
| 242 |
// generation of spec tag is newer than the generation recorded in the status and use that as a trigger |
| 243 |
// to import the newest remote tag. To trigger a new import, clients may set this value to zero which |
| 244 |
// will reset the generation to the latest stream generation. Legacy clients will send this value as |
| 245 |
// nil which will be merged with the current tag generation. |
| 246 |
// +optional |
| 247 |
Generation *int64 `json:"generation" protobuf:"varint,5,opt,name=generation"` |
| 248 |
// ImportPolicy is information that controls how images may be imported by the server. |
| 249 |
ImportPolicy TagImportPolicy `json:"importPolicy,omitempty" protobuf:"bytes,6,opt,name=importPolicy"` |
| 250 |
// ReferencePolicy defines how other components should consume the image. |
| 251 |
ReferencePolicy TagReferencePolicy `json:"referencePolicy,omitempty" protobuf:"bytes,7,opt,name=referencePolicy"` |
| 252 |
} |
| 253 |
|
| 254 |
// TagImportPolicy controls how images related to this tag will be imported. |
| 255 |
type TagImportPolicy struct { |
| 256 |
// Insecure is true if the server may bypass certificate verification or connect directly over HTTP during image import. |
| 257 |
Insecure bool `json:"insecure,omitempty" protobuf:"varint,1,opt,name=insecure"` |
| 258 |
// Scheduled indicates to the server that this tag should be periodically checked to ensure it is up to date, and imported |
| 259 |
Scheduled bool `json:"scheduled,omitempty" protobuf:"varint,2,opt,name=scheduled"` |
| 260 |
} |
| 261 |
|
| 262 |
// TagReferencePolicyType describes how pull-specs for images in an image stream tag are generated when |
| 263 |
// image change triggers are fired. |
| 264 |
type TagReferencePolicyType string |
| 265 |
|
| 266 |
const ( |
| 267 |
// SourceTagReferencePolicy indicates the image's original location should be used when the image stream tag |
| 268 |
// is resolved into other resources (builds and deployment configurations). |
| 269 |
SourceTagReferencePolicy TagReferencePolicyType = "Source" |
| 270 |
// LocalTagReferencePolicy indicates the image should prefer to pull via the local integrated registry, |
| 271 |
// falling back to the remote location if the integrated registry has not been configured. The reference will |
| 272 |
// use the internal DNS name or registry service IP. |
| 273 |
LocalTagReferencePolicy TagReferencePolicyType = "Local" |
| 274 |
) |
| 275 |
|
| 276 |
// TagReferencePolicy describes how pull-specs for images in this image stream tag are generated when |
| 277 |
// image change triggers in deployment configs or builds are resolved. This allows the image stream |
| 278 |
// author to control how images are accessed. |
| 279 |
type TagReferencePolicy struct { |
| 280 |
// Type determines how the image pull spec should be transformed when the image stream tag is used in |
| 281 |
// deployment config triggers or new builds. The default value is `Source`, indicating the original |
| 282 |
// location of the image should be used (if imported). The user may also specify `Local`, indicating |
| 283 |
// that the pull spec should point to the integrated container image registry and leverage the registry's |
| 284 |
// ability to proxy the pull to an upstream registry. `Local` allows the credentials used to pull this |
| 285 |
// image to be managed from the image stream's namespace, so others on the platform can access a remote |
| 286 |
// image but have no access to the remote secret. It also allows the image layers to be mirrored into |
| 287 |
// the local registry which the images can still be pulled even if the upstream registry is unavailable. |
| 288 |
Type TagReferencePolicyType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=TagReferencePolicyType"` |
| 289 |
} |
| 290 |
|
| 291 |
// ImageStreamStatus contains information about the state of this image stream. |
| 292 |
type ImageStreamStatus struct { |
| 293 |
// DockerImageRepository represents the effective location this stream may be accessed at. |
| 294 |
// May be empty until the server determines where the repository is located |
| 295 |
DockerImageRepository string `json:"dockerImageRepository" protobuf:"bytes,1,opt,name=dockerImageRepository"` |
| 296 |
// PublicDockerImageRepository represents the public location from where the image can |
| 297 |
// be pulled outside the cluster. This field may be empty if the administrator |
| 298 |
// has not exposed the integrated registry externally. |
| 299 |
PublicDockerImageRepository string `json:"publicDockerImageRepository,omitempty" protobuf:"bytes,3,opt,name=publicDockerImageRepository"` |
| 300 |
// Tags are a historical record of images associated with each tag. The first entry in the |
| 301 |
// TagEvent array is the currently tagged image. |
| 302 |
// +patchMergeKey=tag |
| 303 |
// +patchStrategy=merge |
| 304 |
Tags []NamedTagEventList `json:"tags,omitempty" patchStrategy:"merge" patchMergeKey:"tag" protobuf:"bytes,2,rep,name=tags"` |
| 305 |
} |
| 306 |
|
| 307 |
// NamedTagEventList relates a tag to its image history. |
| 308 |
type NamedTagEventList struct { |
| 309 |
// Tag is the tag for which the history is recorded |
| 310 |
Tag string `json:"tag" protobuf:"bytes,1,opt,name=tag"` |
| 311 |
// Standard object's metadata. |
| 312 |
Items []TagEvent `json:"items" protobuf:"bytes,2,rep,name=items"` |
| 313 |
// Conditions is an array of conditions that apply to the tag event list. |
| 314 |
Conditions []TagEventCondition `json:"conditions,omitempty" protobuf:"bytes,3,rep,name=conditions"` |
| 315 |
} |
| 316 |
|
| 317 |
// TagEvent is used by ImageStreamStatus to keep a historical record of images associated with a tag. |
| 318 |
type TagEvent struct { |
| 319 |
// Created holds the time the TagEvent was created |
| 320 |
Created metav1.Time `json:"created" protobuf:"bytes,1,opt,name=created"` |
| 321 |
// DockerImageReference is the string that can be used to pull this image |
| 322 |
DockerImageReference string `json:"dockerImageReference" protobuf:"bytes,2,opt,name=dockerImageReference"` |
| 323 |
// Image is the image |
| 324 |
Image string `json:"image" protobuf:"bytes,3,opt,name=image"` |
| 325 |
// Generation is the spec tag generation that resulted in this tag being updated |
| 326 |
Generation int64 `json:"generation" protobuf:"varint,4,opt,name=generation"` |
| 327 |
} |
| 328 |
|
| 329 |
type TagEventConditionType string |
| 330 |
|
| 331 |
// These are valid conditions of TagEvents. |
| 332 |
const ( |
| 333 |
// ImportSuccess with status False means the import of the specific tag failed |
| 334 |
ImportSuccess TagEventConditionType = "ImportSuccess" |
| 335 |
) |
| 336 |
|
| 337 |
// TagEventCondition contains condition information for a tag event. |
| 338 |
type TagEventCondition struct { |
| 339 |
// Type of tag event condition, currently only ImportSuccess |
| 340 |
Type TagEventConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=TagEventConditionType"` |
| 341 |
// Status of the condition, one of True, False, Unknown. |
| 342 |
Status corev1.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/api/core/v1.ConditionStatus"` |
| 343 |
// LastTransitionTIme is the time the condition transitioned from one status to another. |
| 344 |
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,3,opt,name=lastTransitionTime"` |
| 345 |
// Reason is a brief machine readable explanation for the condition's last transition. |
| 346 |
Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"` |
| 347 |
// Message is a human readable description of the details about last transition, complementing reason. |
| 348 |
Message string `json:"message,omitempty" protobuf:"bytes,5,opt,name=message"` |
| 349 |
// Generation is the spec tag generation that this status corresponds to |
| 350 |
Generation int64 `json:"generation" protobuf:"varint,6,opt,name=generation"` |
| 351 |
} |
| 352 |
|
| 353 |
// +genclient |
| 354 |
// +genclient:skipVerbs=get,list,create,update,patch,delete,deleteCollection,watch |
| 355 |
// +genclient:method=Create,verb=create,result=k8s.io/apimachinery/pkg/apis/meta/v1.Status |
| 356 |
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 357 |
|
| 358 |
// ImageStreamMapping represents a mapping from a single tag to a container image as |
| 359 |
// well as the reference to the container image stream the image came from. |
| 360 |
type ImageStreamMapping struct { |
| 361 |
metav1.TypeMeta `json:",inline"` |
| 362 |
// Standard object's metadata. |
| 363 |
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` |
| 364 |
|
| 365 |
// Image is a container image. |
| 366 |
Image Image `json:"image" protobuf:"bytes,2,opt,name=image"` |
| 367 |
// Tag is a string value this image can be located with inside the stream. |
| 368 |
Tag string `json:"tag" protobuf:"bytes,3,opt,name=tag"` |
| 369 |
} |
| 370 |
|
| 371 |
// +genclient |
| 372 |
// +genclient:onlyVerbs=get,list,create,update,delete |
| 373 |
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 374 |
|
| 375 |
// ImageStreamTag represents an Image that is retrieved by tag name from an ImageStream. |
| 376 |
type ImageStreamTag struct { |
| 377 |
metav1.TypeMeta `json:",inline"` |
| 378 |
// Standard object's metadata. |
| 379 |
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` |
| 380 |
|
| 381 |
// tag is the spec tag associated with this image stream tag, and it may be null |
| 382 |
// if only pushes have occurred to this image stream. |
| 383 |
Tag *TagReference `json:"tag" protobuf:"bytes,2,opt,name=tag"` |
| 384 |
|
| 385 |
// generation is the current generation of the tagged image - if tag is provided |
| 386 |
// and this value is not equal to the tag generation, a user has requested an |
| 387 |
// import that has not completed, or conditions will be filled out indicating any |
| 388 |
// error. |
| 389 |
Generation int64 `json:"generation" protobuf:"varint,3,opt,name=generation"` |
| 390 |
|
| 391 |
// lookupPolicy indicates whether this tag will handle image references in this |
| 392 |
// namespace. |
| 393 |
LookupPolicy ImageLookupPolicy `json:"lookupPolicy" protobuf:"varint,6,opt,name=lookupPolicy"` |
| 394 |
|
| 395 |
// conditions is an array of conditions that apply to the image stream tag. |
| 396 |
Conditions []TagEventCondition `json:"conditions,omitempty" protobuf:"bytes,4,rep,name=conditions"` |
| 397 |
|
| 398 |
// image associated with the ImageStream and tag. |
| 399 |
Image Image `json:"image" protobuf:"bytes,5,opt,name=image"` |
| 400 |
} |
| 401 |
|
| 402 |
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 403 |
|
| 404 |
// ImageStreamTagList is a list of ImageStreamTag objects. |
| 405 |
type ImageStreamTagList struct { |
| 406 |
metav1.TypeMeta `json:",inline"` |
| 407 |
// Standard object's metadata. |
| 408 |
metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` |
| 409 |
|
| 410 |
// Items is the list of image stream tags |
| 411 |
Items []ImageStreamTag `json:"items" protobuf:"bytes,2,rep,name=items"` |
| 412 |
} |
| 413 |
|
| 414 |
// +genclient |
| 415 |
// +genclient:onlyVerbs=get |
| 416 |
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 417 |
|
| 418 |
// ImageStreamImage represents an Image that is retrieved by image name from an ImageStream. |
| 419 |
type ImageStreamImage struct { |
| 420 |
metav1.TypeMeta `json:",inline"` |
| 421 |
// Standard object's metadata. |
| 422 |
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` |
| 423 |
|
| 424 |
// Image associated with the ImageStream and image name. |
| 425 |
Image Image `json:"image" protobuf:"bytes,2,opt,name=image"` |
| 426 |
} |
| 427 |
|
| 428 |
// DockerImageReference points to a container image. |
| 429 |
type DockerImageReference struct { |
| 430 |
// Registry is the registry that contains the container image |
| 431 |
Registry string `protobuf:"bytes,1,opt,name=registry"` |
| 432 |
// Namespace is the namespace that contains the container image |
| 433 |
Namespace string `protobuf:"bytes,2,opt,name=namespace"` |
| 434 |
// Name is the name of the container image |
| 435 |
Name string `protobuf:"bytes,3,opt,name=name"` |
| 436 |
// Tag is which tag of the container image is being referenced |
| 437 |
Tag string `protobuf:"bytes,4,opt,name=tag"` |
| 438 |
// ID is the identifier for the container image |
| 439 |
ID string `protobuf:"bytes,5,opt,name=iD"` |
| 440 |
} |
| 441 |
|
| 442 |
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 443 |
|
| 444 |
// ImageStreamLayers describes information about the layers referenced by images in this |
| 445 |
// image stream. |
| 446 |
type ImageStreamLayers struct { |
| 447 |
metav1.TypeMeta `json:",inline"` |
| 448 |
// Standard object's metadata. |
| 449 |
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` |
| 450 |
// blobs is a map of blob name to metadata about the blob. |
| 451 |
Blobs map[string]ImageLayerData `json:"blobs" protobuf:"bytes,2,rep,name=blobs"` |
| 452 |
// images is a map between an image name and the names of the blobs and config that |
| 453 |
// comprise the image. |
| 454 |
Images map[string]ImageBlobReferences `json:"images" protobuf:"bytes,3,rep,name=images"` |
| 455 |
} |
| 456 |
|
| 457 |
// ImageBlobReferences describes the blob references within an image. |
| 458 |
type ImageBlobReferences struct { |
| 459 |
// imageMissing is true if the image is referenced by the image stream but the image |
| 460 |
// object has been deleted from the API by an administrator. When this field is set, |
| 461 |
// layers and config fields may be empty and callers that depend on the image metadata |
| 462 |
// should consider the image to be unavailable for download or viewing. |
| 463 |
// +optional |
| 464 |
ImageMissing bool `json:"imageMissing" protobuf:"varint,3,opt,name=imageMissing"` |
| 465 |
// layers is the list of blobs that compose this image, from base layer to top layer. |
| 466 |
// All layers referenced by this array will be defined in the blobs map. Some images |
| 467 |
// may have zero layers. |
| 468 |
// +optional |
| 469 |
Layers []string `json:"layers" protobuf:"bytes,1,rep,name=layers"` |
| 470 |
// config, if set, is the blob that contains the image config. Some images do |
| 471 |
// not have separate config blobs and this field will be set to nil if so. |
| 472 |
// +optional |
| 473 |
Config *string `json:"config" protobuf:"bytes,2,opt,name=config"` |
| 474 |
} |
| 475 |
|
| 476 |
// ImageLayerData contains metadata about an image layer. |
| 477 |
type ImageLayerData struct { |
| 478 |
// Size of the layer in bytes as defined by the underlying store. This field is |
| 479 |
// optional if the necessary information about size is not available. |
| 480 |
LayerSize *int64 `json:"size" protobuf:"varint,1,opt,name=size"` |
| 481 |
// MediaType of the referenced object. |
| 482 |
MediaType string `json:"mediaType" protobuf:"bytes,2,opt,name=mediaType"` |
| 483 |
} |
| 484 |
|
| 485 |
// +genclient |
| 486 |
// +genclient:onlyVerbs=create |
| 487 |
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 488 |
|
| 489 |
// The image stream import resource provides an easy way for a user to find and import container images |
| 490 |
// from other container image registries into the server. Individual images or an entire image repository may |
| 491 |
// be imported, and users may choose to see the results of the import prior to tagging the resulting |
| 492 |
// images into the specified image stream. |
| 493 |
// |
| 494 |
// This API is intended for end-user tools that need to see the metadata of the image prior to import |
| 495 |
// (for instance, to generate an application from it). Clients that know the desired image can continue |
| 496 |
// to create spec.tags directly into their image streams. |
| 497 |
type ImageStreamImport struct { |
| 498 |
metav1.TypeMeta `json:",inline"` |
| 499 |
// Standard object's metadata. |
| 500 |
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` |
| 501 |
|
| 502 |
// Spec is a description of the images that the user wishes to import |
| 503 |
Spec ImageStreamImportSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` |
| 504 |
// Status is the the result of importing the image |
| 505 |
Status ImageStreamImportStatus `json:"status" protobuf:"bytes,3,opt,name=status"` |
| 506 |
} |
| 507 |
|
| 508 |
// ImageStreamImportSpec defines what images should be imported. |
| 509 |
type ImageStreamImportSpec struct { |
| 510 |
// Import indicates whether to perform an import - if so, the specified tags are set on the spec |
| 511 |
// and status of the image stream defined by the type meta. |
| 512 |
Import bool `json:"import" protobuf:"varint,1,opt,name=import"` |
| 513 |
// Repository is an optional import of an entire container image repository. A maximum limit on the |
| 514 |
// number of tags imported this way is imposed by the server. |
| 515 |
Repository *RepositoryImportSpec `json:"repository,omitempty" protobuf:"bytes,2,opt,name=repository"` |
| 516 |
// Images are a list of individual images to import. |
| 517 |
Images []ImageImportSpec `json:"images,omitempty" protobuf:"bytes,3,rep,name=images"` |
| 518 |
} |
| 519 |
|
| 520 |
// ImageStreamImportStatus contains information about the status of an image stream import. |
| 521 |
type ImageStreamImportStatus struct { |
| 522 |
// Import is the image stream that was successfully updated or created when 'to' was set. |
| 523 |
Import *ImageStream `json:"import,omitempty" protobuf:"bytes,1,opt,name=import"` |
| 524 |
// Repository is set if spec.repository was set to the outcome of the import |
| 525 |
Repository *RepositoryImportStatus `json:"repository,omitempty" protobuf:"bytes,2,opt,name=repository"` |
| 526 |
// Images is set with the result of importing spec.images |
| 527 |
Images []ImageImportStatus `json:"images,omitempty" protobuf:"bytes,3,rep,name=images"` |
| 528 |
} |
| 529 |
|
| 530 |
// RepositoryImportSpec describes a request to import images from a container image repository. |
| 531 |
type RepositoryImportSpec struct { |
| 532 |
// From is the source for the image repository to import; only kind DockerImage and a name of a container image repository is allowed |
| 533 |
From corev1.ObjectReference `json:"from" protobuf:"bytes,1,opt,name=from"` |
| 534 |
|
| 535 |
// ImportPolicy is the policy controlling how the image is imported |
| 536 |
ImportPolicy TagImportPolicy `json:"importPolicy,omitempty" protobuf:"bytes,2,opt,name=importPolicy"` |
| 537 |
// ReferencePolicy defines how other components should consume the image |
| 538 |
ReferencePolicy TagReferencePolicy `json:"referencePolicy,omitempty" protobuf:"bytes,4,opt,name=referencePolicy"` |
| 539 |
// IncludeManifest determines if the manifest for each image is returned in the response |
| 540 |
IncludeManifest bool `json:"includeManifest,omitempty" protobuf:"varint,3,opt,name=includeManifest"` |
| 541 |
} |
| 542 |
|
| 543 |
// RepositoryImportStatus describes the result of an image repository import |
| 544 |
type RepositoryImportStatus struct { |
| 545 |
// Status reflects whether any failure occurred during import |
| 546 |
Status metav1.Status `json:"status,omitempty" protobuf:"bytes,1,opt,name=status"` |
| 547 |
// Images is a list of images successfully retrieved by the import of the repository. |
| 548 |
Images []ImageImportStatus `json:"images,omitempty" protobuf:"bytes,2,rep,name=images"` |
| 549 |
// AdditionalTags are tags that exist in the repository but were not imported because |
| 550 |
// a maximum limit of automatic imports was applied. |
| 551 |
AdditionalTags []string `json:"additionalTags,omitempty" protobuf:"bytes,3,rep,name=additionalTags"` |
| 552 |
} |
| 553 |
|
| 554 |
// ImageImportSpec describes a request to import a specific image. |
| 555 |
type ImageImportSpec struct { |
| 556 |
// From is the source of an image to import; only kind DockerImage is allowed |
| 557 |
From corev1.ObjectReference `json:"from" protobuf:"bytes,1,opt,name=from"` |
| 558 |
// To is a tag in the current image stream to assign the imported image to, if name is not specified the default tag from from.name will be used |
| 559 |
To *corev1.LocalObjectReference `json:"to,omitempty" protobuf:"bytes,2,opt,name=to"` |
| 560 |
|
| 561 |
// ImportPolicy is the policy controlling how the image is imported |
| 562 |
ImportPolicy TagImportPolicy `json:"importPolicy,omitempty" protobuf:"bytes,3,opt,name=importPolicy"` |
| 563 |
// ReferencePolicy defines how other components should consume the image |
| 564 |
ReferencePolicy TagReferencePolicy `json:"referencePolicy,omitempty" protobuf:"bytes,5,opt,name=referencePolicy"` |
| 565 |
// IncludeManifest determines if the manifest for each image is returned in the response |
| 566 |
IncludeManifest bool `json:"includeManifest,omitempty" protobuf:"varint,4,opt,name=includeManifest"` |
| 567 |
} |
| 568 |
|
| 569 |
// ImageImportStatus describes the result of an image import. |
| 570 |
type ImageImportStatus struct { |
| 571 |
// Status is the status of the image import, including errors encountered while retrieving the image |
| 572 |
Status metav1.Status `json:"status" protobuf:"bytes,1,opt,name=status"` |
| 573 |
// Image is the metadata of that image, if the image was located |
| 574 |
Image *Image `json:"image,omitempty" protobuf:"bytes,2,opt,name=image"` |
| 575 |
// Tag is the tag this image was located under, if any |
| 576 |
Tag string `json:"tag,omitempty" protobuf:"bytes,3,opt,name=tag"` |
| 577 |
} |