chore: address some gaps in infra (#6871)

This commit is contained in:
Srikanth Chekuri 2025-01-21 23:25:15 +05:30 committed by GitHub
parent 403043e076
commit 0baf0e9453
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 17 additions and 13 deletions

View File

@ -164,7 +164,8 @@ function K8sClustersList({
} = useGetAggregateKeys(
{
dataSource: currentQuery.builder.queryData[0].dataSource,
aggregateAttribute: K8sEntityToAggregateAttributeMapping[K8sCategory.NODES],
aggregateAttribute:
K8sEntityToAggregateAttributeMapping[K8sCategory.CLUSTERS],
aggregateOperator: 'noop',
searchText: '',
tagType: '',

View File

@ -165,7 +165,8 @@ function K8sDeploymentsList({
} = useGetAggregateKeys(
{
dataSource: currentQuery.builder.queryData[0].dataSource,
aggregateAttribute: K8sEntityToAggregateAttributeMapping[K8sCategory.NODES],
aggregateAttribute:
K8sEntityToAggregateAttributeMapping[K8sCategory.DEPLOYMENTS],
aggregateOperator: 'noop',
searchText: '',
tagType: '',

View File

@ -164,7 +164,8 @@ function K8sNamespacesList({
} = useGetAggregateKeys(
{
dataSource: currentQuery.builder.queryData[0].dataSource,
aggregateAttribute: K8sEntityToAggregateAttributeMapping[K8sCategory.NODES],
aggregateAttribute:
K8sEntityToAggregateAttributeMapping[K8sCategory.NAMESPACES],
aggregateOperator: 'noop',
searchText: '',
tagType: '',

View File

@ -19,7 +19,8 @@ var (
clusterAttrsToEnrich = []string{"k8s_cluster_name"}
k8sClusterUIDAttrKey = "k8s_cluster_uid"
// TODO(srikanthccv): change this to k8s_cluster_uid after showing the missing data banner
k8sClusterUIDAttrKey = "k8s_cluster_name"
queryNamesForClusters = map[string][]string{
"cpu": {"A"},
@ -319,7 +320,7 @@ func (p *ClustersRepo) GetClusterList(ctx context.Context, req model.ClusterList
}
record.Meta = map[string]string{}
if _, ok := clusterAttrs[record.ClusterUID]; ok {
if _, ok := clusterAttrs[record.ClusterUID]; ok && record.ClusterUID != "" {
record.Meta = clusterAttrs[record.ClusterUID]
}

View File

@ -421,7 +421,7 @@ func (d *DaemonSetsRepo) GetDaemonSetList(ctx context.Context, req model.DaemonS
}
record.Meta = map[string]string{}
if _, ok := daemonSetAttrs[record.DaemonSetName]; ok {
if _, ok := daemonSetAttrs[record.DaemonSetName]; ok && record.DaemonSetName != "" {
record.Meta = daemonSetAttrs[record.DaemonSetName]
}

View File

@ -421,7 +421,7 @@ func (d *DeploymentsRepo) GetDeploymentList(ctx context.Context, req model.Deplo
}
record.Meta = map[string]string{}
if _, ok := deploymentAttrs[record.DeploymentName]; ok {
if _, ok := deploymentAttrs[record.DeploymentName]; ok && record.DeploymentName != "" {
record.Meta = deploymentAttrs[record.DeploymentName]
}

View File

@ -475,7 +475,7 @@ func (d *JobsRepo) GetJobList(ctx context.Context, req model.JobListRequest) (mo
}
record.Meta = map[string]string{}
if _, ok := jobAttrs[record.JobName]; ok {
if _, ok := jobAttrs[record.JobName]; ok && record.JobName != "" {
record.Meta = jobAttrs[record.JobName]
}

View File

@ -322,7 +322,7 @@ func (p *NamespacesRepo) GetNamespaceList(ctx context.Context, req model.Namespa
}
record.Meta = map[string]string{}
if _, ok := namespaceAttrs[record.NamespaceName]; ok {
if _, ok := namespaceAttrs[record.NamespaceName]; ok && record.NamespaceName != "" {
record.Meta = namespaceAttrs[record.NamespaceName]
}

View File

@ -335,7 +335,7 @@ func (p *NodesRepo) GetNodeList(ctx context.Context, req model.NodeListRequest)
}
record.Meta = map[string]string{}
if _, ok := nodeAttrs[record.NodeUID]; ok {
if _, ok := nodeAttrs[record.NodeUID]; ok && record.NodeUID != "" {
record.Meta = nodeAttrs[record.NodeUID]
}

View File

@ -385,7 +385,7 @@ func (p *PodsRepo) GetPodList(ctx context.Context, req model.PodListRequest) (mo
}
record.Meta = map[string]string{}
if _, ok := podAttrs[record.PodUID]; ok {
if _, ok := podAttrs[record.PodUID]; ok && record.PodUID != "" {
record.Meta = podAttrs[record.PodUID]
}

View File

@ -355,7 +355,7 @@ func (p *PvcsRepo) GetPvcList(ctx context.Context, req model.VolumeListRequest)
record.VolumeUsage = record.VolumeCapacity - record.VolumeAvailable
record.Meta = map[string]string{}
if _, ok := volumeAttrs[record.PersistentVolumeClaimName]; ok {
if _, ok := volumeAttrs[record.PersistentVolumeClaimName]; ok && record.PersistentVolumeClaimName != "" {
record.Meta = volumeAttrs[record.PersistentVolumeClaimName]
}

View File

@ -421,7 +421,7 @@ func (d *StatefulSetsRepo) GetStatefulSetList(ctx context.Context, req model.Sta
}
record.Meta = map[string]string{}
if _, ok := statefulSetAttrs[record.StatefulSetName]; ok {
if _, ok := statefulSetAttrs[record.StatefulSetName]; ok && record.StatefulSetName != "" {
record.Meta = statefulSetAttrs[record.StatefulSetName]
}