// Filters lines in the result table based on the pod labels
Filters lines in the result table based on the pod labels
// Filters lines in the result table based on the pod labels
func filterLinesBasedOnPodLabels(tableLines []TableLine, pod *corev1.Pod) []TableLine {
	var filteredTable []TableLine
	for _, line := range tableLines {
		if line.pods != Wildcard {
			labels := strings.Split(line.pods, "\n")
			for _, label := range labels {
				keyValue := strings.Split(label, "=")
				if pod.Labels[keyValue[0]] == keyValue[1] {
					filteredTable = append(filteredTable, line)
				}
			}
		} else {
			filteredTable = append(filteredTable, line)
		}
	}
	return filteredTable
}
func filterLinesBasedOnPodLabels ( tableLines [ ] TableLine , pod * corev1 . Pod ) [ ] TableLine { var filteredTable [ ] TableLine for _ , line := range tableLines { if line . pods != Wildcard { labels := strings . Split ( line . pods , " \n " ) for _ , label := range labels { keyValue := strings . Split ( label , " " ) if pod . Labels [ keyValue [ 0 ] ] == keyValue [ 1 ] { filteredTable = append ( filteredTable , line ) } } } else { filteredTable = append ( filteredTable , line ) } } return filteredTable }
Filters lines in the result table based on the pod labels
Filters lines in the result table based on the pod labels