@@ -310,11 +310,11 @@ func (m *Manager) StartWorkspace(ctx context.Context, req *api.StartWorkspaceReq
310
310
safePod , _ := log .RedactJSON (m )
311
311
312
312
if k8serr .IsAlreadyExists (err ) {
313
- clog .WithError (err ).WithField ("req" , req ).WithField ("pod" , safePod ).Warn ("was unable to start workspace which already exists" )
313
+ clog .WithError (err ).WithField ("req" , req ).WithField ("pod" , string ( safePod ) ).Warn ("was unable to start workspace which already exists" )
314
314
return false , status .Error (codes .AlreadyExists , "workspace instance already exists" )
315
315
}
316
316
317
- clog .WithError (err ).WithField ("req" , req ).WithField ("pod" , safePod ). Error ("was unable to start workspace" )
317
+ clog .WithError (err ).WithField ("req" , req ).WithField ("pod" , string ( safePod )). Warn ("was unable to start workspace" )
318
318
return false , err
319
319
}
320
320
@@ -340,7 +340,7 @@ func (m *Manager) StartWorkspace(ctx context.Context, req *api.StartWorkspaceReq
340
340
if err != nil {
341
341
jsonPod , _ := json .Marshal (pod )
342
342
safePod , _ := log .RedactJSON (jsonPod )
343
- clog .WithError (err ).WithField ("req" , req ).WithField ("pod" , string (safePod )).Error ("was unable to reach ready state" )
343
+ clog .WithError (err ).WithField ("req" , req ).WithField ("pod" , string (safePod )).Warn ("was unable to reach ready state" )
344
344
retryErr = err
345
345
346
346
var tempPod corev1.Pod
@@ -357,7 +357,7 @@ func (m *Manager) StartWorkspace(ctx context.Context, req *api.StartWorkspaceReq
357
357
// pod doesn't exist, so we are safe to proceed with retry
358
358
return false , nil
359
359
}
360
- clog .WithError (getErr ).WithField ("pod.Namespace" , pod .Namespace ).WithField ("pod.Name" , pod .Name ).Error ("was unable to get pod" )
360
+ clog .WithError (getErr ).WithField ("pod.Namespace" , pod .Namespace ).WithField ("pod.Name" , pod .Name ).Warn ("was unable to get pod" )
361
361
// pod get call failed so we error out
362
362
return false , retryErr
363
363
}
@@ -369,7 +369,7 @@ func (m *Manager) StartWorkspace(ctx context.Context, req *api.StartWorkspaceReq
369
369
// pod doesn't exist, so we are safe to proceed with retry
370
370
return false , nil
371
371
}
372
- clog .WithError (updateErr ).WithField ("pod.Namespace" , pod .Namespace ).WithField ("pod.Name" , pod .Name ).Error ("was unable to remove finalizer" )
372
+ clog .WithError (updateErr ).WithField ("pod.Namespace" , pod .Namespace ).WithField ("pod.Name" , pod .Name ).Warn ("was unable to remove finalizer" )
373
373
continue
374
374
}
375
375
finalizerRemoved = true
@@ -381,7 +381,7 @@ func (m *Manager) StartWorkspace(ctx context.Context, req *api.StartWorkspaceReq
381
381
382
382
deleteErr := m .Clientset .Delete (rmCtx , & tempPod )
383
383
if deleteErr != nil && ! k8serr .IsNotFound (deleteErr ) {
384
- clog .WithError (deleteErr ).WithField ("pod.Namespace" , pod .Namespace ).WithField ("pod.Name" , pod .Name ).Error ("was unable to delete pod" )
384
+ clog .WithError (deleteErr ).WithField ("pod.Namespace" , pod .Namespace ).WithField ("pod.Name" , pod .Name ).Warn ("was unable to delete pod" )
385
385
// failed to delete pod, so not going to be able to create a new pod, so bail out
386
386
return false , retryErr
387
387
}
@@ -397,6 +397,7 @@ func (m *Manager) StartWorkspace(ctx context.Context, req *api.StartWorkspaceReq
397
397
}
398
398
399
399
if err != nil {
400
+ clog .WithError (err ).WithField ("pod.Namespace" , pod .Namespace ).WithField ("pod.Name" , pod .Name ).Error ("was unable to start workspace after backoff" )
400
401
return nil , xerrors .Errorf ("cannot create workspace pod: %w" , err )
401
402
}
402
403
0 commit comments