Skip to content

Commit f33c80d

Browse files
authored
feat: Add node info to list resource (#10118)
* fix pdb schema * make fix * fix details * add node info to list * make fix * make schema * make schema
1 parent 2e89a34 commit f33c80d

File tree

5 files changed

+186
-180
lines changed

5 files changed

+186
-180
lines changed

modules/api/pkg/resource/node/detail.go

+1-4
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,6 @@ type NodeDetail struct {
9696
// Unschedulable controls node schedulability of new pods. By default node is schedulable.
9797
Unschedulable bool `json:"unschedulable"`
9898

99-
// Set of ids/uuids to uniquely identify the node.
100-
NodeInfo v1.NodeSystemInfo `json:"nodeInfo"`
101-
10299
// Conditions is an array of current node conditions.
103100
Conditions []common.Condition `json:"conditions"`
104101

@@ -285,13 +282,13 @@ func toNodeDetail(node v1.Node, pods *pod.PodList, eventList *common.EventList,
285282
TypeMeta: types.NewTypeMeta(types.ResourceKindNode),
286283
Ready: getNodeConditionStatus(node, v1.NodeReady),
287284
AllocatedResources: allocatedResources,
285+
NodeInfo: node.Status.NodeInfo,
288286
},
289287
// TODO: Remove deprecated field
290288
Phase: node.Status.Phase,
291289
ProviderID: node.Spec.ProviderID,
292290
PodCIDR: node.Spec.PodCIDR,
293291
Unschedulable: node.Spec.Unschedulable,
294-
NodeInfo: node.Status.NodeInfo,
295292
Conditions: getNodeConditions(node),
296293
ContainerImages: getContainerImages(node),
297294
PodList: *pods,

modules/api/pkg/resource/node/list.go

+4
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ type Node struct {
4545
TypeMeta types.TypeMeta `json:"typeMeta"`
4646
Ready v1.ConditionStatus `json:"ready"`
4747
AllocatedResources NodeAllocatedResources `json:"allocatedResources"`
48+
49+
// Set of ids/uuids to uniquely identify the node.
50+
NodeInfo v1.NodeSystemInfo `json:"nodeInfo"`
4851
}
4952

5053
// GetNodeList returns a list of all Nodes in the cluster.
@@ -101,6 +104,7 @@ func toNode(node v1.Node, pods *v1.PodList) Node {
101104
TypeMeta: types.NewTypeMeta(types.ResourceKindNode),
102105
Ready: getNodeConditionStatus(node, v1.NodeReady),
103106
AllocatedResources: allocatedResources,
107+
NodeInfo: node.Status.NodeInfo,
104108
}
105109
}
106110

modules/api/schema/swagger.json

+29-25
Original file line numberDiff line numberDiff line change
@@ -10479,13 +10479,13 @@
1047910479
},
1048010480
"cronjob.CronJobDetail": {
1048110481
"required": [
10482-
"active",
10483-
"lastSchedule",
1048410482
"containerImages",
1048510483
"objectMeta",
1048610484
"typeMeta",
1048710485
"schedule",
1048810486
"suspend",
10487+
"active",
10488+
"lastSchedule",
1048910489
"concurrencyPolicy",
1049010490
"startingDeadlineSeconds",
1049110491
"errors"
@@ -10828,11 +10828,11 @@
1082810828
},
1082910829
"deployment.DeploymentDetail": {
1083010830
"required": [
10831+
"initContainerImages",
1083110832
"objectMeta",
1083210833
"typeMeta",
1083310834
"pods",
1083410835
"containerImages",
10835-
"initContainerImages",
1083610836
"selector",
1083710837
"statusInfo",
1083810838
"conditions",
@@ -11147,13 +11147,13 @@
1114711147
},
1114811148
"horizontalpodautoscaler.HorizontalPodAutoscalerDetail": {
1114911149
"required": [
11150-
"typeMeta",
11151-
"scaleTargetRef",
1115211150
"minReplicas",
1115311151
"maxReplicas",
1115411152
"currentCPUUtilizationPercentage",
1115511153
"targetCPUUtilizationPercentage",
1115611154
"objectMeta",
11155+
"typeMeta",
11156+
"scaleTargetRef",
1115711157
"currentReplicas",
1115811158
"desiredReplicas",
1115911159
"lastScaleTime"
@@ -11450,13 +11450,13 @@
1145011450
},
1145111451
"job.JobDetail": {
1145211452
"required": [
11453-
"jobStatus",
1145411453
"objectMeta",
1145511454
"typeMeta",
1145611455
"podInfo",
1145711456
"containerImages",
1145811457
"initContainerImages",
1145911458
"parallelism",
11459+
"jobStatus",
1146011460
"completions",
1146111461
"errors"
1146211462
],
@@ -11860,12 +11860,16 @@
1186011860
"objectMeta",
1186111861
"typeMeta",
1186211862
"ready",
11863-
"allocatedResources"
11863+
"allocatedResources",
11864+
"nodeInfo"
1186411865
],
1186511866
"properties": {
1186611867
"allocatedResources": {
1186711868
"$ref": "#/definitions/node.NodeAllocatedResources"
1186811869
},
11870+
"nodeInfo": {
11871+
"$ref": "#/definitions/v1.NodeSystemInfo"
11872+
},
1186911873
"objectMeta": {
1187011874
"$ref": "#/definitions/types.ObjectMeta"
1187111875
},
@@ -11950,6 +11954,7 @@
1195011954
},
1195111955
"node.NodeDetail": {
1195211956
"required": [
11957+
"nodeInfo",
1195311958
"objectMeta",
1195411959
"typeMeta",
1195511960
"ready",
@@ -11958,7 +11963,6 @@
1195811963
"podCIDR",
1195911964
"providerID",
1196011965
"unschedulable",
11961-
"nodeInfo",
1196211966
"conditions",
1196311967
"containerImages",
1196411968
"podList",
@@ -12147,16 +12151,16 @@
1214712151
},
1214812152
"persistentvolume.PersistentVolumeDetail": {
1214912153
"required": [
12150-
"objectMeta",
12151-
"capacity",
1215212154
"storageClass",
1215312155
"claim",
1215412156
"reason",
12157+
"objectMeta",
1215512158
"typeMeta",
1215612159
"accessModes",
12157-
"reclaimPolicy",
1215812160
"mountOptions",
1215912161
"status",
12162+
"capacity",
12163+
"reclaimPolicy",
1216012164
"message",
1216112165
"persistentVolumeSource"
1216212166
],
@@ -12274,13 +12278,13 @@
1227412278
},
1227512279
"persistentvolumeclaim.PersistentVolumeClaimDetail": {
1227612280
"required": [
12277-
"objectMeta",
1227812281
"typeMeta",
1227912282
"status",
1228012283
"volume",
1228112284
"capacity",
1228212285
"accessModes",
12283-
"storageClass"
12286+
"storageClass",
12287+
"objectMeta"
1228412288
],
1228512289
"properties": {
1228612290
"accessModes": {
@@ -12761,14 +12765,14 @@
1276112765
"poddisruptionbudget.PodDisruptionBudgetDetail": {
1276212766
"required": [
1276312767
"minAvailable",
12764-
"maxUnavailable",
1276512768
"unhealthyPodEvictionPolicy",
12766-
"currentHealthy",
12769+
"expectedPods",
1276712770
"objectMeta",
1276812771
"typeMeta",
12772+
"maxUnavailable",
12773+
"currentHealthy",
1276912774
"desiredHealthy",
1277012775
"disruptionsAllowed",
12771-
"expectedPods",
1277212776
"disruptedPods"
1277312777
],
1277412778
"properties": {
@@ -12872,11 +12876,11 @@
1287212876
},
1287312877
"replicaset.ReplicaSetDetail": {
1287412878
"required": [
12875-
"podInfo",
12876-
"containerImages",
1287712879
"initContainerImages",
1287812880
"objectMeta",
1287912881
"typeMeta",
12882+
"podInfo",
12883+
"containerImages",
1288012884
"selector",
1288112885
"horizontalPodAutoscalerList",
1288212886
"errors"
@@ -12986,11 +12990,11 @@
1298612990
},
1298712991
"replicationcontroller.ReplicationControllerDetail": {
1298812992
"required": [
12989-
"typeMeta",
12990-
"podInfo",
1299112993
"containerImages",
1299212994
"initContainerImages",
1299312995
"objectMeta",
12996+
"typeMeta",
12997+
"podInfo",
1299412998
"labelSelector",
1299512999
"errors"
1299613000
],
@@ -13366,9 +13370,9 @@
1336613370
},
1336713371
"secret.SecretDetail": {
1336813372
"required": [
13373+
"objectMeta",
1336913374
"typeMeta",
1337013375
"type",
13371-
"objectMeta",
1337213376
"data"
1337313377
],
1337413378
"properties": {
@@ -13455,13 +13459,13 @@
1345513459
},
1345613460
"service.ServiceDetail": {
1345713461
"required": [
13462+
"objectMeta",
13463+
"typeMeta",
1345813464
"internalEndpoint",
1345913465
"externalEndpoints",
1346013466
"selector",
1346113467
"type",
1346213468
"clusterIP",
13463-
"objectMeta",
13464-
"typeMeta",
1346513469
"endpointList",
1346613470
"sessionAffinity",
1346713471
"errors"
@@ -13625,11 +13629,11 @@
1362513629
},
1362613630
"statefulset.StatefulSetDetail": {
1362713631
"required": [
13628-
"containerImages",
13629-
"initContainerImages",
1363013632
"objectMeta",
1363113633
"typeMeta",
1363213634
"podInfo",
13635+
"containerImages",
13636+
"initContainerImages",
1363313637
"errors"
1363413638
],
1363513639
"properties": {

modules/web/i18n/messages.xlf

+1-1
Original file line numberDiff line numberDiff line change
@@ -1969,4 +1969,4 @@
19691969
</trans-unit>
19701970
</body>
19711971
</file>
1972-
</xliff>
1972+
</xliff>

0 commit comments

Comments
 (0)