Skip to content

Commit afa8c44

Browse files
authored
Propagate error component from WaitForHealthy. (#335)
Reformat some files.
1 parent 24771d4 commit afa8c44

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

go/healthreporter/health_reporter.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,13 @@ func WaitForHealthy(ctx context.Context, h HealthReporter) error {
6767
if errors.IsPermanent(err) {
6868
return err
6969
}
70+
comp := errors.Component(err)
71+
if comp == errors.DefaultComp {
72+
comp = h.Name()
73+
}
7074
select {
7175
case <-ctx.Done():
72-
return errors.New(h.Name(), fmt.Errorf("%v waiting for healthy: %v", ctx.Err(), err))
76+
return errors.New(comp, fmt.Errorf("%v waiting for healthy: %v", ctx.Err(), err))
7377
case <-ticker.C:
7478
}
7579
}

go/metadata/capabilities/capabilities_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,7 +1082,7 @@ func TestStripAllPrefixedExcept(t *testing.T) {
10821082
exempt: []string{""},
10831083
out: &Capabilities{
10841084
AlwaysMatch: map[string]interface{}{},
1085-
FirstMatch: []map[string]interface{}{map[string]interface{}{}},
1085+
FirstMatch: []map[string]interface{}{{}},
10861086
},
10871087
},
10881088
{
@@ -1519,4 +1519,3 @@ func TestMergeUnder(t *testing.T) {
15191519
})
15201520
}
15211521
}
1522-

go/wsl/driver/driver.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,4 +529,3 @@ func (f *fakeResponseWriter) Write(b []byte) (int, error) {
529529
func (f *fakeResponseWriter) WriteHeader(statusCode int) {
530530
log.Printf("%s status code: %d", f.prefix, statusCode)
531531
}
532-

0 commit comments

Comments
 (0)