Commit 33e61267 authored by draveness's avatar draveness

feat: use bytes.NewReader(nil) instead of stdin in genyaml

parent 6b288273
...@@ -17,6 +17,7 @@ limitations under the License. ...@@ -17,6 +17,7 @@ limitations under the License.
package main package main
import ( import (
"bytes"
"fmt" "fmt"
"io/ioutil" "io/ioutil"
"os" "os"
...@@ -64,8 +65,7 @@ func main() { ...@@ -64,8 +65,7 @@ func main() {
// Set environment variables used by kubectl so the output is consistent, // Set environment variables used by kubectl so the output is consistent,
// regardless of where we run. // regardless of where we run.
os.Setenv("HOME", "/home/username") os.Setenv("HOME", "/home/username")
// TODO os.Stdin should really be something like ioutil.Discard, but a Reader kubectl := cmd.NewKubectlCommand(bytes.NewReader(nil), ioutil.Discard, ioutil.Discard)
kubectl := cmd.NewKubectlCommand(os.Stdin, ioutil.Discard, ioutil.Discard)
genYaml(kubectl, "", outDir) genYaml(kubectl, "", outDir)
for _, c := range kubectl.Commands() { for _, c := range kubectl.Commands() {
genYaml(c, "kubectl", outDir) genYaml(c, "kubectl", outDir)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment