File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change 11package main
22
33import (
4- "os"
5-
64 "github.com/sirupsen/logrus"
75 "github.com/spf13/cobra"
86
@@ -11,11 +9,6 @@ import (
119
1210func main () {
1311
14- wd , err := os .Getwd ()
15- if err != nil {
16- logrus .Fatal (err )
17- }
18-
1912 nodesAddCmd := & cobra.Command {
2013 Use : "add-nodes" ,
2114 Short : "Generates an ISO that could be used to boot the configured nodes to let them join an existing cluster" ,
@@ -24,22 +17,27 @@ func main() {
2417 if err != nil {
2518 return err
2619 }
27- return nodejoiner .NewAddNodesCommand (wd , kubeConfig )
20+ dir , err := cmd .Flags ().GetString ("dir" )
21+ if err != nil {
22+ return err
23+ }
24+ return nodejoiner .NewAddNodesCommand (dir , kubeConfig )
2825 },
2926 }
3027
3128 nodesMonitorCmd := & cobra.Command {
3229 Use : "monitor-add-nodes" ,
3330 Short : "Monitors the configured nodes while they are joining an existing cluster" ,
3431 RunE : func (cmd * cobra.Command , args []string ) error {
35- return nodejoiner .NewMonitorAddNodesCommand (wd )
32+ return nodejoiner .NewMonitorAddNodesCommand ("" )
3633 },
3734 }
3835
3936 rootCmd := & cobra.Command {
4037 Use : "node-joiner" ,
4138 }
4239 rootCmd .PersistentFlags ().String ("kubeconfig" , "" , "Path to the kubeconfig file." )
40+ rootCmd .PersistentFlags ().String ("dir" , "." , "assets directory" )
4341
4442 rootCmd .AddCommand (nodesAddCmd )
4543 rootCmd .AddCommand (nodesMonitorCmd )
You can’t perform that action at this time.
0 commit comments