()
| 144 | } |
| 145 | |
| 146 | func readStdin() ([]*unstructured.Unstructured, error) { |
| 147 | stdinfo, err := os.Stdin.Stat() |
| 148 | if err != nil { |
| 149 | return nil, fmt.Errorf("getting stdin info: %w", err) |
| 150 | } |
| 151 | |
| 152 | // check if data is being piped or redirected to stdin |
| 153 | if (stdinfo.Mode() & os.ModeCharDevice) != 0 { |
| 154 | return nil, nil |
| 155 | } |
| 156 | |
| 157 | us, err := ReadK8sResources(os.Stdin) |
| 158 | if err != nil { |
| 159 | return nil, fmt.Errorf("reading: %w", err) |
| 160 | } |
| 161 | |
| 162 | return us, nil |
| 163 | } |
| 164 | |
| 165 | func expandDirectories(filenames []string) ([]string, error) { |
| 166 | var output []string |
no test coverage detected
searching dependent graphs…