Bug 2014995

Summary: oc adm must-gather cannot gather audit logs with 'None' audit profile
Product: OpenShift Container Platform Reporter: Ke Wang <kewang>
Component: ocAssignee: Maciej Szulik <maszulik>
oc sub component: oc QA Contact: zhou ying <yinzhou>
Status: CLOSED ERRATA Docs Contact:
Severity: high    
Priority: high CC: aos-bugs, mfojtik
Version: 4.10   
Target Milestone: ---   
Target Release: 4.10.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-03-11 18:15:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2008223    

Description Ke Wang 2021-10-18 07:27:17 UTC
Description of problem:
oc adm must-gather -- /usr/bin/gather_audit_logs with 'None' audit profile doesn't work.

Version-Release number of selected component (if applicable):
$ ./oc version
Client Version: 4.10.0-0.nightly-2021-10-16-173656
Server Version: 4.10.0-0.nightly-2021-10-16-173656
Kubernetes Version: v1.22.1+9312243


How reproducible:
Always

Steps to Reproduce:
1. $ ./oc patch apiserver cluster -p '{"spec": {"audit": {"profile": "None"}}}' --type merge

2. After the kube-apiserver degradation is finished.
$ ./oc get pods -n openshift-kube-apiserver -l apiserver --show-labels

3.$ ./oc adm must-gather -- /usr/bin/gather_audit_logs

Actual results:
oc adm must-gather -- /usr/bin/gather_audit_logs with 'None' audit profile doesn't work, hang in terminal.

$ ./oc adm must-gather -- /usr/bin/gather_audit_logs
[must-gather      ] OUT Using must-gather plug-in image: quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:cff59e07170457e57ee1929e5c12037dd77cbb188b4aee79e58d0553d21f6bd0
When opening a support case, bugzilla, or issue please include the following summary data along with any other requested information.
ClusterID: ad8a410a-5055-42ea-a195-ac5a65775b84
ClusterVersion: Stable at "4.10.0-0.nightly-2021-10-16-173656"
ClusterOperators:
	All healthy and stable


[must-gather      ] OUT namespace/openshift-must-gather-qm49c created
[must-gather      ] OUT clusterrolebinding.rbac.authorization.k8s.io/must-gather-cm97j created
[must-gather      ] OUT pod for plug-in image quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:cff59e07170457e57ee1929e5c12037dd77cbb188b4aee79e58d0553d21f6bd0 created
[must-gather-7bvjh] POD 2021-10-18T03:56:07.767932687Z Vim: Warning: Output is not to a terminal
[must-gather-7bvjh] POD 2021-10-18T03:56:07.767932687Z Vim: Warning: Input is not from a terminal

Expected results:
oc adm must-gather -- /usr/bin/gather_audit_logs with 'None' audit profile works fine.

Additional info:

Comment 1 Ke Wang 2021-10-18 07:45:21 UTC
Works fine with 'Default' audit profile.

Comment 3 zhou ying 2021-10-20 02:17:28 UTC
can't reproduce now:
[root@localhost ~]# oc version --client
Client Version: 4.10.0-0.nightly-2021-10-19-210507


[root@localhost ~]#  oc get  apiserver cluster --template={{.spec.audit.profile}}
None

oc adm must-gather -- /usr/bin/gather_audit_logs ; echo $?
......
When opening a support case, bugzilla, or issue please include the following summary data along with any other requested information.
ClusterID: dd8b8dcc-9944-4a40-a9c3-a16ba54db839
ClusterVersion: Stable at "4.9.0"
ClusterOperators:
	All healthy and stable


0