Skip to content

Commit e4169d2

Browse files
committed
modified v1alpha1 internalreleaseimage status to use the same structure adopted for the MCN status field
1 parent c3b0c0e commit e4169d2

File tree

21 files changed

+662
-308
lines changed

21 files changed

+662
-308
lines changed

machineconfiguration/v1/types_machineconfignode.go

Lines changed: 8 additions & 6 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
@@ -201,13 +202,14 @@ type MachineConfigNodeStatusInternalReleaseImageRef struct {
201202
// image is an OCP release image referenced by digest.
202203
// The format of the image pull spec is: host[:port][/namespace]/name@sha256:<digest>,
203204
// 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.
205-
// +kubebuilder:validation:MinLength=1
205+
// The length of the whole spec must be between 0 to 447 characters.
206+
// The field is optional, and it will be provided after a release will be successfully installed.
207+
// +kubebuilder:validation:MinLength=0
206208
// +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
210-
Image string `json:"image,omitempty"`
209+
// +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"
210+
// +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"
211+
// +optional
212+
Image *string `json:"image,omitempty"`
211213
}
212214

213215
// InternalReleaseImageConditionType is each possible state for each possible MachineConfigNodeStatusInternalReleaseImageRef

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

Lines changed: 6 additions & 5 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: |-
@@ -440,18 +441,19 @@ spec:
440441
image is an OCP release image referenced by digest.
441442
The format of the image pull spec is: host[:port][/namespace]/name@sha256:<digest>,
442443
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.
444+
The length of the whole spec must be between 0 to 447 characters.
445+
The field is optional, and it will be provided after a release will be successfully installed.
444446
maxLength: 447
445-
minLength: 1
447+
minLength: 0
446448
type: string
447449
x-kubernetes-validations:
448450
- message: the OCI Image reference must end with a valid
449451
'@sha256:<digest>' suffix, where '<digest>' is 64 characters
450452
long
451-
rule: (self.split('@').size() == 2 && self.split('@')[1].matches('^sha256:[a-f0-9]{64}$'))
453+
rule: self == '' || (self.split('@').size() == 2 && self.split('@')[1].matches('^sha256:[a-f0-9]{64}$'))
452454
- message: the OCI Image name should follow the host[:port][/namespace]/name
453455
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-_.]*?$'))
456+
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-_.]*?$'))
455457
name:
456458
description: name indicates the desired release bundle identifier.
457459
This field is required and must be between 1 and 64 characters
@@ -460,7 +462,6 @@ spec:
460462
minLength: 1
461463
type: string
462464
required:
463-
- image
464465
- name
465466
type: object
466467
maxItems: 5

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

Lines changed: 6 additions & 5 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: |-
@@ -440,18 +441,19 @@ spec:
440441
image is an OCP release image referenced by digest.
441442
The format of the image pull spec is: host[:port][/namespace]/name@sha256:<digest>,
442443
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.
444+
The length of the whole spec must be between 0 to 447 characters.
445+
The field is optional, and it will be provided after a release will be successfully installed.
444446
maxLength: 447
445-
minLength: 1
447+
minLength: 0
446448
type: string
447449
x-kubernetes-validations:
448450
- message: the OCI Image reference must end with a valid
449451
'@sha256:<digest>' suffix, where '<digest>' is 64 characters
450452
long
451-
rule: (self.split('@').size() == 2 && self.split('@')[1].matches('^sha256:[a-f0-9]{64}$'))
453+
rule: self == '' || (self.split('@').size() == 2 && self.split('@')[1].matches('^sha256:[a-f0-9]{64}$'))
452454
- message: the OCI Image name should follow the host[:port][/namespace]/name
453455
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-_.]*?$'))
456+
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-_.]*?$'))
455457
name:
456458
description: name indicates the desired release bundle identifier.
457459
This field is required and must be between 1 and 64 characters
@@ -460,7 +462,6 @@ spec:
460462
minLength: 1
461463
type: string
462464
required:
463-
- image
464465
- name
465466
type: object
466467
maxItems: 5

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

Lines changed: 6 additions & 5 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: |-
@@ -440,18 +441,19 @@ spec:
440441
image is an OCP release image referenced by digest.
441442
The format of the image pull spec is: host[:port][/namespace]/name@sha256:<digest>,
442443
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.
444+
The length of the whole spec must be between 0 to 447 characters.
445+
The field is optional, and it will be provided after a release will be successfully installed.
444446
maxLength: 447
445-
minLength: 1
447+
minLength: 0
446448
type: string
447449
x-kubernetes-validations:
448450
- message: the OCI Image reference must end with a valid
449451
'@sha256:<digest>' suffix, where '<digest>' is 64 characters
450452
long
451-
rule: (self.split('@').size() == 2 && self.split('@')[1].matches('^sha256:[a-f0-9]{64}$'))
453+
rule: self == '' || (self.split('@').size() == 2 && self.split('@')[1].matches('^sha256:[a-f0-9]{64}$'))
452454
- message: the OCI Image name should follow the host[:port][/namespace]/name
453455
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-_.]*?$'))
456+
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-_.]*?$'))
455457
name:
456458
description: name indicates the desired release bundle identifier.
457459
This field is required and must be between 1 and 64 characters
@@ -460,7 +462,6 @@ spec:
460462
minLength: 1
461463
type: string
462464
required:
463-
- image
464465
- name
465466
type: object
466467
maxItems: 5

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

Lines changed: 6 additions & 5 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: |-
@@ -440,18 +441,19 @@ spec:
440441
image is an OCP release image referenced by digest.
441442
The format of the image pull spec is: host[:port][/namespace]/name@sha256:<digest>,
442443
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.
444+
The length of the whole spec must be between 0 to 447 characters.
445+
The field is optional, and it will be provided after a release will be successfully installed.
444446
maxLength: 447
445-
minLength: 1
447+
minLength: 0
446448
type: string
447449
x-kubernetes-validations:
448450
- message: the OCI Image reference must end with a valid
449451
'@sha256:<digest>' suffix, where '<digest>' is 64 characters
450452
long
451-
rule: (self.split('@').size() == 2 && self.split('@')[1].matches('^sha256:[a-f0-9]{64}$'))
453+
rule: self == '' || (self.split('@').size() == 2 && self.split('@')[1].matches('^sha256:[a-f0-9]{64}$'))
452454
- message: the OCI Image name should follow the host[:port][/namespace]/name
453455
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-_.]*?$'))
456+
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-_.]*?$'))
455457
name:
456458
description: name indicates the desired release bundle identifier.
457459
This field is required and must be between 1 and 64 characters
@@ -460,7 +462,6 @@ spec:
460462
minLength: 1
461463
type: string
462464
required:
463-
- image
464465
- name
465466
type: object
466467
maxItems: 5

machineconfiguration/v1/zz_generated.deepcopy.go

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

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

Lines changed: 6 additions & 5 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: |-
@@ -371,18 +372,19 @@ spec:
371372
image is an OCP release image referenced by digest.
372373
The format of the image pull spec is: host[:port][/namespace]/name@sha256:<digest>,
373374
where the digest must be 64 characters long, and consist only of lowercase hexadecimal characters, a-f and 0-9.
374-
The length of the whole spec must be between 1 to 447 characters.
375+
The length of the whole spec must be between 0 to 447 characters.
376+
The field is optional, and it will be provided after a release will be successfully installed.
375377
maxLength: 447
376-
minLength: 1
378+
minLength: 0
377379
type: string
378380
x-kubernetes-validations:
379381
- message: the OCI Image reference must end with a valid
380382
'@sha256:<digest>' suffix, where '<digest>' is 64 characters
381383
long
382-
rule: (self.split('@').size() == 2 && self.split('@')[1].matches('^sha256:[a-f0-9]{64}$'))
384+
rule: self == '' || (self.split('@').size() == 2 && self.split('@')[1].matches('^sha256:[a-f0-9]{64}$'))
383385
- message: the OCI Image name should follow the host[:port][/namespace]/name
384386
format, resembling a valid URL without the scheme
385-
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-_.]*?$'))
387+
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-_.]*?$'))
386388
name:
387389
description: name indicates the desired release bundle identifier.
388390
This field is required and must be between 1 and 64 characters
@@ -391,7 +393,6 @@ spec:
391393
minLength: 1
392394
type: string
393395
required:
394-
- image
395396
- name
396397
type: object
397398
maxItems: 5

machineconfiguration/v1/zz_generated.swagger_doc_generated.go

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

0 commit comments

Comments
 (0)