forked from openshift/origin
/
types.go
74 lines (60 loc) · 2.7 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package v1beta1
import (
kapi "github.com/GoogleCloudPlatform/kubernetes/pkg/api/v1beta3"
"github.com/GoogleCloudPlatform/kubernetes/pkg/runtime"
)
// ImageList is a list of Image objects.
type ImageList struct {
kapi.TypeMeta `json:",inline"`
kapi.ListMeta `json:"metadata,omitempty"`
Items []Image `json:"items"`
}
// Image is an immutable representation of a Docker image and metadata at a point in time.
type Image struct {
kapi.TypeMeta `json:",inline"`
kapi.ObjectMeta `json:"metadata,omitempty"`
// The string that can be used to pull this image.
DockerImageReference string `json:"dockerImageReference,omitempty"`
// Metadata about this image
DockerImageMetadata runtime.RawExtension `json:"dockerImageMetadata,omitempty"`
// This attribute conveys the version of the object, which if empty defaults to "1.0"
DockerImageMetadataVersion string `json:"dockerImageMetadataVersion,omitempty"`
}
// ImageRepositoryList is a list of ImageRepository objects.
type ImageRepositoryList struct {
kapi.TypeMeta `json:",inline"`
kapi.ListMeta `json:"metadata,omitempty"`
Items []ImageRepository `json:"items"`
}
// ImageRepository stores a mapping of tags to images, metadata overrides that are applied
// when images are tagged in a repository, and an optional reference to a Docker image
// repository on a registry.
type ImageRepository struct {
kapi.TypeMeta `json:",inline"`
kapi.ObjectMeta `json:"metadata,omitempty"`
// Optional, if specified this repository is backed by a Docker repository on this server
DockerImageRepository string `json:"dockerImageRepository,omitempty"`
// Tags map arbitrary string values to specific image locators
Tags map[string]string `json:"tags,omitempty"`
// Status describes the current state of this repository
Status ImageRepositoryStatus `json:"status,omitempty"`
}
// ImageRepositoryStatus contains information about the state of this image repository.
type ImageRepositoryStatus struct {
// Represents the effective location this repository may be accessed at. May be empty until the server
// determines where the repository is located
DockerImageRepository string `json:"dockerImageRepository"`
}
// TODO add metadata overrides
// ImageRepositoryMapping represents a mapping from a single tag to a Docker image as
// well as the reference to the Docker image repository the image came from.
type ImageRepositoryMapping struct {
kapi.TypeMeta `json:",inline"`
kapi.ObjectMeta `json:"metadata,omitempty"`
// The Docker image repository the specified image is located in
DockerImageRepository string `json:"dockerImageRepository"`
// A Docker image.
Image Image `json:"image"`
// A string value this image can be located with inside the repository.
Tag string `json:"tag"`
}