Skip to content

Commit ee91dd4

Browse files
committed
machineconfiguration/v1alpha1: add InternalReleaseImage
1 parent 44baf88 commit ee91dd4

File tree

28 files changed

+4018
-0
lines changed

28 files changed

+4018
-0
lines changed

machineconfiguration/v1/types_machineconfignode.go

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,78 @@ type MachineConfigNodeStatus struct {
158158
// +kubebuilder:validation:MaxItems=32
159159
// +optional
160160
IrreconcilableChanges []IrreconcilableChangeDiff `json:"irreconcilableChanges,omitempty"`
161+
// internalReleaseImage describes the status of the release payloads stored in the node.
162+
// +optional
163+
InternalReleaseImage *MachineConfigNodeStatusInternalReleaseImage `json:"internalReleaseImage,omitempty"`
164+
}
165+
166+
// MachineConfigNodeStatusInternalReleaseImage holds information about the current, desidered and discovered release bundles for the observed machine
167+
// config node.
168+
// +openshift:enable:FeatureGate=NoRegistryClusterOperations
169+
type MachineConfigNodeStatusInternalReleaseImage struct {
170+
// conditions represent the observations of an internal release image current state.
171+
// +listType=map
172+
// +listMapKey=type
173+
// +kubebuilder:validation:MinItems=1
174+
// +kubebuilder:validation:MaxItems=256
175+
// +optional
176+
Conditions []metav1.Condition `json:"conditions,omitempty"`
177+
178+
// availableReleases is a list of release bundle identifiers currently detected
179+
// from the ISO attached to one of the control plane nodes. Any reported identifier can
180+
// be used to amend the `spec.Releases` field to add a new release bundle to the cluster.
181+
// An empty value indicates that no ISOs are currently being detected on any control plane
182+
// node.
183+
// Must not exceed 5 entries.
184+
// +listType=map
185+
// +listMapKey=name
186+
// +kubebuilder:validation:MaxItems=5
187+
// +optional
188+
AvailableReleases []MachineConfigNodeStatusInternalReleaseImageRef `json:"availableReleases,omitempty"`
189+
190+
// installedReleases is a list of the release bundles currently owned and managed by the
191+
// cluster, indicating that their images can be safely pulled by any cluster entity
192+
// requiring them.
193+
// This field can contain between 1 and 5 entries.
194+
// +listType=map
195+
// +listMapKey=name
196+
// +kubebuilder:validation:MinItems=1
197+
// +kubebuilder:validation:MaxItems=5
198+
// +optional
199+
InstalledReleases []MachineConfigNodeStatusInternalReleaseImageDetailedRef `json:"installedReleases,omitempty"`
200+
}
201+
202+
// MachineConfigNodeStatusInternalReleaseImageRef is used to provide a simple reference for a release
203+
// bundle. Currently it contains only the name field.
204+
// +openshift:enable:FeatureGate=NoRegistryClusterOperations
205+
type MachineConfigNodeStatusInternalReleaseImageRef struct {
206+
// name indicates the desired release bundle identifier. This field is required and must be between 1 and 64 characters long.
207+
// +required
208+
// +kubebuilder:validation:MinLength=1
209+
// +kubebuilder:validation:MaxLength=64
210+
Name string `json:"name,omitempty"`
211+
}
212+
213+
// MachineConfigNodeStatusInternalReleaseImageDetailedRef is used to provide a more detailed reference for
214+
// a release bundle.
215+
// +openshift:enable:FeatureGate=NoRegistryClusterOperations
216+
type MachineConfigNodeStatusInternalReleaseImageDetailedRef struct {
217+
// name indicates the desired release bundle identifier. This field is required and must be between 1 and 64 characters long.
218+
// +kubebuilder:validation:MinLength=1
219+
// +kubebuilder:validation:MaxLength=64
220+
// +required
221+
Name string `json:"name,omitempty"`
222+
223+
// image is an OCP release image referenced by digest.
224+
// The format of the image pull spec is: host[:port][/namespace]/name@sha256:<digest>,
225+
// where the digest must be 64 characters long, and consist only of lowercase hexadecimal characters, a-f and 0-9.
226+
// The length of the whole spec must be between 1 to 447 characters.
227+
// +kubebuilder:validation:MinLength=1
228+
// +kubebuilder:validation:MaxLength=447
229+
// +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"
230+
// +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"
231+
// +required
232+
Image string `json:"image,omitempty"`
161233
}
162234

163235
// IrreconcilableChangeDiff holds an individual diff between the initial install-time MachineConfig

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

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,148 @@ spec:
353353
required:
354354
- desired
355355
type: object
356+
internalReleaseImage:
357+
description: internalReleaseImage describes the status of the release
358+
payloads stored in the node.
359+
properties:
360+
availableReleases:
361+
description: |-
362+
availableReleases is a list of release bundle identifiers currently detected
363+
from the ISO attached to one of the control plane nodes. Any reported identifier can
364+
be used to amend the `spec.Releases` field to add a new release bundle to the cluster.
365+
An empty value indicates that no ISOs are currently being detected on any control plane
366+
node.
367+
Must not exceed 5 entries.
368+
items:
369+
description: |-
370+
MachineConfigNodeStatusInternalReleaseImageRef is used to provide a simple reference for a release
371+
bundle. Currently it contains only the name field.
372+
properties:
373+
name:
374+
description: name indicates the desired release bundle identifier.
375+
This field is required and must be between 1 and 64 characters
376+
long.
377+
maxLength: 64
378+
minLength: 1
379+
type: string
380+
required:
381+
- name
382+
type: object
383+
maxItems: 5
384+
type: array
385+
x-kubernetes-list-map-keys:
386+
- name
387+
x-kubernetes-list-type: map
388+
conditions:
389+
description: conditions represent the observations of an internal
390+
release image current state.
391+
items:
392+
description: Condition contains details for one aspect of the
393+
current state of this API Resource.
394+
properties:
395+
lastTransitionTime:
396+
description: |-
397+
lastTransitionTime is the last time the condition transitioned from one status to another.
398+
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
399+
format: date-time
400+
type: string
401+
message:
402+
description: |-
403+
message is a human readable message indicating details about the transition.
404+
This may be an empty string.
405+
maxLength: 32768
406+
type: string
407+
observedGeneration:
408+
description: |-
409+
observedGeneration represents the .metadata.generation that the condition was set based upon.
410+
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
411+
with respect to the current state of the instance.
412+
format: int64
413+
minimum: 0
414+
type: integer
415+
reason:
416+
description: |-
417+
reason contains a programmatic identifier indicating the reason for the condition's last transition.
418+
Producers of specific condition types may define expected values and meanings for this field,
419+
and whether the values are considered a guaranteed API.
420+
The value should be a CamelCase string.
421+
This field may not be empty.
422+
maxLength: 1024
423+
minLength: 1
424+
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
425+
type: string
426+
status:
427+
description: status of the condition, one of True, False,
428+
Unknown.
429+
enum:
430+
- "True"
431+
- "False"
432+
- Unknown
433+
type: string
434+
type:
435+
description: type of condition in CamelCase or in foo.example.com/CamelCase.
436+
maxLength: 316
437+
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])$
438+
type: string
439+
required:
440+
- lastTransitionTime
441+
- message
442+
- reason
443+
- status
444+
- type
445+
type: object
446+
maxItems: 256
447+
minItems: 1
448+
type: array
449+
x-kubernetes-list-map-keys:
450+
- type
451+
x-kubernetes-list-type: map
452+
installedReleases:
453+
description: |-
454+
installedReleases is a list of the release bundles currently owned and managed by the
455+
cluster, indicating that their images can be safely pulled by any cluster entity
456+
requiring them.
457+
This field can contain between 1 and 5 entries.
458+
items:
459+
description: |-
460+
MachineConfigNodeStatusInternalReleaseImageDetailedRef is used to provide a more detailed reference for
461+
a release bundle.
462+
properties:
463+
image:
464+
description: |-
465+
image is an OCP release image referenced by digest.
466+
The format of the image pull spec is: host[:port][/namespace]/name@sha256:<digest>,
467+
where the digest must be 64 characters long, and consist only of lowercase hexadecimal characters, a-f and 0-9.
468+
The length of the whole spec must be between 1 to 447 characters.
469+
maxLength: 447
470+
minLength: 1
471+
type: string
472+
x-kubernetes-validations:
473+
- message: the OCI Image reference must end with a valid
474+
'@sha256:<digest>' suffix, where '<digest>' is 64 characters
475+
long
476+
rule: (self.split('@').size() == 2 && self.split('@')[1].matches('^sha256:[a-f0-9]{64}$'))
477+
- message: the OCI Image name should follow the host[:port][/namespace]/name
478+
format, resembling a valid URL without the scheme
479+
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-_.]*?$'))
480+
name:
481+
description: name indicates the desired release bundle identifier.
482+
This field is required and must be between 1 and 64 characters
483+
long.
484+
maxLength: 64
485+
minLength: 1
486+
type: string
487+
required:
488+
- image
489+
- name
490+
type: object
491+
maxItems: 5
492+
minItems: 1
493+
type: array
494+
x-kubernetes-list-map-keys:
495+
- name
496+
x-kubernetes-list-type: map
497+
type: object
356498
irreconcilableChanges:
357499
description: |-
358500
irreconcilableChanges is an optional field that contains the observed differences between this nodes

0 commit comments

Comments
 (0)