Skip to content

Commit b5cd2cc

Browse files
authored
Enhance Status with IgnitionDataFetched and IPXEScriptFetched Conditions (#226)
1 parent 5644caf commit b5cd2cc

File tree

10 files changed

+353
-5
lines changed

10 files changed

+353
-5
lines changed

api/v1alpha1/constants.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,5 @@ const (
99
SystemUUIDIndexKey = "spec.systemUUID" // Field to index resources by their system UUID.
1010
SystemIPIndexKey = "spec.systemIPs" // Field to index resources by their system IP addresses.
1111
DefaultFormatKey = "format" // Key for determining the format of the data stored in a Secret, such as fcos or plain-ignition.
12-
IgnitionV2Format = "ignitionv2" // Specifies the format value corresponding to Ignition config version 2.
13-
IgnitionV3Format = "ignitionv3" // Specifies the format value corresponding to Ignition config version 3.
1412
FCOSFormat = "fcos" // Specifies the format value used for Fedora CoreOS specific configurations.
1513
)

api/v1alpha1/httpbootconfig_types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ type HTTPBootConfigSpec struct {
2626
// HTTPBootConfigStatus defines the observed state of HTTPBootConfig
2727
type HTTPBootConfigStatus struct {
2828
State HTTPBootConfigState `json:"state,omitempty"`
29+
30+
// Conditions represent the latest available observations of the IPXEBootConfig's state
31+
Conditions []metav1.Condition `json:"conditions,omitempty"`
2932
}
3033

3134
type HTTPBootConfigState string

api/v1alpha1/ipxebootconfig_types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ const (
5858
type IPXEBootConfigStatus struct {
5959
// Important: Run "make" to regenerate code after modifying this file
6060
State IPXEBootConfigState `json:"state,omitempty"`
61+
62+
// Conditions represent the latest available observations of the IPXEBootConfig's state
63+
Conditions []metav1.Condition `json:"conditions,omitempty"`
6164
}
6265

6366
//+kubebuilder:object:root=true

api/v1alpha1/zz_generated.deepcopy.go

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

config/crd/bases/boot.ironcore.dev_httpbootconfigs.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,64 @@ spec:
7777
status:
7878
description: HTTPBootConfigStatus defines the observed state of HTTPBootConfig
7979
properties:
80+
conditions:
81+
description: Conditions represent the latest available observations
82+
of the IPXEBootConfig's state
83+
items:
84+
description: Condition contains details for one aspect of the current
85+
state of this API Resource.
86+
properties:
87+
lastTransitionTime:
88+
description: |-
89+
lastTransitionTime is the last time the condition transitioned from one status to another.
90+
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
91+
format: date-time
92+
type: string
93+
message:
94+
description: |-
95+
message is a human readable message indicating details about the transition.
96+
This may be an empty string.
97+
maxLength: 32768
98+
type: string
99+
observedGeneration:
100+
description: |-
101+
observedGeneration represents the .metadata.generation that the condition was set based upon.
102+
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
103+
with respect to the current state of the instance.
104+
format: int64
105+
minimum: 0
106+
type: integer
107+
reason:
108+
description: |-
109+
reason contains a programmatic identifier indicating the reason for the condition's last transition.
110+
Producers of specific condition types may define expected values and meanings for this field,
111+
and whether the values are considered a guaranteed API.
112+
The value should be a CamelCase string.
113+
This field may not be empty.
114+
maxLength: 1024
115+
minLength: 1
116+
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
117+
type: string
118+
status:
119+
description: status of the condition, one of True, False, Unknown.
120+
enum:
121+
- "True"
122+
- "False"
123+
- Unknown
124+
type: string
125+
type:
126+
description: type of condition in CamelCase or in foo.example.com/CamelCase.
127+
maxLength: 316
128+
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])$
129+
type: string
130+
required:
131+
- lastTransitionTime
132+
- message
133+
- reason
134+
- status
135+
- type
136+
type: object
137+
type: array
80138
state:
81139
type: string
82140
type: object

config/crd/bases/boot.ironcore.dev_ipxebootconfigs.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,64 @@ spec:
107107
status:
108108
description: IPXEBootConfigStatus defines the observed state of IPXEBootConfig
109109
properties:
110+
conditions:
111+
description: Conditions represent the latest available observations
112+
of the IPXEBootConfig's state
113+
items:
114+
description: Condition contains details for one aspect of the current
115+
state of this API Resource.
116+
properties:
117+
lastTransitionTime:
118+
description: |-
119+
lastTransitionTime is the last time the condition transitioned from one status to another.
120+
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
121+
format: date-time
122+
type: string
123+
message:
124+
description: |-
125+
message is a human readable message indicating details about the transition.
126+
This may be an empty string.
127+
maxLength: 32768
128+
type: string
129+
observedGeneration:
130+
description: |-
131+
observedGeneration represents the .metadata.generation that the condition was set based upon.
132+
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
133+
with respect to the current state of the instance.
134+
format: int64
135+
minimum: 0
136+
type: integer
137+
reason:
138+
description: |-
139+
reason contains a programmatic identifier indicating the reason for the condition's last transition.
140+
Producers of specific condition types may define expected values and meanings for this field,
141+
and whether the values are considered a guaranteed API.
142+
The value should be a CamelCase string.
143+
This field may not be empty.
144+
maxLength: 1024
145+
minLength: 1
146+
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
147+
type: string
148+
status:
149+
description: status of the condition, one of True, False, Unknown.
150+
enum:
151+
- "True"
152+
- "False"
153+
- Unknown
154+
type: string
155+
type:
156+
description: type of condition in CamelCase or in foo.example.com/CamelCase.
157+
maxLength: 316
158+
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])$
159+
type: string
160+
required:
161+
- lastTransitionTime
162+
- message
163+
- reason
164+
- status
165+
- type
166+
type: object
167+
type: array
110168
state:
111169
description: 'Important: Run "make" to regenerate code after modifying
112170
this file'

dist/chart/templates/crd/boot.ironcore.dev_httpbootconfigs.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,64 @@ spec:
8383
status:
8484
description: HTTPBootConfigStatus defines the observed state of HTTPBootConfig
8585
properties:
86+
conditions:
87+
description: Conditions represent the latest available observations
88+
of the IPXEBootConfig's state
89+
items:
90+
description: Condition contains details for one aspect of the current
91+
state of this API Resource.
92+
properties:
93+
lastTransitionTime:
94+
description: |-
95+
lastTransitionTime is the last time the condition transitioned from one status to another.
96+
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
97+
format: date-time
98+
type: string
99+
message:
100+
description: |-
101+
message is a human readable message indicating details about the transition.
102+
This may be an empty string.
103+
maxLength: 32768
104+
type: string
105+
observedGeneration:
106+
description: |-
107+
observedGeneration represents the .metadata.generation that the condition was set based upon.
108+
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
109+
with respect to the current state of the instance.
110+
format: int64
111+
minimum: 0
112+
type: integer
113+
reason:
114+
description: |-
115+
reason contains a programmatic identifier indicating the reason for the condition's last transition.
116+
Producers of specific condition types may define expected values and meanings for this field,
117+
and whether the values are considered a guaranteed API.
118+
The value should be a CamelCase string.
119+
This field may not be empty.
120+
maxLength: 1024
121+
minLength: 1
122+
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
123+
type: string
124+
status:
125+
description: status of the condition, one of True, False, Unknown.
126+
enum:
127+
- "True"
128+
- "False"
129+
- Unknown
130+
type: string
131+
type:
132+
description: type of condition in CamelCase or in foo.example.com/CamelCase.
133+
maxLength: 316
134+
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])$
135+
type: string
136+
required:
137+
- lastTransitionTime
138+
- message
139+
- reason
140+
- status
141+
- type
142+
type: object
143+
type: array
86144
state:
87145
type: string
88146
type: object

dist/chart/templates/crd/boot.ironcore.dev_ipxebootconfigs.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,64 @@ spec:
113113
status:
114114
description: IPXEBootConfigStatus defines the observed state of IPXEBootConfig
115115
properties:
116+
conditions:
117+
description: Conditions represent the latest available observations
118+
of the IPXEBootConfig's state
119+
items:
120+
description: Condition contains details for one aspect of the current
121+
state of this API Resource.
122+
properties:
123+
lastTransitionTime:
124+
description: |-
125+
lastTransitionTime is the last time the condition transitioned from one status to another.
126+
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
127+
format: date-time
128+
type: string
129+
message:
130+
description: |-
131+
message is a human readable message indicating details about the transition.
132+
This may be an empty string.
133+
maxLength: 32768
134+
type: string
135+
observedGeneration:
136+
description: |-
137+
observedGeneration represents the .metadata.generation that the condition was set based upon.
138+
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
139+
with respect to the current state of the instance.
140+
format: int64
141+
minimum: 0
142+
type: integer
143+
reason:
144+
description: |-
145+
reason contains a programmatic identifier indicating the reason for the condition's last transition.
146+
Producers of specific condition types may define expected values and meanings for this field,
147+
and whether the values are considered a guaranteed API.
148+
The value should be a CamelCase string.
149+
This field may not be empty.
150+
maxLength: 1024
151+
minLength: 1
152+
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
153+
type: string
154+
status:
155+
description: status of the condition, one of True, False, Unknown.
156+
enum:
157+
- "True"
158+
- "False"
159+
- Unknown
160+
type: string
161+
type:
162+
description: type of condition in CamelCase or in foo.example.com/CamelCase.
163+
maxLength: 316
164+
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])$
165+
type: string
166+
required:
167+
- lastTransitionTime
168+
- message
169+
- reason
170+
- status
171+
- type
172+
type: object
173+
type: array
116174
state:
117175
description: 'Important: Run "make" to regenerate code after modifying
118176
this file'

docs/api-reference/api.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,19 @@ HTTPBootConfigState
428428
<td>
429429
</td>
430430
</tr>
431+
<tr>
432+
<td>
433+
<code>conditions</code><br/>
434+
<em>
435+
<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/#condition-v1-meta">
436+
[]Kubernetes meta/v1.Condition
437+
</a>
438+
</em>
439+
</td>
440+
<td>
441+
<p>Conditions represent the latest available observations of the IPXEBootConfig&rsquo;s state</p>
442+
</td>
443+
</tr>
431444
</tbody>
432445
</table>
433446
<h3 id="boot.ironcore.dev/v1alpha1.IPXEBootConfigSpec">IPXEBootConfigSpec
@@ -605,6 +618,19 @@ IPXEBootConfigState
605618
<p>Important: Run &ldquo;make&rdquo; to regenerate code after modifying this file</p>
606619
</td>
607620
</tr>
621+
<tr>
622+
<td>
623+
<code>conditions</code><br/>
624+
<em>
625+
<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/#condition-v1-meta">
626+
[]Kubernetes meta/v1.Condition
627+
</a>
628+
</em>
629+
</td>
630+
<td>
631+
<p>Conditions represent the latest available observations of the IPXEBootConfig&rsquo;s state</p>
632+
</td>
633+
</tr>
608634
</tbody>
609635
</table>
610636
<hr/>

0 commit comments

Comments
 (0)