Bug 1314238 - oc logs dc should not return user pod logs after deployment completed
Summary: oc logs dc should not return user pod logs after deployment completed
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: oc
Version: 3.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Michail Kargakis
QA Contact: Wei Sun
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-03 09:23 UTC by Yadan Pei
Modified: 2016-05-12 17:11 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-05-12 17:11:52 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Yadan Pei 2016-03-03 09:23:36 UTC
Description of problem:
After latest deployment of deployment config is complete, use oc logs -f dc/<dc-name> to check dc logs, pod logs are returned and printed

Version-Release number of selected component (if applicable):
devenv-rhel7_3592

How reproducible:
Always

Steps to Reproduce:
1. Create dc 
# oc create -f https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/deployment/deployment1.json
2. Trigger deployment manually
# oc deploy hooks --latest
3. Check latest deployment logs when deployment is running 
# oc logs -f dc/hooks
I0303 08:58:36.390237       1 deployer.go:201] Deploying from yapei-test/hooks-1 to yapei-test/hooks-2 (replicas: 1)
I0303 08:58:36.403661       1 lifecycle.go:168] Created lifecycle pod yapei-test/hooks-2-hook-pre for deployment yapei-test/hooks-2
I0303 08:58:36.403714       1 lifecycle.go:181] Watching logs for hook pod yapei-test/hooks-2-hook-pre while awaiting completion
I0303 08:58:39.465704       1 lifecycle.go:221] Finished reading logs for hook pod yapei-test/hooks-2-hook-pre
I0303 08:58:39.465728       1 recreate.go:103] Pre hook finished
I0303 08:58:39.465734       1 recreate.go:108] Scaling yapei-test/hooks-1 down to zero
I0303 08:58:41.518432       1 recreate.go:126] Scaling yapei-test/hooks-2 to 1 before performing acceptance check
I0303 08:58:43.549588       1 recreate.go:131] Performing acceptance check of yapei-test/hooks-2
I0303 08:58:43.549724       1 lifecycle.go:445] Waiting 600 seconds for pods owned by deployment "yapei-test/hooks-2" to become ready (checking every 1 seconds; 0 pods previously accepted)
I0303 08:58:45.551946       1 lifecycle.go:466] All pods ready for yapei-test/hooks-2
I0303 08:58:45.587916       1 lifecycle.go:168] Created lifecycle pod yapei-test/hooks-2-hook-post for deployment yapei-test/hooks-2
I0303 08:58:45.587945       1 lifecycle.go:181] Watching logs for hook pod yapei-test/hooks-2-hook-post while awaiting completion
I0303 08:58:47.625286       1 lifecycle.go:221] Finished reading logs for hook pod yapei-test/hooks-2-hook-post
I0303 08:58:47.625320       1 lifecycle.go:87] Hook failed, ignoring: 
I0303 08:58:47.625329       1 recreate.go:153] Post hook finished
I0303 08:58:47.625333       1 recreate.go:156] Deployment hooks-2 successfully made active
4. Check latest deployment status
# oc deploy hooks
hooks #2 deployed about a minute ago - 1 pod
5. Check latest deployment log again
# oc log -f dc/hooks
W0303 17:00:56.135411    7774 cmd.go:200] log is DEPRECATED and will be removed in a future version. Use logs instead.
---> 08:58:45     Processing MySQL configuration files ...
---> 08:58:45     Initializing database ...
---> 08:58:45     Running mysql_install_db ...
160303  8:58:45 [Note] /opt/rh/mysql55/root/usr/libexec/mysqld (mysqld 5.5.45) starting as process 41 ...
160303  8:58:45 [Note] /opt/rh/mysql55/root/usr/libexec/mysqld (mysqld 5.5.45) starting as process 48 ...

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

<...snip...>
Version: '5.5.45'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MySQL Community Server (GPL)


Actual results:
5. user pod logs are returned 

Expected results:
5. For latest completed deployment, should not show user pod logs

Additional info:
On web console, for completed deployment, no logs is printed

Comment 1 Michail Kargakis 2016-03-03 14:54:00 UTC
This is working as expected. We should document it better.

Comment 2 Yadan Pei 2016-03-04 00:41:31 UTC
if 'oc logs -f dc/<dc-name>' shows user pod logs, does that mean user should also have pod logs returned when requesting Deployed deployments on web console?

Comment 3 Michail Kargakis 2016-03-04 10:50:41 UTC
I guess the console should have parity with the cli. I've asked Jessica and Sam about it in https://github.com/openshift/origin/pull/6935#issuecomment-192229733. Closing this bug.

Comment 4 Yadan Pei 2016-03-08 03:08:38 UTC
checked on web console, now Deployed deployments show pod logs, the console has the same behavior with CLI, move to VERIFIED


Note You need to log in before you can comment on or make changes to this bug.