Merge pull request #14933 from oldium/fix-tunnel-reporting
Fix minikube tunnel repeated printout of statuspull/15216/head
commit
d0a07b75b7
|
@ -18,6 +18,7 @@ package tunnel
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
|
||||
"io"
|
||||
"strings"
|
||||
|
@ -38,7 +39,7 @@ type simpleReporter struct {
|
|||
const noErrors = "no errors"
|
||||
|
||||
func (r *simpleReporter) Report(tunnelState *Status) {
|
||||
if r.lastState == tunnelState {
|
||||
if reflect.DeepEqual(r.lastState, tunnelState) {
|
||||
return
|
||||
}
|
||||
r.lastState = tunnelState
|
||||
|
|
|
@ -103,11 +103,11 @@ Got: "%s"`, tc.name, tc.expectedOutput, out.output)
|
|||
// testing deduplication
|
||||
out := &recordingWriter{}
|
||||
reporter := newReporter(out)
|
||||
reporter.Report(testCases[0].tunnelState)
|
||||
reporter.Report(testCases[0].tunnelState)
|
||||
reporter.Report(testCases[1].tunnelState)
|
||||
reporter.Report(testCases[1].tunnelState)
|
||||
reporter.Report(testCases[0].tunnelState)
|
||||
reporter.Report(testCases[0].tunnelState.Clone())
|
||||
reporter.Report(testCases[0].tunnelState.Clone())
|
||||
reporter.Report(testCases[1].tunnelState.Clone())
|
||||
reporter.Report(testCases[1].tunnelState.Clone())
|
||||
reporter.Report(testCases[0].tunnelState.Clone())
|
||||
|
||||
expectedOutput := fmt.Sprintf("%s%s%s",
|
||||
testCases[0].expectedOutput,
|
||||
|
|
Loading…
Reference in New Issue