Skip to content

Commit f0a4fd8

Browse files
Arta AsadiArta Asadi
authored andcommitted
fix: have most of the structs
1 parent e5defb3 commit f0a4fd8

File tree

3 files changed

+133
-130
lines changed

3 files changed

+133
-130
lines changed

discovery/describers/kubernetes.go

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func KubernetesClusterRoleBinding(ctx context.Context, client model.Client, extr
9292
ClusterRoleBinding: helpers.ClusterRoleBinding{
9393
TypeMeta: helpers.ConvertTypeMeta(clusterRoleBinding.TypeMeta),
9494
ObjectMeta: helpers.ConvertObjectMeta(&clusterRoleBinding.ObjectMeta),
95-
Subjects: helpers.ConvertSubject(clusterRoleBinding.Subjects),
95+
Subjects: helpers.ConvertSubjects(clusterRoleBinding.Subjects),
9696
RoleRef: helpers.ConvertRoleRef(clusterRoleBinding.RoleRef),
9797
},
9898
},
@@ -170,7 +170,7 @@ func KubernetesCronJob(ctx context.Context, client model.Client, extra string, s
170170
Name: fmt.Sprintf("%s/%s", cronJob.Namespace, cronJob.Name),
171171
Description: model.KubernetesCronJobDescription{
172172
MetaObject: helpers.ConvertObjectMeta(&cronJob.ObjectMeta),
173-
CronJob: cronJob,
173+
CronJob: helpers.ConvertCronJob(&cronJob),
174174
},
175175
}
176176

@@ -269,7 +269,7 @@ func KubernetesCustomResourceDefinition(ctx context.Context, client model.Client
269269
Name: customResourceDefinition.Name,
270270
Description: model.KubernetesCustomResourceDefinitionDescription{
271271
MetaObject: helpers.ConvertObjectMeta(&customResourceDefinition.ObjectMeta),
272-
CustomResourceDefinition: customResourceDefinition,
272+
CustomResourceDefinition: helpers.ConvertCustomResourceDefinition(&customResourceDefinition),
273273
},
274274
}
275275

@@ -302,7 +302,7 @@ func KubernetesDaemonSet(ctx context.Context, client model.Client, extra string,
302302
Name: fmt.Sprintf("%s/%s", daemonSet.Namespace, daemonSet.Name),
303303
Description: model.KubernetesDaemonSetDescription{
304304
MetaObject: helpers.ConvertObjectMeta(&daemonSet.ObjectMeta),
305-
DaemonSet: daemonSet,
305+
DaemonSet: helpers.ConvertDaemonSet(&daemonSet),
306306
},
307307
}
308308

@@ -335,7 +335,7 @@ func KubernetesDeployment(ctx context.Context, client model.Client, extra string
335335
Name: fmt.Sprintf("%s/%s", deployment.Namespace, deployment.Name),
336336
Description: model.KubernetesDeploymentDescription{
337337
MetaObject: helpers.ConvertObjectMeta(&deployment.ObjectMeta),
338-
Deployment: deployment,
338+
Deployment: helpers.ConvertDeployment(&deployment),
339339
},
340340
}
341341

@@ -368,7 +368,7 @@ func KubernetesEndpointSlice(ctx context.Context, client model.Client, extra str
368368
Name: fmt.Sprintf("%s/%s", endpointSlice.Namespace, endpointSlice.Name),
369369
Description: model.KubernetesEndpointSliceDescription{
370370
MetaObject: helpers.ConvertObjectMeta(&endpointSlice.ObjectMeta),
371-
EndpointSlice: endpointSlice,
371+
EndpointSlice: helpers.ConvertEndpointSlice(&endpointSlice),
372372
},
373373
}
374374
if stream != nil {
@@ -400,7 +400,7 @@ func KubernetesEndpoint(ctx context.Context, client model.Client, extra string,
400400
Name: fmt.Sprintf("%s/%s", endpoint.Namespace, endpoint.Name),
401401
Description: model.KubernetesEndpointDescription{
402402
MetaObject: helpers.ConvertObjectMeta(&endpoint.ObjectMeta),
403-
Endpoint: endpoint,
403+
Endpoint: helpers.ConvertEndpoints(&endpoint),
404404
},
405405
}
406406
if stream != nil {
@@ -432,7 +432,7 @@ func KubernetesEvent(ctx context.Context, client model.Client, extra string, str
432432
Name: fmt.Sprintf("%s/%s", event.Namespace, event.Name),
433433
Description: model.KubernetesEventDescription{
434434
MetaObject: helpers.ConvertObjectMeta(&event.ObjectMeta),
435-
Event: event,
435+
Event: helpers.ConvertEvent(&event),
436436
},
437437
}
438438
if stream != nil {
@@ -464,7 +464,7 @@ func KubernetesHorizontalPodAutoscaler(ctx context.Context, client model.Client,
464464
Name: fmt.Sprintf("%s/%s", horizontalPodAutoscaler.Namespace, horizontalPodAutoscaler.Name),
465465
Description: model.KubernetesHorizontalPodAutoscalerDescription{
466466
MetaObject: helpers.ConvertObjectMeta(&horizontalPodAutoscaler.ObjectMeta),
467-
HorizontalPodAutoscaler: horizontalPodAutoscaler,
467+
HorizontalPodAutoscaler: helpers.ConvertHorizontalPodAutoscaler(&horizontalPodAutoscaler),
468468
},
469469
}
470470
if stream != nil {
@@ -496,7 +496,7 @@ func KubernetesIngress(ctx context.Context, client model.Client, extra string, s
496496
Name: fmt.Sprintf("%s/%s", ingress.Namespace, ingress.Name),
497497
Description: model.KubernetesIngressDescription{
498498
MetaObject: helpers.ConvertObjectMeta(&ingress.ObjectMeta),
499-
Ingress: ingress,
499+
Ingress: helpers.ConvertIngress(&ingress),
500500
},
501501
}
502502
if stream != nil {
@@ -560,7 +560,7 @@ func KubernetesLimitRange(ctx context.Context, client model.Client, extra string
560560
Name: fmt.Sprintf("%s/%s", limitRange.Namespace, limitRange.Name),
561561
Description: model.KubernetesLimitRangeDescription{
562562
MetaObject: helpers.ConvertObjectMeta(&limitRange.ObjectMeta),
563-
LimitRange: limitRange,
563+
LimitRange: helpers.ConvertLimitRange(&limitRange),
564564
},
565565
}
566566
if stream != nil {
@@ -592,7 +592,7 @@ func KubernetesNamespace(ctx context.Context, client model.Client, extra string,
592592
Name: namespace.Name,
593593
Description: model.KubernetesNamespaceDescription{
594594
MetaObject: helpers.ConvertObjectMeta(&namespace.ObjectMeta),
595-
Namespace: namespace,
595+
Namespace: helpers.ConvertNamespace(&namespace),
596596
},
597597
}
598598
if stream != nil {
@@ -624,7 +624,7 @@ func KubernetesNetworkPolicy(ctx context.Context, client model.Client, extra str
624624
Name: fmt.Sprintf("%s/%s", networkPolicy.Namespace, networkPolicy.Name),
625625
Description: model.KubernetesNetworkPolicyDescription{
626626
MetaObject: helpers.ConvertObjectMeta(&networkPolicy.ObjectMeta),
627-
NetworkPolicy: networkPolicy,
627+
NetworkPolicy: helpers.ConvertNetworkPolicy(&networkPolicy),
628628
},
629629
}
630630
if stream != nil {
@@ -657,7 +657,7 @@ func KubernetesNode(ctx context.Context, client model.Client, extra string, stre
657657
Name: node.Name,
658658
Description: model.KubernetesNodeDescription{
659659
MetaObject: helpers.ConvertObjectMeta(&node.ObjectMeta),
660-
Node: node,
660+
Node: helpers.ConvertNode(&node),
661661
},
662662
}
663663

@@ -691,7 +691,7 @@ func KubernetesPersistentVolume(ctx context.Context, client model.Client, extra
691691
Name: pv.Name,
692692
Description: model.KubernetesPersistentVolumeDescription{
693693
MetaObject: helpers.ConvertObjectMeta(&pv.ObjectMeta),
694-
PV: pv,
694+
PV: helpers.ConvertPersistentVolume(&pv),
695695
},
696696
}
697697

@@ -724,7 +724,7 @@ func KubernetesPersistentVolumeClaim(ctx context.Context, client model.Client, e
724724
Name: fmt.Sprintf("%s/%s", pvc.Namespace, pvc.Name),
725725
Description: model.KubernetesPersistentVolumeClaimDescription{
726726
MetaObject: helpers.ConvertObjectMeta(&pvc.ObjectMeta),
727-
PVC: pvc,
727+
PVC: helpers.ConvertPersistentVolumeClaim(&pvc),
728728
},
729729
}
730730

@@ -757,7 +757,7 @@ func KubernetesPod(ctx context.Context, client model.Client, extra string, strea
757757
Name: fmt.Sprintf("%s/%s", pod.Namespace, pod.Name),
758758
Description: model.KubernetesPodDescription{
759759
MetaObject: helpers.ConvertObjectMeta(&pod.ObjectMeta),
760-
Pod: pod,
760+
Pod: helpers.ConvertPod(&pod),
761761
},
762762
}
763763

@@ -790,7 +790,7 @@ func KubernetesPodDisruptionBudget(ctx context.Context, client model.Client, ext
790790
Name: fmt.Sprintf("%s/%s", podDisruptionBudget.Namespace, podDisruptionBudget.Name),
791791
Description: model.KubernetesPodDisruptionBudgetDescription{
792792
MetaObject: helpers.ConvertObjectMeta(&podDisruptionBudget.ObjectMeta),
793-
PodDisruptionBudget: podDisruptionBudget,
793+
PodDisruptionBudget: helpers.ConvertPodDisruptionBudget(&podDisruptionBudget),
794794
},
795795
}
796796

@@ -823,7 +823,7 @@ func KubernetesPodTemplate(ctx context.Context, client model.Client, extra strin
823823
Name: fmt.Sprintf("%s/%s", podTemplate.Namespace, podTemplate.Name),
824824
Description: model.KubernetesPodTemplateDescription{
825825
MetaObject: helpers.ConvertObjectMeta(&podTemplate.ObjectMeta),
826-
PodTemplate: podTemplate,
826+
PodTemplate: helpers.ConvertPodTemplate(&podTemplate),
827827
},
828828
}
829829

@@ -856,7 +856,7 @@ func KubernetesReplicaSet(ctx context.Context, client model.Client, extra string
856856
Name: fmt.Sprintf("%s/%s", replicaSet.Namespace, replicaSet.Name),
857857
Description: model.KubernetesReplicaSetDescription{
858858
MetaObject: helpers.ConvertObjectMeta(&replicaSet.ObjectMeta),
859-
ReplicaSet: replicaSet,
859+
ReplicaSet: helpers.ConvertReplicaSet(&replicaSet),
860860
},
861861
}
862862

@@ -889,7 +889,7 @@ func KubernetesReplicationController(ctx context.Context, client model.Client, e
889889
Name: fmt.Sprintf("%s/%s", replicationController.Namespace, replicationController.Name),
890890
Description: model.KubernetesReplicationControllerDescription{
891891
MetaObject: helpers.ConvertObjectMeta(&replicationController.ObjectMeta),
892-
ReplicationController: replicationController,
892+
ReplicationController: helpers.ConvertReplicationController(&replicationController),
893893
},
894894
}
895895

@@ -922,7 +922,7 @@ func KubernetesResourceQuota(ctx context.Context, client model.Client, extra str
922922
Name: fmt.Sprintf("%s/%s", resourceQuota.Namespace, resourceQuota.Name),
923923
Description: model.KubernetesResourceQuotaDescription{
924924
MetaObject: helpers.ConvertObjectMeta(&resourceQuota.ObjectMeta),
925-
ResourceQuota: resourceQuota,
925+
ResourceQuota: helpers.ConvertResourceQuota(&resourceQuota),
926926
},
927927
}
928928

@@ -955,7 +955,7 @@ func KubernetesRole(ctx context.Context, client model.Client, extra string, stre
955955
Name: fmt.Sprintf("%s/%s", role.Namespace, role.Name),
956956
Description: model.KubernetesRoleDescription{
957957
MetaObject: helpers.ConvertObjectMeta(&role.ObjectMeta),
958-
Role: role,
958+
Role: helpers.ConvertRole(&role),
959959
},
960960
}
961961

@@ -988,7 +988,7 @@ func KubernetesRoleBinding(ctx context.Context, client model.Client, extra strin
988988
Name: fmt.Sprintf("%s/%s", roleBinding.Namespace, roleBinding.Name),
989989
Description: model.KubernetesRoleBindingDescription{
990990
MetaObject: helpers.ConvertObjectMeta(&roleBinding.ObjectMeta),
991-
RoleBinding: roleBinding,
991+
RoleBinding: helpers.ConvertRoleBinding(&roleBinding),
992992
},
993993
}
994994

@@ -1024,7 +1024,7 @@ func KubernetesSecret(ctx context.Context, client model.Client, extra string, st
10241024
Name: fmt.Sprintf("%s/%s", secret.Namespace, secret.Name),
10251025
Description: model.KubernetesSecretDescription{
10261026
MetaObject: helpers.ConvertObjectMeta(&secret.ObjectMeta),
1027-
Secret: secret,
1027+
Secret: helpers.ConvertSecret(&secret),
10281028
},
10291029
}
10301030

@@ -1057,7 +1057,7 @@ func KubernetesService(ctx context.Context, client model.Client, extra string, s
10571057
Name: fmt.Sprintf("%s/%s", service.Namespace, service.Name),
10581058
Description: model.KubernetesServiceDescription{
10591059
MetaObject: helpers.ConvertObjectMeta(&service.ObjectMeta),
1060-
Service: service,
1060+
Service: helpers.ConvertService(&service),
10611061
},
10621062
}
10631063

@@ -1090,7 +1090,7 @@ func KubernetesServiceAccount(ctx context.Context, client model.Client, extra st
10901090
Name: fmt.Sprintf("%s/%s", serviceAccount.Namespace, serviceAccount.Name),
10911091
Description: model.KubernetesServiceAccountDescription{
10921092
MetaObject: helpers.ConvertObjectMeta(&serviceAccount.ObjectMeta),
1093-
ServiceAccount: serviceAccount,
1093+
ServiceAccount: helpers.ConvertServiceAccount(&serviceAccount),
10941094
},
10951095
}
10961096

@@ -1123,7 +1123,7 @@ func KubernetesStatefulSet(ctx context.Context, client model.Client, extra strin
11231123
Name: fmt.Sprintf("%s/%s", statefulSet.Namespace, statefulSet.Name),
11241124
Description: model.KubernetesStatefulSetDescription{
11251125
MetaObject: helpers.ConvertObjectMeta(&statefulSet.ObjectMeta),
1126-
StatefulSet: statefulSet,
1126+
StatefulSet: helpers.ConvertStatefulSet(&statefulSet),
11271127
},
11281128
}
11291129

@@ -1156,7 +1156,7 @@ func KubernetesStorageClass(ctx context.Context, client model.Client, extra stri
11561156
Name: storageClass.Name,
11571157
Description: model.KubernetesStorageClassDescription{
11581158
MetaObject: helpers.ConvertObjectMeta(&storageClass.ObjectMeta),
1159-
StorageClass: storageClass,
1159+
StorageClass: helpers.ConvertStorageClass(&storageClass),
11601160
},
11611161
}
11621162

0 commit comments

Comments
 (0)