Red Hat Bugzilla – Bug 1314238
oc logs dc should not return user pod logs after deployment completed
Last modified: 2016-05-12 13:11:52 EDT
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):
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:
Version: '5.5.45' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
5. user pod logs are returned
5. For latest completed deployment, should not show user pod logs
On web console, for completed deployment, no logs is printed
This is working as expected. We should document it better.
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?
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.
checked on web console, now Deployed deployments show pod logs, the console has the same behavior with CLI, move to VERIFIED