Skip to content

Commit 043e3c0

Browse files
aledbfroboquat
authored andcommitted
[supervisor] Remove noise log and refactor error handling
1 parent 3225597 commit 043e3c0

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

components/supervisor/pkg/supervisor/supervisor.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,8 +1295,11 @@ func startContentInit(ctx context.Context, cfg *Config, wg *sync.WaitGroup, cst
12951295
log.Info("Detected content.json in /.workspace folder, assuming PVC feature enabled")
12961296
}
12971297
f, err := os.Open(fn)
1298-
if os.IsNotExist(err) {
1299-
log.WithError(err).Info("no content init descriptor found - not trying to run it")
1298+
if err != nil {
1299+
if !os.IsNotExist(err) {
1300+
log.WithError(err).Error("cannot open init descriptor")
1301+
return
1302+
}
13001303

13011304
// If there is no content descriptor the content must have come from somewhere (i.e. a layer or ws-daemon).
13021305
// Let's wait for that to happen.
@@ -1327,10 +1330,6 @@ func startContentInit(ctx context.Context, cfg *Config, wg *sync.WaitGroup, cst
13271330
err = nil
13281331
return
13291332
}
1330-
if err != nil {
1331-
log.WithError(err).Error("cannot open init descriptor")
1332-
return
1333-
}
13341333

13351334
src, err := executor.Execute(ctx, "/workspace", f, true)
13361335
if err != nil {

0 commit comments

Comments
 (0)