Commit Graph

9 Commits

Author SHA1 Message Date
Daniel J Walsh 7c76968b10 Standardize on capatalize logrus messages, remove stutters
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-09-24 14:35:52 -04:00
Sascha Grunert 89b399d4cf Fix all gocritic lints
This enables the missing gocritic checks and fixes all of the lints.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-08-25 20:58:15 +02:00
Sascha Grunert b1670784f9 Add FindAppArmorParserBinary() helper
This function will be now used internally to get the correct path to the
`apparmor_parser` binary.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-08-20 09:22:27 +02:00
Sascha Grunert fa66b56024 Add mock'able unit tests and move package to `internal`
This adds internal strucutres and fakes to be able to mock the former
`isSupproted` function.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-08-19 10:19:01 +02:00
Sascha Grunert 29747623fd Validate that apparmor_parser is available on the system
If AppArmor is enabled, then we now check if the `apparmor_parser`
binary is either in `/sbin` or in `$PATH`.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-08-19 09:29:13 +02:00
Sascha Grunert 73aa297b0c Wrap AppArmor errors to provide more debug information
Mostly all AppArmor errors are now wrapped to provide additional context
to the user what actually went wrong. We now only use the spelling
`AppArmor` rather than `apparmor` to give the errors a uniform look.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-08-17 12:20:25 +02:00
Sascha Grunert 2a2476fcfd Omit apparmor_parser warnings when parsing the version
The `execAAParser()` function also takes `stderr` into account when
parsing the output. This function is right now only called by the
`getAAParserVersion()` function. Depending on the system configuration,
it might be possible that `apparmor_parser` prints a warning, for
example if `/etc/apparmor/parser.conf` does not exist on the system. To
thake this input not into account for the version parsing, we now just
use `stdout` as the returned result.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-08-17 09:49:58 +02:00
Sascha Grunert 4a58c879e2 Change AppArmor profile prefix and fix name-check
The default AppArmor profile is now prefixed with
`container-default-$VERSION`, whereas the version is now part of a new
`version` package.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-06-23 18:11:28 +02:00
Daniel J Walsh ed25ff4eb6 Add more utils for returning defaults
Move pkg/sysinfo and pkg/apparmor out of libpod into containers/common.

This will allow other packages to use these libraries without requiring all of libpod.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-01 08:39:44 -04:00