Skip to content

Commit 373ea71

Browse files
committed
extend supported values for MCN IRI image status field
1 parent 464776f commit 373ea71

12 files changed

Lines changed: 130 additions & 20 deletions

machineconfiguration/v1/tests/machineconfignodes.machineconfiguration.openshift.io/NoRegistryClusterInstall.yaml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,42 @@ tests:
5151
reason: "Degraded"
5252
message: ""
5353
lastTransitionTime: "2024-12-01T08:04:21Z"
54+
- name: ocp-release-bundle-4.19.0-x86_64
55+
image: localhost/openshift/release-images@sha256:e98795f7932441b30bb8bcfbbf05912875383fad1f2b3be08a22ec148d68607f
56+
conditions:
57+
- type: Mounted
58+
status: "False"
59+
reason: "Mounted"
60+
message: ""
61+
lastTransitionTime: "2024-12-01T08:04:30Z"
62+
- type: Available
63+
status: "True"
64+
reason: "Available"
65+
message: "Release ocp-release-bundle-4.19.0-x86_64 is currently available on node master-0"
66+
lastTransitionTime: "2024-12-01T08:04:30Z"
67+
- type: Degraded
68+
status: "False"
69+
reason: "Degraded"
70+
message: ""
71+
lastTransitionTime: "2024-12-01T08:04:30Z"
72+
- name: ocp-release-bundle-4.20.0-x86_64
73+
image: localhost.localdomain/openshift/release-images@sha256:f98795f7932441b30bb8bcfbbf05912875383fad1f2b3be08a22ec148d68607f
74+
conditions:
75+
- type: Mounted
76+
status: "False"
77+
reason: "Mounted"
78+
message: ""
79+
lastTransitionTime: "2024-12-01T08:04:40Z"
80+
- type: Available
81+
status: "True"
82+
reason: "Available"
83+
message: "Release ocp-release-bundle-4.20.0-x86_64 is currently available on node master-0"
84+
lastTransitionTime: "2024-12-01T08:04:40Z"
85+
- type: Degraded
86+
status: "False"
87+
reason: "Degraded"
88+
message: ""
89+
lastTransitionTime: "2024-12-01T08:04:40Z"
5490
expected: |
5591
apiVersion: machineconfiguration.openshift.io/v1
5692
kind: MachineConfigNode
@@ -84,3 +120,39 @@ tests:
84120
reason: "Degraded"
85121
message: ""
86122
lastTransitionTime: "2024-12-01T08:04:21Z"
123+
- name: ocp-release-bundle-4.19.0-x86_64
124+
image: localhost/openshift/release-images@sha256:e98795f7932441b30bb8bcfbbf05912875383fad1f2b3be08a22ec148d68607f
125+
conditions:
126+
- type: Mounted
127+
status: "False"
128+
reason: "Mounted"
129+
message: ""
130+
lastTransitionTime: "2024-12-01T08:04:30Z"
131+
- type: Available
132+
status: "True"
133+
reason: "Available"
134+
message: "Release ocp-release-bundle-4.19.0-x86_64 is currently available on node master-0"
135+
lastTransitionTime: "2024-12-01T08:04:30Z"
136+
- type: Degraded
137+
status: "False"
138+
reason: "Degraded"
139+
message: ""
140+
lastTransitionTime: "2024-12-01T08:04:30Z"
141+
- name: ocp-release-bundle-4.20.0-x86_64
142+
image: localhost.localdomain/openshift/release-images@sha256:f98795f7932441b30bb8bcfbbf05912875383fad1f2b3be08a22ec148d68607f
143+
conditions:
144+
- type: Mounted
145+
status: "False"
146+
reason: "Mounted"
147+
message: ""
148+
lastTransitionTime: "2024-12-01T08:04:40Z"
149+
- type: Available
150+
status: "True"
151+
reason: "Available"
152+
message: "Release ocp-release-bundle-4.20.0-x86_64 is currently available on node master-0"
153+
lastTransitionTime: "2024-12-01T08:04:40Z"
154+
- type: Degraded
155+
status: "False"
156+
reason: "Degraded"
157+
message: ""
158+
lastTransitionTime: "2024-12-01T08:04:40Z"

machineconfiguration/v1/types_machineconfignode.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,12 +211,14 @@ type MachineConfigNodeStatusInternalReleaseImageRef struct {
211211
// image is an OCP release image referenced by digest.
212212
// The format of the image pull spec is: host[:port][/namespace]/name@sha256:<digest>,
213213
// where the digest must be 64 characters long, and consist only of lowercase hexadecimal characters, a-f and 0-9.
214+
// The host must be either exactly "localhost" or a dot-qualified domain name.
215+
// Single-label hosts other than "localhost" are not permitted.
214216
// The length of the whole spec must be between 1 to 447 characters.
215217
// The field is optional, and it will be provided after a release will be successfully installed.
216218
// +kubebuilder:validation:MinLength=1
217219
// +kubebuilder:validation:MaxLength=447
218220
// +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"
219-
// +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"
221+
// +kubebuilder:validation:XValidation:rule=`(self.split('@')[0].matches('^(localhost|([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; host must be either 'localhost' or a dot-qualified domain name"
220222
// +optional
221223
Image string `json:"image,omitempty"`
222224
}

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,8 @@ spec:
449449
image is an OCP release image referenced by digest.
450450
The format of the image pull spec is: host[:port][/namespace]/name@sha256:<digest>,
451451
where the digest must be 64 characters long, and consist only of lowercase hexadecimal characters, a-f and 0-9.
452+
The host must be either exactly "localhost" or a dot-qualified domain name.
453+
Single-label hosts other than "localhost" are not permitted.
452454
The length of the whole spec must be between 1 to 447 characters.
453455
The field is optional, and it will be provided after a release will be successfully installed.
454456
maxLength: 447
@@ -460,8 +462,10 @@ spec:
460462
long
461463
rule: (self.split('@').size() == 2 && self.split('@')[1].matches('^sha256:[a-f0-9]{64}$'))
462464
- message: the OCI Image name should follow the host[:port][/namespace]/name
463-
format, resembling a valid URL without the scheme
464-
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-_.]*?$'))
465+
format, resembling a valid URL without the scheme; host
466+
must be either 'localhost' or a dot-qualified domain
467+
name
468+
rule: (self.split('@')[0].matches('^(localhost|([a-zA-Z0-9-]+\\.)+[a-zA-Z0-9-]+)(:[0-9]{2,5})?/([a-zA-Z0-9-_]{0,61}/)?[a-zA-Z0-9-_.]*?$'))
465469
name:
466470
description: |-
467471
name indicates the desired release bundle identifier. This field is required and must be between 1 and 64 characters long.

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,8 @@ spec:
449449
image is an OCP release image referenced by digest.
450450
The format of the image pull spec is: host[:port][/namespace]/name@sha256:<digest>,
451451
where the digest must be 64 characters long, and consist only of lowercase hexadecimal characters, a-f and 0-9.
452+
The host must be either exactly "localhost" or a dot-qualified domain name.
453+
Single-label hosts other than "localhost" are not permitted.
452454
The length of the whole spec must be between 1 to 447 characters.
453455
The field is optional, and it will be provided after a release will be successfully installed.
454456
maxLength: 447
@@ -460,8 +462,10 @@ spec:
460462
long
461463
rule: (self.split('@').size() == 2 && self.split('@')[1].matches('^sha256:[a-f0-9]{64}$'))
462464
- message: the OCI Image name should follow the host[:port][/namespace]/name
463-
format, resembling a valid URL without the scheme
464-
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-_.]*?$'))
465+
format, resembling a valid URL without the scheme; host
466+
must be either 'localhost' or a dot-qualified domain
467+
name
468+
rule: (self.split('@')[0].matches('^(localhost|([a-zA-Z0-9-]+\\.)+[a-zA-Z0-9-]+)(:[0-9]{2,5})?/([a-zA-Z0-9-_]{0,61}/)?[a-zA-Z0-9-_.]*?$'))
465469
name:
466470
description: |-
467471
name indicates the desired release bundle identifier. This field is required and must be between 1 and 64 characters long.

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,8 @@ spec:
449449
image is an OCP release image referenced by digest.
450450
The format of the image pull spec is: host[:port][/namespace]/name@sha256:<digest>,
451451
where the digest must be 64 characters long, and consist only of lowercase hexadecimal characters, a-f and 0-9.
452+
The host must be either exactly "localhost" or a dot-qualified domain name.
453+
Single-label hosts other than "localhost" are not permitted.
452454
The length of the whole spec must be between 1 to 447 characters.
453455
The field is optional, and it will be provided after a release will be successfully installed.
454456
maxLength: 447
@@ -460,8 +462,10 @@ spec:
460462
long
461463
rule: (self.split('@').size() == 2 && self.split('@')[1].matches('^sha256:[a-f0-9]{64}$'))
462464
- message: the OCI Image name should follow the host[:port][/namespace]/name
463-
format, resembling a valid URL without the scheme
464-
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-_.]*?$'))
465+
format, resembling a valid URL without the scheme; host
466+
must be either 'localhost' or a dot-qualified domain
467+
name
468+
rule: (self.split('@')[0].matches('^(localhost|([a-zA-Z0-9-]+\\.)+[a-zA-Z0-9-]+)(:[0-9]{2,5})?/([a-zA-Z0-9-_]{0,61}/)?[a-zA-Z0-9-_.]*?$'))
465469
name:
466470
description: |-
467471
name indicates the desired release bundle identifier. This field is required and must be between 1 and 64 characters long.

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,8 @@ spec:
449449
image is an OCP release image referenced by digest.
450450
The format of the image pull spec is: host[:port][/namespace]/name@sha256:<digest>,
451451
where the digest must be 64 characters long, and consist only of lowercase hexadecimal characters, a-f and 0-9.
452+
The host must be either exactly "localhost" or a dot-qualified domain name.
453+
Single-label hosts other than "localhost" are not permitted.
452454
The length of the whole spec must be between 1 to 447 characters.
453455
The field is optional, and it will be provided after a release will be successfully installed.
454456
maxLength: 447
@@ -460,8 +462,10 @@ spec:
460462
long
461463
rule: (self.split('@').size() == 2 && self.split('@')[1].matches('^sha256:[a-f0-9]{64}$'))
462464
- message: the OCI Image name should follow the host[:port][/namespace]/name
463-
format, resembling a valid URL without the scheme
464-
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-_.]*?$'))
465+
format, resembling a valid URL without the scheme; host
466+
must be either 'localhost' or a dot-qualified domain
467+
name
468+
rule: (self.split('@')[0].matches('^(localhost|([a-zA-Z0-9-]+\\.)+[a-zA-Z0-9-]+)(:[0-9]{2,5})?/([a-zA-Z0-9-_]{0,61}/)?[a-zA-Z0-9-_.]*?$'))
465469
name:
466470
description: |-
467471
name indicates the desired release bundle identifier. This field is required and must be between 1 and 64 characters long.

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,8 @@ spec:
380380
image is an OCP release image referenced by digest.
381381
The format of the image pull spec is: host[:port][/namespace]/name@sha256:<digest>,
382382
where the digest must be 64 characters long, and consist only of lowercase hexadecimal characters, a-f and 0-9.
383+
The host must be either exactly "localhost" or a dot-qualified domain name.
384+
Single-label hosts other than "localhost" are not permitted.
383385
The length of the whole spec must be between 1 to 447 characters.
384386
The field is optional, and it will be provided after a release will be successfully installed.
385387
maxLength: 447
@@ -391,8 +393,10 @@ spec:
391393
long
392394
rule: (self.split('@').size() == 2 && self.split('@')[1].matches('^sha256:[a-f0-9]{64}$'))
393395
- message: the OCI Image name should follow the host[:port][/namespace]/name
394-
format, resembling a valid URL without the scheme
395-
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-_.]*?$'))
396+
format, resembling a valid URL without the scheme; host
397+
must be either 'localhost' or a dot-qualified domain
398+
name
399+
rule: (self.split('@')[0].matches('^(localhost|([a-zA-Z0-9-]+\\.)+[a-zA-Z0-9-]+)(:[0-9]{2,5})?/([a-zA-Z0-9-_]{0,61}/)?[a-zA-Z0-9-_.]*?$'))
396400
name:
397401
description: |-
398402
name indicates the desired release bundle identifier. This field is required and must be between 1 and 64 characters long.

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.

payload-manifests/crds/0000_80_machine-config_01_machineconfignodes-Hypershift-CustomNoUpgrade.crd.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,8 @@ spec:
449449
image is an OCP release image referenced by digest.
450450
The format of the image pull spec is: host[:port][/namespace]/name@sha256:<digest>,
451451
where the digest must be 64 characters long, and consist only of lowercase hexadecimal characters, a-f and 0-9.
452+
The host must be either exactly "localhost" or a dot-qualified domain name.
453+
Single-label hosts other than "localhost" are not permitted.
452454
The length of the whole spec must be between 1 to 447 characters.
453455
The field is optional, and it will be provided after a release will be successfully installed.
454456
maxLength: 447
@@ -460,8 +462,10 @@ spec:
460462
long
461463
rule: (self.split('@').size() == 2 && self.split('@')[1].matches('^sha256:[a-f0-9]{64}$'))
462464
- message: the OCI Image name should follow the host[:port][/namespace]/name
463-
format, resembling a valid URL without the scheme
464-
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-_.]*?$'))
465+
format, resembling a valid URL without the scheme; host
466+
must be either 'localhost' or a dot-qualified domain
467+
name
468+
rule: (self.split('@')[0].matches('^(localhost|([a-zA-Z0-9-]+\\.)+[a-zA-Z0-9-]+)(:[0-9]{2,5})?/([a-zA-Z0-9-_]{0,61}/)?[a-zA-Z0-9-_.]*?$'))
465469
name:
466470
description: |-
467471
name indicates the desired release bundle identifier. This field is required and must be between 1 and 64 characters long.

0 commit comments

Comments
 (0)