Repository navigation
Wait for deployer pod to be running before getting logs - #10560
Conversation
|
@Kargakis PTAL |
|
|
||
| // WaitForRunningDeployer waits until the specified deployer pod name is | ||
| // running. | ||
| func WaitForRunningDeployer(pn kclient.PodsNamespacer, namespace, name string, timeout time.Duration) (bool, error) { |
There was a problem hiding this comment.
@Kargakis I think this should be some generic helper (if it is not already), something like "WaitForPodRunning()" or "WaitForPodCondition()"... any idea if something like that exists?
2a1dd26 to
7d3a0e2
Compare
|
[test] @Kargakis ptal |
| return observed, false, nil | ||
| stopChan := make(chan struct{}) | ||
| isRunning := false | ||
| wait.Until(func() { |
There was a problem hiding this comment.
watch.Until is different from wait.Until: https://github.com/kubernetes/kubernetes/blob/53e9832ba36630f34bd920469ef7983a2488c3e9/pkg/watch/until.go#L35 :)
There was a problem hiding this comment.
oh my, i'm getting blind
3d82768 to
98a041d
Compare
| return observed, false, nil | ||
| if _, err := watch.Until(timeout, w, func(e watch.Event) (bool, error) { | ||
| if e.Type == watch.Error { | ||
| return false, fmt.Errorf("encountered error while watching for pod: %v", e.Object) |
There was a problem hiding this comment.
s/pod/replication controller/
5f7240f to
6324951
Compare
|
@Kargakis all fixed |
| return false, errors.New("received unknown object while watching for pods") | ||
| } | ||
| if !controller.IsPodActive(*obj) { | ||
| return false, nil |
There was a problem hiding this comment.
Actually do something like the other function we have for deployments. I don't like the deletionTimestamp check.
6324951 to
b9eb3d7
Compare
| if err != nil { | ||
| return false, err | ||
| } | ||
| if isPodTerminated(pod) { |
There was a problem hiding this comment.
You also need to return when it's running. Add it in your closure too and rename it to something like canGetLogs.
302ecfe to
d9f706b
Compare
| return nil, err | ||
| } | ||
| } | ||
| // Wait for the deployer pod to be running so we can fetch logs |
There was a problem hiding this comment.
You don't need this part of code, do you?
51bedf7 to
3326c8a
Compare
|
LGTM [merge] |
|
Evaluated for origin test up to 3326c8a |
|
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/8398/) |
|
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/8421/) (Image: devenv-rhel7_4925) |
|
#10487 [merge] |
|
Evaluated for origin merge up to 3326c8a |
Fixes: #9627
Fixes: #10002 (hopefully)