Skip to content

[supervisor] Remove noisy log and refactor error handling #10885

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions components/supervisor/pkg/supervisor/supervisor.go
Original file line number Diff line number Diff line change
Expand Up @@ -1295,8 +1295,11 @@ func startContentInit(ctx context.Context, cfg *Config, wg *sync.WaitGroup, cst
log.Info("Detected content.json in /.workspace folder, assuming PVC feature enabled")
}
f, err := os.Open(fn)
if os.IsNotExist(err) {
log.WithError(err).Info("no content init descriptor found - not trying to run it")
if err != nil {
if !os.IsNotExist(err) {
log.WithError(err).Error("cannot open init descriptor")
return
}

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

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