Skip to content

Commit

Permalink
Adjust resources readiness(ReadyTimeout, ReadyCheckInterval) for slow…
Browse files Browse the repository at this point in the history
… clusters (#731)

Adjust ReadyTimeout, ReadyCheckInterval for slow clusters
  • Loading branch information
szwedm authored Jun 20, 2024
1 parent 9278848 commit 89c8b69
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions controllers/btpoperator_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ var (
DeploymentName = "sap-btp-operator-controller-manager"
ProcessingStateRequeueInterval = time.Minute * 5
ReadyStateRequeueInterval = time.Minute * 15
ReadyTimeout = time.Minute * 1
ReadyCheckInterval = time.Second * 1
ReadyTimeout = time.Minute * 5
ReadyCheckInterval = time.Second * 30
HardDeleteTimeout = time.Minute * 20
HardDeleteCheckInterval = time.Second * 10
DeleteRequestTimeout = time.Minute * 5
Expand Down Expand Up @@ -651,7 +651,7 @@ func (r *BtpOperatorReconciler) checkResourceReadiness(ctx context.Context, u *u

func (r *BtpOperatorReconciler) checkDeploymentReadiness(ctx context.Context, u *unstructured.Unstructured, c chan<- bool) {
logger := log.FromContext(ctx)
ctxWithTimeout, cancel := context.WithTimeout(ctx, ReadyCheckInterval/2)
ctxWithTimeout, cancel := context.WithTimeout(ctx, ReadyCheckInterval)
defer cancel()

var err error
Expand All @@ -676,13 +676,12 @@ func (r *BtpOperatorReconciler) checkDeploymentReadiness(ctx context.Context, u
return
}
}
time.Sleep(ReadyCheckInterval)
}
}

func (r *BtpOperatorReconciler) checkResourceExistence(ctx context.Context, u *unstructured.Unstructured, c chan<- bool) {
logger := log.FromContext(ctx)
ctxWithTimeout, cancel := context.WithTimeout(ctx, ReadyCheckInterval/2)
ctxWithTimeout, cancel := context.WithTimeout(ctx, ReadyCheckInterval)
defer cancel()

var err error
Expand All @@ -698,7 +697,6 @@ func (r *BtpOperatorReconciler) checkResourceExistence(ctx context.Context, u *u
c <- true
return
}
time.Sleep(ReadyCheckInterval)
}
}

Expand Down

0 comments on commit 89c8b69

Please sign in to comment.