add missing errchecks
This commit is contained in:
parent
ac43655396
commit
8c965a9f16
@ -22,6 +22,7 @@ THE SOFTWARE.
|
|||||||
package create
|
package create
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
log "github.com/sirupsen/logrus"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -34,7 +35,10 @@ func NewCmdCreate() *cobra.Command {
|
|||||||
Short: "Create a resource [cluster, node].",
|
Short: "Create a resource [cluster, node].",
|
||||||
Long: `Create a resource [cluster, node].`,
|
Long: `Create a resource [cluster, node].`,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
cmd.Help()
|
if err := cmd.Help(); err != nil {
|
||||||
|
log.Errorln("Couldn't get help text")
|
||||||
|
log.Fatalln(err)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -41,7 +41,9 @@ func NewCmdCreateCluster() *cobra.Command {
|
|||||||
Long: `Create a new k3s cluster with containerized nodes (k3s in docker).`,
|
Long: `Create a new k3s cluster with containerized nodes (k3s in docker).`,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
runtime, cluster := parseCmd(cmd, args)
|
runtime, cluster := parseCmd(cmd, args)
|
||||||
k3dCluster.CreateCluster(cluster, runtime)
|
if err := k3dCluster.CreateCluster(cluster, runtime); err != nil {
|
||||||
|
log.Fatalln(err)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -43,7 +43,9 @@ func NewCmdCreateNode() *cobra.Command {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.Debugln("runtime not defined")
|
log.Debugln("runtime not defined")
|
||||||
}
|
}
|
||||||
cluster.CreateNode(&k3d.Node{}, rt)
|
if err := cluster.CreateNode(&k3d.Node{}, rt); err != nil {
|
||||||
|
log.Fatalln(err)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -42,7 +42,9 @@ func NewCmdDeleteNode() *cobra.Command {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.Debugln("runtime not defined")
|
log.Debugln("runtime not defined")
|
||||||
}
|
}
|
||||||
cluster.DeleteNode(&k3d.Node{Name: "test"}, rt)
|
if err := cluster.DeleteNode(&k3d.Node{Name: "test"}, rt); err != nil {
|
||||||
|
log.Fatalln(err)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user