Skip to content

Commit 69a28e6

Browse files
committed
modified v1alpha1 internalreleaseimage status to use the same structure adopted for the MCN status field
1 parent b91c71a commit 69a28e6

15 files changed

+407
-229
lines changed

machineconfiguration/v1/types_machineconfignode.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ type MachineConfigNodeStatusInternalReleaseImage struct {
172172
// releases is a list of the release bundles currently owned and managed by the
173173
// cluster, indicating that their images can be safely pulled by any cluster entity
174174
// requiring them.
175+
// Entries must be unique, keyed on the name field.
175176
// This field can contain between 1 and 5 entries.
176177
// +listType=map
177178
// +listMapKey=name

machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-Hypershift-CustomNoUpgrade.crd.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ spec:
363363
releases is a list of the release bundles currently owned and managed by the
364364
cluster, indicating that their images can be safely pulled by any cluster entity
365365
requiring them.
366+
Entries must be unique, keyed on the name field.
366367
This field can contain between 1 and 5 entries.
367368
items:
368369
description: |-

machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-SelfManagedHA-CustomNoUpgrade.crd.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ spec:
363363
releases is a list of the release bundles currently owned and managed by the
364364
cluster, indicating that their images can be safely pulled by any cluster entity
365365
requiring them.
366+
Entries must be unique, keyed on the name field.
366367
This field can contain between 1 and 5 entries.
367368
items:
368369
description: |-

machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-SelfManagedHA-DevPreviewNoUpgrade.crd.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ spec:
363363
releases is a list of the release bundles currently owned and managed by the
364364
cluster, indicating that their images can be safely pulled by any cluster entity
365365
requiring them.
366+
Entries must be unique, keyed on the name field.
366367
This field can contain between 1 and 5 entries.
367368
items:
368369
description: |-

machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes-SelfManagedHA-TechPreviewNoUpgrade.crd.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ spec:
363363
releases is a list of the release bundles currently owned and managed by the
364364
cluster, indicating that their images can be safely pulled by any cluster entity
365365
requiring them.
366+
Entries must be unique, keyed on the name field.
366367
This field can contain between 1 and 5 entries.
367368
items:
368369
description: |-

machineconfiguration/v1/zz_generated.featuregated-crd-manifests/machineconfignodes.machineconfiguration.openshift.io/NoRegistryClusterOperations.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ spec:
294294
releases is a list of the release bundles currently owned and managed by the
295295
cluster, indicating that their images can be safely pulled by any cluster entity
296296
requiring them.
297+
Entries must be unique, keyed on the name field.
297298
This field can contain between 1 and 5 entries.
298299
items:
299300
description: |-

machineconfiguration/v1/zz_generated.swagger_doc_generated.go

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

machineconfiguration/v1alpha1/types_internalreleaseimage.go

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ type InternalReleaseImage struct {
4242
type InternalReleaseImageSpec struct {
4343
// releases is a list of release bundle identifiers that the user wants to
4444
// add/remove to/from the control plane nodes.
45+
// Entries must be unique, keyed on the name field.
4546
// This field can contain between 1 and 5 entries.
4647
// +kubebuilder:validation:MinItems=1
4748
// +kubebuilder:validation:MaxItems=5
@@ -63,39 +64,33 @@ type InternalReleaseImageRef struct {
6364

6465
// InternalReleaseImageStatus describes the current state of a InternalReleaseImage.
6566
type InternalReleaseImageStatus struct {
66-
// mountedReleases is a list of release bundle identifiers currently detected
67-
// from the ISO attached to one of the control plane nodes. Any reported identifier can
68-
// be used to amend the `spec.Releases` field to add a new release bundle to the cluster.
69-
// An empty value indicates that no ISOs are currently being detected on any control plane
70-
// node.
71-
// Must not exceed 5 entries.
72-
// +listType=map
73-
// +listMapKey=name
74-
// +kubebuilder:validation:MaxItems=5
75-
// +optional
76-
MountedReleases []InternalReleaseImageRef `json:"mountedReleases,omitempty"`
77-
78-
// availableReleases is a list of the release bundles currently owned and managed by the
67+
// releases is a list of the release bundles currently owned and managed by the
7968
// cluster, indicating that their images can be safely pulled by any cluster entity
8069
// requiring them.
70+
// Entries must be unique, keyed on the name field.
8171
// This field can contain between 1 and 5 entries.
8272
// +listType=map
8373
// +listMapKey=name
8474
// +kubebuilder:validation:MinItems=1
8575
// +kubebuilder:validation:MaxItems=5
86-
// +optional
87-
AvailableReleases []InternalReleaseImageDetailedRef `json:"availableReleases,omitempty"`
76+
// +required
77+
Releases []InternalReleaseImageStatusRef `json:"releases,omitempty"`
8878
}
8979

90-
// InternalReleaseImageDetailedRef is used to provide a more detailed reference for
91-
// a release bundle.
92-
type InternalReleaseImageDetailedRef struct {
80+
type InternalReleaseImageStatusRef struct {
81+
// conditions represent the observations of an internal release image current state. See InternalReleaseImageConditionType for the possible
82+
// type values.
83+
// +listType=map
84+
// +listMapKey=type
85+
// +kubebuilder:validation:MinItems=1
86+
// +kubebuilder:validation:MaxItems=5
87+
// +optional
88+
Conditions []metav1.Condition `json:"conditions,omitempty"`
9389
// name indicates the desired release bundle identifier. This field is required and must be between 1 and 64 characters long.
9490
// +kubebuilder:validation:MinLength=1
9591
// +kubebuilder:validation:MaxLength=64
9692
// +required
9793
Name string `json:"name,omitempty"`
98-
9994
// image is an OCP release image referenced by digest.
10095
// The format of the image pull spec is: host[:port][/namespace]/name@sha256:<digest>,
10196
// where the digest must be 64 characters long, and consist only of lowercase hexadecimal characters, a-f and 0-9.
@@ -108,6 +103,26 @@ type InternalReleaseImageDetailedRef struct {
108103
Image string `json:"image,omitempty"`
109104
}
110105

106+
// InternalReleaseImageConditionType is each possible state for each possible MachineConfigNodeStatusInternalReleaseImageRef
107+
// conditions type.
108+
// +enum
109+
type InternalReleaseImageConditionType string
110+
111+
const (
112+
// InternalReleaseImageConditionTypeMounted describes a new release, not yet installed, that has been discovered when an ISO has been attached to
113+
// the current node
114+
InternalReleaseImageConditionTypeMounted InternalReleaseImageConditionType = "Mounted"
115+
// InternalReleaseImageConditionTypeInstalling describes a new release that is getting installed on the current node. Due the size of the data
116+
// transfered, the operation could take several minutes
117+
InternalReleaseImageConditionTypeInstalling InternalReleaseImageConditionType = "Installing"
118+
// InternalReleaseImageConditionTypeAvailable describes a release that has been successfully installed on the current node, ready to be consumed
119+
InternalReleaseImageConditionTypeAvailable InternalReleaseImageConditionType = "Available"
120+
// InternalReleaseImageConditionTypeRemoving describes an existing release that is getting removed from the current node
121+
InternalReleaseImageConditionTypeRemoving InternalReleaseImageConditionType = "Removing"
122+
// InternalReleaseImageConditionTypeDegraded describes a failure for the current release
123+
InternalReleaseImageConditionTypeDegraded InternalReleaseImageConditionType = "Degraded"
124+
)
125+
111126
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
112127

113128
// InternalReleaseImageList is a list of InternalReleaseImage resources

machineconfiguration/v1alpha1/zz_generated.crd-manifests/0000_80_machine-config_01_internalreleaseimages-CustomNoUpgrade.crd.yaml

Lines changed: 71 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ spec:
5454
description: |-
5555
releases is a list of release bundle identifiers that the user wants to
5656
add/remove to/from the control plane nodes.
57+
Entries must be unique, keyed on the name field.
5758
This field can contain between 1 and 5 entries.
5859
items:
5960
description: |-
@@ -83,17 +84,80 @@ spec:
8384
description: status describes the last observed state of this internal
8485
release image.
8586
properties:
86-
availableReleases:
87+
releases:
8788
description: |-
88-
availableReleases is a list of the release bundles currently owned and managed by the
89+
releases is a list of the release bundles currently owned and managed by the
8990
cluster, indicating that their images can be safely pulled by any cluster entity
9091
requiring them.
92+
Entries must be unique, keyed on the name field.
9193
This field can contain between 1 and 5 entries.
9294
items:
93-
description: |-
94-
InternalReleaseImageDetailedRef is used to provide a more detailed reference for
95-
a release bundle.
9695
properties:
96+
conditions:
97+
description: |-
98+
conditions represent the observations of an internal release image current state. See InternalReleaseImageConditionType for the possible
99+
type values.
100+
items:
101+
description: Condition contains details for one aspect of
102+
the current state of this API Resource.
103+
properties:
104+
lastTransitionTime:
105+
description: |-
106+
lastTransitionTime is the last time the condition transitioned from one status to another.
107+
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
108+
format: date-time
109+
type: string
110+
message:
111+
description: |-
112+
message is a human readable message indicating details about the transition.
113+
This may be an empty string.
114+
maxLength: 32768
115+
type: string
116+
observedGeneration:
117+
description: |-
118+
observedGeneration represents the .metadata.generation that the condition was set based upon.
119+
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
120+
with respect to the current state of the instance.
121+
format: int64
122+
minimum: 0
123+
type: integer
124+
reason:
125+
description: |-
126+
reason contains a programmatic identifier indicating the reason for the condition's last transition.
127+
Producers of specific condition types may define expected values and meanings for this field,
128+
and whether the values are considered a guaranteed API.
129+
The value should be a CamelCase string.
130+
This field may not be empty.
131+
maxLength: 1024
132+
minLength: 1
133+
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
134+
type: string
135+
status:
136+
description: status of the condition, one of True, False,
137+
Unknown.
138+
enum:
139+
- "True"
140+
- "False"
141+
- Unknown
142+
type: string
143+
type:
144+
description: type of condition in CamelCase or in foo.example.com/CamelCase.
145+
maxLength: 316
146+
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
147+
type: string
148+
required:
149+
- lastTransitionTime
150+
- message
151+
- reason
152+
- status
153+
- type
154+
type: object
155+
maxItems: 5
156+
minItems: 1
157+
type: array
158+
x-kubernetes-list-map-keys:
159+
- type
160+
x-kubernetes-list-type: map
97161
image:
98162
description: |-
99163
image is an OCP release image referenced by digest.
@@ -127,34 +191,8 @@ spec:
127191
x-kubernetes-list-map-keys:
128192
- name
129193
x-kubernetes-list-type: map
130-
mountedReleases:
131-
description: |-
132-
mountedReleases is a list of release bundle identifiers currently detected
133-
from the ISO attached to one of the control plane nodes. Any reported identifier can
134-
be used to amend the `spec.Releases` field to add a new release bundle to the cluster.
135-
An empty value indicates that no ISOs are currently being detected on any control plane
136-
node.
137-
Must not exceed 5 entries.
138-
items:
139-
description: |-
140-
InternalReleaseImageRef is used to provide a simple reference for a release
141-
bundle. Currently it contains only the name field.
142-
properties:
143-
name:
144-
description: name indicates the desired release bundle identifier.
145-
This field is required and must be between 1 and 64 characters
146-
long.
147-
maxLength: 64
148-
minLength: 1
149-
type: string
150-
required:
151-
- name
152-
type: object
153-
maxItems: 5
154-
type: array
155-
x-kubernetes-list-map-keys:
156-
- name
157-
x-kubernetes-list-type: map
194+
required:
195+
- releases
158196
type: object
159197
required:
160198
- spec

0 commit comments

Comments
 (0)