Skip to content

Commit

Permalink
Merge pull request #289 from tremes/my-master
Browse files Browse the repository at this point in the history
Check context status when checking container is running OK
  • Loading branch information
openshift-merge-robot committed Dec 8, 2020
2 parents 9aed455 + 4a5e0e4 commit dd939db
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/controller/operator.go
Expand Up @@ -175,6 +175,11 @@ func isRunning(ctx context.Context, config *rest.Config) wait.ConditionFunc {
if err != nil {
return false, err
}
// check if context hasn't been cancelled or done meanwhile
err = ctx.Err()
if err != nil {
return false, err
}
pod, err := c.Pods(os.Getenv("POD_NAMESPACE")).Get(ctx, os.Getenv("POD_NAME"), metav1.GetOptions{})
if err != nil {
if !errors.IsNotFound(err) {
Expand Down

0 comments on commit dd939db

Please sign in to comment.