Skip to content

Commit 6287fcb

Browse files
committed
api/nfd: document all undocumented fields in the types
1 parent f3051f2 commit 6287fcb

File tree

3 files changed

+44
-7
lines changed

3 files changed

+44
-7
lines changed

api/nfd/v1alpha1/types.go

+16-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ type NodeFeatureList struct {
2828
metav1.TypeMeta `json:",inline"`
2929
metav1.ListMeta `json:"metadata"`
3030

31+
// List of NodeFeatures.
3132
Items []NodeFeature `json:"items"`
3233
}
3334

@@ -40,6 +41,7 @@ type NodeFeature struct {
4041
metav1.TypeMeta `json:",inline"`
4142
metav1.ObjectMeta `json:"metadata,omitempty"`
4243

44+
// Specification of the NodeFeature, containing features discovered for a node.
4345
Spec NodeFeatureSpec `json:"spec"`
4446
}
4547

@@ -72,27 +74,31 @@ type Features struct {
7274
//
7375
// +protobuf=true
7476
type FlagFeatureSet struct {
77+
// Individual features of the feature set.
7578
Elements map[string]Nil `json:"elements" protobuf:"bytes,1,rep,name=elements"`
7679
}
7780

7881
// AttributeFeatureSet is a set of features having string value.
7982
//
8083
// +protobuf=true
8184
type AttributeFeatureSet struct {
85+
// Individual features of the feature set.
8286
Elements map[string]string `json:"elements" protobuf:"bytes,1,rep,name=elements"`
8387
}
8488

8589
// InstanceFeatureSet is a set of features each of which is an instance having multiple attributes.
8690
//
8791
// +protobuf=true
8892
type InstanceFeatureSet struct {
93+
// Individual features of the feature set.
8994
Elements []InstanceFeature `json:"elements" protobuf:"bytes,1,rep,name=elements"`
9095
}
9196

9297
// InstanceFeature represents one instance of a complex features, e.g. a device.
9398
//
9499
// +protobuf=true
95100
type InstanceFeature struct {
101+
// Attributes of the instance feature.
96102
Attributes map[string]string `json:"attributes" protobuf:"bytes,1,rep,name=attributes"`
97103
}
98104

@@ -108,6 +114,7 @@ type NodeFeatureRuleList struct {
108114
metav1.TypeMeta `json:",inline"`
109115
metav1.ListMeta `json:"metadata"`
110116

117+
// List of NodeFeatureRules.
111118
Items []NodeFeatureRule `json:"items"`
112119
}
113120

@@ -122,6 +129,7 @@ type NodeFeatureRule struct {
122129
metav1.TypeMeta `json:",inline"`
123130
metav1.ObjectMeta `json:"metadata,omitempty"`
124131

132+
// Spec defines the rules to be evaluated.
125133
Spec NodeFeatureRuleSpec `json:"spec"`
126134
}
127135

@@ -141,12 +149,17 @@ type NodeFeatureGroup struct {
141149
metav1.TypeMeta `json:",inline"`
142150
metav1.ObjectMeta `json:"metadata,omitempty"`
143151

144-
Spec NodeFeatureGroupSpec `json:"spec"`
152+
// Spec defines the rules to be evaluated.
153+
Spec NodeFeatureGroupSpec `json:"spec"`
154+
155+
// Status of the node feature group after the most recent evaluation of the
156+
// specification.
145157
Status NodeFeatureGroupStatus `json:"status,omitempty"`
146158
}
147159

148160
// NodeFeatureGroupSpec describes a NodeFeatureGroup object.
149161
type NodeFeatureGroupSpec struct {
162+
// List of rules to evaluate to determine nodes that belong in this group.
150163
Rules []GroupRule `json:"featureGroupRules"`
151164
}
152165

@@ -161,6 +174,7 @@ type NodeFeatureGroupStatus struct {
161174
}
162175

163176
type FeatureGroupNode struct {
177+
// Name of the node.
164178
Name string `json:"name"`
165179
}
166180

@@ -171,6 +185,7 @@ type NodeFeatureGroupList struct {
171185
metav1.TypeMeta `json:",inline"`
172186
metav1.ListMeta `json:"metadata"`
173187

188+
// List of NodeFeatureGroups.
174189
Items []NodeFeatureGroup `json:"items"`
175190
}
176191

deployment/base/nfd-crds/nfd-api-crds.yaml

+14-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ spec:
3939
metadata:
4040
type: object
4141
spec:
42-
description: NodeFeatureSpec describes a NodeFeature object.
42+
description: Specification of the NodeFeature, containing features discovered
43+
for a node.
4344
properties:
4445
features:
4546
description: Features is the full "raw" features data that has been
@@ -53,6 +54,7 @@ spec:
5354
elements:
5455
additionalProperties:
5556
type: string
57+
description: Individual features of the feature set.
5658
type: object
5759
required:
5860
- elements
@@ -70,6 +72,7 @@ spec:
7072
description: Nil is a dummy empty struct for protobuf
7173
compatibility
7274
type: object
75+
description: Individual features of the feature set.
7376
type: object
7477
required:
7578
- elements
@@ -83,13 +86,15 @@ spec:
8386
which is an instance having multiple attributes.
8487
properties:
8588
elements:
89+
description: Individual features of the feature set.
8690
items:
8791
description: InstanceFeature represents one instance of
8892
a complex features, e.g. a device.
8993
properties:
9094
attributes:
9195
additionalProperties:
9296
type: string
97+
description: Attributes of the instance feature.
9398
type: object
9499
required:
95100
- attributes
@@ -155,9 +160,11 @@ spec:
155160
metadata:
156161
type: object
157162
spec:
158-
description: NodeFeatureGroupSpec describes a NodeFeatureGroup object.
163+
description: Spec defines the rules to be evaluated.
159164
properties:
160165
featureGroupRules:
166+
description: List of rules to evaluate to determine nodes that belong
167+
in this group.
161168
items:
162169
description: GroupRule defines a rule for nodegroup filtering.
163170
properties:
@@ -356,13 +363,17 @@ spec:
356363
- featureGroupRules
357364
type: object
358365
status:
366+
description: |-
367+
Status of the node feature group after the most recent evaluation of the
368+
specification.
359369
properties:
360370
nodes:
361371
description: Nodes is a list of FeatureGroupNode in the cluster that
362372
match the featureGroupRules
363373
items:
364374
properties:
365375
name:
376+
description: Name of the node.
366377
type: string
367378
required:
368379
- name
@@ -422,7 +433,7 @@ spec:
422433
metadata:
423434
type: object
424435
spec:
425-
description: NodeFeatureRuleSpec describes a NodeFeatureRule.
436+
description: Spec defines the rules to be evaluated.
426437
properties:
427438
rules:
428439
description: Rules is a list of node customization rules.

deployment/helm/node-feature-discovery/crds/nfd-api-crds.yaml

+14-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ spec:
3939
metadata:
4040
type: object
4141
spec:
42-
description: NodeFeatureSpec describes a NodeFeature object.
42+
description: Specification of the NodeFeature, containing features discovered
43+
for a node.
4344
properties:
4445
features:
4546
description: Features is the full "raw" features data that has been
@@ -53,6 +54,7 @@ spec:
5354
elements:
5455
additionalProperties:
5556
type: string
57+
description: Individual features of the feature set.
5658
type: object
5759
required:
5860
- elements
@@ -70,6 +72,7 @@ spec:
7072
description: Nil is a dummy empty struct for protobuf
7173
compatibility
7274
type: object
75+
description: Individual features of the feature set.
7376
type: object
7477
required:
7578
- elements
@@ -83,13 +86,15 @@ spec:
8386
which is an instance having multiple attributes.
8487
properties:
8588
elements:
89+
description: Individual features of the feature set.
8690
items:
8791
description: InstanceFeature represents one instance of
8892
a complex features, e.g. a device.
8993
properties:
9094
attributes:
9195
additionalProperties:
9296
type: string
97+
description: Attributes of the instance feature.
9398
type: object
9499
required:
95100
- attributes
@@ -155,9 +160,11 @@ spec:
155160
metadata:
156161
type: object
157162
spec:
158-
description: NodeFeatureGroupSpec describes a NodeFeatureGroup object.
163+
description: Spec defines the rules to be evaluated.
159164
properties:
160165
featureGroupRules:
166+
description: List of rules to evaluate to determine nodes that belong
167+
in this group.
161168
items:
162169
description: GroupRule defines a rule for nodegroup filtering.
163170
properties:
@@ -356,13 +363,17 @@ spec:
356363
- featureGroupRules
357364
type: object
358365
status:
366+
description: |-
367+
Status of the node feature group after the most recent evaluation of the
368+
specification.
359369
properties:
360370
nodes:
361371
description: Nodes is a list of FeatureGroupNode in the cluster that
362372
match the featureGroupRules
363373
items:
364374
properties:
365375
name:
376+
description: Name of the node.
366377
type: string
367378
required:
368379
- name
@@ -422,7 +433,7 @@ spec:
422433
metadata:
423434
type: object
424435
spec:
425-
description: NodeFeatureRuleSpec describes a NodeFeatureRule.
436+
description: Spec defines the rules to be evaluated.
426437
properties:
427438
rules:
428439
description: Rules is a list of node customization rules.

0 commit comments

Comments
 (0)