()
| 81 | } |
| 82 | |
| 83 | func (s Selector) String() string { |
| 84 | if len(s.ImageSelector) == 0 && len(s.LabelSelector) == 0 && s.Pod == "" { |
| 85 | return "everything selector" |
| 86 | } |
| 87 | |
| 88 | strs := []string{} |
| 89 | if len(s.ImageSelector) > 0 { |
| 90 | strs = append(strs, "image selector: "+strings.Join(s.ImageSelector, ",")) |
| 91 | } |
| 92 | if len(s.LabelSelector) > 0 { |
| 93 | if s.ContainerName != "" { |
| 94 | strs = append(strs, "label selector: "+s.LabelSelector+" - container: "+s.ContainerName) |
| 95 | } else { |
| 96 | strs = append(strs, "label selector: "+s.LabelSelector) |
| 97 | } |
| 98 | } |
| 99 | if s.Pod != "" { |
| 100 | strs = append(strs, "pod name: "+s.Pod) |
| 101 | } |
| 102 | |
| 103 | return strings.Join(strs, ", ") |
| 104 | } |
| 105 | |
| 106 | type FilterContainer func(p *corev1.Pod, c *corev1.Container) bool |
| 107 | type SortContainers func(containers []*SelectedPodContainer, i, j int) bool |
no outgoing calls