Skip to content

Commit a9c080e

Browse files
committed
machineconfiguration/v1: add InternalReleaseImage to MCN
1 parent 6b6941e commit a9c080e

File tree

7 files changed

+521
-6
lines changed

7 files changed

+521
-6
lines changed

machineconfiguration/v1alpha1/types_machineconfignode.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,18 @@ type MachineConfigNodeStatus struct {
133133
// +kubebuilder:validation:MaxItems=100
134134
// +optional
135135
PinnedImageSets []MachineConfigNodeStatusPinnedImageSet `json:"pinnedImageSets,omitempty"`
136+
// internalReleaseImage describes the status of the release payloads stored in the node
137+
// +listType=map
138+
// +listMapKey=name
139+
// +kubebuilder:validation:MaxItems=20
140+
// +optional
141+
InternalReleaseImage []MachineConfigNodeStatusInternalReleaseImage `json:"internalReleaseImage,omitempty"`
136142
}
137143

144+
// MachineConfigNodeStatusInternalReleaseImage holds information about the current, desidered and discovered release bundles for the observed machine
145+
// config node.
146+
type MachineConfigNodeStatusInternalReleaseImage InternalReleaseImageStatus
147+
138148
// MachineConfigNodeStatusPinnedImageSet holds information about the current, desired, and failed pinned image sets for the observed machine config node.
139149
// +kubebuilder:validation:XValidation:rule="has(self.desiredGeneration) && has(self.currentGeneration) ? self.desiredGeneration >= self.currentGeneration : true",message="desired generation must be greater than or equal to the current generation"
140150
// +kubebuilder:validation:XValidation:rule="has(self.lastFailedGeneration) && has(self.desiredGeneration) ? self.desiredGeneration >= self.lastFailedGeneration : true",message="desired generation must be greater than or equal to the last failed generation"

machineconfiguration/v1alpha1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfignodes.crd.yaml

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,159 @@ spec:
274274
required:
275275
- desired
276276
type: object
277+
internalReleaseImage:
278+
description: internalReleaseImage describes the status of the release
279+
payloads stored in the node
280+
items:
281+
description: |-
282+
MachineConfigNodeStatusInternalReleaseImage holds information about the current, desidered and discovered release bundles for the observed machine
283+
config node.
284+
properties:
285+
availableReleases:
286+
description: |-
287+
availableReleases is a list of release bundle identifiers currently detected
288+
from the attached ISO.
289+
items:
290+
properties:
291+
image:
292+
description: |-
293+
image is an OCP release imaged referenced by digest.
294+
The format of the image pull spec is: host[:port][/namespace]/name@sha256:<digest>,
295+
where the digest must be 64 characters long, and consist only of lowercase hexadecimal characters, a-f and 0-9.
296+
The length of the whole spec must be between 1 to 447 characters.
297+
maxLength: 447
298+
minLength: 1
299+
type: string
300+
x-kubernetes-validations:
301+
- message: the OCI Image reference must end with a valid
302+
'@sha256:<digest>' suffix, where '<digest>' is 64
303+
characters long
304+
rule: (self.split('@').size() == 2 && self.split('@')[1].matches('^sha256:[a-f0-9]{64}$'))
305+
- message: the OCI Image name should follow the host[:port][/namespace]/name
306+
format, resembling a valid URL without the scheme
307+
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-_.]*?$'))
308+
name:
309+
description: name indicates the desired release bundle
310+
identifier.
311+
maxLength: 64
312+
minLength: 1
313+
type: string
314+
required:
315+
- name
316+
type: object
317+
maxItems: 64
318+
minItems: 1
319+
type: array
320+
x-kubernetes-list-map-keys:
321+
- name
322+
x-kubernetes-list-type: map
323+
conditions:
324+
description: conditions represent the observations of an internal
325+
release image current state.
326+
items:
327+
description: Condition contains details for one aspect of
328+
the current state of this API Resource.
329+
properties:
330+
lastTransitionTime:
331+
description: |-
332+
lastTransitionTime is the last time the condition transitioned from one status to another.
333+
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
334+
format: date-time
335+
type: string
336+
message:
337+
description: |-
338+
message is a human readable message indicating details about the transition.
339+
This may be an empty string.
340+
maxLength: 32768
341+
type: string
342+
observedGeneration:
343+
description: |-
344+
observedGeneration represents the .metadata.generation that the condition was set based upon.
345+
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
346+
with respect to the current state of the instance.
347+
format: int64
348+
minimum: 0
349+
type: integer
350+
reason:
351+
description: |-
352+
reason contains a programmatic identifier indicating the reason for the condition's last transition.
353+
Producers of specific condition types may define expected values and meanings for this field,
354+
and whether the values are considered a guaranteed API.
355+
The value should be a CamelCase string.
356+
This field may not be empty.
357+
maxLength: 1024
358+
minLength: 1
359+
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
360+
type: string
361+
status:
362+
description: status of the condition, one of True, False,
363+
Unknown.
364+
enum:
365+
- "True"
366+
- "False"
367+
- Unknown
368+
type: string
369+
type:
370+
description: type of condition in CamelCase or in foo.example.com/CamelCase.
371+
maxLength: 316
372+
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])$
373+
type: string
374+
required:
375+
- lastTransitionTime
376+
- message
377+
- reason
378+
- status
379+
- type
380+
type: object
381+
maxItems: 256
382+
minItems: 1
383+
type: array
384+
x-kubernetes-list-map-keys:
385+
- type
386+
x-kubernetes-list-type: map
387+
releases:
388+
description: releases is a list of the currently managed release
389+
bundles.
390+
items:
391+
properties:
392+
image:
393+
description: |-
394+
image is an OCP release imaged referenced by digest.
395+
The format of the image pull spec is: host[:port][/namespace]/name@sha256:<digest>,
396+
where the digest must be 64 characters long, and consist only of lowercase hexadecimal characters, a-f and 0-9.
397+
The length of the whole spec must be between 1 to 447 characters.
398+
maxLength: 447
399+
minLength: 1
400+
type: string
401+
x-kubernetes-validations:
402+
- message: the OCI Image reference must end with a valid
403+
'@sha256:<digest>' suffix, where '<digest>' is 64
404+
characters long
405+
rule: (self.split('@').size() == 2 && self.split('@')[1].matches('^sha256:[a-f0-9]{64}$'))
406+
- message: the OCI Image name should follow the host[:port][/namespace]/name
407+
format, resembling a valid URL without the scheme
408+
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-_.]*?$'))
409+
name:
410+
description: name indicates the desired release bundle
411+
identifier.
412+
maxLength: 64
413+
minLength: 1
414+
type: string
415+
required:
416+
- name
417+
type: object
418+
maxItems: 64
419+
minItems: 1
420+
type: array
421+
x-kubernetes-list-map-keys:
422+
- name
423+
x-kubernetes-list-type: map
424+
type: object
425+
maxItems: 20
426+
type: array
427+
x-kubernetes-list-map-keys:
428+
- name
429+
x-kubernetes-list-type: map
277430
observedGeneration:
278431
description: |-
279432
observedGeneration represents the generation of the MachineConfigNode object observed by the Machine Config Operator's controller.

machineconfiguration/v1alpha1/zz_generated.deepcopy.go

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

0 commit comments

Comments
 (0)