@@ -369,7 +369,7 @@ func (r *EphemeralRunnerReconciler) cleanupRunnerLinkedSecrets(ctx context.Conte
369
369
370
370
func (r * EphemeralRunnerReconciler ) markAsFailed (ctx context.Context , ephemeralRunner * v1alpha1.EphemeralRunner , log logr.Logger ) error {
371
371
log .Info ("Updating ephemeral runner status to Failed" )
372
- if err := patch (ctx , r .Status (), ephemeralRunner , func (obj * v1alpha1.EphemeralRunner ) {
372
+ if err := patchSubResource (ctx , r .Status (), ephemeralRunner , func (obj * v1alpha1.EphemeralRunner ) {
373
373
obj .Status .Phase = corev1 .PodFailed
374
374
obj .Status .Reason = "TooManyPodFailures"
375
375
obj .Status .Message = "Pod has failed to start more than 5 times"
@@ -388,7 +388,7 @@ func (r *EphemeralRunnerReconciler) markAsFailed(ctx context.Context, ephemeralR
388
388
389
389
func (r * EphemeralRunnerReconciler ) markAsFinished (ctx context.Context , ephemeralRunner * v1alpha1.EphemeralRunner , log logr.Logger ) error {
390
390
log .Info ("Updating ephemeral runner status to Finished" )
391
- if err := patch (ctx , r .Status (), ephemeralRunner , func (obj * v1alpha1.EphemeralRunner ) {
391
+ if err := patchSubResource (ctx , r .Status (), ephemeralRunner , func (obj * v1alpha1.EphemeralRunner ) {
392
392
obj .Status .Phase = corev1 .PodSucceeded
393
393
}); err != nil {
394
394
return fmt .Errorf ("failed to update ephemeral runner with status finished: %v" , err )
@@ -409,7 +409,7 @@ func (r *EphemeralRunnerReconciler) deletePodAsFailed(ctx context.Context, ephem
409
409
}
410
410
411
411
log .Info ("Updating ephemeral runner status to track the failure count" )
412
- if err := patch (ctx , r .Status (), ephemeralRunner , func (obj * v1alpha1.EphemeralRunner ) {
412
+ if err := patchSubResource (ctx , r .Status (), ephemeralRunner , func (obj * v1alpha1.EphemeralRunner ) {
413
413
if obj .Status .Failures == nil {
414
414
obj .Status .Failures = make (map [string ]bool )
415
415
}
@@ -487,7 +487,7 @@ func (r *EphemeralRunnerReconciler) updateStatusWithRunnerConfig(ctx context.Con
487
487
log .Info ("Created ephemeral runner JIT config" , "runnerId" , jitConfig .Runner .Id )
488
488
489
489
log .Info ("Updating ephemeral runner status with runnerId and runnerJITConfig" )
490
- err = patch (ctx , r .Status (), ephemeralRunner , func (obj * v1alpha1.EphemeralRunner ) {
490
+ err = patchSubResource (ctx , r .Status (), ephemeralRunner , func (obj * v1alpha1.EphemeralRunner ) {
491
491
obj .Status .RunnerId = jitConfig .Runner .Id
492
492
obj .Status .RunnerName = jitConfig .Runner .Name
493
493
obj .Status .RunnerJITConfig = jitConfig .EncodedJITConfig
@@ -556,7 +556,7 @@ func (r *EphemeralRunnerReconciler) updateRunStatusFromPod(ctx context.Context,
556
556
}
557
557
558
558
log .Info ("Updating ephemeral runner status with pod phase" , "phase" , pod .Status .Phase , "reason" , pod .Status .Reason , "message" , pod .Status .Message )
559
- err := patch (ctx , r .Status (), ephemeralRunner , func (obj * v1alpha1.EphemeralRunner ) {
559
+ err := patchSubResource (ctx , r .Status (), ephemeralRunner , func (obj * v1alpha1.EphemeralRunner ) {
560
560
obj .Status .Phase = pod .Status .Phase
561
561
obj .Status .Ready = obj .Status .Ready || (pod .Status .Phase == corev1 .PodRunning )
562
562
obj .Status .Reason = pod .Status .Reason
0 commit comments