Skip to content

Commit

Permalink
Remove debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
Priya Wadhwa committed Aug 21, 2020
1 parent 44b93f4 commit c88619f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
13 changes: 2 additions & 11 deletions cmd/minikube/cmd/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -429,9 +429,7 @@ func readEventLog(name string) ([]cloudevents.Event, time.Time, error) {
scanner := bufio.NewScanner(f)
for scanner.Scan() {
ev := cloudevents.NewEvent()
b := scanner.Bytes()
if err = json.Unmarshal(b, &ev); err != nil {
glog.Infof("error unmarshalling data: %v\n%v", err, string(b))
if err = json.Unmarshal(scanner.Bytes(), &ev); err != nil {
return events, st.ModTime(), err
}
events = append(events, ev)
Expand All @@ -443,7 +441,6 @@ func readEventLog(name string) ([]cloudevents.Event, time.Time, error) {
// clusterState converts Status structs into a ClusterState struct
func clusterState(sts []*Status) ClusterState {
sc := statusCode(sts[0].Host)
glog.Infof("Initial status code is %v", sc)
cs := ClusterState{
BinaryVersion: version.GetVersion(),

Expand Down Expand Up @@ -489,8 +486,6 @@ func clusterState(sts []*Status) ClusterState {
glog.Errorf("unable to read event log: %v", err)
return cs
}
glog.Infof("Found %v events in event log", len(evs))
glog.Infof("%v", evs)

transientCode := 0
var finalStep map[string]string
Expand All @@ -504,7 +499,6 @@ func clusterState(sts []*Status) ClusterState {
glog.Errorf("unable to parse data: %v\nraw data: %s", err, ev.Data())
continue
}
glog.Infof("looking at step %v", data["name"])

switch data["name"] {
case string(register.InitialSetup):
Expand Down Expand Up @@ -532,11 +526,9 @@ func clusterState(sts []*Status) ClusterState {
glog.Errorf("unable to parse data: %v\nraw data: %s", err, ev.Data())
continue
}
glog.Infof("exit code is %v", data["exitcode"])
exitCode, err := strconv.Atoi(strings.Trim(data["exitcode"], "\n"))
exitCode, err := strconv.Atoi(data["exitcode"])
if err != nil {
glog.Errorf("unable to convert exit code to int: %v", err)
glog.Error("(event) ", data)
continue
}
transientCode = exitCode
Expand All @@ -556,7 +548,6 @@ func clusterState(sts []*Status) ClusterState {
cs.Step = strings.TrimSpace(finalStep["name"])
cs.StepDetail = strings.TrimSpace(finalStep["message"])
if transientCode != 0 {
glog.Infof("resetting status code to transient code %v", transientCode)
cs.StatusCode = transientCode
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/integration/status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func TestInsufficientStorage(t *testing.T) {
// runStatusCmd runs the status command and returns stdout
func runStatusCmd(ctx context.Context, t *testing.T, profile string) []byte {
// make sure minikube status shows insufficient storage
c := exec.CommandContext(ctx, Target(), "status", "-p", profile, "--output=json", "--layout=cluster", "--alsologtostderr")
c := exec.CommandContext(ctx, Target(), "status", "-p", profile, "--output=json", "--layout=cluster")
// artificially set /var to 100% capacity
c.Env = append(os.Environ(), fmt.Sprintf("%s=100", constants.TestStorageCapacityEnv))
rr, err := Run(t, c)
Expand Down

0 comments on commit c88619f

Please sign in to comment.