Skip to content

Commit 181b286

Browse files
committed
modified v1alpha1 internalreleaseimage status to use the same structure adopted for the MCN status field
1 parent 46c438a commit 181b286

File tree

24 files changed

+1424
-315
lines changed

24 files changed

+1424
-315
lines changed

hack/update-payload-crds.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ crd_globs="\
2424
config/v1/zz_generated.crd-manifests/0000_10_openshift-controller-manager_01_builds*.crd.yaml
2525
operator/v1/zz_generated.crd-manifests/0000_50_openshift-controller-manager_02_openshiftcontrollermanagers*.crd.yaml
2626
machineconfiguration/v1/zz_generated.crd-manifests/*.crd.yaml
27+
machineconfiguration/v1alpha1/zz_generated.crd-manifests/0000_80_machine-config_01_internalreleaseimages-*.crd.yaml
2728
operator/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigurations*.crd.yaml
2829
config/v1alpha1/zz_generated.crd-manifests/0000_10_config-operator_01_clustermonitoring*.crd.yaml
2930
operator/v1/zz_generated.crd-manifests/*_storage_01_storages*.crd.yaml

machineconfiguration/v1/types_machineconfignode.go

Lines changed: 15 additions & 7 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
@@ -183,10 +184,16 @@ type MachineConfigNodeStatusInternalReleaseImage struct {
183184

184185
// MachineConfigNodeStatusInternalReleaseImageRef is used to provide a more detailed reference for
185186
// a release bundle.
186-
// +openshift:enable:FeatureGate=NoRegistryClusterOperations
187187
type MachineConfigNodeStatusInternalReleaseImageRef struct {
188-
// conditions represent the observations of an internal release image current state. See InternalReleaseImageConditionType for the possible
189-
// type values.
188+
// conditions represent the observations of an internal release image current state. Valid types are:
189+
// Mounted, Installing, Available, Removing and Degraded.
190+
//
191+
// If Mounted is true, that means that a a valid ISO has been mounted on the current node.
192+
// If Installing is true, that means that a new release bundle is currently being copied on the current node, and not yet completed.
193+
// If Available is true, it means that the release has been previously installed on the current node, and it can be used.
194+
// If Removing is true, it means that a release deletion is in progress on the current node, and not yet completed.
195+
// If Degraded is true, that means something has gone wrong in the current node.
196+
//
190197
// +listType=map
191198
// +listMapKey=type
192199
// +kubebuilder:validation:MinItems=1
@@ -201,12 +208,13 @@ type MachineConfigNodeStatusInternalReleaseImageRef struct {
201208
// image is an OCP release image referenced by digest.
202209
// The format of the image pull spec is: host[:port][/namespace]/name@sha256:<digest>,
203210
// where the digest must be 64 characters long, and consist only of lowercase hexadecimal characters, a-f and 0-9.
204-
// The length of the whole spec must be between 1 to 447 characters.
211+
// The length of the whole spec must be between 0 to 447 characters.
212+
// The field is optional, and it will be provided after a release will be successfully installed.
205213
// +kubebuilder:validation:MinLength=1
206214
// +kubebuilder:validation:MaxLength=447
207-
// +kubebuilder:validation:XValidation:rule=`(self.split('@').size() == 2 && self.split('@')[1].matches('^sha256:[a-f0-9]{64}$'))`,message="the OCI Image reference must end with a valid '@sha256:<digest>' suffix, where '<digest>' is 64 characters long"
208-
// +kubebuilder:validation:XValidation:rule=`(self.split('@')[0].matches('^([a-zA-Z0-9-]+\\.)+[a-zA-Z0-9-]+(:[0-9]{2,5})?/([a-zA-Z0-9-_]{0,61}/)?[a-zA-Z0-9-_.]*?$'))`,message="the OCI Image name should follow the host[:port][/namespace]/name format, resembling a valid URL without the scheme"
209-
// +required
215+
// +kubebuilder:validation:XValidation:rule=`self == '' || (self.split('@').size() == 2 && self.split('@')[1].matches('^sha256:[a-f0-9]{64}$'))`,message="the OCI Image reference must end with a valid '@sha256:<digest>' suffix, where '<digest>' is 64 characters long"
216+
// +kubebuilder:validation:XValidation:rule=`self == '' || (self.split('@')[0].matches('^([a-zA-Z0-9-]+\\.)+[a-zA-Z0-9-]+(:[0-9]{2,5})?/([a-zA-Z0-9-_]{0,61}/)?[a-zA-Z0-9-_.]*?$'))`,message="the OCI Image name should follow the host[:port][/namespace]/name format, resembling a valid URL without the scheme"
217+
// +optional
210218
Image string `json:"image,omitempty"`
211219
}
212220

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

Lines changed: 13 additions & 6 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: |-
@@ -371,8 +372,14 @@ spec:
371372
properties:
372373
conditions:
373374
description: |-
374-
conditions represent the observations of an internal release image current state. See InternalReleaseImageConditionType for the possible
375-
type values.
375+
conditions represent the observations of an internal release image current state. Valid types are:
376+
Mounted, Installing, Available, Removing and Degraded.
377+
378+
If Mounted is true, that means that a a valid ISO has been mounted on the current node.
379+
If Installing is true, that means that a new release bundle is currently being copied on the current node, and not yet completed.
380+
If Available is true, it means that the release has been previously installed on the current node, and it can be used.
381+
If Removing is true, it means that a release deletion is in progress on the current node, and not yet completed.
382+
If Degraded is true, that means something has gone wrong in the current node.
376383
items:
377384
description: Condition contains details for one aspect
378385
of the current state of this API Resource.
@@ -440,18 +447,19 @@ spec:
440447
image is an OCP release image referenced by digest.
441448
The format of the image pull spec is: host[:port][/namespace]/name@sha256:<digest>,
442449
where the digest must be 64 characters long, and consist only of lowercase hexadecimal characters, a-f and 0-9.
443-
The length of the whole spec must be between 1 to 447 characters.
450+
The length of the whole spec must be between 0 to 447 characters.
451+
The field is optional, and it will be provided after a release will be successfully installed.
444452
maxLength: 447
445453
minLength: 1
446454
type: string
447455
x-kubernetes-validations:
448456
- message: the OCI Image reference must end with a valid
449457
'@sha256:<digest>' suffix, where '<digest>' is 64 characters
450458
long
451-
rule: (self.split('@').size() == 2 && self.split('@')[1].matches('^sha256:[a-f0-9]{64}$'))
459+
rule: self == '' || (self.split('@').size() == 2 && self.split('@')[1].matches('^sha256:[a-f0-9]{64}$'))
452460
- message: the OCI Image name should follow the host[:port][/namespace]/name
453461
format, resembling a valid URL without the scheme
454-
rule: (self.split('@')[0].matches('^([a-zA-Z0-9-]+\\.)+[a-zA-Z0-9-]+(:[0-9]{2,5})?/([a-zA-Z0-9-_]{0,61}/)?[a-zA-Z0-9-_.]*?$'))
462+
rule: self == '' || (self.split('@')[0].matches('^([a-zA-Z0-9-]+\\.)+[a-zA-Z0-9-]+(:[0-9]{2,5})?/([a-zA-Z0-9-_]{0,61}/)?[a-zA-Z0-9-_.]*?$'))
455463
name:
456464
description: name indicates the desired release bundle identifier.
457465
This field is required and must be between 1 and 64 characters
@@ -460,7 +468,6 @@ spec:
460468
minLength: 1
461469
type: string
462470
required:
463-
- image
464471
- name
465472
type: object
466473
maxItems: 5

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

Lines changed: 13 additions & 6 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: |-
@@ -371,8 +372,14 @@ spec:
371372
properties:
372373
conditions:
373374
description: |-
374-
conditions represent the observations of an internal release image current state. See InternalReleaseImageConditionType for the possible
375-
type values.
375+
conditions represent the observations of an internal release image current state. Valid types are:
376+
Mounted, Installing, Available, Removing and Degraded.
377+
378+
If Mounted is true, that means that a a valid ISO has been mounted on the current node.
379+
If Installing is true, that means that a new release bundle is currently being copied on the current node, and not yet completed.
380+
If Available is true, it means that the release has been previously installed on the current node, and it can be used.
381+
If Removing is true, it means that a release deletion is in progress on the current node, and not yet completed.
382+
If Degraded is true, that means something has gone wrong in the current node.
376383
items:
377384
description: Condition contains details for one aspect
378385
of the current state of this API Resource.
@@ -440,18 +447,19 @@ spec:
440447
image is an OCP release image referenced by digest.
441448
The format of the image pull spec is: host[:port][/namespace]/name@sha256:<digest>,
442449
where the digest must be 64 characters long, and consist only of lowercase hexadecimal characters, a-f and 0-9.
443-
The length of the whole spec must be between 1 to 447 characters.
450+
The length of the whole spec must be between 0 to 447 characters.
451+
The field is optional, and it will be provided after a release will be successfully installed.
444452
maxLength: 447
445453
minLength: 1
446454
type: string
447455
x-kubernetes-validations:
448456
- message: the OCI Image reference must end with a valid
449457
'@sha256:<digest>' suffix, where '<digest>' is 64 characters
450458
long
451-
rule: (self.split('@').size() == 2 && self.split('@')[1].matches('^sha256:[a-f0-9]{64}$'))
459+
rule: self == '' || (self.split('@').size() == 2 && self.split('@')[1].matches('^sha256:[a-f0-9]{64}$'))
452460
- message: the OCI Image name should follow the host[:port][/namespace]/name
453461
format, resembling a valid URL without the scheme
454-
rule: (self.split('@')[0].matches('^([a-zA-Z0-9-]+\\.)+[a-zA-Z0-9-]+(:[0-9]{2,5})?/([a-zA-Z0-9-_]{0,61}/)?[a-zA-Z0-9-_.]*?$'))
462+
rule: self == '' || (self.split('@')[0].matches('^([a-zA-Z0-9-]+\\.)+[a-zA-Z0-9-]+(:[0-9]{2,5})?/([a-zA-Z0-9-_]{0,61}/)?[a-zA-Z0-9-_.]*?$'))
455463
name:
456464
description: name indicates the desired release bundle identifier.
457465
This field is required and must be between 1 and 64 characters
@@ -460,7 +468,6 @@ spec:
460468
minLength: 1
461469
type: string
462470
required:
463-
- image
464471
- name
465472
type: object
466473
maxItems: 5

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

Lines changed: 13 additions & 6 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: |-
@@ -371,8 +372,14 @@ spec:
371372
properties:
372373
conditions:
373374
description: |-
374-
conditions represent the observations of an internal release image current state. See InternalReleaseImageConditionType for the possible
375-
type values.
375+
conditions represent the observations of an internal release image current state. Valid types are:
376+
Mounted, Installing, Available, Removing and Degraded.
377+
378+
If Mounted is true, that means that a a valid ISO has been mounted on the current node.
379+
If Installing is true, that means that a new release bundle is currently being copied on the current node, and not yet completed.
380+
If Available is true, it means that the release has been previously installed on the current node, and it can be used.
381+
If Removing is true, it means that a release deletion is in progress on the current node, and not yet completed.
382+
If Degraded is true, that means something has gone wrong in the current node.
376383
items:
377384
description: Condition contains details for one aspect
378385
of the current state of this API Resource.
@@ -440,18 +447,19 @@ spec:
440447
image is an OCP release image referenced by digest.
441448
The format of the image pull spec is: host[:port][/namespace]/name@sha256:<digest>,
442449
where the digest must be 64 characters long, and consist only of lowercase hexadecimal characters, a-f and 0-9.
443-
The length of the whole spec must be between 1 to 447 characters.
450+
The length of the whole spec must be between 0 to 447 characters.
451+
The field is optional, and it will be provided after a release will be successfully installed.
444452
maxLength: 447
445453
minLength: 1
446454
type: string
447455
x-kubernetes-validations:
448456
- message: the OCI Image reference must end with a valid
449457
'@sha256:<digest>' suffix, where '<digest>' is 64 characters
450458
long
451-
rule: (self.split('@').size() == 2 && self.split('@')[1].matches('^sha256:[a-f0-9]{64}$'))
459+
rule: self == '' || (self.split('@').size() == 2 && self.split('@')[1].matches('^sha256:[a-f0-9]{64}$'))
452460
- message: the OCI Image name should follow the host[:port][/namespace]/name
453461
format, resembling a valid URL without the scheme
454-
rule: (self.split('@')[0].matches('^([a-zA-Z0-9-]+\\.)+[a-zA-Z0-9-]+(:[0-9]{2,5})?/([a-zA-Z0-9-_]{0,61}/)?[a-zA-Z0-9-_.]*?$'))
462+
rule: self == '' || (self.split('@')[0].matches('^([a-zA-Z0-9-]+\\.)+[a-zA-Z0-9-]+(:[0-9]{2,5})?/([a-zA-Z0-9-_]{0,61}/)?[a-zA-Z0-9-_.]*?$'))
455463
name:
456464
description: name indicates the desired release bundle identifier.
457465
This field is required and must be between 1 and 64 characters
@@ -460,7 +468,6 @@ spec:
460468
minLength: 1
461469
type: string
462470
required:
463-
- image
464471
- name
465472
type: object
466473
maxItems: 5

0 commit comments

Comments
 (0)