diff --git a/cmd/create/createCluster.go b/cmd/create/createCluster.go index 0b55e22b..9fa4bf36 100644 --- a/cmd/create/createCluster.go +++ b/cmd/create/createCluster.go @@ -98,7 +98,6 @@ func NewCmdCreateCluster() *cobra.Command { fmt.Printf("kubectl config use-context %s\n", fmt.Sprintf("%s-%s", k3d.DefaultObjectNamePrefix, cluster.Name)) } else { if runtime.GOOS == "windows" { - log.Debugf("GOOS is %s", runtime.GOOS) fmt.Printf("$env:KUBECONFIG=(%s get kubeconfig %s)\n", os.Args[0], cluster.Name) } else { fmt.Printf("export KUBECONFIG=$(%s get kubeconfig %s)\n", os.Args[0], cluster.Name) diff --git a/cmd/delete/deleteCluster.go b/cmd/delete/deleteCluster.go index c1578a96..fcd08f86 100644 --- a/cmd/delete/deleteCluster.go +++ b/cmd/delete/deleteCluster.go @@ -40,8 +40,6 @@ func NewCmdDeleteCluster() *cobra.Command { Long: `Delete a cluster.`, Args: cobra.MinimumNArgs(0), // 0 or n arguments; 0 only if --all is set Run: func(cmd *cobra.Command, args []string) { - log.Debugln("delete cluster called") - clusters := parseDeleteClusterCmd(cmd, args) if len(clusters) == 0 { diff --git a/cmd/delete/deleteNode.go b/cmd/delete/deleteNode.go index 9a11ce3f..f4333c36 100644 --- a/cmd/delete/deleteNode.go +++ b/cmd/delete/deleteNode.go @@ -39,7 +39,6 @@ func NewCmdDeleteNode() *cobra.Command { Long: `Delete a node.`, Args: cobra.MinimumNArgs(1), // at least one node has to be specified Run: func(cmd *cobra.Command, args []string) { - log.Debugln("delete node called") nodes := parseDeleteNodeCmd(cmd, args) @@ -52,8 +51,6 @@ func NewCmdDeleteNode() *cobra.Command { } } } - - log.Debugln("...Finished") }, } diff --git a/cmd/get/getCluster.go b/cmd/get/getCluster.go index ac72c546..db8a9a37 100644 --- a/cmd/get/getCluster.go +++ b/cmd/get/getCluster.go @@ -48,7 +48,6 @@ func NewCmdGetCluster() *cobra.Command { Long: `Get cluster.`, Args: cobra.MinimumNArgs(0), // 0 or more; 0 = all Run: func(cmd *cobra.Command, args []string) { - log.Debugln("get cluster called") clusters, headersOff := parseGetClusterCmd(cmd, args) var existingClusters []*k3d.Cluster if clusters == nil { // Option a) no cluster name specified -> get all clusters diff --git a/cmd/get/getNode.go b/cmd/get/getNode.go index 1cae1b46..66628f30 100644 --- a/cmd/get/getNode.go +++ b/cmd/get/getNode.go @@ -46,7 +46,6 @@ func NewCmdGetNode() *cobra.Command { Aliases: []string{"nodes"}, Long: `Get node.`, Run: func(cmd *cobra.Command, args []string) { - log.Debugln("get node called") node, headersOff := parseGetNodeCmd(cmd, args) var existingNodes []*k3d.Node if node == nil { // Option a) no name specified -> get all nodes diff --git a/cmd/load/loadImage.go b/cmd/load/loadImage.go index 1551cffc..f2588438 100644 --- a/cmd/load/loadImage.go +++ b/cmd/load/loadImage.go @@ -44,13 +44,13 @@ func NewCmdLoadImage() *cobra.Command { images, clusters, keepTarball := parseLoadImageCmd(cmd, args) log.Debugf("Load images [%+v] from runtime [%s] into clusters [%+v]", images, runtimes.SelectedRuntime, clusters) for _, cluster := range clusters { - log.Debugf("Loading images into '%s'", cluster.Name) + log.Infof("Loading images into '%s'", cluster.Name) if err := tools.LoadImagesIntoCluster(cmd.Context(), runtimes.SelectedRuntime, images, &cluster, keepTarball); err != nil { log.Errorf("Failed to load images into cluster '%s'", cluster.Name) log.Errorln(err) } } - log.Debugln("Finished loading images into clusters") + log.Info("DONE") }, } diff --git a/cmd/start/startCluster.go b/cmd/start/startCluster.go index bcc7cd03..0b946186 100644 --- a/cmd/start/startCluster.go +++ b/cmd/start/startCluster.go @@ -40,7 +40,6 @@ func NewCmdStartCluster() *cobra.Command { Short: "Start an existing k3d cluster", Long: `Start an existing k3d cluster`, Run: func(cmd *cobra.Command, args []string) { - log.Debugln("start cluster called") clusters := parseStartClusterCmd(cmd, args) if len(clusters) == 0 { log.Infoln("No clusters found") @@ -51,8 +50,6 @@ func NewCmdStartCluster() *cobra.Command { } } } - - log.Debugln("...Finished") }, } diff --git a/cmd/start/startNode.go b/cmd/start/startNode.go index 9afb2c97..0e563b4b 100644 --- a/cmd/start/startNode.go +++ b/cmd/start/startNode.go @@ -38,7 +38,6 @@ func NewCmdStartNode() *cobra.Command { Short: "Start an existing k3d node", Long: `Start an existing k3d node.`, Run: func(cmd *cobra.Command, args []string) { - log.Debugln("start node called") node := parseStartNodeCmd(cmd, args) if err := runtimes.SelectedRuntime.StartNode(cmd.Context(), node); err != nil { log.Fatalln(err) diff --git a/cmd/stop/stopCluster.go b/cmd/stop/stopCluster.go index 81d93a18..cdc047db 100644 --- a/cmd/stop/stopCluster.go +++ b/cmd/stop/stopCluster.go @@ -40,7 +40,6 @@ func NewCmdStopCluster() *cobra.Command { Short: "Stop an existing k3d cluster", Long: `Stop an existing k3d cluster.`, Run: func(cmd *cobra.Command, args []string) { - log.Debugln("stop cluster called") clusters := parseStopClusterCmd(cmd, args) if len(clusters) == 0 { log.Infoln("No clusters found") @@ -51,8 +50,6 @@ func NewCmdStopCluster() *cobra.Command { } } } - - log.Debugln("...Finished") }, } diff --git a/cmd/stop/stopNode.go b/cmd/stop/stopNode.go index f47af9f3..80dbda3d 100644 --- a/cmd/stop/stopNode.go +++ b/cmd/stop/stopNode.go @@ -39,7 +39,6 @@ func NewCmdStopNode() *cobra.Command { Short: "Stop an existing k3d node", Long: `Stop an existing k3d node.`, Run: func(cmd *cobra.Command, args []string) { - log.Debugln("stop node called") node := parseStopNodeCmd(cmd, args) if err := runtimes.SelectedRuntime.StopNode(cmd.Context(), node); err != nil { log.Fatalln(err) diff --git a/install.sh b/install.sh index 41b2fade..f5b77d1b 100755 --- a/install.sh +++ b/install.sh @@ -23,7 +23,7 @@ initArch() { # initOS discovers the operating system for this system. initOS() { - OS=$(echo `uname`|tr '[:upper:]' '[:lower:]') + OS=$(uname|tr '[:upper:]' '[:lower:]') case "$OS" in # Minimalist GNU for Windows diff --git a/pkg/cluster/cluster.go b/pkg/cluster/cluster.go index 9ffb25ad..570045c6 100644 --- a/pkg/cluster/cluster.go +++ b/pkg/cluster/cluster.go @@ -320,7 +320,7 @@ func CreateCluster(ctx context.Context, runtime k3drt.Runtime, cluster *k3d.Clus func DeleteCluster(ctx context.Context, runtime k3drt.Runtime, cluster *k3d.Cluster) error { log.Infof("Deleting cluster '%s'", cluster.Name) - log.Debugf("%+v", cluster) + log.Debugf("Cluster Details: %+v", cluster) failed := 0 for _, node := range cluster.Nodes { diff --git a/pkg/cluster/loadbalancer.go b/pkg/cluster/loadbalancer.go index bd7442ed..a1310bd5 100644 --- a/pkg/cluster/loadbalancer.go +++ b/pkg/cluster/loadbalancer.go @@ -47,7 +47,7 @@ func AddMasterToLoadBalancer(ctx context.Context, runtime runtimes.Runtime, clus } masterNodes += newNode.Name // append the new master node to the end of the list - log.Debugf("SERVERS=%s", masterNodes) + log.Debugf("Servers as passed to masterlb: '%s'", masterNodes) command := fmt.Sprintf("SERVERS=%s %s", masterNodes, "confd -onetime -backend env && nginx -s reload") if err := runtime.ExecInNode(ctx, loadbalancer, []string{"sh", "-c", command}); err != nil { diff --git a/pkg/cluster/node.go b/pkg/cluster/node.go index 230d4ed4..c8434bfe 100644 --- a/pkg/cluster/node.go +++ b/pkg/cluster/node.go @@ -162,7 +162,6 @@ func CreateNode(ctx context.Context, runtime runtimes.Runtime, node *k3d.Node) e if err := patchMasterSpec(node); err != nil { return err } - log.Debugf("spec = %+v\n", node) } /* diff --git a/pkg/runtimes/containerd/node.go b/pkg/runtimes/containerd/node.go index 324efbf4..aecfe860 100644 --- a/pkg/runtimes/containerd/node.go +++ b/pkg/runtimes/containerd/node.go @@ -34,8 +34,6 @@ import ( // CreateNode creates a new k3d node func (d Containerd) CreateNode(ctx context.Context, node *k3d.Node) error { - log.Debugln("containerd.CreateNode...") - // create containerd client clientOpts := []containerd.ClientOpt{ containerd.WithDefaultNamespace("k3d"), @@ -77,7 +75,6 @@ func (d Containerd) CreateNode(ctx context.Context, node *k3d.Node) error { // DeleteNode deletes an existing k3d node func (d Containerd) DeleteNode(ctx context.Context, node *k3d.Node) error { - log.Debugln("containerd.DeleteNode...") clientOpts := []containerd.ClientOpt{ containerd.WithDefaultNamespace("k3d"), } diff --git a/pkg/runtimes/docker/kubeconfig.go b/pkg/runtimes/docker/kubeconfig.go index ad7cc85d..8d6ff606 100644 --- a/pkg/runtimes/docker/kubeconfig.go +++ b/pkg/runtimes/docker/kubeconfig.go @@ -45,7 +45,7 @@ func (d Docker) GetKubeconfig(ctx context.Context, node *k3d.Node) (io.ReadClose return nil, err } - log.Debugf("Container: %+v", container) + log.Debugf("Container Details: %+v", container) reader, _, err := docker.CopyFromContainer(ctx, container.ID, "/output/kubeconfig.yaml") if err != nil { diff --git a/pkg/runtimes/docker/node.go b/pkg/runtimes/docker/node.go index 5443aa99..fc418a0c 100644 --- a/pkg/runtimes/docker/node.go +++ b/pkg/runtimes/docker/node.go @@ -57,7 +57,6 @@ func (d Docker) CreateNode(ctx context.Context, node *k3d.Node) error { // DeleteNode deletes a node func (d Docker) DeleteNode(ctx context.Context, nodeSpec *k3d.Node) error { - log.Debugln("docker.DeleteNode...") return removeContainer(ctx, nodeSpec.Name) } @@ -252,7 +251,7 @@ func (d Docker) GetNodeLogs(ctx context.Context, node *k3d.Node) (io.ReadCloser, // ExecInNode execs a command inside a node func (d Docker) ExecInNode(ctx context.Context, node *k3d.Node, cmd []string) error { - log.Debugf("Exec cmds '%+v' in node '%s'", cmd, node.Name) + log.Debugf("Executing command '%+v' in node '%s'", cmd, node.Name) // get the container for the given node container, err := getNodeContainer(ctx, node)