MCPcopy
hub / github.com/open-policy-agent/gatekeeper / readStdin

Function readStdin

pkg/gator/reader/filereader.go:146–163  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

144}
145
146func 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
165func expandDirectories(filenames []string) ([]string, error) {
166 var output []string

Callers 1

ReadSourcesFunction · 0.85

Calls 1

ReadK8sResourcesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…