Skip to content

Wait for deployer pod to be running before getting logs - #10560

Merged
openshift-bot merged 1 commit into
openshift:masterfrom
mfojtik:deployment-logs
Aug 25, 2016
Merged

openshift-bot merged 1 commit into
openshift:masterfrom
mfojtik:deployment-logs

Conversation

@mfojtik

@mfojtik mfojtik commented Aug 22, 2016 •

Copy link
Copy Markdown
Contributor

Fixes: #9627
Fixes: #10002 (hopefully)

@mfojtik

mfojtik commented Aug 22, 2016

Copy link
Copy Markdown
Contributor Author

@Kargakis PTAL

Comment thread pkg/deploy/registry/rest.go Outdated

// WaitForRunningDeployer waits until the specified deployer pod name is
// running.
func WaitForRunningDeployer(pn kclient.PodsNamespacer, namespace, name string, timeout time.Duration) (bool, error) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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?

@mfojtik

mfojtik commented Aug 22, 2016

Copy link
Copy Markdown
Contributor Author

[test]

@Kargakis ptal

Comment thread pkg/deploy/registry/rest.go Outdated
return observed, false, nil
stopChan := make(chan struct{})
isRunning := false
wait.Until(func() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh my, i'm getting blind

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

Comment thread pkg/deploy/registry/rest.go Outdated
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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/pod/replication controller/

@mfojtik
mfojtik force-pushed the deployment-logs branch 2 times, most recently from 5f7240f to 6324951 Compare August 22, 2016 14:32
@mfojtik

mfojtik commented Aug 22, 2016

Copy link
Copy Markdown
Contributor Author

@Kargakis all fixed

Comment thread pkg/deploy/util/util.go Outdated
return false, errors.New("received unknown object while watching for pods")
}
if !controller.IsPodActive(*obj) {
return false, nil

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually do something like the other function we have for deployments. I don't like the deletionTimestamp check.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

Comment thread pkg/deploy/util/util.go Outdated
if err != nil {
return false, err
}
if isPodTerminated(pod) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You also need to return when it's running. Add it in your closure too and rename it to something like canGetLogs.

@mfojtik
mfojtik force-pushed the deployment-logs branch 2 times, most recently from 302ecfe to d9f706b Compare August 24, 2016 12:12
Comment thread pkg/deploy/registry/deploylog/rest.go Outdated
return nil, err
}
}
// Wait for the deployer pod to be running so we can fetch logs

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need this part of code, do you?

@0xmichalis

Copy link
Copy Markdown
Contributor

LGTM [merge]

@openshift-bot

Copy link
Copy Markdown
Contributor

Evaluated for origin test up to 3326c8a

@openshift-bot

Copy link
Copy Markdown
Contributor

@openshift-bot

openshift-bot commented Aug 24, 2016 •

Copy link
Copy Markdown
Contributor

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/8421/) (Image: devenv-rhel7_4925)

@0xmichalis

Copy link
Copy Markdown
Contributor

#10487 [merge]

@openshift-bot

Copy link
Copy Markdown
Contributor

Evaluated for origin merge up to 3326c8a

@openshift-bot
openshift-bot merged commit 258e529 into openshift:master Aug 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants