forked from openshift/origin
/
types.go
190 lines (162 loc) · 6.91 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
package v1beta1
import (
kapi "github.com/GoogleCloudPlatform/kubernetes/pkg/api/v1beta3"
"github.com/GoogleCloudPlatform/kubernetes/pkg/runtime"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
)
// 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"`
// The raw JSON of the manifest
DockerImageManifest string `json:"dockerImageManifest,omitempty"`
}
// ImageRepositoryList is a list of ImageRepository objects.
//
// ImageRepositoryList is DEPRECATED; use ImageStreamList instead.
type ImageRepositoryList struct {
kapi.TypeMeta `json:",inline"`
kapi.ListMeta `json:"metadata,omitempty"`
Items []ImageRepository `json:"items"`
}
// ImageStreamList is a list of ImageStream objects.
type ImageStreamList struct {
kapi.TypeMeta `json:",inline"`
kapi.ListMeta `json:"metadata,omitempty"`
Items []ImageStream `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.
//
// ImageRepository is DEPRECATED; use ImageStream instead.
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"`
}
// ImageStream stores a mapping of tags to images, metadata overrides that are applied
// when images are tagged in a stream, and an optional reference to a Docker image
// repository on a registry.
type ImageStream struct {
kapi.TypeMeta `json:",inline"`
kapi.ObjectMeta `json:"metadata,omitempty"`
// Spec describes the desired state of this stream
Spec ImageStreamSpec `json:"spec"`
// Status describes the current state of this stream
Status ImageStreamStatus `json:"status,omitempty"`
}
// ImageStreamSpec represents options for ImageStreams.
type ImageStreamSpec struct {
// Optional, if specified this stream is backed by a Docker repository on this server
DockerImageRepository string `json:"dockerImageRepository,omitempty"`
// Tags map arbitrary string values to specific image locators
Tags []NamedTagReference `json:"tags,omitempty"`
}
// NamedTagReference allows a user to TODO.
type NamedTagReference struct {
Name string `json:"name"`
Annotations map[string]string `json:"annotations,omitempty"`
DockerImageReference string `json:"dockerImageReference,omitempty"`
From *kapi.ObjectReference `json:"from,omitempty"`
}
// ImageRepositoryStatus contains information about the state of this image repository.
//
// ImageRepositoryStatus is DEPRECATED; use ImageStreamStatus instead.
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"`
// A historical record of images associated with each tag. The first entry in the TagEvent array is
// the currently tagged image.
Tags []NamedTagEventList `json:"tags,omitempty"`
}
// ImageStreamStatus contains information about the state of this image stream.
type ImageStreamStatus struct {
// Represents the effective location this stream may be accessed at. May be empty until the server
// determines where the repository is located
DockerImageRepository string `json:"dockerImageRepository"`
// A historical record of images associated with each tag. The first entry in the TagEvent array is
// the currently tagged image.
Tags []NamedTagEventList `json:"tags,omitempty"`
}
// NamedTagEventList relates a tag to its image history.
type NamedTagEventList struct {
Tag string `json:"tag"`
Items []TagEvent `json:"items"`
}
// TagEvent is used by ImageRepositoryStatus to keep a historical record of images associated with a tag.
type TagEvent struct {
// When the TagEvent was created
Created util.Time `json:"created"`
// The string that can be used to pull this image
DockerImageReference string `json:"dockerImageReference"`
// The image
Image string `json:"image"`
}
// 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.
//
// ImageRepositoryMapping is DEPRECATED; use ImageStreamMapping instead.
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"`
}
// ImageStreamMapping 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 ImageStreamMapping 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"`
}
// ImageRepositoryTag exists to allow calls to `osc get imageRepositoryTag ...` to function.
//
// ImageRepositoryTag is DEPRECATED; use ImageStreamTag instead.
type ImageRepositoryTag struct {
Image `json:",inline"`
}
// ImageStreamTag exists to allow calls to `osc get imageStreamTag ...` to function.
type ImageStreamTag struct {
Image `json:",inline"`
ImageName string `json:"imageName"`
}
// ImageStreamImage exists to allow calls to `osc get imageStreamImage ...` to function.
type ImageStreamImage struct {
Image `json:",inline"`
}
// DockerImageReference points to a Docker image.
type DockerImageReference struct {
Registry string
Namespace string
Name string
Tag string
ID string
}