Federate resource from standard input
@@ -212,10 +212,17 @@ func getResourcesInNamespace(config *rest.Config, namespace string, skipAPIResou
// decodeUnstructuredFromFile reads a list of yamls into a slice of unstructured objects
func decodeUnstructuredFromFile(filename string) ([]*unstructured.Unstructured, error) {
- f, err := os.Open(filename)
+ var f *os.File
+ if filename == "-" {
+ f = os.Stdin
+ } else {
+ var err error
+ f, err = os.Open(filename)
+
if err != nil {
return nil, err
}
+ }
defer f.Close()
var unstructuredList []*unstructured.Unstructured
