Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
33e61267
Commit
33e61267
authored
Apr 02, 2019
by
draveness
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: use bytes.NewReader(nil) instead of stdin in genyaml
parent
6b288273
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
gen_kubectl_yaml.go
cmd/genyaml/gen_kubectl_yaml.go
+2
-2
genyaml
cmd/genyaml/genyaml
+0
-0
No files found.
cmd/genyaml/gen_kubectl_yaml.go
View file @
33e61267
...
@@ -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
)
...
...
cmd/genyaml/genyaml
0 → 100755
View file @
33e61267
File added
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment