security-profiles-operator
security-profiles-operator copied to clipboard
apparmor: Add AppArmor info at start time
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Provides additional information for users using AppArmor to debug potential setup issues. An example of what the SPO will write onto logs at the start:
I0809 18:39:30.678856 21442 apparmorprofile.go:279] apparmor-spod "msg"="detecting apparmor support..."
I0809 18:39:30.679580 21442 apparmorprofile.go:286] apparmor-spod "msg"="apparmor enabled: OK"
I0809 18:39:30.679682 21442 apparmorprofile.go:289] apparmor-spod "msg"="apparmor fs: (appArmor mount point: could not complete operation)"
I0809 18:39:30.679768 21442 apparmorprofile.go:292] apparmor-spod "msg"="apparmor enforceable: OK"
Which issue(s) this PR fixes:
None
Does this PR have test?
N/A
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional debug information about AppArmor state is now provided at start-up.
Codecov Report
Merging #1079 (01a3bbd) into main (8e1b375) will decrease coverage by
0.29%. The diff coverage is0.00%.
@@ Coverage Diff @@
## main #1079 +/- ##
==========================================
- Coverage 50.43% 50.13% -0.30%
==========================================
Files 42 42
Lines 4761 4789 +28
==========================================
Hits 2401 2401
- Misses 2281 2309 +28
Partials 79 79
Noticed that some dependencies were being downgraded as part of the change - reverted such changes.
This linter warning is confusing:
internal/pkg/daemon/apparmorprofile/apparmorprofile.go:29:2: Expected 'a', Found 'c' at internal/pkg/daemon/apparmorprofile/apparmorprofile.go[line 29,col 2] (gci)
ctrl "sigs.k8s.io/controller-runtime"
but it pretty much means that the imports must be sorted alphabetically. I think the linter has a --fix option that should do all that.
the code looks OK to me btw
@jhrozek thank you for the review and pointing out the linter issue. PTAL
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: jhrozek, pjbgf
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [jhrozek,pjbgf]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment