Skip to content

Commit 3ae6754

Browse files
Merge pull request #521 from wking/available-release-metadata
config/v1: New Release type for ClusterVersionStatus
2 parents 2f8fc61 + 575f8d2 commit 3ae6754

File tree

4 files changed

+98
-34
lines changed

4 files changed

+98
-34
lines changed

config/v1/0000_00_cluster-version-operator_01_clusterversion.crd.yaml

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -162,28 +162,29 @@ spec:
162162
channel has been specified.
163163
type: array
164164
items:
165-
description: Update represents a release of the ClusterVersionOperator,
166-
referenced by the Image member.
165+
description: Release represents an OpenShift release image and associated
166+
metadata.
167167
type: object
168168
properties:
169-
force:
170-
description: "force allows an administrator to update to an image
171-
that has failed verification, does not appear in the availableUpdates
172-
list, or otherwise would be blocked by normal protections on
173-
update. This option should only be used when the authenticity
174-
of the provided image has been verified out of band because
175-
the provided image will run with full administrative access
176-
to the cluster. Do not use this flag with images that comes
177-
from unknown or potentially malicious sources. \n This flag
178-
does not override other forms of consistency checking that are
179-
required before a new update is deployed."
180-
type: boolean
169+
channels:
170+
description: channels is the set of Cincinnati channels to which
171+
the release currently belongs.
172+
type: array
173+
items:
174+
type: string
181175
image:
182176
description: image is a container image location that contains
183177
the update. When this field is part of spec, image is optional
184178
if version is specified and the availableUpdates field contains
185179
a matching version.
186180
type: string
181+
url:
182+
description: url contains information about this release. This
183+
URL is set by the 'url' metadata property on a release or the
184+
metadata returned by the update API and should be displayed
185+
as a link in user interfaces. The URL field may not be set for
186+
test or nightly releases.
187+
type: string
187188
version:
188189
description: version is a semantic versioning identifying the
189190
update version. When this field is part of spec, version is
@@ -234,24 +235,25 @@ spec:
234235
tag.
235236
type: object
236237
properties:
237-
force:
238-
description: "force allows an administrator to update to an image
239-
that has failed verification, does not appear in the availableUpdates
240-
list, or otherwise would be blocked by normal protections on update.
241-
This option should only be used when the authenticity of the provided
242-
image has been verified out of band because the provided image
243-
will run with full administrative access to the cluster. Do not
244-
use this flag with images that comes from unknown or potentially
245-
malicious sources. \n This flag does not override other forms
246-
of consistency checking that are required before a new update
247-
is deployed."
248-
type: boolean
238+
channels:
239+
description: channels is the set of Cincinnati channels to which
240+
the release currently belongs.
241+
type: array
242+
items:
243+
type: string
249244
image:
250245
description: image is a container image location that contains the
251246
update. When this field is part of spec, image is optional if
252247
version is specified and the availableUpdates field contains a
253248
matching version.
254249
type: string
250+
url:
251+
description: url contains information about this release. This URL
252+
is set by the 'url' metadata property on a release or the metadata
253+
returned by the update API and should be displayed as a link in
254+
user interfaces. The URL field may not be set for test or nightly
255+
releases.
256+
type: string
255257
version:
256258
description: version is a semantic versioning identifying the update
257259
version. When this field is part of spec, version is optional

config/v1/types_cluster_version.go

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ type ClusterVersionStatus struct {
8484
// with the information available, which may be an image or a tag.
8585
// +kubebuilder:validation:Required
8686
// +required
87-
Desired Update `json:"desired"`
87+
Desired Release `json:"desired"`
8888

8989
// history contains a list of the most recent versions applied to the cluster.
9090
// This value may be empty during cluster startup, and then will be updated
@@ -127,7 +127,7 @@ type ClusterVersionStatus struct {
127127
// +nullable
128128
// +kubebuilder:validation:Required
129129
// +required
130-
AvailableUpdates []Update `json:"availableUpdates"`
130+
AvailableUpdates []Release `json:"availableUpdates"`
131131
}
132132

133133
// UpdateState is a constant representing whether an update was successfully
@@ -221,8 +221,7 @@ type ComponentOverride struct {
221221
// URL is a thin wrapper around string that ensures the string is a valid URL.
222222
type URL string
223223

224-
// Update represents a release of the ClusterVersionOperator, referenced by the
225-
// Image member.
224+
// Update represents an administrator update request.
226225
// +k8s:deepcopy-gen=true
227226
type Update struct {
228227
// version is a semantic versioning identifying the update version. When this
@@ -251,6 +250,34 @@ type Update struct {
251250
Force bool `json:"force"`
252251
}
253252

253+
// Release represents an OpenShift release image and associated metadata.
254+
// +k8s:deepcopy-gen=true
255+
type Release struct {
256+
// version is a semantic versioning identifying the update version. When this
257+
// field is part of spec, version is optional if image is specified.
258+
// +required
259+
Version string `json:"version"`
260+
261+
// image is a container image location that contains the update. When this
262+
// field is part of spec, image is optional if version is specified and the
263+
// availableUpdates field contains a matching version.
264+
// +required
265+
Image string `json:"image"`
266+
267+
// url contains information about this release. This URL is set by
268+
// the 'url' metadata property on a release or the metadata returned by
269+
// the update API and should be displayed as a link in user
270+
// interfaces. The URL field may not be set for test or nightly
271+
// releases.
272+
// +optional
273+
URL URL `json:"url,omitempty"`
274+
275+
// channels is the set of Cincinnati channels to which the release
276+
// currently belongs.
277+
// +optional
278+
Channels []string `json:"channels,omitempty"`
279+
}
280+
254281
// RetrievedUpdates reports whether available updates have been retrieved from
255282
// the upstream update server. The condition is Unknown before retrieval, False
256283
// if the updates could not be retrieved or recently failed, or True if the

config/v1/zz_generated.deepcopy.go

Lines changed: 26 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/v1/zz_generated.swagger_doc_generated.go

Lines changed: 13 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)