Skip to content

Commit

Permalink
Switching from glob library to klog library.
Browse files Browse the repository at this point in the history
  • Loading branch information
PriyaModali committed Sep 29, 2020
1 parent 11cad2b commit 97d96bf
Show file tree
Hide file tree
Showing 137 changed files with 1,009 additions and 982 deletions.
5 changes: 3 additions & 2 deletions cmd/minikube/cmd/config/addons.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ limitations under the License.
package config

import (
"github.com/golang/glog"
"github.com/spf13/cobra"

"k8s.io/klog/v2"
)

// AddonsCmd represents the addons command
Expand All @@ -28,7 +29,7 @@ var AddonsCmd = &cobra.Command{
Long: `addons modifies minikube addons files using subcommands like "minikube addons enable dashboard"`,
Run: func(cmd *cobra.Command, args []string) {
if err := cmd.Help(); err != nil {
glog.Errorf("help: %v", err)
klog.Errorf("help: %v", err)
}
},
}
4 changes: 2 additions & 2 deletions cmd/minikube/cmd/config/addons_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import (
"sort"
"strings"

"github.com/golang/glog"
"github.com/olekukonko/tablewriter"
"github.com/spf13/cobra"
"k8s.io/klog/v2"
"k8s.io/minikube/pkg/minikube/assets"
"k8s.io/minikube/pkg/minikube/config"
"k8s.io/minikube/pkg/minikube/exit"
Expand Down Expand Up @@ -114,7 +114,7 @@ var printAddonsList = func(cc *config.ClusterConfig) {

v, _, err := config.ListProfiles()
if err != nil {
glog.Errorf("list profiles returned error: %v", err)
klog.Errorf("list profiles returned error: %v", err)
}
if len(v) > 1 {
out.T(style.Tip, "To see addons list for other profiles use: `minikube addons -p name list`")
Expand Down
4 changes: 2 additions & 2 deletions cmd/minikube/cmd/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ package config
import (
"strings"

"github.com/golang/glog"
"github.com/spf13/cobra"
"k8s.io/klog/v2"
"k8s.io/minikube/pkg/minikube/config"
"k8s.io/minikube/pkg/minikube/driver"
"k8s.io/minikube/pkg/minikube/localpath"
Expand Down Expand Up @@ -185,7 +185,7 @@ var ConfigCmd = &cobra.Command{
Configurable fields: ` + "\n\n" + configurableFields(),
Run: func(cmd *cobra.Command, args []string) {
if err := cmd.Help(); err != nil {
glog.Errorf("help: %v", err)
klog.Errorf("help: %v", err)
}
},
}
Expand Down
12 changes: 6 additions & 6 deletions cmd/minikube/cmd/config/profile_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"strconv"
"strings"

"k8s.io/klog/v2"
"k8s.io/minikube/pkg/minikube/config"
"k8s.io/minikube/pkg/minikube/driver"
"k8s.io/minikube/pkg/minikube/exit"
Expand All @@ -31,7 +32,6 @@ import (
"k8s.io/minikube/pkg/minikube/reason"
"k8s.io/minikube/pkg/minikube/style"

"github.com/golang/glog"
"github.com/olekukonko/tablewriter"
"github.com/spf13/cobra"
)
Expand Down Expand Up @@ -68,7 +68,7 @@ var printProfilesTable = func() {
}
api, err := machine.NewAPIClient()
if err != nil {
glog.Errorf("failed to get machine api client %v", err)
klog.Errorf("failed to get machine api client %v", err)
}
defer api.Close()

Expand All @@ -79,7 +79,7 @@ var printProfilesTable = func() {
}
p.Status, err = machine.Status(api, driver.MachineName(*p.Config, cp))
if err != nil {
glog.Warningf("error getting host status for %s: %v", p.Name, err)
klog.Warningf("error getting host status for %s: %v", p.Name, err)
}
validData = append(validData, []string{p.Name, p.Config.Driver, p.Config.KubernetesConfig.ContainerRuntime, cp.IP, strconv.Itoa(cp.Port), p.Config.KubernetesConfig.KubernetesVersion, p.Status})
}
Expand All @@ -100,14 +100,14 @@ var printProfilesTable = func() {
}

if err != nil {
glog.Warningf("error loading profiles: %v", err)
klog.Warningf("error loading profiles: %v", err)
}
}

var printProfilesJSON = func() {
api, err := machine.NewAPIClient()
if err != nil {
glog.Errorf("failed to get machine api client %v", err)
klog.Errorf("failed to get machine api client %v", err)
}
defer api.Close()

Expand All @@ -119,7 +119,7 @@ var printProfilesJSON = func() {
}
status, err := machine.Status(api, driver.MachineName(*v.Config, cp))
if err != nil {
glog.Warningf("error getting host status for %s: %v", v.Name, err)
klog.Warningf("error getting host status for %s: %v", v.Name, err)
}
v.Status = status
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/minikube/cmd/config/prompt.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
"os"
"strings"

"github.com/golang/glog"
"golang.org/x/crypto/ssh/terminal"
"k8s.io/klog/v2"
"k8s.io/minikube/pkg/minikube/out"
)

Expand Down Expand Up @@ -127,7 +127,7 @@ func AskForPasswordValue(s string) string {
}
defer func() {
if err := terminal.Restore(stdInFd, oldState); err != nil {
glog.Errorf("terminal restore failed: %v", err)
klog.Errorf("terminal restore failed: %v", err)
}
}()

Expand Down
18 changes: 9 additions & 9 deletions cmd/minikube/cmd/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ import (
"regexp"
"time"

"github.com/golang/glog"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"k8s.io/klog/v2"
"k8s.io/minikube/pkg/addons"
"k8s.io/minikube/pkg/minikube/assets"
"k8s.io/minikube/pkg/minikube/style"
Expand Down Expand Up @@ -61,7 +61,7 @@ var dashboardCmd = &cobra.Command{

for _, n := range co.Config.Nodes {
if err := proxy.ExcludeIP(n.IP); err != nil {
glog.Errorf("Error excluding IP from proxy: %s", err)
klog.Errorf("Error excluding IP from proxy: %s", err)
}
}

Expand Down Expand Up @@ -118,9 +118,9 @@ var dashboardCmd = &cobra.Command{
}
}

glog.Infof("Success! I will now quietly sit around until kubectl proxy exits!")
klog.Infof("Success! I will now quietly sit around until kubectl proxy exits!")
if err = p.Wait(); err != nil {
glog.Errorf("Wait: %v", err)
klog.Errorf("Wait: %v", err)
}
},
}
Expand All @@ -143,12 +143,12 @@ func kubectlProxy(kubectlVersion string, contextName string) (*exec.Cmd, string,
return nil, "", errors.Wrap(err, "cmd stdout")
}

glog.Infof("Executing: %s %s", cmd.Path, cmd.Args)
klog.Infof("Executing: %s %s", cmd.Path, cmd.Args)
if err := cmd.Start(); err != nil {
return nil, "", errors.Wrap(err, "proxy start")
}

glog.Infof("Waiting for kubectl to output host:port ...")
klog.Infof("Waiting for kubectl to output host:port ...")
reader := bufio.NewReader(stdoutPipe)

var out []byte
Expand All @@ -161,12 +161,12 @@ func kubectlProxy(kubectlVersion string, contextName string) (*exec.Cmd, string,
break
}
if timedOut {
glog.Infof("timed out waiting for input: possibly due to an old kubectl version.")
klog.Infof("timed out waiting for input: possibly due to an old kubectl version.")
break
}
out = append(out, r)
}
glog.Infof("proxy stdout: %s", string(out))
klog.Infof("proxy stdout: %s", string(out))
return cmd, hostPortRe.FindString(string(out)), nil
}

Expand Down Expand Up @@ -203,7 +203,7 @@ func dashboardURL(proxy string, ns string, svc string) string {
// checkURL checks if a URL returns 200 HTTP OK
func checkURL(url string) error {
resp, err := http.Get(url)
glog.Infof("%s response: %v %+v", url, err, resp)
klog.Infof("%s response: %v %+v", url, err, resp)
if err != nil {
return errors.Wrap(err, "checkURL")
}
Expand Down
Loading

0 comments on commit 97d96bf

Please sign in to comment.