Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config/v1: New Release type for ClusterVersionStatus #521

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -162,28 +162,29 @@ spec:
channel has been specified.
type: array
items:
description: Update represents a release of the ClusterVersionOperator,
referenced by the Image member.
description: Release represents an OpenShift release image and associated
metadata.
type: object
properties:
force:
description: "force allows an administrator to update to an image
that has failed verification, does not appear in the availableUpdates
list, or otherwise would be blocked by normal protections on
update. This option should only be used when the authenticity
of the provided image has been verified out of band because
the provided image will run with full administrative access
to the cluster. Do not use this flag with images that comes
from unknown or potentially malicious sources. \n This flag
does not override other forms of consistency checking that are
required before a new update is deployed."
type: boolean
channels:
description: channels is the set of Cincinnati channels to which
the release currently belongs.
type: array
items:
type: string
image:
description: image is a container image location that contains
the update. When this field is part of spec, image is optional
if version is specified and the availableUpdates field contains
a matching version.
type: string
url:
description: url contains information about this release. This
URL is set by the 'url' metadata property on a release or the
metadata returned by the update API and should be displayed
as a link in user interfaces. The URL field may not be set for
test or nightly releases.
type: string
version:
description: version is a semantic versioning identifying the
update version. When this field is part of spec, version is
Expand Down Expand Up @@ -234,24 +235,25 @@ spec:
tag.
type: object
properties:
force:
description: "force allows an administrator to update to an image
that has failed verification, does not appear in the availableUpdates
list, or otherwise would be blocked by normal protections on update.
This option should only be used when the authenticity of the provided
image has been verified out of band because the provided image
will run with full administrative access to the cluster. Do not
use this flag with images that comes from unknown or potentially
malicious sources. \n This flag does not override other forms
of consistency checking that are required before a new update
is deployed."
type: boolean
channels:
description: channels is the set of Cincinnati channels to which
the release currently belongs.
type: array
items:
type: string
image:
description: image is a container image location that contains the
update. When this field is part of spec, image is optional if
version is specified and the availableUpdates field contains a
matching version.
type: string
url:
description: url contains information about this release. This URL
is set by the 'url' metadata property on a release or the metadata
returned by the update API and should be displayed as a link in
user interfaces. The URL field may not be set for test or nightly
releases.
type: string
version:
description: version is a semantic versioning identifying the update
version. When this field is part of spec, version is optional
Expand Down
35 changes: 31 additions & 4 deletions config/v1/types_cluster_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ type ClusterVersionStatus struct {
// with the information available, which may be an image or a tag.
// +kubebuilder:validation:Required
// +required
Desired Update `json:"desired"`
Desired Release `json:"desired"`

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

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

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

// Release represents an OpenShift release image and associated metadata.
// +k8s:deepcopy-gen=true
type Release struct {
// version is a semantic versioning identifying the update version. When this
// field is part of spec, version is optional if image is specified.
// +required
Version string `json:"version"`

// image is a container image location that contains the update. When this
// field is part of spec, image is optional if version is specified and the
// availableUpdates field contains a matching version.
// +required
Image string `json:"image"`

// url contains information about this release. This URL is set by
// the 'url' metadata property on a release or the metadata returned by
// the update API and should be displayed as a link in user
// interfaces. The URL field may not be set for test or nightly
// releases.
// +optional
URL URL `json:"url,omitempty"`

// channels is the set of Cincinnati channels to which the release
// currently belongs.
// +optional
Channels []string `json:"channels,omitempty"`
}

// RetrievedUpdates reports whether available updates have been retrieved from
// the upstream update server. The condition is Unknown before retrieval, False
// if the updates could not be retrieved or recently failed, or True if the
Expand Down
29 changes: 26 additions & 3 deletions config/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 13 additions & 1 deletion config/v1/zz_generated.swagger_doc_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.