Bug 1774366 - "oc logs --selector k8s-app=machine-config-daemon -n openshift-machine-config-operator -c machine-config-daemon" command returned error message
Summary: "oc logs --selector k8s-app=machine-config-daemon -n openshift-machine-conf...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 4.3.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.4.0
Assignee: Maciej Szulik
QA Contact: xiyuan
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-11-20 06:58 UTC by xiyuan
Modified: 2020-05-13 21:53 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: We have an internal code that recognized which resources it's working with and that was missing newer versions of API. Consequence: Logs were not working correctly for some resources. Fix: Support all known types and versions. Result: oc logs is working against any possible resource.
Clone Of:
Environment:
Last Closed: 2020-05-13 21:53:06 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift oc pull 233 0 None closed Bug 1774366: Squash oc logs on top upstream logs command 2021-02-18 03:02:50 UTC
Red Hat Product Errata RHBA-2020:0581 0 None None None 2020-05-13 21:53:08 UTC

Description xiyuan 2019-11-20 06:58:34 UTC
Description of problem:
"oc logs  --selector  k8s-app=machine-config-daemon  -n openshift-machine-config-operator  -c  machine-config-daemon" command returned error message

Version-Release number of selected components (if applicable):
4.3.0-0.nightly-2019-11-19-122017

Actual result:
$ oc logs  --selector k8s-app=machine-config-daemon  -n openshift-machine-config-operator  -c machine-config-daemon
error: You must provide one or more resources by argument or filename.
Example resource specifications include:
   '-f rsrc.yaml'
   '--filename=rsrc.json'
   '<resource> <name>'
   '<resource>'
$ oc logs  --selector k8s-app=machine-config-daemon  -n openshift-machine-config-operator
error: You must provide one or more resources by argument or filename.
Example resource specifications include:
   '-f rsrc.yaml'
   '--filename=rsrc.json'
   '<resource> <name>'
   '<resource>'

Excepted result:
retrurn logs fo all related pods requested

Additional info:
kubectl can work.
ls -l `which kubectl`
lrwxrwxrwx. 1 root root 4 Nov 19 14:32 /usr/bin/kubectl -> ./oc
kubectl logs --selector k8s-app=machine-config-daemon -n openshift-machine-config-operator -c machine-config-daemon
I1120 01:34:10.212544   12424 update.go:1050] completed update for config rendered-master-dd5bee90d2ef6c7ced55dfd2baf4b65a
...

Comment 1 Maciej Szulik 2019-12-02 15:03:58 UTC
We should try re-use upstream version instead of maintaining our own version.

Comment 3 xiyuan 2020-02-14 04:43:52 UTC
bug verification passed.
$ oc version 
Client Version: v4.4.0
Server Version: 4.4.0-0.nightly-2020-02-13-212616
Kubernetes Version: v1.17.1

$ oc logs  --selector k8s-app=machine-config-daemon  -n openshift-machine-config-operator
error: a container name must be specified for pod machine-config-daemon-4vpgm, choose one of: [machine-config-daemon oauth-proxy]

$ oc logs  --selector  k8s-app=machine-config-daemon  -n openshift-machine-config-operator  -c  machine-config-daemon
I0214 02:38:09.447000   14698 node.go:24] No machineconfiguration.openshift.io/currentConfig annotation on node ip-10-0-71-173.us-east-2.compute.internal: map[volumes.kubernetes.io/controller-managed-attach-detach:true], in cluster bootstrap, loading initial node annotation from /etc/machine-config-daemon/node-annotations.json
I0214 02:38:09.447551   14698 node.go:45] Setting initial node config: rendered-master-e30d9150ae84489554e018ca318b7da3
I0214 02:38:09.497297   14698 daemon.go:696] In bootstrap mode
I0214 02:38:09.497324   14698 daemon.go:724] Current+desired config: rendered-master-e30d9150ae84489554e018ca318b7da3
I0214 02:38:09.530252   14698 daemon.go:917] No bootstrap pivot required; unlinking bootstrap node annotations
I0214 02:38:09.530330   14698 daemon.go:955] Validating against pending config rendered-master-e30d9150ae84489554e018ca318b7da3
I0214 02:38:09.547416   14698 daemon.go:971] Validated on-disk state
I0214 02:38:09.570568   14698 daemon.go:1005] Completing pending config rendered-master-e30d9150ae84489554e018ca318b7da3
I0214 02:38:09.570591   14698 update.go:1240] completed update for config rendered-master-e30d9150ae84489554e018ca318b7da3
I0214 02:38:09.581595   14698 daemon.go:1021] In desired config rendered-master-e30d9150ae84489554e018ca318b7da3

Comment 5 errata-xmlrpc 2020-05-13 21:53:06 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:0581


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