add deubgging

pull/9034/head
Priya Wadhwa 2020-08-20 14:42:55 -04:00
parent 3cb9026770
commit 83eba00d47
2 changed files with 5 additions and 1 deletions

View File

@ -441,6 +441,7 @@ 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(),
@ -499,6 +500,7 @@ 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):
@ -531,6 +533,7 @@ func clusterState(sts []*Status) ClusterState {
case mkerrors.ErrDockerOOM.Error():
transientCode = InsufficientStorage
default:
glog.Infof("skipping error we don't have info about")
continue
}
for _, n := range cs.Nodes {
@ -549,6 +552,7 @@ 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
}
}

View File

@ -75,7 +75,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")
c := exec.CommandContext(ctx, Target(), "status", "-p", profile, "--output=json", "--layout=cluster", "--alsologtostderr")
// artificially set /var to 100% capacity
c.Env = append(os.Environ(), fmt.Sprintf("%s=100", constants.TestMemoryCapacityEnv))
rr, err := Run(t, c)